PARAM 4/4: MODULE_PARM support.
PATCH 1/1 PARAM 4/4: MODULE_PARM support.
No changes since last xmit.
This puts in the wedge code to turn MODULE_PARM into PARAM stuff at loadtime. Also moves __MODULE_STRING() down into the "deprecated" graveyard at the bottom of module.h
The code is under CONFIG_OBSOLETE_MODPARM, but it's wired to "y" without asking the user at the moment.
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
Name: MODULE_PARM support for older modules
Author: Rusty Russell
Status: Experimental
Depends: Module/param-modules.patch.gz
Depends: Module/forceunload.patch.gz
D: This is the backwards compatibility code for MODULE_PARM.
include/linux/module.h +13 -5
@@ -15,13 +15,10 @@#include <linux/compiler.h> #include <linux/cache.h> #include <linux/kmod.h> +#include <linux/stringify.h> #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)
@@ -289,6 +286,17 @@ 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 ];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... */
@@ -301,11 +309,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) \
init/Kconfig +9 -1
@@ -135,6 +135,15 @@ config MODULE_FORCE_UNLOAD rmmod). This is mainly for kernel developers and desparate users. If unsure, say N. +config OBSOLETE_MODPARM + bool + default y + depends on MODULES + help + You need this option to use module parameters on modules which + have not been converted to the new module parameter system yet. + If unsure, say Y. + config KMOD bool "Kernel module loader" depends on MODULES
@@ -150,4 +159,3 @@ config KMOD in <file:Documentation/kmod.txt>. endmenu -
kernel/module.c +147 -9
186 lines not on this page · raw message