📄 cmglobal.c
字号:
/******************************************************************************
*
* Module Name: cmglobal - Global variables for the ACPI subsystem
* $Revision: 1.1 $
*
*****************************************************************************/
/*
* Copyright (C) 2000, 2001 R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <acpi.h>
#define _COMPONENT ACPI_UTILITIES
MODULE_NAME ("cmglobal")
/******************************************************************************
*
* Static global variable initialization.
*
******************************************************************************/
/*
* We want the debug switches statically initialized so they
* are already set when the debugger is entered.
*/
/* Debug switch - level and trace mask */
u32 acpi_dbg_level = NORMAL_DEFAULT;
/* Debug switch - layer (component) mask */
u32 acpi_dbg_layer = ACPI_COMPONENT_DEFAULT;
u32 acpi_gbl_nesting_level = 0;
/* Debugger globals */
u8 acpi_gbl_db_terminate_threads = FALSE;
u8 acpi_gbl_method_executing = FALSE;
/* System flags */
u32 acpi_gbl_system_flags = 0;
u32 acpi_gbl_startup_flags = 0;
/* System starts unitialized! */
u8 acpi_gbl_shutdown = TRUE;
u8 acpi_gbl_decode_to8bit [8] = {1,2,4,8,16,32,64,128};
/******************************************************************************
*
* Namespace globals
*
******************************************************************************/
/*
* Names built-in to the interpreter
*
* Initial values are currently supported only for types String and Number.
* To avoid type punning, both are specified as strings in this table.
*
* NOTES:
* 1) _SB_ is defined to be a device to allow _SB_/_INI to be run
* during the initialization sequence.
*/
PREDEFINED_NAMES acpi_gbl_pre_defined_names[] =
{ {"_GPE", INTERNAL_TYPE_DEF_ANY},
{"_PR_", INTERNAL_TYPE_DEF_ANY},
{"_SB_", ACPI_TYPE_DEVICE},
{"_SI_", INTERNAL_TYPE_DEF_ANY},
{"_TZ_", INTERNAL_TYPE_DEF_ANY},
{"_REV", ACPI_TYPE_INTEGER, "2"},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, "0"},
{NULL, ACPI_TYPE_ANY} /* Table terminator */
};
/*
* Properties of the ACPI Object Types, both internal and external.
*
* Elements of Acpi_ns_properties are bit significant
* and the table is indexed by values of ACPI_OBJECT_TYPE
*/
u8 acpi_gbl_ns_properties[] =
{
NSP_NORMAL, /* 00 Any */
NSP_NORMAL, /* 01 Number */
NSP_NORMAL, /* 02 String */
NSP_NORMAL, /* 03 Buffer */
NSP_LOCAL, /* 04 Package */
NSP_NORMAL, /* 05 Field_unit */
NSP_NEWSCOPE | NSP_LOCAL, /* 06 Device */
NSP_LOCAL, /* 07 Acpi_event */
NSP_NEWSCOPE | NSP_LOCAL, /* 08 Method */
NSP_LOCAL, /* 09 Mutex */
NSP_LOCAL, /* 10 Region */
NSP_NEWSCOPE | NSP_LOCAL, /* 11 Power */
NSP_NEWSCOPE | NSP_LOCAL, /* 12 Processor */
NSP_NEWSCOPE | NSP_LOCAL, /* 13 Thermal */
NSP_NORMAL, /* 14 Buffer_field */
NSP_NORMAL, /* 15 Ddb_handle */
NSP_NORMAL, /* 16 Debug Object */
NSP_NORMAL, /* 17 Def_field */
NSP_NORMAL, /* 18 Bank_field */
NSP_NORMAL, /* 19 Index_field */
NSP_NORMAL, /* 20 Reference */
NSP_NORMAL, /* 21 Alias */
NSP_NORMAL, /* 22 Notify */
NSP_NORMAL, /* 23 Address Handler */
NSP_NEWSCOPE | NSP_LOCAL, /* 24 Resource */
NSP_NORMAL, /* 25 Def_field_defn */
NSP_NORMAL, /* 26 Bank_field_defn */
NSP_NORMAL, /* 27 Index_field_defn */
NSP_NORMAL, /* 28 If */
NSP_NORMAL, /* 29 Else */
NSP_NORMAL, /* 30 While */
NSP_NEWSCOPE, /* 31 Scope */
NSP_LOCAL, /* 32 Def_any */
NSP_NORMAL, /* 33 Extra */
NSP_NORMAL /* 34 Invalid */
};
/* Hex to ASCII conversion table */
NATIVE_CHAR acpi_gbl_hex_to_ascii[] =
{'0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F'};
/******************************************************************************
*
* Table globals
*
* NOTE: This table includes ONLY the ACPI tables that the subsystem consumes.
* it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables
* that are not used by the subsystem are simply ignored.
*
******************************************************************************/
ACPI_TABLE_DESC acpi_gbl_acpi_tables[NUM_ACPI_TABLES];
ACPI_TABLE_SUPPORT acpi_gbl_acpi_table_data[NUM_ACPI_TABLES] =
{
/*********** Name, Signature, Signature size, How many allowed?, Supported? Global typed pointer */
/* RSDP 0 */ {RSDP_NAME, RSDP_SIG, sizeof (RSDP_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL},
/* DSDT 1 */ {DSDT_SIG, DSDT_SIG, sizeof (DSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &acpi_gbl_DSDT},
/* FADT 2 */ {FADT_SIG, FADT_SIG, sizeof (FADT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &acpi_gbl_FADT},
/* FACS 3 */ {FACS_SIG, FACS_SIG, sizeof (FACS_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, (void **) &acpi_gbl_FACS},
/* PSDT 4 */ {PSDT_SIG, PSDT_SIG, sizeof (PSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL},
/* SSDT 5 */ {SSDT_SIG, SSDT_SIG, sizeof (SSDT_SIG)-1, ACPI_TABLE_MULTIPLE, AE_OK, NULL},
/* XSDT 6 */ {XSDT_SIG, XSDT_SIG, sizeof (RSDT_SIG)-1, ACPI_TABLE_SINGLE, AE_OK, NULL},
};
/*
* String versions of the exception codes above
* These strings must match the corresponding defines exactly
*/
NATIVE_CHAR *acpi_gbl_exception_names_env[] =
{
"AE_OK",
"AE_ERROR",
"AE_NO_ACPI_TABLES",
"AE_NO_NAMESPACE",
"AE_NO_MEMORY",
"AE_NOT_FOUND",
"AE_NOT_EXIST",
"AE_EXIST",
"AE_TYPE",
"AE_NULL_OBJECT",
"AE_NULL_ENTRY",
"AE_BUFFER_OVERFLOW",
"AE_STACK_OVERFLOW",
"AE_STACK_UNDERFLOW",
"AE_NOT_IMPLEMENTED",
"AE_VERSION_MISMATCH",
"AE_SUPPORT",
"AE_SHARE",
"AE_LIMIT",
"AE_TIME",
"AE_UNKNOWN_STATUS",
"AE_ACQUIRE_DEADLOCK",
"AE_RELEASE_DEADLOCK",
"AE_NOT_ACQUIRED",
"AE_ALREADY_ACQUIRED",
"AE_NO_HARDWARE_RESPONSE",
"AE_NO_GLOBAL_LOCK",
};
static NATIVE_CHAR *acpi_gbl_exception_names_pgm[] =
{
"AE_BAD_PARAMETER",
"AE_BAD_CHARACTER",
"AE_BAD_PATHNAME",
"AE_BAD_DATA",
"AE_BAD_ADDRESS",
};
static NATIVE_CHAR *acpi_gbl_exception_names_tbl[] =
{
"AE_BAD_SIGNATURE",
"AE_BAD_HEADER",
"AE_BAD_CHECKSUM",
"AE_BAD_VALUE",
};
static NATIVE_CHAR *acpi_gbl_exception_names_aml[] =
{
"AE_AML_ERROR",
"AE_AML_PARSE",
"AE_AML_BAD_OPCODE",
"AE_AML_NO_OPERAND",
"AE_AML_OPERAND_TYPE",
"AE_AML_OPERAND_VALUE",
"AE_AML_UNINITIALIZED_LOCAL",
"AE_AML_UNINITIALIZED_ARG",
"AE_AML_UNINITIALIZED_ELEMENT",
"AE_AML_NUMERIC_OVERFLOW",
"AE_AML_REGION_LIMIT",
"AE_AML_BUFFER_LIMIT",
"AE_AML_PACKAGE_LIMIT",
"AE_AML_DIVIDE_BY_ZERO",
"AE_AML_BAD_NAME",
"AE_AML_NAME_NOT_FOUND",
"AE_AML_INTERNAL",
"AE_AML_INVALID_SPACE_ID",
"AE_AML_STRING_LIMIT",
"AE_AML_NO_RETURN_VALUE",
"AE_AML_METHOD_LIMIT",
"AE_AML_NOT_OWNER",
"AE_AML_MUTEX_ORDER",
"AE_AML_MUTEX_NOT_ACQUIRED",
};
static NATIVE_CHAR *acpi_gbl_exception_names_ctrl[] =
{
"AE_CTRL_RETURN_VALUE",
"AE_CTRL_PENDING",
"AE_CTRL_TERMINATE",
"AE_CTRL_TRUE",
"AE_CTRL_FALSE",
"AE_CTRL_DEPTH",
"AE_CTRL_END",
"AE_CTRL_TRANSFER",
};
/*****************************************************************************
*
* FUNCTION: Acpi_cm_valid_object_type
*
* PARAMETERS: None.
*
* RETURN: TRUE if valid object type
*
* DESCRIPTION: Validate an object type
*
****************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -