1/****************************************************************************** 2 * 3 * Module Name: utglobal - Global variables for the ACPI subsystem
| 1/****************************************************************************** 2 * 3 * Module Name: utglobal - Global variables for the ACPI subsystem
|
4 * $Revision: 193 $
| 4 * $Revision: 194 $
|
5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#define __UTGLOBAL_C__ 118#define DEFINE_ACPI_GLOBALS 119 120#include "acpi.h" 121#include "acnamesp.h" 122 123#define _COMPONENT ACPI_UTILITIES 124 ACPI_MODULE_NAME ("utglobal") 125 126 127/****************************************************************************** 128 * 129 * FUNCTION: AcpiFormatException 130 * 131 * PARAMETERS: Status - The ACPI_STATUS code to be formatted 132 * 133 * RETURN: A string containing the exception text 134 * 135 * DESCRIPTION: This function translates an ACPI exception into an ASCII string. 136 * 137 ******************************************************************************/ 138 139const char * 140AcpiFormatException ( 141 ACPI_STATUS Status) 142{ 143 const char *Exception = "UNKNOWN_STATUS_CODE"; 144 ACPI_STATUS SubStatus; 145 146 147 ACPI_FUNCTION_NAME ("FormatException"); 148 149 150 SubStatus = (Status & ~AE_CODE_MASK); 151 152 switch (Status & AE_CODE_MASK) 153 { 154 case AE_CODE_ENVIRONMENTAL: 155 156 if (SubStatus <= AE_CODE_ENV_MAX) 157 { 158 Exception = AcpiGbl_ExceptionNames_Env [SubStatus]; 159 break; 160 } 161 goto Unknown; 162 163 case AE_CODE_PROGRAMMER: 164 165 if (SubStatus <= AE_CODE_PGM_MAX) 166 { 167 Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1]; 168 break; 169 } 170 goto Unknown; 171 172 case AE_CODE_ACPI_TABLES: 173 174 if (SubStatus <= AE_CODE_TBL_MAX) 175 { 176 Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; 177 break; 178 } 179 goto Unknown; 180 181 case AE_CODE_AML: 182 183 if (SubStatus <= AE_CODE_AML_MAX) 184 { 185 Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; 186 break; 187 } 188 goto Unknown; 189 190 case AE_CODE_CONTROL: 191 192 if (SubStatus <= AE_CODE_CTRL_MAX) 193 { 194 Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; 195 break; 196 } 197 goto Unknown; 198 199 default: 200 goto Unknown; 201 } 202 203 204 return ((const char *) Exception); 205 206Unknown: 207 208 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", Status)); 209 return ((const char *) Exception); 210} 211 212 213/****************************************************************************** 214 * 215 * Static global variable initialization. 216 * 217 ******************************************************************************/ 218 219/* 220 * We want the debug switches statically initialized so they 221 * are already set when the debugger is entered. 222 */ 223 224/* Debug switch - level and trace mask */ 225 226#ifdef ACPI_DEBUG_OUTPUT 227UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT; 228#else 229UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT; 230#endif 231 232/* Debug switch - layer (component) mask */ 233 234UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT; 235UINT32 AcpiGbl_NestingLevel = 0; 236 237 238/* Debugger globals */ 239 240BOOLEAN AcpiGbl_DbTerminateThreads = FALSE; 241BOOLEAN AcpiGbl_AbortMethod = FALSE; 242BOOLEAN AcpiGbl_MethodExecuting = FALSE; 243 244/* System flags */ 245 246UINT32 AcpiGbl_StartupFlags = 0; 247 248/* System starts uninitialized */ 249 250BOOLEAN AcpiGbl_Shutdown = TRUE; 251 252const UINT8 AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128}; 253 254const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] = { 255 "\\_S0_", 256 "\\_S1_", 257 "\\_S2_", 258 "\\_S3_", 259 "\\_S4_", 260 "\\_S5_"}; 261 262const char *AcpiGbl_HighestDstateNames[4] = { 263 "_S1D", 264 "_S2D", 265 "_S3D", 266 "_S4D"}; 267
| 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. 21 * 22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23 * copy of the source code appearing in this file ("Covered Code") an 24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25 * base code distributed originally by Intel ("Original Intel Code") to copy, 26 * make derivatives, distribute, use and display any portion of the Covered 27 * Code in any form, with the right to sublicense such rights; and 28 * 29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30 * license (with the right to sublicense), under only those claims of Intel 31 * patents that are infringed by the Original Intel Code, to make, use, sell, 32 * offer to sell, and import the Covered Code and derivative works thereof 33 * solely to the minimum extent necessary to exercise the above copyright 34 * license, and in no event shall the patent license extend to any additions 35 * to or modifications of the Original Intel Code. No other license or right 36 * is granted directly or by implication, estoppel or otherwise; 37 * 38 * The above copyright and patent license is granted only if the following 39 * conditions are met: 40 * 41 * 3. Conditions 42 * 43 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44 * Redistribution of source code of any substantial portion of the Covered 45 * Code or modification with rights to further distribute source must include 46 * the above Copyright Notice, the above License, this list of Conditions, 47 * and the following Disclaimer and Export Compliance provision. In addition, 48 * Licensee must cause all Covered Code to which Licensee contributes to 49 * contain a file documenting the changes Licensee made to create that Covered 50 * Code and the date of any change. Licensee must include in that file the 51 * documentation of any changes made by any predecessor Licensee. Licensee 52 * must include a prominent statement that the modification is derived, 53 * directly or indirectly, from Original Intel Code. 54 * 55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56 * Redistribution of source code of any substantial portion of the Covered 57 * Code or modification without rights to further distribute source must 58 * include the following Disclaimer and Export Compliance provision in the 59 * documentation and/or other materials provided with distribution. In 60 * addition, Licensee may not authorize further sublicense of source of any 61 * portion of the Covered Code, and must include terms to the effect that the 62 * license from Licensee to its licensee is limited to the intellectual 63 * property embodied in the software Licensee provides to its licensee, and 64 * not to intellectual property embodied in modifications its licensee may 65 * make. 66 * 67 * 3.3. Redistribution of Executable. Redistribution in executable form of any 68 * substantial portion of the Covered Code or modification must reproduce the 69 * above Copyright Notice, and the following Disclaimer and Export Compliance 70 * provision in the documentation and/or other materials provided with the 71 * distribution. 72 * 73 * 3.4. Intel retains all right, title, and interest in and to the Original 74 * Intel Code. 75 * 76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77 * Intel shall be used in advertising or otherwise to promote the sale, use or 78 * other dealings in products derived from or relating to the Covered Code 79 * without prior written authorization from Intel. 80 * 81 * 4. Disclaimer and Export Compliance 82 * 83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89 * PARTICULAR PURPOSE. 90 * 91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98 * LIMITED REMEDY. 99 * 100 * 4.3. Licensee shall not export, either directly or indirectly, any of this 101 * software or system incorporating such software without first obtaining any 102 * required license or other approval from the U. S. Department of Commerce or 103 * any other agency or department of the United States Government. In the 104 * event Licensee exports any such software from the United States or 105 * re-exports any such software from a foreign destination, Licensee shall 106 * ensure that the distribution and export/re-export of the software is in 107 * compliance with all laws, regulations, orders, or other restrictions of the 108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109 * any of its subsidiaries will export/re-export any technical data, process, 110 * software, or service, directly or indirectly, to any country for which the 111 * United States government or any agency thereof requires an export license, 112 * other governmental approval, or letter of assurance, without first obtaining 113 * such license, approval or letter. 114 * 115 *****************************************************************************/ 116 117#define __UTGLOBAL_C__ 118#define DEFINE_ACPI_GLOBALS 119 120#include "acpi.h" 121#include "acnamesp.h" 122 123#define _COMPONENT ACPI_UTILITIES 124 ACPI_MODULE_NAME ("utglobal") 125 126 127/****************************************************************************** 128 * 129 * FUNCTION: AcpiFormatException 130 * 131 * PARAMETERS: Status - The ACPI_STATUS code to be formatted 132 * 133 * RETURN: A string containing the exception text 134 * 135 * DESCRIPTION: This function translates an ACPI exception into an ASCII string. 136 * 137 ******************************************************************************/ 138 139const char * 140AcpiFormatException ( 141 ACPI_STATUS Status) 142{ 143 const char *Exception = "UNKNOWN_STATUS_CODE"; 144 ACPI_STATUS SubStatus; 145 146 147 ACPI_FUNCTION_NAME ("FormatException"); 148 149 150 SubStatus = (Status & ~AE_CODE_MASK); 151 152 switch (Status & AE_CODE_MASK) 153 { 154 case AE_CODE_ENVIRONMENTAL: 155 156 if (SubStatus <= AE_CODE_ENV_MAX) 157 { 158 Exception = AcpiGbl_ExceptionNames_Env [SubStatus]; 159 break; 160 } 161 goto Unknown; 162 163 case AE_CODE_PROGRAMMER: 164 165 if (SubStatus <= AE_CODE_PGM_MAX) 166 { 167 Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus -1]; 168 break; 169 } 170 goto Unknown; 171 172 case AE_CODE_ACPI_TABLES: 173 174 if (SubStatus <= AE_CODE_TBL_MAX) 175 { 176 Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus -1]; 177 break; 178 } 179 goto Unknown; 180 181 case AE_CODE_AML: 182 183 if (SubStatus <= AE_CODE_AML_MAX) 184 { 185 Exception = AcpiGbl_ExceptionNames_Aml [SubStatus -1]; 186 break; 187 } 188 goto Unknown; 189 190 case AE_CODE_CONTROL: 191 192 if (SubStatus <= AE_CODE_CTRL_MAX) 193 { 194 Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus -1]; 195 break; 196 } 197 goto Unknown; 198 199 default: 200 goto Unknown; 201 } 202 203 204 return ((const char *) Exception); 205 206Unknown: 207 208 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unknown exception code: 0x%8.8X\n", Status)); 209 return ((const char *) Exception); 210} 211 212 213/****************************************************************************** 214 * 215 * Static global variable initialization. 216 * 217 ******************************************************************************/ 218 219/* 220 * We want the debug switches statically initialized so they 221 * are already set when the debugger is entered. 222 */ 223 224/* Debug switch - level and trace mask */ 225 226#ifdef ACPI_DEBUG_OUTPUT 227UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT; 228#else 229UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT; 230#endif 231 232/* Debug switch - layer (component) mask */ 233 234UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT; 235UINT32 AcpiGbl_NestingLevel = 0; 236 237 238/* Debugger globals */ 239 240BOOLEAN AcpiGbl_DbTerminateThreads = FALSE; 241BOOLEAN AcpiGbl_AbortMethod = FALSE; 242BOOLEAN AcpiGbl_MethodExecuting = FALSE; 243 244/* System flags */ 245 246UINT32 AcpiGbl_StartupFlags = 0; 247 248/* System starts uninitialized */ 249 250BOOLEAN AcpiGbl_Shutdown = TRUE; 251 252const UINT8 AcpiGbl_DecodeTo8bit [8] = {1,2,4,8,16,32,64,128}; 253 254const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] = { 255 "\\_S0_", 256 "\\_S1_", 257 "\\_S2_", 258 "\\_S3_", 259 "\\_S4_", 260 "\\_S5_"}; 261 262const char *AcpiGbl_HighestDstateNames[4] = { 263 "_S1D", 264 "_S2D", 265 "_S3D", 266 "_S4D"}; 267
|
| 268/* Strings supported by the _OSI predefined (internal) method */ 269 270const char *AcpiGbl_ValidOsiStrings[ACPI_NUM_OSI_STRINGS] = { 271 "Linux", 272 "Windows 2000", 273 "Windows 2001", 274 "Windows 2001.1"}; 275 276
|
268/****************************************************************************** 269 * 270 * Namespace globals 271 * 272 ******************************************************************************/ 273 274 275/* 276 * Predefined ACPI Names (Built-in to the Interpreter) 277 *
| 277/****************************************************************************** 278 * 279 * Namespace globals 280 * 281 ******************************************************************************/ 282 283 284/* 285 * Predefined ACPI Names (Built-in to the Interpreter) 286 *
|
278 * Initial values are currently supported only for types String and Number. 279 * Both are specified as strings in this table. 280 *
| |
281 * NOTES:
| 287 * NOTES:
|
282 * 1) _SB_ is defined to be a device to allow _SB_/_INI to be run
| 288 * 1) _SB_ is defined to be a device to allow \_SB_._INI to be run
|
283 * during the initialization sequence. 284 */
| 289 * during the initialization sequence. 290 */
|
285
| |
286const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = 287{ 288 {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, 289 {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 290 {"_SB_", ACPI_TYPE_DEVICE, NULL}, 291 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 292 {"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 293 {"_REV", ACPI_TYPE_INTEGER, "2"}, 294 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 295 {"_GL_", ACPI_TYPE_MUTEX, "0"}, 296
| 291const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = 292{ 293 {"_GPE", ACPI_TYPE_LOCAL_SCOPE, NULL}, 294 {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 295 {"_SB_", ACPI_TYPE_DEVICE, NULL}, 296 {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 297 {"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL}, 298 {"_REV", ACPI_TYPE_INTEGER, "2"}, 299 {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, 300 {"_GL_", ACPI_TYPE_MUTEX, "0"}, 301
|
297#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
| 302#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
|
298 {"_OSI", ACPI_TYPE_METHOD, "1"}, 299#endif 300 {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */ 301}; 302 303 304/* 305 * Properties of the ACPI Object Types, both internal and external. 306 * The table is indexed by values of ACPI_OBJECT_TYPE 307 */
| 303 {"_OSI", ACPI_TYPE_METHOD, "1"}, 304#endif 305 {NULL, ACPI_TYPE_ANY, NULL} /* Table terminator */ 306}; 307 308 309/* 310 * Properties of the ACPI Object Types, both internal and external. 311 * The table is indexed by values of ACPI_OBJECT_TYPE 312 */
|
308
| |
309const UINT8 AcpiGbl_NsProperties[] = 310{ 311 ACPI_NS_NORMAL, /* 00 Any */ 312 ACPI_NS_NORMAL, /* 01 Number */ 313 ACPI_NS_NORMAL, /* 02 String */ 314 ACPI_NS_NORMAL, /* 03 Buffer */ 315 ACPI_NS_NORMAL, /* 04 Package */ 316 ACPI_NS_NORMAL, /* 05 FieldUnit */ 317 ACPI_NS_NEWSCOPE, /* 06 Device */ 318 ACPI_NS_NORMAL, /* 07 Event */ 319 ACPI_NS_NEWSCOPE, /* 08 Method */ 320 ACPI_NS_NORMAL, /* 09 Mutex */ 321 ACPI_NS_NORMAL, /* 10 Region */ 322 ACPI_NS_NEWSCOPE, /* 11 Power */ 323 ACPI_NS_NEWSCOPE, /* 12 Processor */ 324 ACPI_NS_NEWSCOPE, /* 13 Thermal */ 325 ACPI_NS_NORMAL, /* 14 BufferField */ 326 ACPI_NS_NORMAL, /* 15 DdbHandle */ 327 ACPI_NS_NORMAL, /* 16 Debug Object */ 328 ACPI_NS_NORMAL, /* 17 DefField */ 329 ACPI_NS_NORMAL, /* 18 BankField */ 330 ACPI_NS_NORMAL, /* 19 IndexField */ 331 ACPI_NS_NORMAL, /* 20 Reference */ 332 ACPI_NS_NORMAL, /* 21 Alias */ 333 ACPI_NS_NORMAL, /* 22 Notify */ 334 ACPI_NS_NORMAL, /* 23 Address Handler */ 335 ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */ 336 ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */ 337 ACPI_NS_NEWSCOPE, /* 26 Scope */ 338 ACPI_NS_NORMAL, /* 27 Extra */ 339 ACPI_NS_NORMAL, /* 28 Data */ 340 ACPI_NS_NORMAL /* 29 Invalid */ 341}; 342 343 344/* Hex to ASCII conversion table */ 345 346static const char AcpiGbl_HexToAscii[] = 347 {'0','1','2','3','4','5','6','7', 348 '8','9','A','B','C','D','E','F'}; 349 350/***************************************************************************** 351 * 352 * FUNCTION: AcpiUtHexToAsciiChar 353 * 354 * PARAMETERS: Integer - Contains the hex digit 355 * Position - bit position of the digit within the 356 * integer 357 * 358 * RETURN: Ascii character 359 * 360 * DESCRIPTION: Convert a hex digit to an ascii character 361 * 362 ****************************************************************************/ 363 364char 365AcpiUtHexToAsciiChar ( 366 ACPI_INTEGER Integer, 367 UINT32 Position) 368{ 369 370 return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]); 371} 372 373 374/****************************************************************************** 375 * 376 * Table name globals 377 * 378 * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. 379 * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables 380 * that are not used by the subsystem are simply ignored. 381 * 382 * Do NOT add any table to this list that is not consumed directly by this 383 * subsystem. 384 * 385 ******************************************************************************/ 386
| 313const UINT8 AcpiGbl_NsProperties[] = 314{ 315 ACPI_NS_NORMAL, /* 00 Any */ 316 ACPI_NS_NORMAL, /* 01 Number */ 317 ACPI_NS_NORMAL, /* 02 String */ 318 ACPI_NS_NORMAL, /* 03 Buffer */ 319 ACPI_NS_NORMAL, /* 04 Package */ 320 ACPI_NS_NORMAL, /* 05 FieldUnit */ 321 ACPI_NS_NEWSCOPE, /* 06 Device */ 322 ACPI_NS_NORMAL, /* 07 Event */ 323 ACPI_NS_NEWSCOPE, /* 08 Method */ 324 ACPI_NS_NORMAL, /* 09 Mutex */ 325 ACPI_NS_NORMAL, /* 10 Region */ 326 ACPI_NS_NEWSCOPE, /* 11 Power */ 327 ACPI_NS_NEWSCOPE, /* 12 Processor */ 328 ACPI_NS_NEWSCOPE, /* 13 Thermal */ 329 ACPI_NS_NORMAL, /* 14 BufferField */ 330 ACPI_NS_NORMAL, /* 15 DdbHandle */ 331 ACPI_NS_NORMAL, /* 16 Debug Object */ 332 ACPI_NS_NORMAL, /* 17 DefField */ 333 ACPI_NS_NORMAL, /* 18 BankField */ 334 ACPI_NS_NORMAL, /* 19 IndexField */ 335 ACPI_NS_NORMAL, /* 20 Reference */ 336 ACPI_NS_NORMAL, /* 21 Alias */ 337 ACPI_NS_NORMAL, /* 22 Notify */ 338 ACPI_NS_NORMAL, /* 23 Address Handler */ 339 ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 24 Resource Desc */ 340 ACPI_NS_NEWSCOPE | ACPI_NS_LOCAL, /* 25 Resource Field */ 341 ACPI_NS_NEWSCOPE, /* 26 Scope */ 342 ACPI_NS_NORMAL, /* 27 Extra */ 343 ACPI_NS_NORMAL, /* 28 Data */ 344 ACPI_NS_NORMAL /* 29 Invalid */ 345}; 346 347 348/* Hex to ASCII conversion table */ 349 350static const char AcpiGbl_HexToAscii[] = 351 {'0','1','2','3','4','5','6','7', 352 '8','9','A','B','C','D','E','F'}; 353 354/***************************************************************************** 355 * 356 * FUNCTION: AcpiUtHexToAsciiChar 357 * 358 * PARAMETERS: Integer - Contains the hex digit 359 * Position - bit position of the digit within the 360 * integer 361 * 362 * RETURN: Ascii character 363 * 364 * DESCRIPTION: Convert a hex digit to an ascii character 365 * 366 ****************************************************************************/ 367 368char 369AcpiUtHexToAsciiChar ( 370 ACPI_INTEGER Integer, 371 UINT32 Position) 372{ 373 374 return (AcpiGbl_HexToAscii[(Integer >> Position) & 0xF]); 375} 376 377 378/****************************************************************************** 379 * 380 * Table name globals 381 * 382 * NOTE: This table includes ONLY the ACPI tables that the subsystem consumes. 383 * it is NOT an exhaustive list of all possible ACPI tables. All ACPI tables 384 * that are not used by the subsystem are simply ignored. 385 * 386 * Do NOT add any table to this list that is not consumed directly by this 387 * subsystem. 388 * 389 ******************************************************************************/ 390
|
387
| |
388ACPI_TABLE_LIST AcpiGbl_TableLists[NUM_ACPI_TABLE_TYPES]; 389
| 391ACPI_TABLE_LIST AcpiGbl_TableLists[NUM_ACPI_TABLE_TYPES]; 392
|
390
| |
391ACPI_TABLE_SUPPORT AcpiGbl_TableData[NUM_ACPI_TABLE_TYPES] = 392{ 393 /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ 394 395 /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, 396 /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void *) &AcpiGbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, 397 /* FADT 2 */ {FADT_SIG, FADT_SIG, (void *) &AcpiGbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE}, 398 /* FACS 3 */ {FACS_SIG, FACS_SIG, (void *) &AcpiGbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE}, 399 /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, 400 /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, 401 /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, 402}; 403 404 405/****************************************************************************** 406 * 407 * Event and Hardware globals 408 * 409 ******************************************************************************/ 410 411ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] = 412{ 413 /* Name Parent Register Register Bit Position Register Bit Mask */ 414 415 /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, 416 /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, 417 /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, 418 /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, 419 /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, 420 /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, 421 /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, 422 423 /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, 424 /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 425 /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 426 /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 427 /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, 428 /* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0}, 429 430 /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, 431 /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, 432 /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, 433 /* ACPI_BITREG_SLEEP_TYPE_A */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, 434 /* ACPI_BITREG_SLEEP_TYPE_B */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, 435 /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, 436 437 /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} 438}; 439 440 441ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = 442{ 443 /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, 444 /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 445 /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 446 /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 447 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, 448}; 449 450/***************************************************************************** 451 * 452 * FUNCTION: AcpiUtGetRegionName 453 * 454 * PARAMETERS: None. 455 * 456 * RETURN: Status 457 * 458 * DESCRIPTION: Translate a Space ID into a name string (Debug only) 459 * 460 ****************************************************************************/ 461 462/* Region type decoding */ 463 464const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = 465{ 466/*! [Begin] no source code translation (keep these ASL Keywords as-is) */ 467 "SystemMemory", 468 "SystemIO", 469 "PCI_Config", 470 "EmbeddedControl", 471 "SMBus", 472 "CMOS", 473 "PCIBARTarget", 474 "DataTable" 475/*! [End] no source code translation !*/ 476}; 477 478 479char * 480AcpiUtGetRegionName ( 481 UINT8 SpaceId) 482{ 483 484 if (SpaceId >= ACPI_USER_REGION_BEGIN) 485 { 486 return ("UserDefinedRegion"); 487 } 488 489 else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) 490 { 491 return ("InvalidSpaceId"); 492 } 493 494 return ((char *) AcpiGbl_RegionTypes[SpaceId]); 495} 496 497 498/***************************************************************************** 499 * 500 * FUNCTION: AcpiUtGetEventName 501 * 502 * PARAMETERS: None. 503 * 504 * RETURN: Status 505 * 506 * DESCRIPTION: Translate a Event ID into a name string (Debug only) 507 * 508 ****************************************************************************/ 509 510/* Event type decoding */ 511 512static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] = 513{ 514 "PM_Timer", 515 "GlobalLock", 516 "PowerButton", 517 "SleepButton", 518 "RealTimeClock", 519}; 520 521 522char * 523AcpiUtGetEventName ( 524 UINT32 EventId) 525{ 526 527 if (EventId > ACPI_EVENT_MAX) 528 { 529 return ("InvalidEventID"); 530 } 531 532 return ((char *) AcpiGbl_EventTypes[EventId]); 533} 534 535 536/***************************************************************************** 537 * 538 * FUNCTION: AcpiUtGetTypeName 539 * 540 * PARAMETERS: None. 541 * 542 * RETURN: Status 543 * 544 * DESCRIPTION: Translate a Type ID into a name string (Debug only) 545 * 546 ****************************************************************************/ 547 548/* 549 * Elements of AcpiGbl_NsTypeNames below must match 550 * one-to-one with values of ACPI_OBJECT_TYPE 551 * 552 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when 553 * stored in a table it really means that we have thus far seen no evidence to
| 393ACPI_TABLE_SUPPORT AcpiGbl_TableData[NUM_ACPI_TABLE_TYPES] = 394{ 395 /*********** Name, Signature, Global typed pointer Signature size, Type How many allowed?, Contains valid AML? */ 396 397 /* RSDP 0 */ {RSDP_NAME, RSDP_SIG, NULL, sizeof (RSDP_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, 398 /* DSDT 1 */ {DSDT_SIG, DSDT_SIG, (void *) &AcpiGbl_DSDT, sizeof (DSDT_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE | ACPI_TABLE_EXECUTABLE}, 399 /* FADT 2 */ {FADT_SIG, FADT_SIG, (void *) &AcpiGbl_FADT, sizeof (FADT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_SINGLE}, 400 /* FACS 3 */ {FACS_SIG, FACS_SIG, (void *) &AcpiGbl_FACS, sizeof (FACS_SIG)-1, ACPI_TABLE_SECONDARY| ACPI_TABLE_SINGLE}, 401 /* PSDT 4 */ {PSDT_SIG, PSDT_SIG, NULL, sizeof (PSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, 402 /* SSDT 5 */ {SSDT_SIG, SSDT_SIG, NULL, sizeof (SSDT_SIG)-1, ACPI_TABLE_PRIMARY | ACPI_TABLE_MULTIPLE | ACPI_TABLE_EXECUTABLE}, 403 /* XSDT 6 */ {XSDT_SIG, XSDT_SIG, NULL, sizeof (RSDT_SIG)-1, ACPI_TABLE_ROOT | ACPI_TABLE_SINGLE}, 404}; 405 406 407/****************************************************************************** 408 * 409 * Event and Hardware globals 410 * 411 ******************************************************************************/ 412 413ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG] = 414{ 415 /* Name Parent Register Register Bit Position Register Bit Mask */ 416 417 /* ACPI_BITREG_TIMER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_TIMER_STATUS, ACPI_BITMASK_TIMER_STATUS}, 418 /* ACPI_BITREG_BUS_MASTER_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_BUS_MASTER_STATUS, ACPI_BITMASK_BUS_MASTER_STATUS}, 419 /* ACPI_BITREG_GLOBAL_LOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_STATUS}, 420 /* ACPI_BITREG_POWER_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_STATUS}, 421 /* ACPI_BITREG_SLEEP_BUTTON_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_STATUS}, 422 /* ACPI_BITREG_RT_CLOCK_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_STATUS}, 423 /* ACPI_BITREG_WAKE_STATUS */ {ACPI_REGISTER_PM1_STATUS, ACPI_BITPOSITION_WAKE_STATUS, ACPI_BITMASK_WAKE_STATUS}, 424 425 /* ACPI_BITREG_TIMER_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_TIMER_ENABLE, ACPI_BITMASK_TIMER_ENABLE}, 426 /* ACPI_BITREG_GLOBAL_LOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 427 /* ACPI_BITREG_POWER_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 428 /* ACPI_BITREG_SLEEP_BUTTON_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 429 /* ACPI_BITREG_RT_CLOCK_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, ACPI_BITPOSITION_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_ENABLE}, 430 /* ACPI_BITREG_WAKE_ENABLE */ {ACPI_REGISTER_PM1_ENABLE, 0, 0}, 431 432 /* ACPI_BITREG_SCI_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SCI_ENABLE, ACPI_BITMASK_SCI_ENABLE}, 433 /* ACPI_BITREG_BUS_MASTER_RLD */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_BUS_MASTER_RLD, ACPI_BITMASK_BUS_MASTER_RLD}, 434 /* ACPI_BITREG_GLOBAL_LOCK_RELEASE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE, ACPI_BITMASK_GLOBAL_LOCK_RELEASE}, 435 /* ACPI_BITREG_SLEEP_TYPE_A */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, 436 /* ACPI_BITREG_SLEEP_TYPE_B */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_TYPE_X, ACPI_BITMASK_SLEEP_TYPE_X}, 437 /* ACPI_BITREG_SLEEP_ENABLE */ {ACPI_REGISTER_PM1_CONTROL, ACPI_BITPOSITION_SLEEP_ENABLE, ACPI_BITMASK_SLEEP_ENABLE}, 438 439 /* ACPI_BITREG_ARB_DIS */ {ACPI_REGISTER_PM2_CONTROL, ACPI_BITPOSITION_ARB_DISABLE, ACPI_BITMASK_ARB_DISABLE} 440}; 441 442 443ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = 444{ 445 /* ACPI_EVENT_PMTIMER */ {ACPI_BITREG_TIMER_STATUS, ACPI_BITREG_TIMER_ENABLE, ACPI_BITMASK_TIMER_STATUS, ACPI_BITMASK_TIMER_ENABLE}, 446 /* ACPI_EVENT_GLOBAL */ {ACPI_BITREG_GLOBAL_LOCK_STATUS, ACPI_BITREG_GLOBAL_LOCK_ENABLE, ACPI_BITMASK_GLOBAL_LOCK_STATUS, ACPI_BITMASK_GLOBAL_LOCK_ENABLE}, 447 /* ACPI_EVENT_POWER_BUTTON */ {ACPI_BITREG_POWER_BUTTON_STATUS, ACPI_BITREG_POWER_BUTTON_ENABLE, ACPI_BITMASK_POWER_BUTTON_STATUS, ACPI_BITMASK_POWER_BUTTON_ENABLE}, 448 /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, 449 /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, 450}; 451 452/***************************************************************************** 453 * 454 * FUNCTION: AcpiUtGetRegionName 455 * 456 * PARAMETERS: None. 457 * 458 * RETURN: Status 459 * 460 * DESCRIPTION: Translate a Space ID into a name string (Debug only) 461 * 462 ****************************************************************************/ 463 464/* Region type decoding */ 465 466const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = 467{ 468/*! [Begin] no source code translation (keep these ASL Keywords as-is) */ 469 "SystemMemory", 470 "SystemIO", 471 "PCI_Config", 472 "EmbeddedControl", 473 "SMBus", 474 "CMOS", 475 "PCIBARTarget", 476 "DataTable" 477/*! [End] no source code translation !*/ 478}; 479 480 481char * 482AcpiUtGetRegionName ( 483 UINT8 SpaceId) 484{ 485 486 if (SpaceId >= ACPI_USER_REGION_BEGIN) 487 { 488 return ("UserDefinedRegion"); 489 } 490 491 else if (SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) 492 { 493 return ("InvalidSpaceId"); 494 } 495 496 return ((char *) AcpiGbl_RegionTypes[SpaceId]); 497} 498 499 500/***************************************************************************** 501 * 502 * FUNCTION: AcpiUtGetEventName 503 * 504 * PARAMETERS: None. 505 * 506 * RETURN: Status 507 * 508 * DESCRIPTION: Translate a Event ID into a name string (Debug only) 509 * 510 ****************************************************************************/ 511 512/* Event type decoding */ 513 514static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] = 515{ 516 "PM_Timer", 517 "GlobalLock", 518 "PowerButton", 519 "SleepButton", 520 "RealTimeClock", 521}; 522 523 524char * 525AcpiUtGetEventName ( 526 UINT32 EventId) 527{ 528 529 if (EventId > ACPI_EVENT_MAX) 530 { 531 return ("InvalidEventID"); 532 } 533 534 return ((char *) AcpiGbl_EventTypes[EventId]); 535} 536 537 538/***************************************************************************** 539 * 540 * FUNCTION: AcpiUtGetTypeName 541 * 542 * PARAMETERS: None. 543 * 544 * RETURN: Status 545 * 546 * DESCRIPTION: Translate a Type ID into a name string (Debug only) 547 * 548 ****************************************************************************/ 549 550/* 551 * Elements of AcpiGbl_NsTypeNames below must match 552 * one-to-one with values of ACPI_OBJECT_TYPE 553 * 554 * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; when 555 * stored in a table it really means that we have thus far seen no evidence to
|
554 * indicatewhat type is actually going to be stored for this entry.
| 556 * indicate what type is actually going to be stored for this entry.
|
555 */
| 557 */
|
556
| |
557static const char AcpiGbl_BadType[] = "UNDEFINED"; 558#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */ 559 560static const char *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */ 561{ 562 /* 00 */ "Untyped", 563 /* 01 */ "Integer", 564 /* 02 */ "String", 565 /* 03 */ "Buffer", 566 /* 04 */ "Package", 567 /* 05 */ "FieldUnit", 568 /* 06 */ "Device", 569 /* 07 */ "Event", 570 /* 08 */ "Method", 571 /* 09 */ "Mutex", 572 /* 10 */ "Region", 573 /* 11 */ "Power", 574 /* 12 */ "Processor", 575 /* 13 */ "Thermal", 576 /* 14 */ "BufferField", 577 /* 15 */ "DdbHandle", 578 /* 16 */ "DebugObject", 579 /* 17 */ "RegionField", 580 /* 18 */ "BankField", 581 /* 19 */ "IndexField", 582 /* 20 */ "Reference", 583 /* 21 */ "Alias", 584 /* 22 */ "Notify", 585 /* 23 */ "AddrHandler", 586 /* 24 */ "ResourceDesc", 587 /* 25 */ "ResourceFld", 588 /* 26 */ "Scope", 589 /* 27 */ "Extra", 590 /* 28 */ "Data", 591 /* 39 */ "Invalid" 592}; 593 594 595char * 596AcpiUtGetTypeName ( 597 ACPI_OBJECT_TYPE Type) 598{ 599 600 if (Type > ACPI_TYPE_INVALID) 601 { 602 return ((char *) AcpiGbl_BadType); 603 } 604 605 return ((char *) AcpiGbl_NsTypeNames[Type]); 606} 607 608 609char * 610AcpiUtGetObjectTypeName ( 611 ACPI_OPERAND_OBJECT *ObjDesc) 612{ 613 614 if (!ObjDesc) 615 { 616 return ("[NULL Object Descriptor]"); 617 } 618 619 return (AcpiUtGetTypeName (ACPI_GET_OBJECT_TYPE (ObjDesc))); 620} 621 622 623/***************************************************************************** 624 * 625 * FUNCTION: AcpiUtGetNodeName 626 * 627 * PARAMETERS: Object - A namespace node 628 * 629 * RETURN: Pointer to a string 630 * 631 * DESCRIPTION: Validate the node and return the node's ACPI name. 632 * 633 ****************************************************************************/ 634 635char * 636AcpiUtGetNodeName ( 637 void *Object) 638{ 639 ACPI_NAMESPACE_NODE *Node; 640 641 642 if (!Object) 643 { 644 return ("NULL NODE"); 645 } 646 647 Node = (ACPI_NAMESPACE_NODE *) Object; 648 649 if (Node->Descriptor != ACPI_DESC_TYPE_NAMED) 650 { 651 return ("****"); 652 } 653 654 if (!AcpiUtValidAcpiName (* (UINT32 *) Node->Name.Ascii)) 655 { 656 return ("----"); 657 } 658 659 return (Node->Name.Ascii); 660} 661 662 663/***************************************************************************** 664 * 665 * FUNCTION: AcpiUtGetDescriptorName 666 * 667 * PARAMETERS: Object - An ACPI object 668 * 669 * RETURN: Pointer to a string 670 * 671 * DESCRIPTION: Validate object and return the descriptor type 672 * 673 ****************************************************************************/ 674 675static const char *AcpiGbl_DescTypeNames[] = /* printable names of descriptor types */ 676{ 677 /* 00 */ "Invalid", 678 /* 01 */ "Cached", 679 /* 02 */ "State-Generic", 680 /* 03 */ "State-Update", 681 /* 04 */ "State-Package", 682 /* 05 */ "State-Control", 683 /* 06 */ "State-RootParseScope", 684 /* 07 */ "State-ParseScope", 685 /* 08 */ "State-WalkScope", 686 /* 09 */ "State-Result", 687 /* 10 */ "State-Notify", 688 /* 11 */ "State-Thread", 689 /* 12 */ "Walk", 690 /* 13 */ "Parser", 691 /* 14 */ "Operand", 692 /* 15 */ "Node" 693}; 694 695 696char * 697AcpiUtGetDescriptorName ( 698 void *Object) 699{ 700 701 if (!Object) 702 { 703 return ("NULL OBJECT"); 704 } 705 706 if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX) 707 { 708 return ((char *) AcpiGbl_BadType); 709 } 710 711 return ((char *) AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]); 712 713} 714 715 716#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 717/* 718 * Strings and procedures used for debug only 719 */ 720 721/***************************************************************************** 722 * 723 * FUNCTION: AcpiUtGetMutexName 724 * 725 * PARAMETERS: None. 726 * 727 * RETURN: Status 728 * 729 * DESCRIPTION: Translate a mutex ID into a name string (Debug only) 730 * 731 ****************************************************************************/ 732 733char * 734AcpiUtGetMutexName ( 735 UINT32 MutexId) 736{ 737 738 if (MutexId > MAX_MUTEX) 739 { 740 return ("Invalid Mutex ID"); 741 } 742 743 return (AcpiGbl_MutexNames[MutexId]); 744} 745 746#endif 747 748 749/***************************************************************************** 750 * 751 * FUNCTION: AcpiUtValidObjectType 752 * 753 * PARAMETERS: Type - Object type to be validated 754 * 755 * RETURN: TRUE if valid object type 756 * 757 * DESCRIPTION: Validate an object type 758 * 759 ****************************************************************************/ 760 761BOOLEAN 762AcpiUtValidObjectType ( 763 ACPI_OBJECT_TYPE Type) 764{ 765 766 if (Type > ACPI_TYPE_LOCAL_MAX) 767 { 768 /* Note: Assumes all TYPEs are contiguous (external/local) */ 769 770 return (FALSE); 771 } 772 773 return (TRUE); 774} 775 776 777/**************************************************************************** 778 * 779 * FUNCTION: AcpiUtAllocateOwnerId 780 * 781 * PARAMETERS: IdType - Type of ID (method or table) 782 * 783 * DESCRIPTION: Allocate a table or method owner id 784 * 785 ***************************************************************************/ 786 787ACPI_OWNER_ID 788AcpiUtAllocateOwnerId ( 789 UINT32 IdType) 790{ 791 ACPI_OWNER_ID OwnerId = 0xFFFF; 792 793 794 ACPI_FUNCTION_TRACE ("UtAllocateOwnerId"); 795 796 797 if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES))) 798 { 799 return (0); 800 } 801 802 switch (IdType) 803 { 804 case ACPI_OWNER_TYPE_TABLE: 805 806 OwnerId = AcpiGbl_NextTableOwnerId; 807 AcpiGbl_NextTableOwnerId++; 808 809 /* Check for wraparound */ 810 811 if (AcpiGbl_NextTableOwnerId == ACPI_FIRST_METHOD_ID) 812 { 813 AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID; 814 ACPI_REPORT_WARNING (("Table owner ID wraparound\n")); 815 } 816 break; 817 818 819 case ACPI_OWNER_TYPE_METHOD: 820 821 OwnerId = AcpiGbl_NextMethodOwnerId; 822 AcpiGbl_NextMethodOwnerId++; 823 824 if (AcpiGbl_NextMethodOwnerId == ACPI_FIRST_TABLE_ID) 825 { 826 /* Check for wraparound */ 827 828 AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID; 829 } 830 break; 831 832 default: 833 break; 834 } 835 836 (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); 837 return_VALUE (OwnerId); 838} 839 840 841/**************************************************************************** 842 * 843 * FUNCTION: AcpiUtInitGlobals 844 * 845 * PARAMETERS: none 846 * 847 * DESCRIPTION: Init library globals. All globals that require specific 848 * initialization should be initialized here! 849 * 850 ***************************************************************************/ 851 852void 853AcpiUtInitGlobals ( 854 void) 855{ 856 UINT32 i; 857 858 859 ACPI_FUNCTION_TRACE ("UtInitGlobals"); 860
| 558static const char AcpiGbl_BadType[] = "UNDEFINED"; 559#define TYPE_NAME_LENGTH 12 /* Maximum length of each string */ 560 561static const char *AcpiGbl_NsTypeNames[] = /* printable names of ACPI types */ 562{ 563 /* 00 */ "Untyped", 564 /* 01 */ "Integer", 565 /* 02 */ "String", 566 /* 03 */ "Buffer", 567 /* 04 */ "Package", 568 /* 05 */ "FieldUnit", 569 /* 06 */ "Device", 570 /* 07 */ "Event", 571 /* 08 */ "Method", 572 /* 09 */ "Mutex", 573 /* 10 */ "Region", 574 /* 11 */ "Power", 575 /* 12 */ "Processor", 576 /* 13 */ "Thermal", 577 /* 14 */ "BufferField", 578 /* 15 */ "DdbHandle", 579 /* 16 */ "DebugObject", 580 /* 17 */ "RegionField", 581 /* 18 */ "BankField", 582 /* 19 */ "IndexField", 583 /* 20 */ "Reference", 584 /* 21 */ "Alias", 585 /* 22 */ "Notify", 586 /* 23 */ "AddrHandler", 587 /* 24 */ "ResourceDesc", 588 /* 25 */ "ResourceFld", 589 /* 26 */ "Scope", 590 /* 27 */ "Extra", 591 /* 28 */ "Data", 592 /* 39 */ "Invalid" 593}; 594 595 596char * 597AcpiUtGetTypeName ( 598 ACPI_OBJECT_TYPE Type) 599{ 600 601 if (Type > ACPI_TYPE_INVALID) 602 { 603 return ((char *) AcpiGbl_BadType); 604 } 605 606 return ((char *) AcpiGbl_NsTypeNames[Type]); 607} 608 609 610char * 611AcpiUtGetObjectTypeName ( 612 ACPI_OPERAND_OBJECT *ObjDesc) 613{ 614 615 if (!ObjDesc) 616 { 617 return ("[NULL Object Descriptor]"); 618 } 619 620 return (AcpiUtGetTypeName (ACPI_GET_OBJECT_TYPE (ObjDesc))); 621} 622 623 624/***************************************************************************** 625 * 626 * FUNCTION: AcpiUtGetNodeName 627 * 628 * PARAMETERS: Object - A namespace node 629 * 630 * RETURN: Pointer to a string 631 * 632 * DESCRIPTION: Validate the node and return the node's ACPI name. 633 * 634 ****************************************************************************/ 635 636char * 637AcpiUtGetNodeName ( 638 void *Object) 639{ 640 ACPI_NAMESPACE_NODE *Node; 641 642 643 if (!Object) 644 { 645 return ("NULL NODE"); 646 } 647 648 Node = (ACPI_NAMESPACE_NODE *) Object; 649 650 if (Node->Descriptor != ACPI_DESC_TYPE_NAMED) 651 { 652 return ("****"); 653 } 654 655 if (!AcpiUtValidAcpiName (* (UINT32 *) Node->Name.Ascii)) 656 { 657 return ("----"); 658 } 659 660 return (Node->Name.Ascii); 661} 662 663 664/***************************************************************************** 665 * 666 * FUNCTION: AcpiUtGetDescriptorName 667 * 668 * PARAMETERS: Object - An ACPI object 669 * 670 * RETURN: Pointer to a string 671 * 672 * DESCRIPTION: Validate object and return the descriptor type 673 * 674 ****************************************************************************/ 675 676static const char *AcpiGbl_DescTypeNames[] = /* printable names of descriptor types */ 677{ 678 /* 00 */ "Invalid", 679 /* 01 */ "Cached", 680 /* 02 */ "State-Generic", 681 /* 03 */ "State-Update", 682 /* 04 */ "State-Package", 683 /* 05 */ "State-Control", 684 /* 06 */ "State-RootParseScope", 685 /* 07 */ "State-ParseScope", 686 /* 08 */ "State-WalkScope", 687 /* 09 */ "State-Result", 688 /* 10 */ "State-Notify", 689 /* 11 */ "State-Thread", 690 /* 12 */ "Walk", 691 /* 13 */ "Parser", 692 /* 14 */ "Operand", 693 /* 15 */ "Node" 694}; 695 696 697char * 698AcpiUtGetDescriptorName ( 699 void *Object) 700{ 701 702 if (!Object) 703 { 704 return ("NULL OBJECT"); 705 } 706 707 if (ACPI_GET_DESCRIPTOR_TYPE (Object) > ACPI_DESC_TYPE_MAX) 708 { 709 return ((char *) AcpiGbl_BadType); 710 } 711 712 return ((char *) AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]); 713 714} 715 716 717#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 718/* 719 * Strings and procedures used for debug only 720 */ 721 722/***************************************************************************** 723 * 724 * FUNCTION: AcpiUtGetMutexName 725 * 726 * PARAMETERS: None. 727 * 728 * RETURN: Status 729 * 730 * DESCRIPTION: Translate a mutex ID into a name string (Debug only) 731 * 732 ****************************************************************************/ 733 734char * 735AcpiUtGetMutexName ( 736 UINT32 MutexId) 737{ 738 739 if (MutexId > MAX_MUTEX) 740 { 741 return ("Invalid Mutex ID"); 742 } 743 744 return (AcpiGbl_MutexNames[MutexId]); 745} 746 747#endif 748 749 750/***************************************************************************** 751 * 752 * FUNCTION: AcpiUtValidObjectType 753 * 754 * PARAMETERS: Type - Object type to be validated 755 * 756 * RETURN: TRUE if valid object type 757 * 758 * DESCRIPTION: Validate an object type 759 * 760 ****************************************************************************/ 761 762BOOLEAN 763AcpiUtValidObjectType ( 764 ACPI_OBJECT_TYPE Type) 765{ 766 767 if (Type > ACPI_TYPE_LOCAL_MAX) 768 { 769 /* Note: Assumes all TYPEs are contiguous (external/local) */ 770 771 return (FALSE); 772 } 773 774 return (TRUE); 775} 776 777 778/**************************************************************************** 779 * 780 * FUNCTION: AcpiUtAllocateOwnerId 781 * 782 * PARAMETERS: IdType - Type of ID (method or table) 783 * 784 * DESCRIPTION: Allocate a table or method owner id 785 * 786 ***************************************************************************/ 787 788ACPI_OWNER_ID 789AcpiUtAllocateOwnerId ( 790 UINT32 IdType) 791{ 792 ACPI_OWNER_ID OwnerId = 0xFFFF; 793 794 795 ACPI_FUNCTION_TRACE ("UtAllocateOwnerId"); 796 797 798 if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES))) 799 { 800 return (0); 801 } 802 803 switch (IdType) 804 { 805 case ACPI_OWNER_TYPE_TABLE: 806 807 OwnerId = AcpiGbl_NextTableOwnerId; 808 AcpiGbl_NextTableOwnerId++; 809 810 /* Check for wraparound */ 811 812 if (AcpiGbl_NextTableOwnerId == ACPI_FIRST_METHOD_ID) 813 { 814 AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID; 815 ACPI_REPORT_WARNING (("Table owner ID wraparound\n")); 816 } 817 break; 818 819 820 case ACPI_OWNER_TYPE_METHOD: 821 822 OwnerId = AcpiGbl_NextMethodOwnerId; 823 AcpiGbl_NextMethodOwnerId++; 824 825 if (AcpiGbl_NextMethodOwnerId == ACPI_FIRST_TABLE_ID) 826 { 827 /* Check for wraparound */ 828 829 AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID; 830 } 831 break; 832 833 default: 834 break; 835 } 836 837 (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); 838 return_VALUE (OwnerId); 839} 840 841 842/**************************************************************************** 843 * 844 * FUNCTION: AcpiUtInitGlobals 845 * 846 * PARAMETERS: none 847 * 848 * DESCRIPTION: Init library globals. All globals that require specific 849 * initialization should be initialized here! 850 * 851 ***************************************************************************/ 852 853void 854AcpiUtInitGlobals ( 855 void) 856{ 857 UINT32 i; 858 859 860 ACPI_FUNCTION_TRACE ("UtInitGlobals"); 861
|
| 862 /* Runtime configuration */ 863 864 AcpiGbl_CreateOsiMethod = TRUE; 865 AcpiGbl_AllMethodsSerialized = FALSE; 866
|
861 /* Memory allocation and cache lists */ 862 863 ACPI_MEMSET (AcpiGbl_MemoryLists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS); 864 865 AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_GENERIC_STATE *) NULL)->Common.Next), NULL); 866 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL); 867 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL); 868 AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_OPERAND_OBJECT *) NULL)->Cache.Next), NULL); 869 AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_WALK_STATE *) NULL)->Next), NULL); 870 871 AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ObjectSize = sizeof (ACPI_NAMESPACE_NODE); 872 AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ObjectSize = sizeof (ACPI_GENERIC_STATE); 873 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ObjectSize = sizeof (ACPI_PARSE_OBJ_COMMON); 874 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ObjectSize = sizeof (ACPI_PARSE_OBJ_NAMED); 875 AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ObjectSize = sizeof (ACPI_OPERAND_OBJECT); 876 AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ObjectSize = sizeof (ACPI_WALK_STATE); 877 878 AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].MaxCacheDepth = ACPI_MAX_STATE_CACHE_DEPTH; 879 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].MaxCacheDepth = ACPI_MAX_PARSE_CACHE_DEPTH; 880 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].MaxCacheDepth = ACPI_MAX_EXTPARSE_CACHE_DEPTH; 881 AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].MaxCacheDepth = ACPI_MAX_OBJECT_CACHE_DEPTH; 882 AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].MaxCacheDepth = ACPI_MAX_WALK_CACHE_DEPTH; 883 884 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].ListName = "Global Memory Allocation"); 885 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ListName = "Namespace Nodes"); 886 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ListName = "State Object Cache"); 887 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ListName = "Parse Node Cache"); 888 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ListName = "Extended Parse Node Cache"); 889 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ListName = "Operand Object Cache"); 890 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ListName = "Tree Walk Node Cache"); 891 892 /* ACPI table structure */ 893 894 for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) 895 { 896 AcpiGbl_TableLists[i].Next = NULL; 897 AcpiGbl_TableLists[i].Count = 0; 898 } 899 900 /* Mutex locked flags */ 901 902 for (i = 0; i < NUM_MUTEX; i++) 903 { 904 AcpiGbl_MutexInfo[i].Mutex = NULL; 905 AcpiGbl_MutexInfo[i].OwnerId = ACPI_MUTEX_NOT_ACQUIRED; 906 AcpiGbl_MutexInfo[i].UseCount = 0; 907 } 908 909 /* GPE support */ 910 911 AcpiGbl_GpeXruptListHead = NULL; 912 AcpiGbl_GpeFadtBlocks[0] = NULL; 913 AcpiGbl_GpeFadtBlocks[1] = NULL; 914 915 /* Global notify handlers */ 916 917 AcpiGbl_SystemNotify.Handler = NULL; 918 AcpiGbl_DeviceNotify.Handler = NULL; 919 AcpiGbl_InitHandler = NULL; 920 921 /* Global "typed" ACPI table pointers */ 922 923 AcpiGbl_RSDP = NULL; 924 AcpiGbl_XSDT = NULL; 925 AcpiGbl_FACS = NULL; 926 AcpiGbl_FADT = NULL; 927 AcpiGbl_DSDT = NULL; 928 929 /* Global Lock support */ 930 931 AcpiGbl_GlobalLockAcquired = FALSE; 932 AcpiGbl_GlobalLockThreadCount = 0; 933 AcpiGbl_GlobalLockHandle = 0; 934 935 /* Miscellaneous variables */ 936 937 AcpiGbl_TableFlags = ACPI_PHYSICAL_POINTER; 938 AcpiGbl_RsdpOriginalLocation = 0; 939 AcpiGbl_CmSingleStep = FALSE; 940 AcpiGbl_DbTerminateThreads = FALSE; 941 AcpiGbl_Shutdown = FALSE; 942 AcpiGbl_NsLookupCount = 0; 943 AcpiGbl_PsFindCount = 0; 944 AcpiGbl_AcpiHardwarePresent = TRUE; 945 AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID; 946 AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID; 947 AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; 948 AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; 949 950 /* Hardware oriented */ 951 952 AcpiGbl_EventsInitialized = FALSE; 953 954 /* Namespace */ 955 956 AcpiGbl_RootNode = NULL; 957 958 AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; 959 AcpiGbl_RootNodeStruct.Descriptor = ACPI_DESC_TYPE_NAMED; 960 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; 961 AcpiGbl_RootNodeStruct.Child = NULL; 962 AcpiGbl_RootNodeStruct.Peer = NULL; 963 AcpiGbl_RootNodeStruct.Object = NULL; 964 AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; 965 966 967#ifdef ACPI_DEBUG_OUTPUT 968 AcpiGbl_LowestStackPointer = ACPI_SIZE_MAX; 969#endif 970 971 return_VOID; 972} 973 974
| 867 /* Memory allocation and cache lists */ 868 869 ACPI_MEMSET (AcpiGbl_MemoryLists, 0, sizeof (ACPI_MEMORY_LIST) * ACPI_NUM_MEM_LISTS); 870 871 AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_GENERIC_STATE *) NULL)->Common.Next), NULL); 872 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL); 873 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_PARSE_OBJECT *) NULL)->Common.Next), NULL); 874 AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_OPERAND_OBJECT *) NULL)->Cache.Next), NULL); 875 AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].LinkOffset = (UINT16) ACPI_PTR_DIFF (&(((ACPI_WALK_STATE *) NULL)->Next), NULL); 876 877 AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ObjectSize = sizeof (ACPI_NAMESPACE_NODE); 878 AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ObjectSize = sizeof (ACPI_GENERIC_STATE); 879 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ObjectSize = sizeof (ACPI_PARSE_OBJ_COMMON); 880 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ObjectSize = sizeof (ACPI_PARSE_OBJ_NAMED); 881 AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ObjectSize = sizeof (ACPI_OPERAND_OBJECT); 882 AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ObjectSize = sizeof (ACPI_WALK_STATE); 883 884 AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].MaxCacheDepth = ACPI_MAX_STATE_CACHE_DEPTH; 885 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].MaxCacheDepth = ACPI_MAX_PARSE_CACHE_DEPTH; 886 AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].MaxCacheDepth = ACPI_MAX_EXTPARSE_CACHE_DEPTH; 887 AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].MaxCacheDepth = ACPI_MAX_OBJECT_CACHE_DEPTH; 888 AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].MaxCacheDepth = ACPI_MAX_WALK_CACHE_DEPTH; 889 890 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_GLOBAL].ListName = "Global Memory Allocation"); 891 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_NSNODE].ListName = "Namespace Nodes"); 892 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_STATE].ListName = "State Object Cache"); 893 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE].ListName = "Parse Node Cache"); 894 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_PSNODE_EXT].ListName = "Extended Parse Node Cache"); 895 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_OPERAND].ListName = "Operand Object Cache"); 896 ACPI_MEM_TRACKING (AcpiGbl_MemoryLists[ACPI_MEM_LIST_WALK].ListName = "Tree Walk Node Cache"); 897 898 /* ACPI table structure */ 899 900 for (i = 0; i < NUM_ACPI_TABLE_TYPES; i++) 901 { 902 AcpiGbl_TableLists[i].Next = NULL; 903 AcpiGbl_TableLists[i].Count = 0; 904 } 905 906 /* Mutex locked flags */ 907 908 for (i = 0; i < NUM_MUTEX; i++) 909 { 910 AcpiGbl_MutexInfo[i].Mutex = NULL; 911 AcpiGbl_MutexInfo[i].OwnerId = ACPI_MUTEX_NOT_ACQUIRED; 912 AcpiGbl_MutexInfo[i].UseCount = 0; 913 } 914 915 /* GPE support */ 916 917 AcpiGbl_GpeXruptListHead = NULL; 918 AcpiGbl_GpeFadtBlocks[0] = NULL; 919 AcpiGbl_GpeFadtBlocks[1] = NULL; 920 921 /* Global notify handlers */ 922 923 AcpiGbl_SystemNotify.Handler = NULL; 924 AcpiGbl_DeviceNotify.Handler = NULL; 925 AcpiGbl_InitHandler = NULL; 926 927 /* Global "typed" ACPI table pointers */ 928 929 AcpiGbl_RSDP = NULL; 930 AcpiGbl_XSDT = NULL; 931 AcpiGbl_FACS = NULL; 932 AcpiGbl_FADT = NULL; 933 AcpiGbl_DSDT = NULL; 934 935 /* Global Lock support */ 936 937 AcpiGbl_GlobalLockAcquired = FALSE; 938 AcpiGbl_GlobalLockThreadCount = 0; 939 AcpiGbl_GlobalLockHandle = 0; 940 941 /* Miscellaneous variables */ 942 943 AcpiGbl_TableFlags = ACPI_PHYSICAL_POINTER; 944 AcpiGbl_RsdpOriginalLocation = 0; 945 AcpiGbl_CmSingleStep = FALSE; 946 AcpiGbl_DbTerminateThreads = FALSE; 947 AcpiGbl_Shutdown = FALSE; 948 AcpiGbl_NsLookupCount = 0; 949 AcpiGbl_PsFindCount = 0; 950 AcpiGbl_AcpiHardwarePresent = TRUE; 951 AcpiGbl_NextTableOwnerId = ACPI_FIRST_TABLE_ID; 952 AcpiGbl_NextMethodOwnerId = ACPI_FIRST_METHOD_ID; 953 AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; 954 AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; 955 956 /* Hardware oriented */ 957 958 AcpiGbl_EventsInitialized = FALSE; 959 960 /* Namespace */ 961 962 AcpiGbl_RootNode = NULL; 963 964 AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME; 965 AcpiGbl_RootNodeStruct.Descriptor = ACPI_DESC_TYPE_NAMED; 966 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE; 967 AcpiGbl_RootNodeStruct.Child = NULL; 968 AcpiGbl_RootNodeStruct.Peer = NULL; 969 AcpiGbl_RootNodeStruct.Object = NULL; 970 AcpiGbl_RootNodeStruct.Flags = ANOBJ_END_OF_PEER_LIST; 971 972 973#ifdef ACPI_DEBUG_OUTPUT 974 AcpiGbl_LowestStackPointer = ACPI_SIZE_MAX; 975#endif 976 977 return_VOID; 978} 979 980
|