summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@maxwell.earthlink.net>2002-12-29 18:44:33 -0800
committerJames Simmons <jsimmons@maxwell.earthlink.net>2002-12-29 18:44:33 -0800
commita5900581f22590feaa182c440be0ab67ad964863 (patch)
tree71c6e5c0cabf70e0da90f1ed3d51148039acee6d /include/linux
parent6065bc2dc398089fa385f128baaa858a8ecab5a6 (diff)
parentbec7aa00ffe5b1270837b965fdfe80be3e8e6e2e (diff)
Merge maxwell.earthlink.net:/usr/src/linus-2.5
into maxwell.earthlink.net:/usr/src/fbdev-2.5
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ax25.h2
-rw-r--r--include/linux/binfmts.h8
-rw-r--r--include/linux/compiler.h13
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/init.h5
-rw-r--r--include/linux/ioport.h3
-rw-r--r--include/linux/module.h68
-rw-r--r--include/linux/moduleparam.h2
-rw-r--r--include/linux/mtd/map.h5
-rw-r--r--include/linux/mtd/mtd.h3
-rw-r--r--include/linux/personality.h18
11 files changed, 69 insertions, 63 deletions
diff --git a/include/linux/ax25.h b/include/linux/ax25.h
index 6dfc8fc9116d..56c11f0dbd80 100644
--- a/include/linux/ax25.h
+++ b/include/linux/ax25.h
@@ -85,7 +85,7 @@ struct ax25_ctl_struct {
};
/* this will go away. Please do not export to user land */
-struct ax25_info_struct_depreciated {
+struct ax25_info_struct_deprecated {
unsigned int n2, n2count;
unsigned int t1, t1timer;
unsigned int t2, t2timer;
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index ae1b454395b5..bd929e344d75 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -58,13 +58,7 @@ extern int copy_strings(int argc,char ** argv,struct linux_binprm *bprm);
extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
extern void compute_creds(struct linux_binprm *binprm);
extern int do_coredump(long signr, int exit_code, struct pt_regs * regs);
-extern void set_binfmt(struct linux_binfmt *new);
-
-
-#if 0
-/* this went away now */
-#define change_ldt(a,b) setup_arg_pages(a,b)
-#endif
+extern int set_binfmt(struct linux_binfmt *new);
#endif /* __KERNEL__ */
#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 6b19413b47a6..f88889740949 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -13,6 +13,19 @@
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
+/*
+ * Allow us to mark functions as 'deprecated' and have gcc emit a nice
+ * warning for each use, in hopes of speeding the functions removal.
+ * Usage is:
+ * int deprecated foo(void)
+ * and then gcc will emit a warning for each usage of the function.
+ */
+#if __GNUC__ >= 3
+#define __deprecated __attribute__((deprecated))
+#else
+#define __deprecated
+#endif
+
/* This macro obfuscates arithmetic on a variable address so that gcc
shouldn't recognize the original var, and make assumptions about it */
#define RELOC_HIDE(ptr, off) \
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 500cb3ac421e..6c3188b991e6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -983,13 +983,13 @@ struct super_block *get_sb_pseudo(struct file_system_type *, char *,
/* Alas, no aliases. Too much hassle with bringing module.h everywhere */
#define fops_get(fops) \
(((fops) && (fops)->owner) \
- ? ( try_inc_mod_count((fops)->owner) ? (fops) : NULL ) \
+ ? (try_inc_mod_count((fops)->owner) ? (fops) : NULL) \
: (fops))
#define fops_put(fops) \
do { \
if ((fops) && (fops)->owner) \
- __MOD_DEC_USE_COUNT((fops)->owner); \
+ module_put((fops)->owner); \
} while(0)
extern int register_filesystem(struct file_system_type *);
@@ -1300,6 +1300,7 @@ extern int dcache_dir_open(struct inode *, struct file *);
extern int dcache_dir_close(struct inode *, struct file *);
extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
extern int dcache_readdir(struct file *, void *, filldir_t);
+extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
extern int simple_statfs(struct super_block *, struct statfs *);
extern int simple_link(struct dentry *, struct inode *, struct dentry *);
extern int simple_unlink(struct inode *, struct dentry *);
diff --git a/include/linux/init.h b/include/linux/init.h
index 46b1ef190c52..b7c6363478aa 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -147,14 +147,13 @@ struct obs_kernel_param {
#define module_init(initfn) \
static inline initcall_t __inittest(void) \
{ return initfn; } \
- int __initfn(void) __attribute__((alias(#initfn)));
+ int init_module(void) __attribute__((alias(#initfn)));
/* This is only required if you want to be unloadable. */
#define module_exit(exitfn) \
static inline exitcall_t __exittest(void) \
{ return exitfn; } \
- void __exitfn(void) __attribute__((alias(#exitfn)));
-
+ void cleanup_module(void) __attribute__((alias(#exitfn)));
#define __setup(str,func) /* nothing */
#endif
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 020bd1596ab9..edd1eadb98b8 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -8,6 +8,7 @@
#ifndef _LINUX_IOPORT_H
#define _LINUX_IOPORT_H
+#include <linux/compiler.h>
/*
* Resources are tree-like, allowing
* nesting etc..
@@ -107,7 +108,7 @@ extern struct resource * __request_region(struct resource *, unsigned long start
#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
-extern int __check_region(struct resource *, unsigned long, unsigned long);
+extern int __deprecated __check_region(struct resource *, unsigned long, unsigned long);
extern void __release_region(struct resource *, unsigned long, unsigned long);
#define get_ioport_list(buf) get_resource_list(&ioport_resource, buf, PAGE_SIZE)
diff --git a/include/linux/module.h b/include/linux/module.h
index 2392edcc3307..3a411c8c6575 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -40,12 +40,11 @@ struct kernel_symbol
char name[MODULE_NAME_LEN];
};
-#ifdef MODULE
+/* These are either module local, or the kernel's dummy ones. */
+extern int init_module(void);
+extern void cleanup_module(void);
-#ifdef KBUILD_MODNAME
-static const char __module_name[MODULE_NAME_LEN] __attribute__((section(".gnu.linkonce.modname"))) = \
- __stringify(KBUILD_MODNAME);
-#endif
+#ifdef MODULE
/* For replacement modutils, use an alias not a pointer. */
#define MODULE_GENERIC_TABLE(gtype,name) \
@@ -56,9 +55,6 @@ static const struct gtype##_id * __module_##gtype##_table \
extern const struct gtype##_id __mod_##gtype##_table \
__attribute__ ((unused, alias(__stringify(name))))
-/* This is magically filled in by the linker, but THIS_MODULE must be
- a constant so it works in initializers. */
-extern struct module __this_module;
#define THIS_MODULE (&__this_module)
#else /* !MODULE */
@@ -176,7 +172,7 @@ struct module
/* The command line arguments (may be mangled). People like
keeping pointers to this stuff */
- char args[0];
+ char *args;
};
/* FIXME: It'd be nice to isolate modules during init, too, so they
@@ -289,6 +285,19 @@ static inline const char *module_address_lookup(unsigned long addr,
}
#endif /* CONFIG_MODULES */
+#if defined(MODULE) && defined(KBUILD_MODNAME)
+/* We make the linker do some of the work. */
+struct module __this_module
+__attribute__((section(".gnu.linkonce.this_module"))) = {
+ .name = __stringify(KBUILD_MODNAME),
+ .symbols = { .owner = &__this_module },
+ .init = init_module,
+#ifdef CONFIG_MODULE_UNLOAD
+ .exit = cleanup_module,
+#endif
+};
+#endif /* MODULE && KBUILD_MODNAME */
+
/* For archs to search exception tables */
extern struct list_head extables;
extern spinlock_t modlist_lock;
@@ -296,9 +305,20 @@ extern spinlock_t modlist_lock;
#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
/* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
-#define __MOD_INC_USE_COUNT(mod) \
- do { __unsafe(mod); (void)try_module_get(mod); } while(0)
-#define __MOD_DEC_USE_COUNT(mod) module_put(mod)
+static inline void __deprecated __MOD_INC_USE_COUNT(struct module *module)
+{
+ __unsafe(module);
+ /*
+ * Yes, we ignore the retval here, that's why it's deprecated.
+ */
+ try_module_get(module);
+}
+
+static inline void __deprecated __MOD_DEC_USE_COUNT(struct module *module)
+{
+ module_put(module);
+}
+
#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE)
struct obsolete_modparm {
@@ -319,14 +339,21 @@ struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
/* People do this inside their init routines, when the module isn't
"live" yet. They should no longer be doing that, but
meanwhile... */
+static inline void __deprecated _MOD_INC_USE_COUNT(struct module *module)
+{
+ __unsafe(module);
+
#if defined(CONFIG_MODULE_UNLOAD) && defined(MODULE)
-#define MOD_INC_USE_COUNT \
- do { __unsafe(THIS_MODULE); local_inc(&THIS_MODULE->ref[get_cpu()].count); put_cpu(); } while (0)
+ local_inc(&module->ref[get_cpu()].count);
+ put_cpu();
#else
-#define MOD_INC_USE_COUNT \
- do { __unsafe(THIS_MODULE); (void)try_module_get(THIS_MODULE); } while (0)
+ try_module_get(module);
#endif
-#define MOD_DEC_USE_COUNT module_put(THIS_MODULE)
+}
+#define MOD_INC_USE_COUNT \
+ _MOD_INC_USE_COUNT(THIS_MODULE)
+#define MOD_DEC_USE_COUNT \
+ __MOD_DEC_USE_COUNT(THIS_MODULE)
#define try_inc_mod_count(mod) try_module_get(mod)
#define EXPORT_NO_SYMBOLS
extern int module_dummy_usage;
@@ -342,13 +369,6 @@ extern int module_dummy_usage;
&& __mod_between((p),(n),(m)->module_init,(m)->init_size)) \
|| __mod_between((p),(n),(m)->module_core,(m)->core_size))
-/* Old-style "I'll just call it init_module and it'll be run at
- insert". Use module_init(myroutine) instead. */
-#ifdef MODULE
-#define init_module(voidarg) __initfn(void)
-#define cleanup_module(voidarg) __exitfn(void)
-#endif
-
/*
* The exception and symbol tables, and the lock
* to protect them.
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 92a1bc154e8e..e52553263640 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -39,7 +39,7 @@ struct kparam_string {
writable. */
#define __module_param_call(prefix, name, set, get, arg, perm) \
static char __param_str_##name[] __initdata = prefix #name; \
- static struct kernel_param __param_##name \
+ static struct kernel_param const __param_##name \
__attribute__ ((unused,__section__ ("__param"))) \
= { __param_str_##name, perm, set, get, arg }
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 94ffed22315b..ad8dfcbda17d 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -81,10 +81,7 @@ static inline void map_destroy(struct mtd_info *mtd)
if (map->fldrv->destroy)
map->fldrv->destroy(mtd);
-#ifdef CONFIG_MODULES
- if (map->fldrv->module)
- __MOD_DEC_USE_COUNT(map->fldrv->module);
-#endif
+ module_put(map->fldrv->module);
kfree(mtd);
}
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index ae5bfe3e10fb..52d38241e91e 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -224,8 +224,7 @@ static inline struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num)
static inline void put_mtd_device(struct mtd_info *mtd)
{
- if (mtd->module)
- __MOD_DEC_USE_COUNT(mtd->module);
+ module_put(mtd->module);
}
diff --git a/include/linux/personality.h b/include/linux/personality.h
index ca5d403e49ff..33802c8eeedb 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -107,22 +107,4 @@ struct exec_domain {
#define set_personality(pers) \
((current->personality == pers) ? 0 : __set_personality(pers))
-/*
- * Load an execution domain.
- */
-#define get_exec_domain(ep) \
-do { \
- if (ep != NULL && ep->module != NULL) \
- __MOD_INC_USE_COUNT(ep->module); \
-} while (0)
-
-/*
- * Unload an execution domain.
- */
-#define put_exec_domain(ep) \
-do { \
- if (ep != NULL && ep->module != NULL) \
- __MOD_DEC_USE_COUNT(ep->module); \
-} while (0)
-
#endif /* _LINUX_PERSONALITY_H */