Beispiel #1
0
void
module_register_init(const void *arg)
{
    const moduledata_t* data = (const moduledata_t*) arg;
    int error;
    module_t mod;

    mod = module_lookupbyname(data->name);
    if (mod == NULL) {
#if 0
	panic("module_register_init: module named %s not found\n", data->name);
#else
	/* temporary kludge until kernel `file' attachment registers modules */
	error = module_register(data, linker_kernel_file);
	if (error)
	    panic("module_register_init: register of module failed! %d", error);
	mod = module_lookupbyname(data->name);
	if (mod == NULL)
	    panic("module_register_init: module STILL not found!");
#endif
    }
    error = MOD_EVENT(mod, MOD_LOAD);
    if (error) {
	MOD_EVENT(mod, MOD_UNLOAD);
	module_release(mod);
	printf("module_register_init: MOD_LOAD (%s, %lx, %p) error %d\n",
	       data->name, (u_long)(uintfptr_t)data->evhand, data->priv, error);
    }
}
Beispiel #2
0
static void
module_shutdown(void* arg1, int arg2)
{
    module_t mod;

    for (mod = TAILQ_FIRST(&modules); mod; mod = TAILQ_NEXT(mod, link))
	MOD_EVENT(mod, MOD_SHUTDOWN);
}
Beispiel #3
0
int
module_unload(module_t mod)
{
    int error;

    error = MOD_EVENT(mod, MOD_UNLOAD);
    /*sync_devs();*/
    return (error);
}
Beispiel #4
0
int
module_unload(module_t mod)
{
    return MOD_EVENT(mod, MOD_UNLOAD);
}