summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-12-14 20:13:23 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-12-14 20:13:23 -0800
commit136839a1b4597a6b99a4286586d04a16b5d30295 (patch)
treef5eaff3742cca801788b5899acebe110abfdd36a /include/linux
parent9abc5156ce4c55443e9f6176063af2c4fa90c793 (diff)
[PATCH] MODULE_PARM support for older modules
This is the backwards compatibility code for MODULE_PARM, and moves __MODULE_STRING() down to the graveyard at the bottom of module.h. It's complicated by the fact that many modules place MODULE_PARM() before the declaration (some do MODULE_PARM() for non-existant variables, too). To avoid breaking them, we have to do the name lookups at load time, rather than just storing a pointer 8( CONFIG_OBSOLETE_MODPARM is set to y without prompting: it's a useful marker for deprecating in 2.7.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/module.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 90810238f424..2392edcc3307 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -20,10 +20,6 @@
#include <asm/module.h>
#include <asm/uaccess.h> /* For struct exception_table_entry */
-/* Indirect stringification */
-#define __MODULE_STRING_1(x) #x
-#define __MODULE_STRING(x) __MODULE_STRING_1(x)
-
/* Not Yet Implemented */
#define MODULE_LICENSE(name)
#define MODULE_AUTHOR(name)
@@ -305,6 +301,21 @@ extern spinlock_t modlist_lock;
#define __MOD_DEC_USE_COUNT(mod) module_put(mod)
#define SET_MODULE_OWNER(dev) ((dev)->owner = THIS_MODULE)
+struct obsolete_modparm {
+ char name[64];
+ char type[64-sizeof(void *)];
+ void *addr;
+};
+#ifdef MODULE
+/* DEPRECATED: Do not use. */
+#define MODULE_PARM(var,type) \
+struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
+{ __stringify(var), type };
+
+#else
+#define MODULE_PARM(var,type)
+#endif
+
/* People do this inside their init routines, when the module isn't
"live" yet. They should no longer be doing that, but
meanwhile... */
@@ -317,11 +328,11 @@ extern spinlock_t modlist_lock;
#endif
#define MOD_DEC_USE_COUNT module_put(THIS_MODULE)
#define try_inc_mod_count(mod) try_module_get(mod)
-#define MODULE_PARM(parm,string)
#define EXPORT_NO_SYMBOLS
extern int module_dummy_usage;
#define GET_USE_COUNT(module) (module_dummy_usage)
#define MOD_IN_USE 0
+#define __MODULE_STRING(x) __stringify(x)
#define __mod_between(a_start, a_len, b_start, b_len) \
(((a_start) >= (b_start) && (a_start) <= (b_start)+(b_len)) \
|| ((a_start)+(a_len) >= (b_start) \