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 /sys/i4b/include | |
| parent | e1d756ce2abf07823331a13b67ceb226eeb22eeb (diff) | |
Notes
Diffstat (limited to 'sys/i4b/include')
| -rw-r--r-- | sys/i4b/include/i4b_global.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/i4b/include/i4b_global.h b/sys/i4b/include/i4b_global.h index d4dc77d6715dc..f2e9bffd92191 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 */ /*---------------*/ |
