diff options
author | Peter Wemm <peter@FreeBSD.org> | 2001-02-04 11:46:17 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2001-02-04 11:46:17 +0000 |
commit | 19b61693ce3914000bbaf7e406d55f5aba98b1dd (patch) | |
tree | dc6973d41b1172e091490b77f1f542a79b574493 | |
parent | e1d756ce2abf07823331a13b67ceb226eeb22eeb (diff) | |
download | src-19b61693ce3914000bbaf7e406d55f5aba98b1dd.tar.gz src-19b61693ce3914000bbaf7e406d55f5aba98b1dd.zip |
Pull the rug from under the 'LKM Compatability' macro - PSEUDO_SET().
There are two 3rd party code chunks using this still - the IPv6 stuff and
i4b. Give them a private copy as an alternative to changing them too much.
XXX sys/kernel.h still has a #include <sys/module.h> in it. I will be
taking this out shortly - this affects a number of drivers.
Notes
Notes:
svn path=/head/; revision=71991
-rw-r--r-- | sys/i4b/include/i4b_global.h | 28 | ||||
-rw-r--r-- | sys/net/if_faith.c | 2 | ||||
-rw-r--r-- | sys/net/net_osdep.h | 26 | ||||
-rw-r--r-- | sys/sys/kernel.h | 30 |
4 files changed, 59 insertions, 27 deletions
diff --git a/sys/i4b/include/i4b_global.h b/sys/i4b/include/i4b_global.h index d4dc77d6715d..f2e9bffd9219 100644 --- a/sys/i4b/include/i4b_global.h +++ b/sys/i4b/include/i4b_global.h @@ -59,6 +59,34 @@ #endif +#if defined(__FreeBSD__) && __FreeBSD__ >= 5 +/* + * Deprecated LKM interface. + */ +#include <sys/module.h> +#define PSEUDO_SET(sym, name) \ + static int name ## _modevent(module_t mod, int type, void *data) \ + { \ + void (*initfunc)(void *) = (void (*)(void *))data; \ + switch (type) { \ + case MOD_LOAD: \ + /* printf(#name " module load\n"); */ \ + initfunc(NULL); \ + break; \ + case MOD_UNLOAD: \ + printf(#name " module unload - not possible for this module type\n"); \ + return EINVAL; \ + } \ + return 0; \ + } \ + static moduledata_t name ## _mod = { \ + #name, \ + name ## _modevent, \ + (void *)sym \ + }; \ + DECLARE_MODULE(name, name ## _mod, SI_SUB_PSEUDO, SI_ORDER_ANY) +#endif + /*---------------*/ /* time handling */ /*---------------*/ diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c index a4d5162d7335..b28fecd899eb 100644 --- a/sys/net/if_faith.c +++ b/sys/net/if_faith.c @@ -57,6 +57,8 @@ #include <net/route.h> #include <net/bpf.h> +#include <net/net_osdep.h> + extern int loioctl __P((struct ifnet *, u_long, caddr_t)); extern int looutput __P((struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt)); diff --git a/sys/net/net_osdep.h b/sys/net/net_osdep.h index fc77022e27bf..3bb3c181d100 100644 --- a/sys/net/net_osdep.h +++ b/sys/net/net_osdep.h @@ -165,5 +165,31 @@ extern const char *if_name __P((struct ifnet *)); #define HAVE_OLD_BPF +/* + * Deprecated. + */ +#include <sys/module.h> +#define PSEUDO_SET(sym, name) \ + static int name ## _modevent(module_t mod, int type, void *data) \ + { \ + void (*initfunc)(void *) = (void (*)(void *))data; \ + switch (type) { \ + case MOD_LOAD: \ + /* printf(#name " module load\n"); */ \ + initfunc(NULL); \ + break; \ + case MOD_UNLOAD: \ + printf(#name " module unload - not possible for this module type\n"); \ + return EINVAL; \ + } \ + return 0; \ + } \ + static moduledata_t name ## _mod = { \ + #name, \ + name ## _modevent, \ + (void *)sym \ + }; \ + DECLARE_MODULE(name, name ## _mod, SI_SUB_PSEUDO, SI_ORDER_ANY) + #endif /*_KERNEL*/ #endif /*__NET_NET_OSDEP_H_DEFINED_ */ diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 0824b006a145..03f8c433d397 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -52,6 +52,9 @@ /* for intrhook below */ #include <sys/queue.h> +/* THIS MUST DIE! */ +#include <sys/module.h> + /* Global variables for the kernel. */ /* 1.1 */ @@ -280,33 +283,6 @@ SYSINIT(__Tunable_init_ ## var, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, __Tunable_ ## strncpy((var), tmp, (size)); \ (var)[(size) - 1] = 0; -/* - * Compatibility. To be deprecated after LKM is removed. - */ -#include <sys/module.h> -#define PSEUDO_SET(sym, name) \ - static int name ## _modevent(module_t mod, int type, void *data) \ - { \ - void (*initfunc)(void *) = (void (*)(void *))data; \ - switch (type) { \ - case MOD_LOAD: \ - /* printf(#name " module load\n"); */ \ - initfunc(NULL); \ - break; \ - case MOD_UNLOAD: \ - printf(#name " module unload - not possible for this module type\n"); \ - return EINVAL; \ - } \ - return 0; \ - } \ - static moduledata_t name ## _mod = { \ - #name, \ - name ## _modevent, \ - (void *)sym \ - }; \ - DECLARE_MODULE(name, name ## _mod, SI_SUB_PSEUDO, SI_ORDER_ANY) - - struct intr_config_hook { TAILQ_ENTRY(intr_config_hook) ich_links; void (*ich_func) __P((void *arg)); |