⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utglobal.c

📁 linux-2.6.15.6
💻 C
📖 第 1 页 / 共 2 页
字号:
struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS] = {	/* ACPI_EVENT_PMTIMER       */ {ACPI_BITREG_TIMER_STATUS,					ACPI_BITREG_TIMER_ENABLE,					ACPI_BITMASK_TIMER_STATUS,					ACPI_BITMASK_TIMER_ENABLE},	/* ACPI_EVENT_GLOBAL        */ {ACPI_BITREG_GLOBAL_LOCK_STATUS,					ACPI_BITREG_GLOBAL_LOCK_ENABLE,					ACPI_BITMASK_GLOBAL_LOCK_STATUS,					ACPI_BITMASK_GLOBAL_LOCK_ENABLE},	/* ACPI_EVENT_POWER_BUTTON  */ {ACPI_BITREG_POWER_BUTTON_STATUS,					ACPI_BITREG_POWER_BUTTON_ENABLE,					ACPI_BITMASK_POWER_BUTTON_STATUS,					ACPI_BITMASK_POWER_BUTTON_ENABLE},	/* ACPI_EVENT_SLEEP_BUTTON  */ {ACPI_BITREG_SLEEP_BUTTON_STATUS,					ACPI_BITREG_SLEEP_BUTTON_ENABLE,					ACPI_BITMASK_SLEEP_BUTTON_STATUS,					ACPI_BITMASK_SLEEP_BUTTON_ENABLE},	/* ACPI_EVENT_RTC           */ {ACPI_BITREG_RT_CLOCK_STATUS,					ACPI_BITREG_RT_CLOCK_ENABLE,					ACPI_BITMASK_RT_CLOCK_STATUS,					ACPI_BITMASK_RT_CLOCK_ENABLE},};/******************************************************************************* * * FUNCTION:    acpi_ut_get_region_name * * PARAMETERS:  None. * * RETURN:      Status * * DESCRIPTION: Translate a Space ID into a name string (Debug only) * ******************************************************************************//* Region type decoding */const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {/*! [Begin] no source code translation (keep these ASL Keywords as-is) */	"SystemMemory",	"SystemIO",	"PCI_Config",	"EmbeddedControl",	"SMBus",	"CMOS",	"PCIBARTarget",	"DataTable"/*! [End] no source code translation !*/};char *acpi_ut_get_region_name(u8 space_id){	if (space_id >= ACPI_USER_REGION_BEGIN) {		return ("user_defined_region");	} else if (space_id >= ACPI_NUM_PREDEFINED_REGIONS) {		return ("invalid_space_id");	}	return ((char *)acpi_gbl_region_types[space_id]);}/******************************************************************************* * * FUNCTION:    acpi_ut_get_event_name * * PARAMETERS:  None. * * RETURN:      Status * * DESCRIPTION: Translate a Event ID into a name string (Debug only) * ******************************************************************************//* Event type decoding */static const char *acpi_gbl_event_types[ACPI_NUM_FIXED_EVENTS] = {	"PM_Timer",	"global_lock",	"power_button",	"sleep_button",	"real_time_clock",};char *acpi_ut_get_event_name(u32 event_id){	if (event_id > ACPI_EVENT_MAX) {		return ("invalid_event_iD");	}	return ((char *)acpi_gbl_event_types[event_id]);}/******************************************************************************* * * FUNCTION:    acpi_ut_get_type_name * * PARAMETERS:  None. * * RETURN:      Status * * DESCRIPTION: Translate a Type ID into a name string (Debug only) * ******************************************************************************//* * Elements of acpi_gbl_ns_type_names below must match * one-to-one with values of acpi_object_type * * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; * when stored in a table it really means that we have thus far seen no * evidence to indicate what type is actually going to be stored for this entry. */static const char acpi_gbl_bad_type[] = "UNDEFINED";/* Printable names of the ACPI object types */static const char *acpi_gbl_ns_type_names[] = {	/* 00 */ "Untyped",	/* 01 */ "Integer",	/* 02 */ "String",	/* 03 */ "Buffer",	/* 04 */ "Package",	/* 05 */ "field_unit",	/* 06 */ "Device",	/* 07 */ "Event",	/* 08 */ "Method",	/* 09 */ "Mutex",	/* 10 */ "Region",	/* 11 */ "Power",	/* 12 */ "Processor",	/* 13 */ "Thermal",	/* 14 */ "buffer_field",	/* 15 */ "ddb_handle",	/* 16 */ "debug_object",	/* 17 */ "region_field",	/* 18 */ "bank_field",	/* 19 */ "index_field",	/* 20 */ "Reference",	/* 21 */ "Alias",	/* 22 */ "method_alias",	/* 23 */ "Notify",	/* 24 */ "addr_handler",	/* 25 */ "resource_desc",	/* 26 */ "resource_fld",	/* 27 */ "Scope",	/* 28 */ "Extra",	/* 29 */ "Data",	/* 30 */ "Invalid"};char *acpi_ut_get_type_name(acpi_object_type type){	if (type > ACPI_TYPE_INVALID) {		return ((char *)acpi_gbl_bad_type);	}	return ((char *)acpi_gbl_ns_type_names[type]);}char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc){	if (!obj_desc) {		return ("[NULL Object Descriptor]");	}	return (acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc)));}/******************************************************************************* * * FUNCTION:    acpi_ut_get_node_name * * PARAMETERS:  Object               - A namespace node * * RETURN:      Pointer to a string * * DESCRIPTION: Validate the node and return the node's ACPI name. * ******************************************************************************/char *acpi_ut_get_node_name(void *object){	struct acpi_namespace_node *node = (struct acpi_namespace_node *)object;	/* Must return a string of exactly 4 characters == ACPI_NAME_SIZE */	if (!object) {		return ("NULL");	}	/* Check for Root node */	if ((object == ACPI_ROOT_OBJECT) || (object == acpi_gbl_root_node)) {		return ("\"\\\" ");	}	/* Descriptor must be a namespace node */	if (node->descriptor != ACPI_DESC_TYPE_NAMED) {		return ("####");	}	/* Name must be a valid ACPI name */	if (!acpi_ut_valid_acpi_name(*(u32 *) node->name.ascii)) {		return ("????");	}	/* Return the name */	return (node->name.ascii);}/******************************************************************************* * * FUNCTION:    acpi_ut_get_descriptor_name * * PARAMETERS:  Object               - An ACPI object * * RETURN:      Pointer to a string * * DESCRIPTION: Validate object and return the descriptor type * ******************************************************************************//* Printable names of object descriptor types */static const char *acpi_gbl_desc_type_names[] = {	/* 00 */ "Invalid",	/* 01 */ "Cached",	/* 02 */ "State-Generic",	/* 03 */ "State-Update",	/* 04 */ "State-Package",	/* 05 */ "State-Control",	/* 06 */ "State-root_parse_scope",	/* 07 */ "State-parse_scope",	/* 08 */ "State-walk_scope",	/* 09 */ "State-Result",	/* 10 */ "State-Notify",	/* 11 */ "State-Thread",	/* 12 */ "Walk",	/* 13 */ "Parser",	/* 14 */ "Operand",	/* 15 */ "Node"};char *acpi_ut_get_descriptor_name(void *object){	if (!object) {		return ("NULL OBJECT");	}	if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) {		return ((char *)acpi_gbl_bad_type);	}	return ((char *)		acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE(object)]);}#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)/* * Strings and procedures used for debug only *//******************************************************************************* * * FUNCTION:    acpi_ut_get_mutex_name * * PARAMETERS:  mutex_id        - The predefined ID for this mutex. * * RETURN:      String containing the name of the mutex. Always returns a valid *              pointer. * * DESCRIPTION: Translate a mutex ID into a name string (Debug only) * ******************************************************************************/char *acpi_ut_get_mutex_name(u32 mutex_id){	if (mutex_id > MAX_MUTEX) {		return ("Invalid Mutex ID");	}	return (acpi_gbl_mutex_names[mutex_id]);}#endif/******************************************************************************* * * FUNCTION:    acpi_ut_valid_object_type * * PARAMETERS:  Type            - Object type to be validated * * RETURN:      TRUE if valid object type, FALSE otherwise * * DESCRIPTION: Validate an object type * ******************************************************************************/u8 acpi_ut_valid_object_type(acpi_object_type type){	if (type > ACPI_TYPE_LOCAL_MAX) {		/* Note: Assumes all TYPEs are contiguous (external/local) */		return (FALSE);	}	return (TRUE);}/******************************************************************************* * * FUNCTION:    acpi_ut_init_globals * * PARAMETERS:  None * * RETURN:      None * * DESCRIPTION: Init library globals.  All globals that require specific *              initialization should be initialized here! * ******************************************************************************/void acpi_ut_init_globals(void){	acpi_status status;	u32 i;	ACPI_FUNCTION_TRACE("ut_init_globals");	/* Create all memory caches */	status = acpi_ut_create_caches();	if (ACPI_FAILURE(status)) {		return;	}	/* ACPI table structure */	for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) {		acpi_gbl_table_lists[i].next = NULL;		acpi_gbl_table_lists[i].count = 0;	}	/* Mutex locked flags */	for (i = 0; i < NUM_MUTEX; i++) {		acpi_gbl_mutex_info[i].mutex = NULL;		acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED;		acpi_gbl_mutex_info[i].use_count = 0;	}	/* GPE support */	acpi_gbl_gpe_xrupt_list_head = NULL;	acpi_gbl_gpe_fadt_blocks[0] = NULL;	acpi_gbl_gpe_fadt_blocks[1] = NULL;	/* Global notify handlers */	acpi_gbl_system_notify.handler = NULL;	acpi_gbl_device_notify.handler = NULL;	acpi_gbl_exception_handler = NULL;	acpi_gbl_init_handler = NULL;	/* Global "typed" ACPI table pointers */	acpi_gbl_RSDP = NULL;	acpi_gbl_XSDT = NULL;	acpi_gbl_FACS = NULL;	acpi_gbl_FADT = NULL;	acpi_gbl_DSDT = NULL;	/* Global Lock support */	acpi_gbl_global_lock_acquired = FALSE;	acpi_gbl_global_lock_thread_count = 0;	acpi_gbl_global_lock_handle = 0;	/* Miscellaneous variables */	acpi_gbl_table_flags = ACPI_PHYSICAL_POINTER;	acpi_gbl_rsdp_original_location = 0;	acpi_gbl_cm_single_step = FALSE;	acpi_gbl_db_terminate_threads = FALSE;	acpi_gbl_shutdown = FALSE;	acpi_gbl_ns_lookup_count = 0;	acpi_gbl_ps_find_count = 0;	acpi_gbl_acpi_hardware_present = TRUE;	acpi_gbl_owner_id_mask = 0;	acpi_gbl_debugger_configuration = DEBUGGER_THREADING;	acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;	/* Hardware oriented */	acpi_gbl_events_initialized = FALSE;	acpi_gbl_system_awake_and_running = TRUE;	/* Namespace */	acpi_gbl_root_node = NULL;	acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;	acpi_gbl_root_node_struct.descriptor = ACPI_DESC_TYPE_NAMED;	acpi_gbl_root_node_struct.type = ACPI_TYPE_DEVICE;	acpi_gbl_root_node_struct.child = NULL;	acpi_gbl_root_node_struct.peer = NULL;	acpi_gbl_root_node_struct.object = NULL;	acpi_gbl_root_node_struct.flags = ANOBJ_END_OF_PEER_LIST;#ifdef ACPI_DEBUG_OUTPUT	acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX;#endif	return_VOID;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -