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