/******************************************************************************* * * FUNCTION: acpi_initialize_subsystem * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Initializes all global variables. This is the first function * called, so any early initialization belongs here. * ******************************************************************************/ acpi_status __init acpi_initialize_subsystem(void) { acpi_status status; ACPI_FUNCTION_TRACE(acpi_initialize_subsystem); acpi_gbl_startup_flags = ACPI_SUBSYSTEM_INITIALIZE; ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace()); /* Initialize the OS-Dependent layer */ status = acpi_os_initialize(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During OSL initialization")); return_ACPI_STATUS(status); } /* Initialize all globals used by the subsystem */ status = acpi_ut_init_globals(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During initialization of globals")); return_ACPI_STATUS(status); } /* Create the default mutex objects */ status = acpi_ut_mutex_initialize(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During Global Mutex creation")); return_ACPI_STATUS(status); } /* * Initialize the namespace manager and * the root of the namespace tree */ status = acpi_ns_root_initialize(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During Namespace initialization")); return_ACPI_STATUS(status); } /* Initialize the global OSI interfaces list with the static names */ status = acpi_ut_initialize_interfaces(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During OSI interfaces initialization")); return_ACPI_STATUS(status); } /* If configured, initialize the AML debugger */ ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); return_ACPI_STATUS(status); }
acpi_status acpi_initialize_subsystem ( void) { acpi_status status; ACPI_FUNCTION_TRACE ("acpi_initialize_subsystem"); ACPI_DEBUG_EXEC (acpi_ut_init_stack_ptr_trace ()); /* Initialize all globals used by the subsystem */ acpi_ut_init_globals (); /* Initialize the OS-Dependent layer */ status = acpi_os_initialize (); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("OSD failed to initialize, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } /* Create the default mutex objects */ status = acpi_ut_mutex_initialize (); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("Global mutex creation failure, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } /* * Initialize the namespace manager and * the root of the namespace tree */ status = acpi_ns_root_initialize (); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (("Namespace initialization failure, %s\n", acpi_format_exception (status))); return_ACPI_STATUS (status); } /* If configured, initialize the AML debugger */ ACPI_DEBUGGER_EXEC (status = acpi_db_initialize ()); return_ACPI_STATUS (status); }
/******************************************************************************* * * FUNCTION: acpi_initialize_subsystem * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Initializes all global variables. This is the first function * called, so any early initialization belongs here. * ******************************************************************************/ acpi_status acpi_initialize_subsystem(void) { acpi_status status; ACPI_FUNCTION_TRACE(acpi_initialize_subsystem); ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace()); /* Initialize the OS-Dependent layer */ status = acpi_os_initialize(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During OSL initialization")); return_ACPI_STATUS(status); } /* Initialize all globals used by the subsystem */ /* 初始化全局变量 */ acpi_ut_init_globals(); /* Create the default mutex objects */ /* 创建互斥锁 */ status = acpi_ut_mutex_initialize(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During Global Mutex creation")); return_ACPI_STATUS(status); } /* * Initialize the namespace manager and * the root of the namespace tree */ /* 初始化ACPI的命名空间 */ status = acpi_ns_root_initialize(); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "During Namespace initialization")); return_ACPI_STATUS(status); } /* If configured, initialize the AML debugger */ ACPI_DEBUGGER_EXEC(status = acpi_db_initialize()); return_ACPI_STATUS(status); }
int ACPI_SYSTEM_XFACE acpi_main(int argc, char *argv[]) #endif { int status = 0; struct ap_dump_action *action; u32 file_size; u32 i; ACPI_DEBUG_INITIALIZE(); /* For debug version only */ acpi_os_initialize(); gbl_output_file = ACPI_FILE_OUT; acpi_gbl_integer_byte_width = 8; /* Process command line options */ status = ap_do_options(argc, argv); if (status > 0) { return (0); } if (status < 0) { return (status); } /* Get/dump ACPI table(s) as requested */ for (i = 0; i < current_action; i++) { action = &action_table[i]; switch (action->to_be_done) { case AP_DUMP_ALL_TABLES: status = ap_dump_all_tables(); break; case AP_DUMP_TABLE_BY_ADDRESS: status = ap_dump_table_by_address(action->argument); break; case AP_DUMP_TABLE_BY_NAME: status = ap_dump_table_by_name(action->argument); break; case AP_DUMP_TABLE_BY_FILE: status = ap_dump_table_from_file(action->argument); break; default: fprintf(stderr, "Internal error, invalid action: 0x%X\n", action->to_be_done); return (-1); } if (status) { return (status); } } if (gbl_output_filename) { if (gbl_verbose_mode) { /* Summary for the output file */ file_size = cm_get_file_size(gbl_output_file); fprintf(stderr, "Output file %s contains 0x%X (%u) bytes\n\n", gbl_output_filename, file_size, file_size); } fclose(gbl_output_file); } return (status); }