summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2003-04-29 22:56:05 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2003-04-29 22:56:05 -0700
commit7d5ab07dc7972ef5eb257864c422430c8b3df0bc (patch)
treea0d36078e981cef69e789aac045b94fffd13174f /include/linux
parent25da53aa4497ccf38d2f17c9c28ca02583ddbe37 (diff)
parent4ede0350ba7bc8682ceae0d256d8d8d5d244aecf (diff)
Merge kroah.com:/home/linux/linux/BK/bleed-2.5
into kroah.com:/home/linux/linux/BK/gregkh-2.5
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/ide.h2
-rw-r--r--include/linux/initrd.h2
-rw-r--r--include/linux/ioctl32.h7
-rw-r--r--include/linux/list.h4
-rw-r--r--include/linux/module.h63
-rw-r--r--include/linux/percpu_counter.h2
-rw-r--r--include/linux/slab.h7
9 files changed, 69 insertions, 24 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 572b92e6f443..b9b2cf5b69e8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1068,10 +1068,7 @@ extern int chrdev_open(struct inode *, struct file *);
/* fs/block_dev.c */
#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
extern const char *__bdevname(dev_t, char *buffer);
-extern inline const char *bdevname(struct block_device *bdev, char *buffer)
-{
- return __bdevname(bdev->bd_dev, buffer);
-}
+extern const char *bdevname(struct block_device *bdev, char *buffer);
extern struct block_device *lookup_bdev(const char *);
extern struct block_device *open_bdev_excl(const char *, int, int, void *);
extern void close_bdev_excl(struct block_device *, int);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index ade6d9e97475..be82baa340fa 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -31,6 +31,7 @@
#define __GFP_REPEAT 0x400 /* Retry the allocation. Might fail */
#define __GFP_NOFAIL 0x800 /* Retry for ever. Cannot fail */
#define __GFP_NORETRY 0x1000 /* Do not retry. Might fail */
+#define __GFP_NO_GROW 0x2000 /* Slab internal usage */
#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 082fd9b7687b..f773ff4268a9 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1408,6 +1408,8 @@ typedef struct pkt_task_s {
void *special;
} pkt_task_t;
+extern inline u32 ide_read_24(ide_drive_t *);
+
extern inline void SELECT_DRIVE(ide_drive_t *);
extern inline void SELECT_INTERRUPT(ide_drive_t *);
extern inline void SELECT_MASK(ide_drive_t *, int);
diff --git a/include/linux/initrd.h b/include/linux/initrd.h
index d1978c358b12..32452d53dac3 100644
--- a/include/linux/initrd.h
+++ b/include/linux/initrd.h
@@ -13,4 +13,6 @@ extern int rd_image_start;
/* 1 if it is not an error if initrd_start < memory_start */
extern int initrd_below_start_ok;
+/* free_initrd_mem always gets called with the next two as arguments.. */
extern unsigned long initrd_start, initrd_end;
+extern void free_initrd_mem(unsigned long, unsigned long);
diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h
index 456494591a51..d03489f00793 100644
--- a/include/linux/ioctl32.h
+++ b/include/linux/ioctl32.h
@@ -19,5 +19,12 @@ extern int register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned
extern int unregister_ioctl32_conversion(unsigned int cmd);
+typedef int (*ioctl_trans_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
+
+struct ioctl_trans {
+ unsigned long cmd;
+ ioctl_trans_handler_t handler;
+ struct ioctl_trans *next;
+};
#endif
diff --git a/include/linux/list.h b/include/linux/list.h
index a724f9bcbe4d..11b8674c14ff 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -437,6 +437,10 @@ static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node
for (pos = (head)->first; pos; \
pos = pos->next)
+#define hlist_for_each_safe(pos, n, head) \
+ for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
+ pos = n)
+
#else
#warning "don't include kernel headers in userspace"
#endif /* __KERNEL__ */
diff --git a/include/linux/module.h b/include/linux/module.h
index 657802c8af75..4ddc5edcd22f 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -20,10 +20,7 @@
#include <asm/module.h>
/* Not Yet Implemented */
-#define MODULE_AUTHOR(name)
-#define MODULE_DESCRIPTION(desc)
#define MODULE_SUPPORTED_DEVICE(name)
-#define MODULE_PARM_DESC(var,desc)
#define print_modules()
/* v850 toolchain uses a `_' prefix for all user symbols */
@@ -58,12 +55,11 @@ search_extable(const struct exception_table_entry *first,
unsigned long value);
#ifdef MODULE
-#define ___module_cat(a,b) a ## b
+#define ___module_cat(a,b) __mod_ ## a ## b
#define __module_cat(a,b) ___module_cat(a,b)
-/* For userspace: you can also call me... */
-#define MODULE_ALIAS(alias) \
- static const char __module_cat(__alias_,__LINE__)[] \
- __attribute__((section(".modinfo"),unused)) = "alias=" alias
+#define __MODULE_INFO(tag, name, info) \
+static const char __module_cat(name,__LINE__)[] \
+ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
#define MODULE_GENERIC_TABLE(gtype,name) \
extern const struct gtype##_id __mod_##gtype##_table \
@@ -71,6 +67,19 @@ extern const struct gtype##_id __mod_##gtype##_table \
#define THIS_MODULE (&__this_module)
+#else /* !MODULE */
+
+#define MODULE_GENERIC_TABLE(gtype,name)
+#define __MODULE_INFO(tag, name, info)
+#define THIS_MODULE ((struct module *)0)
+#endif
+
+/* Generic info of form tag = "info" */
+#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
+
+/* For userspace: you can also call me... */
+#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
+
/*
* The following license idents are currently accepted as indicating free
* software modules
@@ -97,17 +106,18 @@ extern const struct gtype##_id __mod_##gtype##_table \
* 2. So the community can ignore bug reports including proprietary modules
* 3. So vendors can do likewise based on their own policies
*/
-#define MODULE_LICENSE(license) \
- static const char __module_license[] \
- __attribute__((section(".init.license"), unused)) = license
+#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
-#else /* !MODULE */
+/* Author, ideally of form NAME <EMAIL>[, NAME <EMAIL>]*[ and NAME <EMAIL>] */
+#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
+
+/* What your module does. */
+#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
-#define MODULE_ALIAS(alias)
-#define MODULE_GENERIC_TABLE(gtype,name)
-#define THIS_MODULE ((struct module *)0)
-#define MODULE_LICENSE(license)
-#endif
+/* One for each parameter, describing how to use it. Some files do
+ multiple of these per line, so can't just use MODULE_INFO. */
+#define MODULE_PARM_DESC(_parm, desc) \
+ __MODULE_INFO(parm, _parm, #_parm ":" desc)
#define MODULE_DEVICE_TABLE(type,name) \
MODULE_GENERIC_TABLE(type##_device,name)
@@ -255,6 +265,7 @@ struct module *module_text_address(unsigned long addr);
#ifdef CONFIG_MODULE_UNLOAD
+unsigned int module_refcount(struct module *mod);
void __symbol_put(const char *symbol);
#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
void symbol_put_addr(void *addr);
@@ -265,6 +276,17 @@ void symbol_put_addr(void *addr);
#define local_dec(x) atomic_dec(x)
#endif
+/* Sometimes we know we already have a refcount, and it's easier not
+ to handle the error case (which only happens with rmmod --wait). */
+static inline void __module_get(struct module *module)
+{
+ if (module) {
+ BUG_ON(module_refcount(module) == 0);
+ local_inc(&module->ref[get_cpu()].count);
+ put_cpu();
+ }
+}
+
static inline int try_module_get(struct module *module)
{
int ret = 1;
@@ -300,6 +322,9 @@ static inline int try_module_get(struct module *module)
static inline void module_put(struct module *module)
{
}
+static inline void __module_get(struct module *module)
+{
+}
#define symbol_put(x) do { } while(0)
#define symbol_put_addr(p) do { } while(0)
@@ -357,6 +382,10 @@ static inline struct module *module_text_address(unsigned long addr)
#define symbol_put(x) do { } while(0)
#define symbol_put_addr(x) do { } while(0)
+static inline void __module_get(struct module *module)
+{
+}
+
static inline int try_module_get(struct module *module)
{
return 1;
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 69d0a66b662e..53c52176c391 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -7,7 +7,7 @@
#include <linux/config.h>
#include <linux/spinlock.h>
#include <linux/smp.h>
-#include <linux/preempt.h>
+#include <linux/threads.h>
#ifdef CONFIG_SMP
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 603748b9b349..49374df2d450 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -22,8 +22,11 @@ typedef struct kmem_cache_s kmem_cache_t;
#define SLAB_KERNEL GFP_KERNEL
#define SLAB_DMA GFP_DMA
-#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|__GFP_NORETRY)
-#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */
+#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
+ __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|\
+ __GFP_NOFAIL|__GFP_NORETRY)
+
+#define SLAB_NO_GROW __GFP_NO_GROW /* don't grow a cache */
/* flags to pass to kmem_cache_create().
* The first 3 are only valid when the allocator as been build