prop_dictionary_t prop_dictionary_augment(prop_dictionary_t bottom, prop_dictionary_t top) { prop_object_iterator_t i; prop_dictionary_t d; prop_object_t ko, o; prop_dictionary_keysym_t k; const char *key; d = prop_dictionary_copy_mutable(bottom); i = prop_dictionary_iterator(top); while ((ko = prop_object_iterator_next(i)) != NULL) { k = (prop_dictionary_keysym_t)ko; key = prop_dictionary_keysym_cstring_nocopy(k); o = prop_dictionary_get_keysym(top, k); if (o == NULL || !prop_dictionary_set(d, key, o)) { prop_object_release((prop_object_t)d); d = NULL; break; } } prop_object_iterator_release(i); prop_dictionary_make_immutable(d); return d; }
static int acpi_debug_create(void) { acpi_debug_layer_d = prop_dictionary_create(); acpi_debug_level_d = prop_dictionary_create(); KASSERT(acpi_debug_layer_d != NULL); KASSERT(acpi_debug_level_d != NULL); /* * General components. */ ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_UTILITIES); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_HARDWARE); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_EVENTS); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_TABLES); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_NAMESPACE); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_PARSER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_DISPATCHER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_EXECUTER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_RESOURCES); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_CA_DEBUGGER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_OS_SERVICES); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_CA_DISASSEMBLER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_COMPILER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_TOOLS); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_EXAMPLE); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_DRIVER); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_ALL_COMPONENTS); /* * NetBSD specific components. */ ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_BUS_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_ACAD_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_BAT_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_BUTTON_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_EC_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_LID_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_RESOURCE_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_TZ_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_DISPLAY_COMPONENT); ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_ALL_DRIVERS); /* * Debug levels. */ ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_INIT); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_DEBUG_OBJECT); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_INFO); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_ALL_EXCEPTIONS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_INIT_NAMES); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_PARSE); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_LOAD); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_DISPATCH); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_EXEC); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_NAMES); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_OPREGION); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_BFIELD); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_TABLES); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_VALUES); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_OBJECTS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_RESOURCES); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_USER_REQUESTS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_PACKAGE); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_VERBOSITY1); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_ALLOCATIONS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_FUNCTIONS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_OPTIMIZATIONS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_VERBOSITY2); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_MUTEX); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_THREADS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_IO); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_INTERRUPTS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_VERBOSITY3); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_AML_DISASSEMBLE); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_VERBOSE_INFO); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_FULL_TABLES); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_EVENTS); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_LV_VERBOSE); /* * The default debug level. */ ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_DEBUG_DEFAULT); /* * A custom ACPI_DEBUG_NONE disables debugging. */ ACPI_DEBUG_ADD(acpi_debug_layer_d, ACPI_DEBUG_NONE); ACPI_DEBUG_ADD(acpi_debug_level_d, ACPI_DEBUG_NONE); prop_dictionary_make_immutable(acpi_debug_layer_d); prop_dictionary_make_immutable(acpi_debug_level_d); return 0; }