Lines Matching refs:mod
61 #define MOD_EVENT(mod, type) (mod)->handler((mod), (type), (mod)->arg)
69 modevent_nop(module_t mod, int what, void *arg)
97 module_t mod;
103 TAILQ_FOREACH_REVERSE(mod, &modules, modulelist, link)
104 MOD_EVENT(mod, MOD_SHUTDOWN);
114 module_t mod;
118 mod = module_lookupbyname(data->name);
119 if (mod == NULL)
123 error = MOD_EVENT(mod, MOD_LOAD);
125 MOD_EVENT(mod, MOD_UNLOAD);
127 module_release(mod);
134 if (mod->file) {
143 TAILQ_REMOVE(&mod->file->modules, mod, flink);
144 TAILQ_INSERT_HEAD(&mod->file->modules, mod, flink);
184 module_reference(module_t mod)
189 MOD_DPF(REFS, ("module_reference: before, refs=%d\n", mod->refs));
190 mod->refs++;
194 module_release(module_t mod)
199 if (mod->refs <= 0)
202 MOD_DPF(REFS, ("module_release: before, refs=%d\n", mod->refs));
204 mod->refs--;
205 if (mod->refs == 0) {
206 TAILQ_REMOVE(&modules, mod, link);
207 if (mod->file)
208 TAILQ_REMOVE(&mod->file->modules, mod, flink);
209 free(mod, M_MODULE);
216 module_t mod;
221 TAILQ_FOREACH(mod, &modules, link) {
222 err = strcmp(mod->name, name);
224 return (mod);
232 module_t mod;
236 TAILQ_FOREACH(mod, &modules, link)
237 if (mod->id == modid)
238 return(mod);
243 module_quiesce(module_t mod)
248 error = MOD_EVENT(mod, MOD_QUIESCE);
256 module_unload(module_t mod)
261 error = MOD_EVENT(mod, MOD_UNLOAD);
267 module_getid(module_t mod)
271 return (mod->id);
275 module_getfnext(module_t mod)
279 return (TAILQ_NEXT(mod, flink));
283 module_getname(module_t mod)
287 return (mod->name);
291 module_setspecific(module_t mod, modspecific_t *datap)
295 mod->data = *datap;
299 module_file(module_t mod)
302 return (mod->file);
311 module_t mod;
318 mod = TAILQ_FIRST(&modules);
319 if (mod)
320 td->td_retval[0] = mod->id;
325 mod = module_lookupbyid(uap->modid);
326 if (mod == NULL) {
330 if (TAILQ_NEXT(mod, link))
331 td->td_retval[0] = TAILQ_NEXT(mod, link)->id;
342 module_t mod;
348 mod = module_lookupbyid(uap->modid);
349 if (mod == NULL) {
353 if (TAILQ_NEXT(mod, flink))
354 td->td_retval[0] = TAILQ_NEXT(mod, flink)->id;
372 module_t mod;
380 mod = module_lookupbyid(uap->modid);
381 if (mod == NULL) {
385 id = mod->id;
386 refs = mod->refs;
387 name = mod->name;
388 data = mod->data;
400 namelen = strlen(mod->name) + 1;
427 module_t mod;
433 mod = module_lookupbyname(name);
434 if (mod == NULL)
437 td->td_retval[0] = module_getid(mod);
469 module_t mod;
477 mod = module_lookupbyid(uap->modid);
478 if (mod == NULL) {
483 id = mod->id;
484 refs = mod->refs;
485 name = mod->name;
486 CP(mod->data, data32, intval);
487 CP(mod->data, data32, uintval);
488 CP(mod->data, data32, longval);
489 CP(mod->data, data32, ulongval);
498 namelen = strlen(mod->name) + 1;