aclocal.h (233250) | aclocal.h (233555) |
---|---|
1/****************************************************************************** 2 * 3 * Name: aclocal.h - Internal data types used across the ACPI subsystem 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44#ifndef __ACLOCAL_H__ 45#define __ACLOCAL_H__ 46 47 48/* acpisrc:StructDefs -- for acpisrc conversion */ 49 50#define ACPI_SERIALIZED 0xFF 51 52typedef UINT32 ACPI_MUTEX_HANDLE; 53#define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1) 54 55/* Total number of aml opcodes defined */ 56 57#define AML_NUM_OPCODES 0x81 58 59 60/* Forward declarations */ 61 62struct acpi_walk_state; 63struct acpi_obj_mutex; 64union acpi_parse_object; 65 66 67/***************************************************************************** 68 * 69 * Mutex typedefs and structs 70 * 71 ****************************************************************************/ 72 73 74/* 75 * Predefined handles for the mutex objects used within the subsystem 76 * All mutex objects are automatically created by AcpiUtMutexInitialize. 77 * 78 * The acquire/release ordering protocol is implied via this list. Mutexes 79 * with a lower value must be acquired before mutexes with a higher value. 80 * 81 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames 82 * table below also! 83 */ 84#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ 85#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */ 86#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ 87#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ 88#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ 89#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ 90#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ 91#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ 92 93#define ACPI_MAX_MUTEX 7 94#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 95 96 97/* Lock structure for reader/writer interfaces */ 98 99typedef struct acpi_rw_lock 100{ 101 ACPI_MUTEX WriterMutex; 102 ACPI_MUTEX ReaderMutex; 103 UINT32 NumReaders; 104 105} ACPI_RW_LOCK; 106 107 108/* 109 * Predefined handles for spinlocks used within the subsystem. 110 * These spinlocks are created by AcpiUtMutexInitialize 111 */ 112#define ACPI_LOCK_GPES 0 113#define ACPI_LOCK_HARDWARE 1 114 115#define ACPI_MAX_LOCK 1 116#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 117 118 119/* This Thread ID means that the mutex is not in use (unlocked) */ 120 121#define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1 122 123/* Table for the global mutexes */ 124 125typedef struct acpi_mutex_info 126{ 127 ACPI_MUTEX Mutex; 128 UINT32 UseCount; 129 ACPI_THREAD_ID ThreadId; 130 131} ACPI_MUTEX_INFO; 132 133 134/* Lock flag parameter for various interfaces */ 135 136#define ACPI_MTX_DO_NOT_LOCK 0 137#define ACPI_MTX_LOCK 1 138 139 140/* Field access granularities */ 141 142#define ACPI_FIELD_BYTE_GRANULARITY 1 143#define ACPI_FIELD_WORD_GRANULARITY 2 144#define ACPI_FIELD_DWORD_GRANULARITY 4 145#define ACPI_FIELD_QWORD_GRANULARITY 8 146 147 148#define ACPI_ENTRY_NOT_FOUND NULL 149 150 151/***************************************************************************** 152 * 153 * Namespace typedefs and structs 154 * 155 ****************************************************************************/ 156 157/* Operational modes of the AML interpreter/scanner */ 158 159typedef enum 160{ 161 ACPI_IMODE_LOAD_PASS1 = 0x01, 162 ACPI_IMODE_LOAD_PASS2 = 0x02, 163 ACPI_IMODE_EXECUTE = 0x03 164 165} ACPI_INTERPRETER_MODE; 166 167 168/* 169 * The Namespace Node describes a named object that appears in the AML. 170 * DescriptorType is used to differentiate between internal descriptors. 171 * 172 * The node is optimized for both 32-bit and 64-bit platforms: 173 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. 174 * 175 * Note: The DescriptorType and Type fields must appear in the identical 176 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 177 * structures. 178 */ 179typedef struct acpi_namespace_node 180{ 181 union acpi_operand_object *Object; /* Interpreter object */ 182 UINT8 DescriptorType; /* Differentiate object descriptor types */ 183 UINT8 Type; /* ACPI Type associated with this name */ 184 UINT8 Flags; /* Miscellaneous flags */ 185 ACPI_OWNER_ID OwnerId; /* Node creator */ 186 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */ 187 struct acpi_namespace_node *Parent; /* Parent node */ 188 struct acpi_namespace_node *Child; /* First child */ 189 struct acpi_namespace_node *Peer; /* First peer */ 190 191 /* 192 * The following fields are used by the ASL compiler and disassembler only 193 */ 194#ifdef ACPI_LARGE_NAMESPACE_NODE 195 union acpi_parse_object *Op; 196 UINT32 Value; 197 UINT32 Length; 198#endif 199 200} ACPI_NAMESPACE_NODE; 201 202 203/* Namespace Node flags */ 204 205#define ANOBJ_RESERVED 0x01 /* Available for use */ 206#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */ 207#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 208#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 209#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 210#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ 211#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ 212 213#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ 214#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ 215#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */ 216#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */ 217 218 219/* Internal ACPI table management - master table list */ 220 221typedef struct acpi_table_list 222{ 223 ACPI_TABLE_DESC *Tables; /* Table descriptor array */ 224 UINT32 CurrentTableCount; /* Tables currently in the array */ 225 UINT32 MaxTableCount; /* Max tables array will hold */ 226 UINT8 Flags; 227 228} ACPI_TABLE_LIST; 229 230/* Flags for above */ 231 232#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */ 233#define ACPI_ROOT_ORIGIN_ALLOCATED (1) 234#define ACPI_ROOT_ALLOW_RESIZE (2) 235 236 237/* Predefined (fixed) table indexes */ 238 239#define ACPI_TABLE_INDEX_DSDT (0) 240#define ACPI_TABLE_INDEX_FACS (1) 241 242 243typedef struct acpi_find_context 244{ 245 char *SearchFor; 246 ACPI_HANDLE *List; 247 UINT32 *Count; 248 249} ACPI_FIND_CONTEXT; 250 251 252typedef struct acpi_ns_search_data 253{ 254 ACPI_NAMESPACE_NODE *Node; 255 256} ACPI_NS_SEARCH_DATA; 257 258 259/* Object types used during package copies */ 260 261#define ACPI_COPY_TYPE_SIMPLE 0 262#define ACPI_COPY_TYPE_PACKAGE 1 263 264 265/* Info structure used to convert external<->internal namestrings */ 266 267typedef struct acpi_namestring_info 268{ 269 const char *ExternalName; 270 const char *NextExternalChar; 271 char *InternalName; 272 UINT32 Length; 273 UINT32 NumSegments; 274 UINT32 NumCarats; 275 BOOLEAN FullyQualified; 276 277} ACPI_NAMESTRING_INFO; 278 279 280/* Field creation info */ 281 282typedef struct acpi_create_field_info 283{ 284 ACPI_NAMESPACE_NODE *RegionNode; 285 ACPI_NAMESPACE_NODE *FieldNode; 286 ACPI_NAMESPACE_NODE *RegisterNode; 287 ACPI_NAMESPACE_NODE *DataRegisterNode; 288 ACPI_NAMESPACE_NODE *ConnectionNode; 289 UINT8 *ResourceBuffer; 290 UINT32 BankValue; 291 UINT32 FieldBitPosition; 292 UINT32 FieldBitLength; 293 UINT16 ResourceLength; 294 UINT8 FieldFlags; 295 UINT8 Attribute; 296 UINT8 FieldType; 297 UINT8 AccessLength; 298 299} ACPI_CREATE_FIELD_INFO; 300 301 302typedef 303ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( 304 struct acpi_walk_state *WalkState); 305 306 307/* 308 * Bitmapped ACPI types. Used internally only 309 */ 310#define ACPI_BTYPE_ANY 0x00000000 311#define ACPI_BTYPE_INTEGER 0x00000001 312#define ACPI_BTYPE_STRING 0x00000002 313#define ACPI_BTYPE_BUFFER 0x00000004 314#define ACPI_BTYPE_PACKAGE 0x00000008 315#define ACPI_BTYPE_FIELD_UNIT 0x00000010 316#define ACPI_BTYPE_DEVICE 0x00000020 317#define ACPI_BTYPE_EVENT 0x00000040 318#define ACPI_BTYPE_METHOD 0x00000080 319#define ACPI_BTYPE_MUTEX 0x00000100 320#define ACPI_BTYPE_REGION 0x00000200 321#define ACPI_BTYPE_POWER 0x00000400 322#define ACPI_BTYPE_PROCESSOR 0x00000800 323#define ACPI_BTYPE_THERMAL 0x00001000 324#define ACPI_BTYPE_BUFFER_FIELD 0x00002000 325#define ACPI_BTYPE_DDB_HANDLE 0x00004000 326#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 327#define ACPI_BTYPE_REFERENCE 0x00010000 328#define ACPI_BTYPE_RESOURCE 0x00020000 329 330#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) 331 332#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) 333#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) 334#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) 335#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ 336#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF 337 338 339/* 340 * Information structure for ACPI predefined names. 341 * Each entry in the table contains the following items: 342 * 343 * Name - The ACPI reserved name 344 * ParamCount - Number of arguments to the method 345 * ExpectedReturnBtypes - Allowed type(s) for the return value 346 */ 347typedef struct acpi_name_info 348{ 349 char Name[ACPI_NAME_SIZE]; 350 UINT8 ParamCount; 351 UINT8 ExpectedBtypes; 352 353} ACPI_NAME_INFO; 354 355/* 356 * Secondary information structures for ACPI predefined objects that return 357 * package objects. This structure appears as the next entry in the table 358 * after the NAME_INFO structure above. 359 * 360 * The reason for this is to minimize the size of the predefined name table. 361 */ 362 363/* 364 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 365 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, 366 * ACPI_PTYPE2_FIX_VAR 367 */ 368typedef struct acpi_package_info 369{ 370 UINT8 Type; 371 UINT8 ObjectType1; 372 UINT8 Count1; 373 UINT8 ObjectType2; 374 UINT8 Count2; 375 UINT8 Reserved; 376 377} ACPI_PACKAGE_INFO; 378 379/* Used for ACPI_PTYPE2_FIXED */ 380 381typedef struct acpi_package_info2 382{ 383 UINT8 Type; 384 UINT8 Count; 385 UINT8 ObjectType[4]; 386 387} ACPI_PACKAGE_INFO2; 388 389/* Used for ACPI_PTYPE1_OPTION */ 390 391typedef struct acpi_package_info3 392{ 393 UINT8 Type; 394 UINT8 Count; 395 UINT8 ObjectType[2]; 396 UINT8 TailObjectType; 397 UINT8 Reserved; 398 399} ACPI_PACKAGE_INFO3; 400 401typedef union acpi_predefined_info 402{ 403 ACPI_NAME_INFO Info; 404 ACPI_PACKAGE_INFO RetInfo; 405 ACPI_PACKAGE_INFO2 RetInfo2; 406 ACPI_PACKAGE_INFO3 RetInfo3; 407 408} ACPI_PREDEFINED_INFO; 409 410 411/* Data block used during object validation */ 412 413typedef struct acpi_predefined_data 414{ 415 char *Pathname; 416 const ACPI_PREDEFINED_INFO *Predefined; 417 union acpi_operand_object *ParentPackage; 418 ACPI_NAMESPACE_NODE *Node; 419 UINT32 Flags; 420 UINT8 NodeFlags; 421 422} ACPI_PREDEFINED_DATA; 423 424/* Defines for Flags field above */ 425 426#define ACPI_OBJECT_REPAIRED 1 | 1/****************************************************************************** 2 * 3 * Name: aclocal.h - Internal data types used across the ACPI subsystem 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44#ifndef __ACLOCAL_H__ 45#define __ACLOCAL_H__ 46 47 48/* acpisrc:StructDefs -- for acpisrc conversion */ 49 50#define ACPI_SERIALIZED 0xFF 51 52typedef UINT32 ACPI_MUTEX_HANDLE; 53#define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1) 54 55/* Total number of aml opcodes defined */ 56 57#define AML_NUM_OPCODES 0x81 58 59 60/* Forward declarations */ 61 62struct acpi_walk_state; 63struct acpi_obj_mutex; 64union acpi_parse_object; 65 66 67/***************************************************************************** 68 * 69 * Mutex typedefs and structs 70 * 71 ****************************************************************************/ 72 73 74/* 75 * Predefined handles for the mutex objects used within the subsystem 76 * All mutex objects are automatically created by AcpiUtMutexInitialize. 77 * 78 * The acquire/release ordering protocol is implied via this list. Mutexes 79 * with a lower value must be acquired before mutexes with a higher value. 80 * 81 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames 82 * table below also! 83 */ 84#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ 85#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */ 86#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ 87#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ 88#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ 89#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ 90#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ 91#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ 92 93#define ACPI_MAX_MUTEX 7 94#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 95 96 97/* Lock structure for reader/writer interfaces */ 98 99typedef struct acpi_rw_lock 100{ 101 ACPI_MUTEX WriterMutex; 102 ACPI_MUTEX ReaderMutex; 103 UINT32 NumReaders; 104 105} ACPI_RW_LOCK; 106 107 108/* 109 * Predefined handles for spinlocks used within the subsystem. 110 * These spinlocks are created by AcpiUtMutexInitialize 111 */ 112#define ACPI_LOCK_GPES 0 113#define ACPI_LOCK_HARDWARE 1 114 115#define ACPI_MAX_LOCK 1 116#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 117 118 119/* This Thread ID means that the mutex is not in use (unlocked) */ 120 121#define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1 122 123/* Table for the global mutexes */ 124 125typedef struct acpi_mutex_info 126{ 127 ACPI_MUTEX Mutex; 128 UINT32 UseCount; 129 ACPI_THREAD_ID ThreadId; 130 131} ACPI_MUTEX_INFO; 132 133 134/* Lock flag parameter for various interfaces */ 135 136#define ACPI_MTX_DO_NOT_LOCK 0 137#define ACPI_MTX_LOCK 1 138 139 140/* Field access granularities */ 141 142#define ACPI_FIELD_BYTE_GRANULARITY 1 143#define ACPI_FIELD_WORD_GRANULARITY 2 144#define ACPI_FIELD_DWORD_GRANULARITY 4 145#define ACPI_FIELD_QWORD_GRANULARITY 8 146 147 148#define ACPI_ENTRY_NOT_FOUND NULL 149 150 151/***************************************************************************** 152 * 153 * Namespace typedefs and structs 154 * 155 ****************************************************************************/ 156 157/* Operational modes of the AML interpreter/scanner */ 158 159typedef enum 160{ 161 ACPI_IMODE_LOAD_PASS1 = 0x01, 162 ACPI_IMODE_LOAD_PASS2 = 0x02, 163 ACPI_IMODE_EXECUTE = 0x03 164 165} ACPI_INTERPRETER_MODE; 166 167 168/* 169 * The Namespace Node describes a named object that appears in the AML. 170 * DescriptorType is used to differentiate between internal descriptors. 171 * 172 * The node is optimized for both 32-bit and 64-bit platforms: 173 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. 174 * 175 * Note: The DescriptorType and Type fields must appear in the identical 176 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 177 * structures. 178 */ 179typedef struct acpi_namespace_node 180{ 181 union acpi_operand_object *Object; /* Interpreter object */ 182 UINT8 DescriptorType; /* Differentiate object descriptor types */ 183 UINT8 Type; /* ACPI Type associated with this name */ 184 UINT8 Flags; /* Miscellaneous flags */ 185 ACPI_OWNER_ID OwnerId; /* Node creator */ 186 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */ 187 struct acpi_namespace_node *Parent; /* Parent node */ 188 struct acpi_namespace_node *Child; /* First child */ 189 struct acpi_namespace_node *Peer; /* First peer */ 190 191 /* 192 * The following fields are used by the ASL compiler and disassembler only 193 */ 194#ifdef ACPI_LARGE_NAMESPACE_NODE 195 union acpi_parse_object *Op; 196 UINT32 Value; 197 UINT32 Length; 198#endif 199 200} ACPI_NAMESPACE_NODE; 201 202 203/* Namespace Node flags */ 204 205#define ANOBJ_RESERVED 0x01 /* Available for use */ 206#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */ 207#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 208#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 209#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 210#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ 211#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ 212 213#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ 214#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ 215#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */ 216#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */ 217 218 219/* Internal ACPI table management - master table list */ 220 221typedef struct acpi_table_list 222{ 223 ACPI_TABLE_DESC *Tables; /* Table descriptor array */ 224 UINT32 CurrentTableCount; /* Tables currently in the array */ 225 UINT32 MaxTableCount; /* Max tables array will hold */ 226 UINT8 Flags; 227 228} ACPI_TABLE_LIST; 229 230/* Flags for above */ 231 232#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */ 233#define ACPI_ROOT_ORIGIN_ALLOCATED (1) 234#define ACPI_ROOT_ALLOW_RESIZE (2) 235 236 237/* Predefined (fixed) table indexes */ 238 239#define ACPI_TABLE_INDEX_DSDT (0) 240#define ACPI_TABLE_INDEX_FACS (1) 241 242 243typedef struct acpi_find_context 244{ 245 char *SearchFor; 246 ACPI_HANDLE *List; 247 UINT32 *Count; 248 249} ACPI_FIND_CONTEXT; 250 251 252typedef struct acpi_ns_search_data 253{ 254 ACPI_NAMESPACE_NODE *Node; 255 256} ACPI_NS_SEARCH_DATA; 257 258 259/* Object types used during package copies */ 260 261#define ACPI_COPY_TYPE_SIMPLE 0 262#define ACPI_COPY_TYPE_PACKAGE 1 263 264 265/* Info structure used to convert external<->internal namestrings */ 266 267typedef struct acpi_namestring_info 268{ 269 const char *ExternalName; 270 const char *NextExternalChar; 271 char *InternalName; 272 UINT32 Length; 273 UINT32 NumSegments; 274 UINT32 NumCarats; 275 BOOLEAN FullyQualified; 276 277} ACPI_NAMESTRING_INFO; 278 279 280/* Field creation info */ 281 282typedef struct acpi_create_field_info 283{ 284 ACPI_NAMESPACE_NODE *RegionNode; 285 ACPI_NAMESPACE_NODE *FieldNode; 286 ACPI_NAMESPACE_NODE *RegisterNode; 287 ACPI_NAMESPACE_NODE *DataRegisterNode; 288 ACPI_NAMESPACE_NODE *ConnectionNode; 289 UINT8 *ResourceBuffer; 290 UINT32 BankValue; 291 UINT32 FieldBitPosition; 292 UINT32 FieldBitLength; 293 UINT16 ResourceLength; 294 UINT8 FieldFlags; 295 UINT8 Attribute; 296 UINT8 FieldType; 297 UINT8 AccessLength; 298 299} ACPI_CREATE_FIELD_INFO; 300 301 302typedef 303ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( 304 struct acpi_walk_state *WalkState); 305 306 307/* 308 * Bitmapped ACPI types. Used internally only 309 */ 310#define ACPI_BTYPE_ANY 0x00000000 311#define ACPI_BTYPE_INTEGER 0x00000001 312#define ACPI_BTYPE_STRING 0x00000002 313#define ACPI_BTYPE_BUFFER 0x00000004 314#define ACPI_BTYPE_PACKAGE 0x00000008 315#define ACPI_BTYPE_FIELD_UNIT 0x00000010 316#define ACPI_BTYPE_DEVICE 0x00000020 317#define ACPI_BTYPE_EVENT 0x00000040 318#define ACPI_BTYPE_METHOD 0x00000080 319#define ACPI_BTYPE_MUTEX 0x00000100 320#define ACPI_BTYPE_REGION 0x00000200 321#define ACPI_BTYPE_POWER 0x00000400 322#define ACPI_BTYPE_PROCESSOR 0x00000800 323#define ACPI_BTYPE_THERMAL 0x00001000 324#define ACPI_BTYPE_BUFFER_FIELD 0x00002000 325#define ACPI_BTYPE_DDB_HANDLE 0x00004000 326#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 327#define ACPI_BTYPE_REFERENCE 0x00010000 328#define ACPI_BTYPE_RESOURCE 0x00020000 329 330#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) 331 332#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) 333#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) 334#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) 335#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ 336#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF 337 338 339/* 340 * Information structure for ACPI predefined names. 341 * Each entry in the table contains the following items: 342 * 343 * Name - The ACPI reserved name 344 * ParamCount - Number of arguments to the method 345 * ExpectedReturnBtypes - Allowed type(s) for the return value 346 */ 347typedef struct acpi_name_info 348{ 349 char Name[ACPI_NAME_SIZE]; 350 UINT8 ParamCount; 351 UINT8 ExpectedBtypes; 352 353} ACPI_NAME_INFO; 354 355/* 356 * Secondary information structures for ACPI predefined objects that return 357 * package objects. This structure appears as the next entry in the table 358 * after the NAME_INFO structure above. 359 * 360 * The reason for this is to minimize the size of the predefined name table. 361 */ 362 363/* 364 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 365 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, 366 * ACPI_PTYPE2_FIX_VAR 367 */ 368typedef struct acpi_package_info 369{ 370 UINT8 Type; 371 UINT8 ObjectType1; 372 UINT8 Count1; 373 UINT8 ObjectType2; 374 UINT8 Count2; 375 UINT8 Reserved; 376 377} ACPI_PACKAGE_INFO; 378 379/* Used for ACPI_PTYPE2_FIXED */ 380 381typedef struct acpi_package_info2 382{ 383 UINT8 Type; 384 UINT8 Count; 385 UINT8 ObjectType[4]; 386 387} ACPI_PACKAGE_INFO2; 388 389/* Used for ACPI_PTYPE1_OPTION */ 390 391typedef struct acpi_package_info3 392{ 393 UINT8 Type; 394 UINT8 Count; 395 UINT8 ObjectType[2]; 396 UINT8 TailObjectType; 397 UINT8 Reserved; 398 399} ACPI_PACKAGE_INFO3; 400 401typedef union acpi_predefined_info 402{ 403 ACPI_NAME_INFO Info; 404 ACPI_PACKAGE_INFO RetInfo; 405 ACPI_PACKAGE_INFO2 RetInfo2; 406 ACPI_PACKAGE_INFO3 RetInfo3; 407 408} ACPI_PREDEFINED_INFO; 409 410 411/* Data block used during object validation */ 412 413typedef struct acpi_predefined_data 414{ 415 char *Pathname; 416 const ACPI_PREDEFINED_INFO *Predefined; 417 union acpi_operand_object *ParentPackage; 418 ACPI_NAMESPACE_NODE *Node; 419 UINT32 Flags; 420 UINT8 NodeFlags; 421 422} ACPI_PREDEFINED_DATA; 423 424/* Defines for Flags field above */ 425 426#define ACPI_OBJECT_REPAIRED 1 |
427#define ACPI_OBJECT_WRAPPED 2 | |
428 429 430/* 431 * Bitmapped return value types 432 * Note: the actual data types must be contiguous, a loop in nspredef.c 433 * depends on this. 434 */ 435#define ACPI_RTYPE_ANY 0x00 436#define ACPI_RTYPE_NONE 0x01 437#define ACPI_RTYPE_INTEGER 0x02 438#define ACPI_RTYPE_STRING 0x04 439#define ACPI_RTYPE_BUFFER 0x08 440#define ACPI_RTYPE_PACKAGE 0x10 441#define ACPI_RTYPE_REFERENCE 0x20 442#define ACPI_RTYPE_ALL 0x3F 443 444#define ACPI_NUM_RTYPES 5 /* Number of actual object types */ 445 446 447/***************************************************************************** 448 * 449 * Event typedefs and structs 450 * 451 ****************************************************************************/ 452 453/* Dispatch info for each GPE -- either a method or handler, cannot be both */ 454 455typedef struct acpi_gpe_handler_info 456{ 457 ACPI_GPE_HANDLER Address; /* Address of handler, if any */ 458 void *Context; /* Context to be passed to handler */ 459 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */ 460 UINT8 OriginalFlags; /* Original (pre-handler) GPE info */ 461 BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */ 462 463} ACPI_GPE_HANDLER_INFO; 464 465/* 466 * GPE dispatch info. At any time, the GPE can have at most one type 467 * of dispatch - Method, Handler, or Implicit Notify. 468 */ 469typedef union acpi_gpe_dispatch_info 470{ 471 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ 472 struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */ 473 ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */ 474 475} ACPI_GPE_DISPATCH_INFO; 476 477/* 478 * Information about a GPE, one per each GPE in an array. 479 * NOTE: Important to keep this struct as small as possible. 480 */ 481typedef struct acpi_gpe_event_info 482{ 483 union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */ 484 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ 485 UINT8 Flags; /* Misc info about this GPE */ 486 UINT8 GpeNumber; /* This GPE */ 487 UINT8 RuntimeCount; /* References to a run GPE */ 488 489} ACPI_GPE_EVENT_INFO; 490 491/* Information about a GPE register pair, one per each status/enable pair in an array */ 492 493typedef struct acpi_gpe_register_info 494{ 495 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */ 496 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */ 497 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */ 498 UINT8 EnableForRun; /* GPEs to keep enabled when running */ 499 UINT8 BaseGpeNumber; /* Base GPE number for this register */ 500 501} ACPI_GPE_REGISTER_INFO; 502 503/* 504 * Information about a GPE register block, one per each installed block -- 505 * GPE0, GPE1, and one per each installed GPE Block Device. 506 */ 507typedef struct acpi_gpe_block_info 508{ 509 ACPI_NAMESPACE_NODE *Node; 510 struct acpi_gpe_block_info *Previous; 511 struct acpi_gpe_block_info *Next; 512 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */ 513 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */ 514 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */ 515 ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */ 516 UINT32 RegisterCount; /* Number of register pairs in block */ 517 UINT16 GpeCount; /* Number of individual GPEs in block */ 518 UINT8 BlockBaseNumber;/* Base GPE number for this block */ 519 BOOLEAN Initialized; /* TRUE if this block is initialized */ 520 521} ACPI_GPE_BLOCK_INFO; 522 523/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 524 525typedef struct acpi_gpe_xrupt_info 526{ 527 struct acpi_gpe_xrupt_info *Previous; 528 struct acpi_gpe_xrupt_info *Next; 529 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */ 530 UINT32 InterruptNumber; /* System interrupt number */ 531 532} ACPI_GPE_XRUPT_INFO; 533 534typedef struct acpi_gpe_walk_info 535{ 536 ACPI_NAMESPACE_NODE *GpeDevice; 537 ACPI_GPE_BLOCK_INFO *GpeBlock; 538 UINT16 Count; 539 ACPI_OWNER_ID OwnerId; 540 BOOLEAN ExecuteByOwnerId; 541 542} ACPI_GPE_WALK_INFO; 543 544typedef struct acpi_gpe_device_info 545{ 546 UINT32 Index; 547 UINT32 NextBlockBaseIndex; 548 ACPI_STATUS Status; 549 ACPI_NAMESPACE_NODE *GpeDevice; 550 551} ACPI_GPE_DEVICE_INFO; 552 553typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) ( 554 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 555 ACPI_GPE_BLOCK_INFO *GpeBlock, 556 void *Context); 557 558 559/* Information about each particular fixed event */ 560 561typedef struct acpi_fixed_event_handler 562{ 563 ACPI_EVENT_HANDLER Handler; /* Address of handler. */ 564 void *Context; /* Context to be passed to handler */ 565 566} ACPI_FIXED_EVENT_HANDLER; 567 568typedef struct acpi_fixed_event_info 569{ 570 UINT8 StatusRegisterId; 571 UINT8 EnableRegisterId; 572 UINT16 StatusBitMask; 573 UINT16 EnableBitMask; 574 575} ACPI_FIXED_EVENT_INFO; 576 577/* Information used during field processing */ 578 579typedef struct acpi_field_info 580{ 581 UINT8 SkipField; 582 UINT8 FieldFlag; 583 UINT32 PkgLength; 584 585} ACPI_FIELD_INFO; 586 587 588/***************************************************************************** 589 * 590 * Generic "state" object for stacks 591 * 592 ****************************************************************************/ 593 594#define ACPI_CONTROL_NORMAL 0xC0 595#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 596#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 597#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 598#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 599 600 601#define ACPI_STATE_COMMON \ 602 void *Next; \ 603 UINT8 DescriptorType; /* To differentiate various internal objs */\ 604 UINT8 Flags; \ 605 UINT16 Value; \ 606 UINT16 State; 607 608 /* There are 2 bytes available here until the next natural alignment boundary */ 609 610typedef struct acpi_common_state 611{ 612 ACPI_STATE_COMMON 613} ACPI_COMMON_STATE; 614 615 616/* 617 * Update state - used to traverse complex objects such as packages 618 */ 619typedef struct acpi_update_state 620{ 621 ACPI_STATE_COMMON 622 union acpi_operand_object *Object; 623 624} ACPI_UPDATE_STATE; 625 626 627/* 628 * Pkg state - used to traverse nested package structures 629 */ 630typedef struct acpi_pkg_state 631{ 632 ACPI_STATE_COMMON 633 UINT16 Index; 634 union acpi_operand_object *SourceObject; 635 union acpi_operand_object *DestObject; 636 struct acpi_walk_state *WalkState; 637 void *ThisTargetObj; 638 UINT32 NumPackages; 639 640} ACPI_PKG_STATE; 641 642 643/* 644 * Control state - one per if/else and while constructs. 645 * Allows nesting of these constructs 646 */ 647typedef struct acpi_control_state 648{ 649 ACPI_STATE_COMMON 650 UINT16 Opcode; 651 union acpi_parse_object *PredicateOp; 652 UINT8 *AmlPredicateStart; /* Start of if/while predicate */ 653 UINT8 *PackageEnd; /* End of if/while block */ 654 UINT32 LoopCount; /* While() loop counter */ 655 656} ACPI_CONTROL_STATE; 657 658 659/* 660 * Scope state - current scope during namespace lookups 661 */ 662typedef struct acpi_scope_state 663{ 664 ACPI_STATE_COMMON 665 ACPI_NAMESPACE_NODE *Node; 666 667} ACPI_SCOPE_STATE; 668 669 670typedef struct acpi_pscope_state 671{ 672 ACPI_STATE_COMMON 673 UINT32 ArgCount; /* Number of fixed arguments */ 674 union acpi_parse_object *Op; /* Current op being parsed */ 675 UINT8 *ArgEnd; /* Current argument end */ 676 UINT8 *PkgEnd; /* Current package end */ 677 UINT32 ArgList; /* Next argument to parse */ 678 679} ACPI_PSCOPE_STATE; 680 681 682/* 683 * Thread state - one per thread across multiple walk states. Multiple walk 684 * states are created when there are nested control methods executing. 685 */ 686typedef struct acpi_thread_state 687{ 688 ACPI_STATE_COMMON 689 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ 690 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ 691 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ 692 ACPI_THREAD_ID ThreadId; /* Running thread ID */ 693 694} ACPI_THREAD_STATE; 695 696 697/* 698 * Result values - used to accumulate the results of nested 699 * AML arguments 700 */ 701typedef struct acpi_result_values 702{ 703 ACPI_STATE_COMMON 704 union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; 705 706} ACPI_RESULT_VALUES; 707 708 709typedef 710ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) ( 711 struct acpi_walk_state *WalkState, 712 union acpi_parse_object **OutOp); 713 714typedef 715ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( 716 struct acpi_walk_state *WalkState); 717 718 719/* 720 * Notify info - used to pass info to the deferred notify 721 * handler/dispatcher. 722 */ 723typedef struct acpi_notify_info 724{ 725 ACPI_STATE_COMMON 726 ACPI_NAMESPACE_NODE *Node; 727 union acpi_operand_object *HandlerObj; 728 729} ACPI_NOTIFY_INFO; 730 731 732/* Generic state is union of structs above */ 733 734typedef union acpi_generic_state 735{ 736 ACPI_COMMON_STATE Common; 737 ACPI_CONTROL_STATE Control; 738 ACPI_UPDATE_STATE Update; 739 ACPI_SCOPE_STATE Scope; 740 ACPI_PSCOPE_STATE ParseScope; 741 ACPI_PKG_STATE Pkg; 742 ACPI_THREAD_STATE Thread; 743 ACPI_RESULT_VALUES Results; 744 ACPI_NOTIFY_INFO Notify; 745 746} ACPI_GENERIC_STATE; 747 748 749/***************************************************************************** 750 * 751 * Interpreter typedefs and structs 752 * 753 ****************************************************************************/ 754 755typedef 756ACPI_STATUS (*ACPI_EXECUTE_OP) ( 757 struct acpi_walk_state *WalkState); 758 759/* Address Range info block */ 760 761typedef struct acpi_address_range 762{ 763 struct acpi_address_range *Next; 764 ACPI_NAMESPACE_NODE *RegionNode; 765 ACPI_PHYSICAL_ADDRESS StartAddress; 766 ACPI_PHYSICAL_ADDRESS EndAddress; 767 768} ACPI_ADDRESS_RANGE; 769 770 771/***************************************************************************** 772 * 773 * Parser typedefs and structs 774 * 775 ****************************************************************************/ 776 777/* 778 * AML opcode, name, and argument layout 779 */ 780typedef struct acpi_opcode_info 781{ 782#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 783 char *Name; /* Opcode name (disassembler/debug only) */ 784#endif 785 UINT32 ParseArgs; /* Grammar/Parse time arguments */ 786 UINT32 RuntimeArgs; /* Interpret time arguments */ 787 UINT16 Flags; /* Misc flags */ 788 UINT8 ObjectType; /* Corresponding internal object type */ 789 UINT8 Class; /* Opcode class */ 790 UINT8 Type; /* Opcode type */ 791 792} ACPI_OPCODE_INFO; 793 794/* Structure for Resource Tag information */ 795 796typedef struct acpi_tag_info 797{ 798 UINT32 BitOffset; 799 UINT32 BitLength; 800 801} ACPI_TAG_INFO; 802 803/* Value associated with the parse object */ 804 805typedef union acpi_parse_value 806{ 807 UINT64 Integer; /* Integer constant (Up to 64 bits) */ 808 UINT32 Size; /* bytelist or field size */ 809 char *String; /* NULL terminated string */ 810 UINT8 *Buffer; /* buffer or string */ 811 char *Name; /* NULL terminated string */ 812 union acpi_parse_object *Arg; /* arguments and contained ops */ 813 ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ 814 815} ACPI_PARSE_VALUE; 816 817 818#ifdef ACPI_DISASSEMBLER 819#define ACPI_DISASM_ONLY_MEMBERS(a) a; 820#else 821#define ACPI_DISASM_ONLY_MEMBERS(a) 822#endif 823 824#define ACPI_PARSE_COMMON \ 825 union acpi_parse_object *Parent; /* Parent op */\ 826 UINT8 DescriptorType; /* To differentiate various internal objs */\ 827 UINT8 Flags; /* Type of Op */\ 828 UINT16 AmlOpcode; /* AML opcode */\ 829 UINT32 AmlOffset; /* Offset of declaration in AML */\ 830 union acpi_parse_object *Next; /* Next op */\ 831 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ 832 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ 833 UINT8 ArgListLength; /* Number of elements in the arg list */\ 834 ACPI_DISASM_ONLY_MEMBERS (\ 835 UINT8 DisasmFlags; /* Used during AML disassembly */\ 836 UINT8 DisasmOpcode; /* Subtype used for disassembly */\ 837 char AmlOpName[16]) /* Op name (debug only) */ 838 839 840#define ACPI_DASM_BUFFER 0x00 841#define ACPI_DASM_RESOURCE 0x01 842#define ACPI_DASM_STRING 0x02 843#define ACPI_DASM_UNICODE 0x03 844#define ACPI_DASM_EISAID 0x04 845#define ACPI_DASM_MATCHOP 0x05 846#define ACPI_DASM_LNOT_PREFIX 0x06 847#define ACPI_DASM_LNOT_SUFFIX 0x07 848#define ACPI_DASM_IGNORE 0x08 849 850/* 851 * Generic operation (for example: If, While, Store) 852 */ 853typedef struct acpi_parse_obj_common 854{ 855 ACPI_PARSE_COMMON 856} ACPI_PARSE_OBJ_COMMON; 857 858 859/* 860 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions), 861 * and bytelists. 862 */ 863typedef struct acpi_parse_obj_named 864{ 865 ACPI_PARSE_COMMON 866 UINT8 *Path; 867 UINT8 *Data; /* AML body or bytelist data */ 868 UINT32 Length; /* AML length */ 869 UINT32 Name; /* 4-byte name or zero if no name */ 870 871} ACPI_PARSE_OBJ_NAMED; 872 873 874/* This version is used by the iASL compiler only */ 875 876#define ACPI_MAX_PARSEOP_NAME 20 877 878typedef struct acpi_parse_obj_asl 879{ 880 ACPI_PARSE_COMMON 881 union acpi_parse_object *Child; 882 union acpi_parse_object *ParentMethod; 883 char *Filename; 884 char *ExternalName; 885 char *Namepath; 886 char NameSeg[4]; 887 UINT32 ExtraValue; 888 UINT32 Column; 889 UINT32 LineNumber; 890 UINT32 LogicalLineNumber; 891 UINT32 LogicalByteOffset; 892 UINT32 EndLine; 893 UINT32 EndLogicalLine; 894 UINT32 AcpiBtype; 895 UINT32 AmlLength; 896 UINT32 AmlSubtreeLength; 897 UINT32 FinalAmlLength; 898 UINT32 FinalAmlOffset; 899 UINT32 CompileFlags; 900 UINT16 ParseOpcode; 901 UINT8 AmlOpcodeLength; 902 UINT8 AmlPkgLenBytes; 903 UINT8 Extra; 904 char ParseOpName[ACPI_MAX_PARSEOP_NAME]; 905 906} ACPI_PARSE_OBJ_ASL; 907 908typedef union acpi_parse_object 909{ 910 ACPI_PARSE_OBJ_COMMON Common; 911 ACPI_PARSE_OBJ_NAMED Named; 912 ACPI_PARSE_OBJ_ASL Asl; 913 914} ACPI_PARSE_OBJECT; 915 916 917/* 918 * Parse state - one state per parser invocation and each control 919 * method. 920 */ 921typedef struct acpi_parse_state 922{ 923 UINT8 *AmlStart; /* First AML byte */ 924 UINT8 *Aml; /* Next AML byte */ 925 UINT8 *AmlEnd; /* (last + 1) AML byte */ 926 UINT8 *PkgStart; /* Current package begin */ 927 UINT8 *PkgEnd; /* Current package end */ 928 union acpi_parse_object *StartOp; /* Root of parse tree */ 929 struct acpi_namespace_node *StartNode; 930 union acpi_generic_state *Scope; /* Current scope */ 931 union acpi_parse_object *StartScope; 932 UINT32 AmlSize; 933 934} ACPI_PARSE_STATE; 935 936 937/* Parse object flags */ 938 939#define ACPI_PARSEOP_GENERIC 0x01 940#define ACPI_PARSEOP_NAMED 0x02 941#define ACPI_PARSEOP_DEFERRED 0x04 942#define ACPI_PARSEOP_BYTELIST 0x08 943#define ACPI_PARSEOP_IN_STACK 0x10 944#define ACPI_PARSEOP_TARGET 0x20 945#define ACPI_PARSEOP_IN_CACHE 0x80 946 947/* Parse object DisasmFlags */ 948 949#define ACPI_PARSEOP_IGNORE 0x01 950#define ACPI_PARSEOP_PARAMLIST 0x02 951#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 952#define ACPI_PARSEOP_SPECIAL 0x10 953 954 955/***************************************************************************** 956 * 957 * Hardware (ACPI registers) and PNP 958 * 959 ****************************************************************************/ 960 961typedef struct acpi_bit_register_info 962{ 963 UINT8 ParentRegister; 964 UINT8 BitPosition; 965 UINT16 AccessBitMask; 966 967} ACPI_BIT_REGISTER_INFO; 968 969 970/* 971 * Some ACPI registers have bits that must be ignored -- meaning that they 972 * must be preserved. 973 */ 974#define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 975 976/* Write-only bits must be zeroed by software */ 977 978#define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */ 979 980/* For control registers, both ignored and reserved bits must be preserved */ 981 982/* 983 * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the 984 * ACPI specification to be a "preserved" bit - "OSPM always preserves this 985 * bit position", section 4.7.3.2.1. However, on some machines the OS must 986 * write a one to this bit after resume for the machine to work properly. 987 * To enable this, we no longer attempt to preserve this bit. No machines 988 * are known to fail if the bit is not preserved. (May 2009) 989 */ 990#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */ 991#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 992#define ACPI_PM1_CONTROL_PRESERVED_BITS \ 993 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 994 995#define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */ 996 997/* 998 * Register IDs 999 * These are the full ACPI registers 1000 */ 1001#define ACPI_REGISTER_PM1_STATUS 0x01 1002#define ACPI_REGISTER_PM1_ENABLE 0x02 1003#define ACPI_REGISTER_PM1_CONTROL 0x03 1004#define ACPI_REGISTER_PM2_CONTROL 0x04 1005#define ACPI_REGISTER_PM_TIMER 0x05 1006#define ACPI_REGISTER_PROCESSOR_BLOCK 0x06 1007#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07 1008 1009 1010/* Masks used to access the BitRegisters */ 1011 1012#define ACPI_BITMASK_TIMER_STATUS 0x0001 1013#define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 1014#define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 1015#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 1016#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 1017#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 1018#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 1019#define ACPI_BITMASK_WAKE_STATUS 0x8000 1020 1021#define ACPI_BITMASK_ALL_FIXED_STATUS (\ 1022 ACPI_BITMASK_TIMER_STATUS | \ 1023 ACPI_BITMASK_BUS_MASTER_STATUS | \ 1024 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 1025 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 1026 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 1027 ACPI_BITMASK_RT_CLOCK_STATUS | \ 1028 ACPI_BITMASK_PCIEXP_WAKE_STATUS | \ 1029 ACPI_BITMASK_WAKE_STATUS) 1030 1031#define ACPI_BITMASK_TIMER_ENABLE 0x0001 1032#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 1033#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 1034#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 1035#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 1036#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 1037 1038#define ACPI_BITMASK_SCI_ENABLE 0x0001 1039#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 1040#define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 1041#define ACPI_BITMASK_SLEEP_TYPE 0x1C00 1042#define ACPI_BITMASK_SLEEP_ENABLE 0x2000 1043 1044#define ACPI_BITMASK_ARB_DISABLE 0x0001 1045 1046 1047/* Raw bit position of each BitRegister */ 1048 1049#define ACPI_BITPOSITION_TIMER_STATUS 0x00 1050#define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 1051#define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 1052#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 1053#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 1054#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 1055#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 1056#define ACPI_BITPOSITION_WAKE_STATUS 0x0F 1057 1058#define ACPI_BITPOSITION_TIMER_ENABLE 0x00 1059#define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 1060#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 1061#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 1062#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 1063#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 1064 1065#define ACPI_BITPOSITION_SCI_ENABLE 0x00 1066#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 1067#define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 1068#define ACPI_BITPOSITION_SLEEP_TYPE 0x0A 1069#define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D 1070 1071#define ACPI_BITPOSITION_ARB_DISABLE 0x00 1072 1073 1074/* Structs and definitions for _OSI support and I/O port validation */ 1075 1076#define ACPI_OSI_WIN_2000 0x01 1077#define ACPI_OSI_WIN_XP 0x02 1078#define ACPI_OSI_WIN_XP_SP1 0x03 1079#define ACPI_OSI_WINSRV_2003 0x04 1080#define ACPI_OSI_WIN_XP_SP2 0x05 1081#define ACPI_OSI_WINSRV_2003_SP1 0x06 1082#define ACPI_OSI_WIN_VISTA 0x07 1083#define ACPI_OSI_WINSRV_2008 0x08 1084#define ACPI_OSI_WIN_VISTA_SP1 0x09 1085#define ACPI_OSI_WIN_VISTA_SP2 0x0A 1086#define ACPI_OSI_WIN_7 0x0B 1087 1088#define ACPI_ALWAYS_ILLEGAL 0x00 1089 1090typedef struct acpi_interface_info 1091{ 1092 char *Name; 1093 struct acpi_interface_info *Next; 1094 UINT8 Flags; 1095 UINT8 Value; 1096 1097} ACPI_INTERFACE_INFO; 1098 1099#define ACPI_OSI_INVALID 0x01 1100#define ACPI_OSI_DYNAMIC 0x02 1101 1102typedef struct acpi_port_info 1103{ 1104 char *Name; 1105 UINT16 Start; 1106 UINT16 End; 1107 UINT8 OsiDependency; 1108 1109} ACPI_PORT_INFO; 1110 1111 1112/***************************************************************************** 1113 * 1114 * Resource descriptors 1115 * 1116 ****************************************************************************/ 1117 1118/* ResourceType values */ 1119 1120#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 1121#define ACPI_ADDRESS_TYPE_IO_RANGE 1 1122#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 1123 1124/* Resource descriptor types and masks */ 1125 1126#define ACPI_RESOURCE_NAME_LARGE 0x80 1127#define ACPI_RESOURCE_NAME_SMALL 0x00 1128 1129#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ 1130#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ 1131#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ 1132 1133 1134/* 1135 * Small resource descriptor "names" as defined by the ACPI specification. 1136 * Note: Bits 2:0 are used for the descriptor length 1137 */ 1138#define ACPI_RESOURCE_NAME_IRQ 0x20 1139#define ACPI_RESOURCE_NAME_DMA 0x28 1140#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 1141#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 1142#define ACPI_RESOURCE_NAME_IO 0x40 1143#define ACPI_RESOURCE_NAME_FIXED_IO 0x48 1144#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 1145#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 1146#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 1147#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 1148#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 1149#define ACPI_RESOURCE_NAME_END_TAG 0x78 1150 1151/* 1152 * Large resource descriptor "names" as defined by the ACPI specification. 1153 * Note: includes the Large Descriptor bit in bit[7] 1154 */ 1155#define ACPI_RESOURCE_NAME_MEMORY24 0x81 1156#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 1157#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 1158#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 1159#define ACPI_RESOURCE_NAME_MEMORY32 0x85 1160#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 1161#define ACPI_RESOURCE_NAME_ADDRESS32 0x87 1162#define ACPI_RESOURCE_NAME_ADDRESS16 0x88 1163#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 1164#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1165#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 1166#define ACPI_RESOURCE_NAME_GPIO 0x8C 1167#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1168#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E 1169 1170 1171/***************************************************************************** 1172 * 1173 * Miscellaneous 1174 * 1175 ****************************************************************************/ 1176 1177#define ACPI_ASCII_ZERO 0x30 1178 1179 1180/***************************************************************************** 1181 * 1182 * Disassembler 1183 * 1184 ****************************************************************************/ 1185 1186typedef struct acpi_external_list 1187{ 1188 char *Path; 1189 char *InternalPath; 1190 struct acpi_external_list *Next; 1191 UINT32 Value; 1192 UINT16 Length; 1193 UINT8 Type; 1194 UINT8 Flags; 1195 1196} ACPI_EXTERNAL_LIST; 1197 1198/* Values for Flags field above */ 1199 1200#define ACPI_IPATH_ALLOCATED 0x01 1201 1202 1203typedef struct acpi_external_file 1204{ 1205 char *Path; 1206 struct acpi_external_file *Next; 1207 1208} ACPI_EXTERNAL_FILE; 1209 1210 1211/***************************************************************************** 1212 * 1213 * Debugger 1214 * 1215 ****************************************************************************/ 1216 1217typedef struct acpi_db_method_info 1218{ 1219 ACPI_HANDLE MainThreadGate; 1220 ACPI_HANDLE ThreadCompleteGate; 1221 ACPI_HANDLE InfoGate; 1222 ACPI_THREAD_ID *Threads; 1223 UINT32 NumThreads; 1224 UINT32 NumCreated; 1225 UINT32 NumCompleted; 1226 1227 char *Name; 1228 UINT32 Flags; 1229 UINT32 NumLoops; 1230 char Pathname[128]; 1231 char **Args; 1232 ACPI_OBJECT_TYPE *Types; 1233 1234 /* 1235 * Arguments to be passed to method for the command 1236 * Threads - 1237 * the Number of threads, ID of current thread and 1238 * Index of current thread inside all them created. 1239 */ 1240 char InitArgs; 1241 ACPI_OBJECT_TYPE ArgTypes[4]; 1242 char *Arguments[4]; 1243 char NumThreadsStr[11]; 1244 char IdOfThreadStr[11]; 1245 char IndexOfThreadStr[11]; 1246 1247} ACPI_DB_METHOD_INFO; 1248 1249typedef struct acpi_integrity_info 1250{ 1251 UINT32 Nodes; 1252 UINT32 Objects; 1253 1254} ACPI_INTEGRITY_INFO; 1255 1256 1257#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1258#define ACPI_DB_CONSOLE_OUTPUT 0x02 1259#define ACPI_DB_DUPLICATE_OUTPUT 0x03 1260 1261 1262/***************************************************************************** 1263 * 1264 * Debug 1265 * 1266 ****************************************************************************/ 1267 1268/* Entry for a memory allocation (debug only) */ 1269 1270#define ACPI_MEM_MALLOC 0 1271#define ACPI_MEM_CALLOC 1 1272#define ACPI_MAX_MODULE_NAME 16 1273 1274#define ACPI_COMMON_DEBUG_MEM_HEADER \ 1275 struct acpi_debug_mem_block *Previous; \ 1276 struct acpi_debug_mem_block *Next; \ 1277 UINT32 Size; \ 1278 UINT32 Component; \ 1279 UINT32 Line; \ 1280 char Module[ACPI_MAX_MODULE_NAME]; \ 1281 UINT8 AllocType; 1282 1283typedef struct acpi_debug_mem_header 1284{ 1285 ACPI_COMMON_DEBUG_MEM_HEADER 1286 1287} ACPI_DEBUG_MEM_HEADER; 1288 1289typedef struct acpi_debug_mem_block 1290{ 1291 ACPI_COMMON_DEBUG_MEM_HEADER 1292 UINT64 UserSpace; 1293 1294} ACPI_DEBUG_MEM_BLOCK; 1295 1296 1297#define ACPI_MEM_LIST_GLOBAL 0 1298#define ACPI_MEM_LIST_NSNODE 1 1299#define ACPI_MEM_LIST_MAX 1 1300#define ACPI_NUM_MEM_LISTS 2 1301 1302 1303#endif /* __ACLOCAL_H__ */ | 427 428 429/* 430 * Bitmapped return value types 431 * Note: the actual data types must be contiguous, a loop in nspredef.c 432 * depends on this. 433 */ 434#define ACPI_RTYPE_ANY 0x00 435#define ACPI_RTYPE_NONE 0x01 436#define ACPI_RTYPE_INTEGER 0x02 437#define ACPI_RTYPE_STRING 0x04 438#define ACPI_RTYPE_BUFFER 0x08 439#define ACPI_RTYPE_PACKAGE 0x10 440#define ACPI_RTYPE_REFERENCE 0x20 441#define ACPI_RTYPE_ALL 0x3F 442 443#define ACPI_NUM_RTYPES 5 /* Number of actual object types */ 444 445 446/***************************************************************************** 447 * 448 * Event typedefs and structs 449 * 450 ****************************************************************************/ 451 452/* Dispatch info for each GPE -- either a method or handler, cannot be both */ 453 454typedef struct acpi_gpe_handler_info 455{ 456 ACPI_GPE_HANDLER Address; /* Address of handler, if any */ 457 void *Context; /* Context to be passed to handler */ 458 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */ 459 UINT8 OriginalFlags; /* Original (pre-handler) GPE info */ 460 BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */ 461 462} ACPI_GPE_HANDLER_INFO; 463 464/* 465 * GPE dispatch info. At any time, the GPE can have at most one type 466 * of dispatch - Method, Handler, or Implicit Notify. 467 */ 468typedef union acpi_gpe_dispatch_info 469{ 470 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ 471 struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */ 472 ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */ 473 474} ACPI_GPE_DISPATCH_INFO; 475 476/* 477 * Information about a GPE, one per each GPE in an array. 478 * NOTE: Important to keep this struct as small as possible. 479 */ 480typedef struct acpi_gpe_event_info 481{ 482 union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */ 483 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ 484 UINT8 Flags; /* Misc info about this GPE */ 485 UINT8 GpeNumber; /* This GPE */ 486 UINT8 RuntimeCount; /* References to a run GPE */ 487 488} ACPI_GPE_EVENT_INFO; 489 490/* Information about a GPE register pair, one per each status/enable pair in an array */ 491 492typedef struct acpi_gpe_register_info 493{ 494 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */ 495 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */ 496 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */ 497 UINT8 EnableForRun; /* GPEs to keep enabled when running */ 498 UINT8 BaseGpeNumber; /* Base GPE number for this register */ 499 500} ACPI_GPE_REGISTER_INFO; 501 502/* 503 * Information about a GPE register block, one per each installed block -- 504 * GPE0, GPE1, and one per each installed GPE Block Device. 505 */ 506typedef struct acpi_gpe_block_info 507{ 508 ACPI_NAMESPACE_NODE *Node; 509 struct acpi_gpe_block_info *Previous; 510 struct acpi_gpe_block_info *Next; 511 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */ 512 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */ 513 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */ 514 ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */ 515 UINT32 RegisterCount; /* Number of register pairs in block */ 516 UINT16 GpeCount; /* Number of individual GPEs in block */ 517 UINT8 BlockBaseNumber;/* Base GPE number for this block */ 518 BOOLEAN Initialized; /* TRUE if this block is initialized */ 519 520} ACPI_GPE_BLOCK_INFO; 521 522/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 523 524typedef struct acpi_gpe_xrupt_info 525{ 526 struct acpi_gpe_xrupt_info *Previous; 527 struct acpi_gpe_xrupt_info *Next; 528 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */ 529 UINT32 InterruptNumber; /* System interrupt number */ 530 531} ACPI_GPE_XRUPT_INFO; 532 533typedef struct acpi_gpe_walk_info 534{ 535 ACPI_NAMESPACE_NODE *GpeDevice; 536 ACPI_GPE_BLOCK_INFO *GpeBlock; 537 UINT16 Count; 538 ACPI_OWNER_ID OwnerId; 539 BOOLEAN ExecuteByOwnerId; 540 541} ACPI_GPE_WALK_INFO; 542 543typedef struct acpi_gpe_device_info 544{ 545 UINT32 Index; 546 UINT32 NextBlockBaseIndex; 547 ACPI_STATUS Status; 548 ACPI_NAMESPACE_NODE *GpeDevice; 549 550} ACPI_GPE_DEVICE_INFO; 551 552typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) ( 553 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 554 ACPI_GPE_BLOCK_INFO *GpeBlock, 555 void *Context); 556 557 558/* Information about each particular fixed event */ 559 560typedef struct acpi_fixed_event_handler 561{ 562 ACPI_EVENT_HANDLER Handler; /* Address of handler. */ 563 void *Context; /* Context to be passed to handler */ 564 565} ACPI_FIXED_EVENT_HANDLER; 566 567typedef struct acpi_fixed_event_info 568{ 569 UINT8 StatusRegisterId; 570 UINT8 EnableRegisterId; 571 UINT16 StatusBitMask; 572 UINT16 EnableBitMask; 573 574} ACPI_FIXED_EVENT_INFO; 575 576/* Information used during field processing */ 577 578typedef struct acpi_field_info 579{ 580 UINT8 SkipField; 581 UINT8 FieldFlag; 582 UINT32 PkgLength; 583 584} ACPI_FIELD_INFO; 585 586 587/***************************************************************************** 588 * 589 * Generic "state" object for stacks 590 * 591 ****************************************************************************/ 592 593#define ACPI_CONTROL_NORMAL 0xC0 594#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 595#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 596#define ACPI_CONTROL_PREDICATE_FALSE 0xC3 597#define ACPI_CONTROL_PREDICATE_TRUE 0xC4 598 599 600#define ACPI_STATE_COMMON \ 601 void *Next; \ 602 UINT8 DescriptorType; /* To differentiate various internal objs */\ 603 UINT8 Flags; \ 604 UINT16 Value; \ 605 UINT16 State; 606 607 /* There are 2 bytes available here until the next natural alignment boundary */ 608 609typedef struct acpi_common_state 610{ 611 ACPI_STATE_COMMON 612} ACPI_COMMON_STATE; 613 614 615/* 616 * Update state - used to traverse complex objects such as packages 617 */ 618typedef struct acpi_update_state 619{ 620 ACPI_STATE_COMMON 621 union acpi_operand_object *Object; 622 623} ACPI_UPDATE_STATE; 624 625 626/* 627 * Pkg state - used to traverse nested package structures 628 */ 629typedef struct acpi_pkg_state 630{ 631 ACPI_STATE_COMMON 632 UINT16 Index; 633 union acpi_operand_object *SourceObject; 634 union acpi_operand_object *DestObject; 635 struct acpi_walk_state *WalkState; 636 void *ThisTargetObj; 637 UINT32 NumPackages; 638 639} ACPI_PKG_STATE; 640 641 642/* 643 * Control state - one per if/else and while constructs. 644 * Allows nesting of these constructs 645 */ 646typedef struct acpi_control_state 647{ 648 ACPI_STATE_COMMON 649 UINT16 Opcode; 650 union acpi_parse_object *PredicateOp; 651 UINT8 *AmlPredicateStart; /* Start of if/while predicate */ 652 UINT8 *PackageEnd; /* End of if/while block */ 653 UINT32 LoopCount; /* While() loop counter */ 654 655} ACPI_CONTROL_STATE; 656 657 658/* 659 * Scope state - current scope during namespace lookups 660 */ 661typedef struct acpi_scope_state 662{ 663 ACPI_STATE_COMMON 664 ACPI_NAMESPACE_NODE *Node; 665 666} ACPI_SCOPE_STATE; 667 668 669typedef struct acpi_pscope_state 670{ 671 ACPI_STATE_COMMON 672 UINT32 ArgCount; /* Number of fixed arguments */ 673 union acpi_parse_object *Op; /* Current op being parsed */ 674 UINT8 *ArgEnd; /* Current argument end */ 675 UINT8 *PkgEnd; /* Current package end */ 676 UINT32 ArgList; /* Next argument to parse */ 677 678} ACPI_PSCOPE_STATE; 679 680 681/* 682 * Thread state - one per thread across multiple walk states. Multiple walk 683 * states are created when there are nested control methods executing. 684 */ 685typedef struct acpi_thread_state 686{ 687 ACPI_STATE_COMMON 688 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ 689 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ 690 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ 691 ACPI_THREAD_ID ThreadId; /* Running thread ID */ 692 693} ACPI_THREAD_STATE; 694 695 696/* 697 * Result values - used to accumulate the results of nested 698 * AML arguments 699 */ 700typedef struct acpi_result_values 701{ 702 ACPI_STATE_COMMON 703 union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; 704 705} ACPI_RESULT_VALUES; 706 707 708typedef 709ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) ( 710 struct acpi_walk_state *WalkState, 711 union acpi_parse_object **OutOp); 712 713typedef 714ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( 715 struct acpi_walk_state *WalkState); 716 717 718/* 719 * Notify info - used to pass info to the deferred notify 720 * handler/dispatcher. 721 */ 722typedef struct acpi_notify_info 723{ 724 ACPI_STATE_COMMON 725 ACPI_NAMESPACE_NODE *Node; 726 union acpi_operand_object *HandlerObj; 727 728} ACPI_NOTIFY_INFO; 729 730 731/* Generic state is union of structs above */ 732 733typedef union acpi_generic_state 734{ 735 ACPI_COMMON_STATE Common; 736 ACPI_CONTROL_STATE Control; 737 ACPI_UPDATE_STATE Update; 738 ACPI_SCOPE_STATE Scope; 739 ACPI_PSCOPE_STATE ParseScope; 740 ACPI_PKG_STATE Pkg; 741 ACPI_THREAD_STATE Thread; 742 ACPI_RESULT_VALUES Results; 743 ACPI_NOTIFY_INFO Notify; 744 745} ACPI_GENERIC_STATE; 746 747 748/***************************************************************************** 749 * 750 * Interpreter typedefs and structs 751 * 752 ****************************************************************************/ 753 754typedef 755ACPI_STATUS (*ACPI_EXECUTE_OP) ( 756 struct acpi_walk_state *WalkState); 757 758/* Address Range info block */ 759 760typedef struct acpi_address_range 761{ 762 struct acpi_address_range *Next; 763 ACPI_NAMESPACE_NODE *RegionNode; 764 ACPI_PHYSICAL_ADDRESS StartAddress; 765 ACPI_PHYSICAL_ADDRESS EndAddress; 766 767} ACPI_ADDRESS_RANGE; 768 769 770/***************************************************************************** 771 * 772 * Parser typedefs and structs 773 * 774 ****************************************************************************/ 775 776/* 777 * AML opcode, name, and argument layout 778 */ 779typedef struct acpi_opcode_info 780{ 781#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 782 char *Name; /* Opcode name (disassembler/debug only) */ 783#endif 784 UINT32 ParseArgs; /* Grammar/Parse time arguments */ 785 UINT32 RuntimeArgs; /* Interpret time arguments */ 786 UINT16 Flags; /* Misc flags */ 787 UINT8 ObjectType; /* Corresponding internal object type */ 788 UINT8 Class; /* Opcode class */ 789 UINT8 Type; /* Opcode type */ 790 791} ACPI_OPCODE_INFO; 792 793/* Structure for Resource Tag information */ 794 795typedef struct acpi_tag_info 796{ 797 UINT32 BitOffset; 798 UINT32 BitLength; 799 800} ACPI_TAG_INFO; 801 802/* Value associated with the parse object */ 803 804typedef union acpi_parse_value 805{ 806 UINT64 Integer; /* Integer constant (Up to 64 bits) */ 807 UINT32 Size; /* bytelist or field size */ 808 char *String; /* NULL terminated string */ 809 UINT8 *Buffer; /* buffer or string */ 810 char *Name; /* NULL terminated string */ 811 union acpi_parse_object *Arg; /* arguments and contained ops */ 812 ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ 813 814} ACPI_PARSE_VALUE; 815 816 817#ifdef ACPI_DISASSEMBLER 818#define ACPI_DISASM_ONLY_MEMBERS(a) a; 819#else 820#define ACPI_DISASM_ONLY_MEMBERS(a) 821#endif 822 823#define ACPI_PARSE_COMMON \ 824 union acpi_parse_object *Parent; /* Parent op */\ 825 UINT8 DescriptorType; /* To differentiate various internal objs */\ 826 UINT8 Flags; /* Type of Op */\ 827 UINT16 AmlOpcode; /* AML opcode */\ 828 UINT32 AmlOffset; /* Offset of declaration in AML */\ 829 union acpi_parse_object *Next; /* Next op */\ 830 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ 831 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ 832 UINT8 ArgListLength; /* Number of elements in the arg list */\ 833 ACPI_DISASM_ONLY_MEMBERS (\ 834 UINT8 DisasmFlags; /* Used during AML disassembly */\ 835 UINT8 DisasmOpcode; /* Subtype used for disassembly */\ 836 char AmlOpName[16]) /* Op name (debug only) */ 837 838 839#define ACPI_DASM_BUFFER 0x00 840#define ACPI_DASM_RESOURCE 0x01 841#define ACPI_DASM_STRING 0x02 842#define ACPI_DASM_UNICODE 0x03 843#define ACPI_DASM_EISAID 0x04 844#define ACPI_DASM_MATCHOP 0x05 845#define ACPI_DASM_LNOT_PREFIX 0x06 846#define ACPI_DASM_LNOT_SUFFIX 0x07 847#define ACPI_DASM_IGNORE 0x08 848 849/* 850 * Generic operation (for example: If, While, Store) 851 */ 852typedef struct acpi_parse_obj_common 853{ 854 ACPI_PARSE_COMMON 855} ACPI_PARSE_OBJ_COMMON; 856 857 858/* 859 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions), 860 * and bytelists. 861 */ 862typedef struct acpi_parse_obj_named 863{ 864 ACPI_PARSE_COMMON 865 UINT8 *Path; 866 UINT8 *Data; /* AML body or bytelist data */ 867 UINT32 Length; /* AML length */ 868 UINT32 Name; /* 4-byte name or zero if no name */ 869 870} ACPI_PARSE_OBJ_NAMED; 871 872 873/* This version is used by the iASL compiler only */ 874 875#define ACPI_MAX_PARSEOP_NAME 20 876 877typedef struct acpi_parse_obj_asl 878{ 879 ACPI_PARSE_COMMON 880 union acpi_parse_object *Child; 881 union acpi_parse_object *ParentMethod; 882 char *Filename; 883 char *ExternalName; 884 char *Namepath; 885 char NameSeg[4]; 886 UINT32 ExtraValue; 887 UINT32 Column; 888 UINT32 LineNumber; 889 UINT32 LogicalLineNumber; 890 UINT32 LogicalByteOffset; 891 UINT32 EndLine; 892 UINT32 EndLogicalLine; 893 UINT32 AcpiBtype; 894 UINT32 AmlLength; 895 UINT32 AmlSubtreeLength; 896 UINT32 FinalAmlLength; 897 UINT32 FinalAmlOffset; 898 UINT32 CompileFlags; 899 UINT16 ParseOpcode; 900 UINT8 AmlOpcodeLength; 901 UINT8 AmlPkgLenBytes; 902 UINT8 Extra; 903 char ParseOpName[ACPI_MAX_PARSEOP_NAME]; 904 905} ACPI_PARSE_OBJ_ASL; 906 907typedef union acpi_parse_object 908{ 909 ACPI_PARSE_OBJ_COMMON Common; 910 ACPI_PARSE_OBJ_NAMED Named; 911 ACPI_PARSE_OBJ_ASL Asl; 912 913} ACPI_PARSE_OBJECT; 914 915 916/* 917 * Parse state - one state per parser invocation and each control 918 * method. 919 */ 920typedef struct acpi_parse_state 921{ 922 UINT8 *AmlStart; /* First AML byte */ 923 UINT8 *Aml; /* Next AML byte */ 924 UINT8 *AmlEnd; /* (last + 1) AML byte */ 925 UINT8 *PkgStart; /* Current package begin */ 926 UINT8 *PkgEnd; /* Current package end */ 927 union acpi_parse_object *StartOp; /* Root of parse tree */ 928 struct acpi_namespace_node *StartNode; 929 union acpi_generic_state *Scope; /* Current scope */ 930 union acpi_parse_object *StartScope; 931 UINT32 AmlSize; 932 933} ACPI_PARSE_STATE; 934 935 936/* Parse object flags */ 937 938#define ACPI_PARSEOP_GENERIC 0x01 939#define ACPI_PARSEOP_NAMED 0x02 940#define ACPI_PARSEOP_DEFERRED 0x04 941#define ACPI_PARSEOP_BYTELIST 0x08 942#define ACPI_PARSEOP_IN_STACK 0x10 943#define ACPI_PARSEOP_TARGET 0x20 944#define ACPI_PARSEOP_IN_CACHE 0x80 945 946/* Parse object DisasmFlags */ 947 948#define ACPI_PARSEOP_IGNORE 0x01 949#define ACPI_PARSEOP_PARAMLIST 0x02 950#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 951#define ACPI_PARSEOP_SPECIAL 0x10 952 953 954/***************************************************************************** 955 * 956 * Hardware (ACPI registers) and PNP 957 * 958 ****************************************************************************/ 959 960typedef struct acpi_bit_register_info 961{ 962 UINT8 ParentRegister; 963 UINT8 BitPosition; 964 UINT16 AccessBitMask; 965 966} ACPI_BIT_REGISTER_INFO; 967 968 969/* 970 * Some ACPI registers have bits that must be ignored -- meaning that they 971 * must be preserved. 972 */ 973#define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 974 975/* Write-only bits must be zeroed by software */ 976 977#define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */ 978 979/* For control registers, both ignored and reserved bits must be preserved */ 980 981/* 982 * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the 983 * ACPI specification to be a "preserved" bit - "OSPM always preserves this 984 * bit position", section 4.7.3.2.1. However, on some machines the OS must 985 * write a one to this bit after resume for the machine to work properly. 986 * To enable this, we no longer attempt to preserve this bit. No machines 987 * are known to fail if the bit is not preserved. (May 2009) 988 */ 989#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */ 990#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 991#define ACPI_PM1_CONTROL_PRESERVED_BITS \ 992 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 993 994#define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */ 995 996/* 997 * Register IDs 998 * These are the full ACPI registers 999 */ 1000#define ACPI_REGISTER_PM1_STATUS 0x01 1001#define ACPI_REGISTER_PM1_ENABLE 0x02 1002#define ACPI_REGISTER_PM1_CONTROL 0x03 1003#define ACPI_REGISTER_PM2_CONTROL 0x04 1004#define ACPI_REGISTER_PM_TIMER 0x05 1005#define ACPI_REGISTER_PROCESSOR_BLOCK 0x06 1006#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07 1007 1008 1009/* Masks used to access the BitRegisters */ 1010 1011#define ACPI_BITMASK_TIMER_STATUS 0x0001 1012#define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 1013#define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 1014#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 1015#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 1016#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 1017#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 1018#define ACPI_BITMASK_WAKE_STATUS 0x8000 1019 1020#define ACPI_BITMASK_ALL_FIXED_STATUS (\ 1021 ACPI_BITMASK_TIMER_STATUS | \ 1022 ACPI_BITMASK_BUS_MASTER_STATUS | \ 1023 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 1024 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 1025 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 1026 ACPI_BITMASK_RT_CLOCK_STATUS | \ 1027 ACPI_BITMASK_PCIEXP_WAKE_STATUS | \ 1028 ACPI_BITMASK_WAKE_STATUS) 1029 1030#define ACPI_BITMASK_TIMER_ENABLE 0x0001 1031#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 1032#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 1033#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 1034#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 1035#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 1036 1037#define ACPI_BITMASK_SCI_ENABLE 0x0001 1038#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 1039#define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 1040#define ACPI_BITMASK_SLEEP_TYPE 0x1C00 1041#define ACPI_BITMASK_SLEEP_ENABLE 0x2000 1042 1043#define ACPI_BITMASK_ARB_DISABLE 0x0001 1044 1045 1046/* Raw bit position of each BitRegister */ 1047 1048#define ACPI_BITPOSITION_TIMER_STATUS 0x00 1049#define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 1050#define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 1051#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 1052#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 1053#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 1054#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 1055#define ACPI_BITPOSITION_WAKE_STATUS 0x0F 1056 1057#define ACPI_BITPOSITION_TIMER_ENABLE 0x00 1058#define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 1059#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 1060#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 1061#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 1062#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 1063 1064#define ACPI_BITPOSITION_SCI_ENABLE 0x00 1065#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 1066#define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 1067#define ACPI_BITPOSITION_SLEEP_TYPE 0x0A 1068#define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D 1069 1070#define ACPI_BITPOSITION_ARB_DISABLE 0x00 1071 1072 1073/* Structs and definitions for _OSI support and I/O port validation */ 1074 1075#define ACPI_OSI_WIN_2000 0x01 1076#define ACPI_OSI_WIN_XP 0x02 1077#define ACPI_OSI_WIN_XP_SP1 0x03 1078#define ACPI_OSI_WINSRV_2003 0x04 1079#define ACPI_OSI_WIN_XP_SP2 0x05 1080#define ACPI_OSI_WINSRV_2003_SP1 0x06 1081#define ACPI_OSI_WIN_VISTA 0x07 1082#define ACPI_OSI_WINSRV_2008 0x08 1083#define ACPI_OSI_WIN_VISTA_SP1 0x09 1084#define ACPI_OSI_WIN_VISTA_SP2 0x0A 1085#define ACPI_OSI_WIN_7 0x0B 1086 1087#define ACPI_ALWAYS_ILLEGAL 0x00 1088 1089typedef struct acpi_interface_info 1090{ 1091 char *Name; 1092 struct acpi_interface_info *Next; 1093 UINT8 Flags; 1094 UINT8 Value; 1095 1096} ACPI_INTERFACE_INFO; 1097 1098#define ACPI_OSI_INVALID 0x01 1099#define ACPI_OSI_DYNAMIC 0x02 1100 1101typedef struct acpi_port_info 1102{ 1103 char *Name; 1104 UINT16 Start; 1105 UINT16 End; 1106 UINT8 OsiDependency; 1107 1108} ACPI_PORT_INFO; 1109 1110 1111/***************************************************************************** 1112 * 1113 * Resource descriptors 1114 * 1115 ****************************************************************************/ 1116 1117/* ResourceType values */ 1118 1119#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 1120#define ACPI_ADDRESS_TYPE_IO_RANGE 1 1121#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 1122 1123/* Resource descriptor types and masks */ 1124 1125#define ACPI_RESOURCE_NAME_LARGE 0x80 1126#define ACPI_RESOURCE_NAME_SMALL 0x00 1127 1128#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ 1129#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ 1130#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ 1131 1132 1133/* 1134 * Small resource descriptor "names" as defined by the ACPI specification. 1135 * Note: Bits 2:0 are used for the descriptor length 1136 */ 1137#define ACPI_RESOURCE_NAME_IRQ 0x20 1138#define ACPI_RESOURCE_NAME_DMA 0x28 1139#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 1140#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 1141#define ACPI_RESOURCE_NAME_IO 0x40 1142#define ACPI_RESOURCE_NAME_FIXED_IO 0x48 1143#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 1144#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 1145#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 1146#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 1147#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 1148#define ACPI_RESOURCE_NAME_END_TAG 0x78 1149 1150/* 1151 * Large resource descriptor "names" as defined by the ACPI specification. 1152 * Note: includes the Large Descriptor bit in bit[7] 1153 */ 1154#define ACPI_RESOURCE_NAME_MEMORY24 0x81 1155#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 1156#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 1157#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 1158#define ACPI_RESOURCE_NAME_MEMORY32 0x85 1159#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 1160#define ACPI_RESOURCE_NAME_ADDRESS32 0x87 1161#define ACPI_RESOURCE_NAME_ADDRESS16 0x88 1162#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 1163#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1164#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 1165#define ACPI_RESOURCE_NAME_GPIO 0x8C 1166#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1167#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E 1168 1169 1170/***************************************************************************** 1171 * 1172 * Miscellaneous 1173 * 1174 ****************************************************************************/ 1175 1176#define ACPI_ASCII_ZERO 0x30 1177 1178 1179/***************************************************************************** 1180 * 1181 * Disassembler 1182 * 1183 ****************************************************************************/ 1184 1185typedef struct acpi_external_list 1186{ 1187 char *Path; 1188 char *InternalPath; 1189 struct acpi_external_list *Next; 1190 UINT32 Value; 1191 UINT16 Length; 1192 UINT8 Type; 1193 UINT8 Flags; 1194 1195} ACPI_EXTERNAL_LIST; 1196 1197/* Values for Flags field above */ 1198 1199#define ACPI_IPATH_ALLOCATED 0x01 1200 1201 1202typedef struct acpi_external_file 1203{ 1204 char *Path; 1205 struct acpi_external_file *Next; 1206 1207} ACPI_EXTERNAL_FILE; 1208 1209 1210/***************************************************************************** 1211 * 1212 * Debugger 1213 * 1214 ****************************************************************************/ 1215 1216typedef struct acpi_db_method_info 1217{ 1218 ACPI_HANDLE MainThreadGate; 1219 ACPI_HANDLE ThreadCompleteGate; 1220 ACPI_HANDLE InfoGate; 1221 ACPI_THREAD_ID *Threads; 1222 UINT32 NumThreads; 1223 UINT32 NumCreated; 1224 UINT32 NumCompleted; 1225 1226 char *Name; 1227 UINT32 Flags; 1228 UINT32 NumLoops; 1229 char Pathname[128]; 1230 char **Args; 1231 ACPI_OBJECT_TYPE *Types; 1232 1233 /* 1234 * Arguments to be passed to method for the command 1235 * Threads - 1236 * the Number of threads, ID of current thread and 1237 * Index of current thread inside all them created. 1238 */ 1239 char InitArgs; 1240 ACPI_OBJECT_TYPE ArgTypes[4]; 1241 char *Arguments[4]; 1242 char NumThreadsStr[11]; 1243 char IdOfThreadStr[11]; 1244 char IndexOfThreadStr[11]; 1245 1246} ACPI_DB_METHOD_INFO; 1247 1248typedef struct acpi_integrity_info 1249{ 1250 UINT32 Nodes; 1251 UINT32 Objects; 1252 1253} ACPI_INTEGRITY_INFO; 1254 1255 1256#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1257#define ACPI_DB_CONSOLE_OUTPUT 0x02 1258#define ACPI_DB_DUPLICATE_OUTPUT 0x03 1259 1260 1261/***************************************************************************** 1262 * 1263 * Debug 1264 * 1265 ****************************************************************************/ 1266 1267/* Entry for a memory allocation (debug only) */ 1268 1269#define ACPI_MEM_MALLOC 0 1270#define ACPI_MEM_CALLOC 1 1271#define ACPI_MAX_MODULE_NAME 16 1272 1273#define ACPI_COMMON_DEBUG_MEM_HEADER \ 1274 struct acpi_debug_mem_block *Previous; \ 1275 struct acpi_debug_mem_block *Next; \ 1276 UINT32 Size; \ 1277 UINT32 Component; \ 1278 UINT32 Line; \ 1279 char Module[ACPI_MAX_MODULE_NAME]; \ 1280 UINT8 AllocType; 1281 1282typedef struct acpi_debug_mem_header 1283{ 1284 ACPI_COMMON_DEBUG_MEM_HEADER 1285 1286} ACPI_DEBUG_MEM_HEADER; 1287 1288typedef struct acpi_debug_mem_block 1289{ 1290 ACPI_COMMON_DEBUG_MEM_HEADER 1291 UINT64 UserSpace; 1292 1293} ACPI_DEBUG_MEM_BLOCK; 1294 1295 1296#define ACPI_MEM_LIST_GLOBAL 0 1297#define ACPI_MEM_LIST_NSNODE 1 1298#define ACPI_MEM_LIST_MAX 1 1299#define ACPI_NUM_MEM_LISTS 2 1300 1301 1302#endif /* __ACLOCAL_H__ */ |