DF-5351 / hello_kld.c
/* bisect step 1: pure kprintf module */ #include <sys/param.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/systm.h> static int hello_modevent(module_t mod __unused, int type, void *data __unused) { switch (type) { case MOD_LOAD: kprintf("hello_kld: loaded ok\n"); return 0; case MOD_UNLOAD: return 0; default: return EOPNOTSUPP; } } static moduledata_t hello_kld_mod = { "hello_kld", hello_modevent, NULL }; DECLARE_MODULE(hello_kld, hello_kld_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); |