Lines Matching defs:module

59  * - Configuration action is a reference to a module and a set of operations
60 * within the module, for example: consconfig:kbd_config
171 static void dacf_destroy_opsets(dacf_module_t *module);
253 dacf_module_hash = mod_hash_create_strhash("dacf module hash",
269 * Register the '__kernel' module.
272 * module. We just feed the framework a dacfsw structure; it will get
307 * If 'module' is null, the kernel is the 'module'. (see dacf_rule_ctor()).
311 char *module, char *opset, dacf_opid_t opid, uint_t opts,
324 module ? module : "[kernel]", opset, dacf_opid_to_str(opid));
341 rule = dacf_rule_ctor(devspec_data, module, opset, opid, opts,
355 devspec_data, module, opset, dacf_opid_to_str(opid));
366 dacf_rule_ctor(char *device_spec, char *module, char *opset, dacf_opid_t opid,
381 * If module is 'null' we set it to __kernel, meaning that this op
384 if (module == NULL) {
385 module = kmod_name;
388 rule->r_module = kmem_alloc(strlen(module) + 1, KM_SLEEP);
389 (void) strcpy(rule->r_module, module);
663 * register a module with the framework. Use when a module gets loaded,
664 * or for the kernel to register a "virtual" module (i.e. a "module"
666 * provided by the module.
673 dacf_module_t *module;
681 cmn_err(CE_WARN, "dacf: module '%s' exports unsupported "
700 cmn_err(CE_WARN, "dacf module %s exports no opsets, "
706 * Look to see if the module has been previously registered with the
710 (mod_hash_val_t)&module) == 0) {
714 rw_enter(&module->dm_lock, RW_WRITER);
715 if (module->dm_loaded) {
716 rw_exit(&module->dm_lock);
717 cmn_err(CE_WARN, "dacf module '%s' is "
723 * This is the first time we've ever seen the module; stick
724 * it into the module hash. If that fails, we've had a
726 * new module. It's safe to stick the module into the
730 module = kmem_zalloc(sizeof (dacf_module_t), KM_SLEEP);
733 rw_enter(&module->dm_lock, RW_WRITER);
736 (mod_hash_val_t)module) != 0) {
737 rw_exit(&module->dm_lock);
739 kmem_free(module, sizeof (dacf_module_t));
740 cmn_err(CE_WARN, "dacf module '%s' is "
746 * In either case (first time we've seen it or not), the module is
749 ASSERT(RW_WRITE_HELD(&module->dm_lock));
752 * Alloc array of opsets for this module. Add one for the final
765 ASSERT(module->dm_opsets == NULL); /* see dacf_destroy_opsets() */
766 module->dm_opsets = opsarray;
775 module->dm_loaded = 1;
776 rw_exit(&module->dm_lock);
783 * remove a module from the framework, and free framework-allocated
789 dacf_module_t *module;
798 * add a flag indicating that this module is really a fake.
809 (mod_hash_val_t)&module) == 0) {
811 !rw_tryenter(&module->dm_lock, RW_WRITER)) {
818 ASSERT(RW_WRITE_HELD(&module->dm_lock));
819 dacf_destroy_opsets(module);
820 module->dm_loaded = 0;
821 rw_exit(&module->dm_lock);
827 * given a module, destroy all of it's associated op-sets.
830 dacf_destroy_opsets(dacf_module_t *module)
832 dacf_opset_t *array = module->dm_opsets;
837 ASSERT(RW_WRITE_HELD(&module->dm_lock));
838 ASSERT(module->dm_loaded == 1);
861 module->dm_opsets = NULL;
908 * Invoke a op in a opset in a module given the rule to invoke.
917 dacf_module_t *module;
933 * Take laps, trying to load the dacf module. For the case of kernel-
940 (mod_hash_val_t *)&module) == 0) {
941 rw_enter(&module->dm_lock, RW_READER);
943 * Found the module, and it is loaded.
945 if (module->dm_loaded != 0) {
948 rw_exit(&module->dm_lock);
953 * but dm_loaded is 0, meaning the module needs to be loaded.
962 ASSERT(RW_READ_HELD(&module->dm_lock));
964 opsarray = module->dm_opsets;
967 * Loop through the opsets exported by this module, and find the one
980 "found in module '%s'", rule->r_opset, rule->r_module);
981 rw_exit(&module->dm_lock);
1001 "in opset '%s' in module '%s'", dacf_opid_to_str(op_id),
1003 rw_exit(&module->dm_lock);
1029 * Completed the invocation against module, so let go of it.
1036 * Drop our r-lock on the module, now that we no longer need the module
1039 rw_exit(&module->dm_lock);