1 /****************************************************************************** 2 * 3 * Name: aclocal.h - Internal data types used across the ACPI subsystem 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2013, 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 52 typedef 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 62 struct acpi_walk_state; 63 struct acpi_obj_mutex; 64 union 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 99 typedef 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 125 typedef 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 159 typedef 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 */ 179 typedef 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 221 typedef 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 243 typedef struct acpi_find_context 244 { 245 char *SearchFor; 246 ACPI_HANDLE *List; 247 UINT32 *Count; 248 249 } ACPI_FIND_CONTEXT; 250 251 252 typedef 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 267 typedef 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 282 typedef 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 302 typedef 303 ACPI_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 #pragma pack(1) 339 340 /* 341 * Information structure for ACPI predefined names. 342 * Each entry in the table contains the following items: 343 * 344 * Name - The ACPI reserved name 345 * ParamCount - Number of arguments to the method 346 * ExpectedReturnBtypes - Allowed type(s) for the return value 347 */ 348 typedef struct acpi_name_info 349 { 350 char Name[ACPI_NAME_SIZE]; 351 UINT16 ArgumentList; 352 UINT8 ExpectedBtypes; 353 354 } ACPI_NAME_INFO; 355 356 /* 357 * Secondary information structures for ACPI predefined objects that return 358 * package objects. This structure appears as the next entry in the table 359 * after the NAME_INFO structure above. 360 * 361 * The reason for this is to minimize the size of the predefined name table. 362 */ 363 364 /* 365 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 366 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, 367 * ACPI_PTYPE2_FIX_VAR 368 */ 369 typedef struct acpi_package_info 370 { 371 UINT8 Type; 372 UINT8 ObjectType1; 373 UINT8 Count1; 374 UINT8 ObjectType2; 375 UINT8 Count2; 376 UINT16 Reserved; 377 378 } ACPI_PACKAGE_INFO; 379 380 /* Used for ACPI_PTYPE2_FIXED */ 381 382 typedef struct acpi_package_info2 383 { 384 UINT8 Type; 385 UINT8 Count; 386 UINT8 ObjectType[4]; 387 UINT8 Reserved; 388 389 } ACPI_PACKAGE_INFO2; 390 391 /* Used for ACPI_PTYPE1_OPTION */ 392 393 typedef struct acpi_package_info3 394 { 395 UINT8 Type; 396 UINT8 Count; 397 UINT8 ObjectType[2]; 398 UINT8 TailObjectType; 399 UINT16 Reserved; 400 401 } ACPI_PACKAGE_INFO3; 402 403 typedef union acpi_predefined_info 404 { 405 ACPI_NAME_INFO Info; 406 ACPI_PACKAGE_INFO RetInfo; 407 ACPI_PACKAGE_INFO2 RetInfo2; 408 ACPI_PACKAGE_INFO3 RetInfo3; 409 410 } ACPI_PREDEFINED_INFO; 411 412 /* Reset to default packing */ 413 414 #pragma pack() 415 416 417 /* Data block used during object validation */ 418 419 typedef struct acpi_predefined_data 420 { 421 char *Pathname; 422 const ACPI_PREDEFINED_INFO *Predefined; 423 union acpi_operand_object *ParentPackage; 424 ACPI_NAMESPACE_NODE *Node; 425 UINT32 Flags; 426 UINT32 ReturnBtype; 427 UINT8 NodeFlags; 428 429 } ACPI_PREDEFINED_DATA; 430 431 /* Defines for Flags field above */ 432 433 #define ACPI_OBJECT_REPAIRED 1 434 #define ACPI_OBJECT_WRAPPED 2 435 436 437 /* Return object auto-repair info */ 438 439 typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) ( 440 union acpi_operand_object *OriginalObject, 441 union acpi_operand_object **ConvertedObject); 442 443 typedef struct acpi_simple_repair_info 444 { 445 char Name[ACPI_NAME_SIZE]; 446 UINT32 UnexpectedBtypes; 447 UINT32 PackageIndex; 448 ACPI_OBJECT_CONVERTER ObjectConverter; 449 450 } ACPI_SIMPLE_REPAIR_INFO; 451 452 453 /* 454 * Bitmapped return value types 455 * Note: the actual data types must be contiguous, a loop in nspredef.c 456 * depends on this. 457 */ 458 #define ACPI_RTYPE_ANY 0x00 459 #define ACPI_RTYPE_NONE 0x01 460 #define ACPI_RTYPE_INTEGER 0x02 461 #define ACPI_RTYPE_STRING 0x04 462 #define ACPI_RTYPE_BUFFER 0x08 463 #define ACPI_RTYPE_PACKAGE 0x10 464 #define ACPI_RTYPE_REFERENCE 0x20 465 #define ACPI_RTYPE_ALL 0x3F 466 467 #define ACPI_NUM_RTYPES 5 /* Number of actual object types */ 468 469 470 /***************************************************************************** 471 * 472 * Event typedefs and structs 473 * 474 ****************************************************************************/ 475 476 /* Dispatch info for each GPE -- either a method or handler, cannot be both */ 477 478 typedef struct acpi_gpe_handler_info 479 { 480 ACPI_GPE_HANDLER Address; /* Address of handler, if any */ 481 void *Context; /* Context to be passed to handler */ 482 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */ 483 UINT8 OriginalFlags; /* Original (pre-handler) GPE info */ 484 BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */ 485 486 } ACPI_GPE_HANDLER_INFO; 487 488 /* Notify info for implicit notify, multiple device objects */ 489 490 typedef struct acpi_gpe_notify_info 491 { 492 ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */ 493 struct acpi_gpe_notify_info *Next; 494 495 } ACPI_GPE_NOTIFY_INFO; 496 497 /* 498 * GPE dispatch info. At any time, the GPE can have at most one type 499 * of dispatch - Method, Handler, or Implicit Notify. 500 */ 501 typedef union acpi_gpe_dispatch_info 502 { 503 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ 504 ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */ 505 ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */ 506 507 } ACPI_GPE_DISPATCH_INFO; 508 509 /* 510 * Information about a GPE, one per each GPE in an array. 511 * NOTE: Important to keep this struct as small as possible. 512 */ 513 typedef struct acpi_gpe_event_info 514 { 515 union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */ 516 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ 517 UINT8 Flags; /* Misc info about this GPE */ 518 UINT8 GpeNumber; /* This GPE */ 519 UINT8 RuntimeCount; /* References to a run GPE */ 520 521 } ACPI_GPE_EVENT_INFO; 522 523 /* Information about a GPE register pair, one per each status/enable pair in an array */ 524 525 typedef struct acpi_gpe_register_info 526 { 527 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */ 528 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */ 529 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */ 530 UINT8 EnableForRun; /* GPEs to keep enabled when running */ 531 UINT8 BaseGpeNumber; /* Base GPE number for this register */ 532 533 } ACPI_GPE_REGISTER_INFO; 534 535 /* 536 * Information about a GPE register block, one per each installed block -- 537 * GPE0, GPE1, and one per each installed GPE Block Device. 538 */ 539 typedef struct acpi_gpe_block_info 540 { 541 ACPI_NAMESPACE_NODE *Node; 542 struct acpi_gpe_block_info *Previous; 543 struct acpi_gpe_block_info *Next; 544 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */ 545 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */ 546 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */ 547 ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */ 548 UINT32 RegisterCount; /* Number of register pairs in block */ 549 UINT16 GpeCount; /* Number of individual GPEs in block */ 550 UINT8 BlockBaseNumber;/* Base GPE number for this block */ 551 BOOLEAN Initialized; /* TRUE if this block is initialized */ 552 553 } ACPI_GPE_BLOCK_INFO; 554 555 /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 556 557 typedef struct acpi_gpe_xrupt_info 558 { 559 struct acpi_gpe_xrupt_info *Previous; 560 struct acpi_gpe_xrupt_info *Next; 561 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */ 562 UINT32 InterruptNumber; /* System interrupt number */ 563 564 } ACPI_GPE_XRUPT_INFO; 565 566 typedef struct acpi_gpe_walk_info 567 { 568 ACPI_NAMESPACE_NODE *GpeDevice; 569 ACPI_GPE_BLOCK_INFO *GpeBlock; 570 UINT16 Count; 571 ACPI_OWNER_ID OwnerId; 572 BOOLEAN ExecuteByOwnerId; 573 574 } ACPI_GPE_WALK_INFO; 575 576 typedef struct acpi_gpe_device_info 577 { 578 UINT32 Index; 579 UINT32 NextBlockBaseIndex; 580 ACPI_STATUS Status; 581 ACPI_NAMESPACE_NODE *GpeDevice; 582 583 } ACPI_GPE_DEVICE_INFO; 584 585 typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) ( 586 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 587 ACPI_GPE_BLOCK_INFO *GpeBlock, 588 void *Context); 589 590 591 /* Information about each particular fixed event */ 592 593 typedef struct acpi_fixed_event_handler 594 { 595 ACPI_EVENT_HANDLER Handler; /* Address of handler. */ 596 void *Context; /* Context to be passed to handler */ 597 598 } ACPI_FIXED_EVENT_HANDLER; 599 600 typedef struct acpi_fixed_event_info 601 { 602 UINT8 StatusRegisterId; 603 UINT8 EnableRegisterId; 604 UINT16 StatusBitMask; 605 UINT16 EnableBitMask; 606 607 } ACPI_FIXED_EVENT_INFO; 608 609 /* Information used during field processing */ 610 611 typedef struct acpi_field_info 612 { 613 UINT8 SkipField; 614 UINT8 FieldFlag; 615 UINT32 PkgLength; 616 617 } ACPI_FIELD_INFO; 618 619 620 /***************************************************************************** 621 * 622 * Generic "state" object for stacks 623 * 624 ****************************************************************************/ 625 626 #define ACPI_CONTROL_NORMAL 0xC0 627 #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 628 #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 629 #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 630 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 631 632 633 #define ACPI_STATE_COMMON \ 634 void *Next; \ 635 UINT8 DescriptorType; /* To differentiate various internal objs */\ 636 UINT8 Flags; \ 637 UINT16 Value; \ 638 UINT16 State; 639 640 /* There are 2 bytes available here until the next natural alignment boundary */ 641 642 typedef struct acpi_common_state 643 { 644 ACPI_STATE_COMMON 645 } ACPI_COMMON_STATE; 646 647 648 /* 649 * Update state - used to traverse complex objects such as packages 650 */ 651 typedef struct acpi_update_state 652 { 653 ACPI_STATE_COMMON 654 union acpi_operand_object *Object; 655 656 } ACPI_UPDATE_STATE; 657 658 659 /* 660 * Pkg state - used to traverse nested package structures 661 */ 662 typedef struct acpi_pkg_state 663 { 664 ACPI_STATE_COMMON 665 UINT16 Index; 666 union acpi_operand_object *SourceObject; 667 union acpi_operand_object *DestObject; 668 struct acpi_walk_state *WalkState; 669 void *ThisTargetObj; 670 UINT32 NumPackages; 671 672 } ACPI_PKG_STATE; 673 674 675 /* 676 * Control state - one per if/else and while constructs. 677 * Allows nesting of these constructs 678 */ 679 typedef struct acpi_control_state 680 { 681 ACPI_STATE_COMMON 682 UINT16 Opcode; 683 union acpi_parse_object *PredicateOp; 684 UINT8 *AmlPredicateStart; /* Start of if/while predicate */ 685 UINT8 *PackageEnd; /* End of if/while block */ 686 UINT32 LoopCount; /* While() loop counter */ 687 688 } ACPI_CONTROL_STATE; 689 690 691 /* 692 * Scope state - current scope during namespace lookups 693 */ 694 typedef struct acpi_scope_state 695 { 696 ACPI_STATE_COMMON 697 ACPI_NAMESPACE_NODE *Node; 698 699 } ACPI_SCOPE_STATE; 700 701 702 typedef struct acpi_pscope_state 703 { 704 ACPI_STATE_COMMON 705 UINT32 ArgCount; /* Number of fixed arguments */ 706 union acpi_parse_object *Op; /* Current op being parsed */ 707 UINT8 *ArgEnd; /* Current argument end */ 708 UINT8 *PkgEnd; /* Current package end */ 709 UINT32 ArgList; /* Next argument to parse */ 710 711 } ACPI_PSCOPE_STATE; 712 713 714 /* 715 * Thread state - one per thread across multiple walk states. Multiple walk 716 * states are created when there are nested control methods executing. 717 */ 718 typedef struct acpi_thread_state 719 { 720 ACPI_STATE_COMMON 721 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ 722 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ 723 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ 724 ACPI_THREAD_ID ThreadId; /* Running thread ID */ 725 726 } ACPI_THREAD_STATE; 727 728 729 /* 730 * Result values - used to accumulate the results of nested 731 * AML arguments 732 */ 733 typedef struct acpi_result_values 734 { 735 ACPI_STATE_COMMON 736 union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; 737 738 } ACPI_RESULT_VALUES; 739 740 741 typedef 742 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) ( 743 struct acpi_walk_state *WalkState, 744 union acpi_parse_object **OutOp); 745 746 typedef 747 ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( 748 struct acpi_walk_state *WalkState); 749 750 751 /* Global handlers for AML Notifies */ 752 753 typedef struct acpi_global_notify_handler 754 { 755 ACPI_NOTIFY_HANDLER Handler; 756 void *Context; 757 758 } ACPI_GLOBAL_NOTIFY_HANDLER; 759 760 /* 761 * Notify info - used to pass info to the deferred notify 762 * handler/dispatcher. 763 */ 764 typedef struct acpi_notify_info 765 { 766 ACPI_STATE_COMMON 767 UINT8 HandlerListId; 768 ACPI_NAMESPACE_NODE *Node; 769 union acpi_operand_object *HandlerListHead; 770 ACPI_GLOBAL_NOTIFY_HANDLER *Global; 771 772 } ACPI_NOTIFY_INFO; 773 774 775 /* Generic state is union of structs above */ 776 777 typedef union acpi_generic_state 778 { 779 ACPI_COMMON_STATE Common; 780 ACPI_CONTROL_STATE Control; 781 ACPI_UPDATE_STATE Update; 782 ACPI_SCOPE_STATE Scope; 783 ACPI_PSCOPE_STATE ParseScope; 784 ACPI_PKG_STATE Pkg; 785 ACPI_THREAD_STATE Thread; 786 ACPI_RESULT_VALUES Results; 787 ACPI_NOTIFY_INFO Notify; 788 789 } ACPI_GENERIC_STATE; 790 791 792 /***************************************************************************** 793 * 794 * Interpreter typedefs and structs 795 * 796 ****************************************************************************/ 797 798 typedef 799 ACPI_STATUS (*ACPI_EXECUTE_OP) ( 800 struct acpi_walk_state *WalkState); 801 802 /* Address Range info block */ 803 804 typedef struct acpi_address_range 805 { 806 struct acpi_address_range *Next; 807 ACPI_NAMESPACE_NODE *RegionNode; 808 ACPI_PHYSICAL_ADDRESS StartAddress; 809 ACPI_PHYSICAL_ADDRESS EndAddress; 810 811 } ACPI_ADDRESS_RANGE; 812 813 814 /***************************************************************************** 815 * 816 * Parser typedefs and structs 817 * 818 ****************************************************************************/ 819 820 /* 821 * AML opcode, name, and argument layout 822 */ 823 typedef struct acpi_opcode_info 824 { 825 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 826 char *Name; /* Opcode name (disassembler/debug only) */ 827 #endif 828 UINT32 ParseArgs; /* Grammar/Parse time arguments */ 829 UINT32 RuntimeArgs; /* Interpret time arguments */ 830 UINT16 Flags; /* Misc flags */ 831 UINT8 ObjectType; /* Corresponding internal object type */ 832 UINT8 Class; /* Opcode class */ 833 UINT8 Type; /* Opcode type */ 834 835 } ACPI_OPCODE_INFO; 836 837 /* Structure for Resource Tag information */ 838 839 typedef struct acpi_tag_info 840 { 841 UINT32 BitOffset; 842 UINT32 BitLength; 843 844 } ACPI_TAG_INFO; 845 846 /* Value associated with the parse object */ 847 848 typedef union acpi_parse_value 849 { 850 UINT64 Integer; /* Integer constant (Up to 64 bits) */ 851 UINT32 Size; /* bytelist or field size */ 852 char *String; /* NULL terminated string */ 853 UINT8 *Buffer; /* buffer or string */ 854 char *Name; /* NULL terminated string */ 855 union acpi_parse_object *Arg; /* arguments and contained ops */ 856 ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ 857 858 } ACPI_PARSE_VALUE; 859 860 861 #ifdef ACPI_DISASSEMBLER 862 #define ACPI_DISASM_ONLY_MEMBERS(a) a; 863 #else 864 #define ACPI_DISASM_ONLY_MEMBERS(a) 865 #endif 866 867 #define ACPI_PARSE_COMMON \ 868 union acpi_parse_object *Parent; /* Parent op */\ 869 UINT8 DescriptorType; /* To differentiate various internal objs */\ 870 UINT8 Flags; /* Type of Op */\ 871 UINT16 AmlOpcode; /* AML opcode */\ 872 UINT32 AmlOffset; /* Offset of declaration in AML */\ 873 union acpi_parse_object *Next; /* Next op */\ 874 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ 875 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ 876 UINT8 ArgListLength; /* Number of elements in the arg list */\ 877 ACPI_DISASM_ONLY_MEMBERS (\ 878 UINT8 DisasmFlags; /* Used during AML disassembly */\ 879 UINT8 DisasmOpcode; /* Subtype used for disassembly */\ 880 char AmlOpName[16]) /* Op name (debug only) */ 881 882 883 /* Flags for DisasmFlags field above */ 884 885 #define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */ 886 #define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */ 887 #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ 888 #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ 889 #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ 890 #define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */ 891 #define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */ 892 #define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */ 893 #define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */ 894 #define ACPI_DASM_IGNORE 0x09 /* Not used at this time */ 895 896 /* 897 * Generic operation (for example: If, While, Store) 898 */ 899 typedef struct acpi_parse_obj_common 900 { 901 ACPI_PARSE_COMMON 902 } ACPI_PARSE_OBJ_COMMON; 903 904 905 /* 906 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions), 907 * and bytelists. 908 */ 909 typedef struct acpi_parse_obj_named 910 { 911 ACPI_PARSE_COMMON 912 UINT8 *Path; 913 UINT8 *Data; /* AML body or bytelist data */ 914 UINT32 Length; /* AML length */ 915 UINT32 Name; /* 4-byte name or zero if no name */ 916 917 } ACPI_PARSE_OBJ_NAMED; 918 919 920 /* This version is used by the iASL compiler only */ 921 922 #define ACPI_MAX_PARSEOP_NAME 20 923 924 typedef struct acpi_parse_obj_asl 925 { 926 ACPI_PARSE_COMMON 927 union acpi_parse_object *Child; 928 union acpi_parse_object *ParentMethod; 929 char *Filename; 930 char *ExternalName; 931 char *Namepath; 932 char NameSeg[4]; 933 UINT32 ExtraValue; 934 UINT32 Column; 935 UINT32 LineNumber; 936 UINT32 LogicalLineNumber; 937 UINT32 LogicalByteOffset; 938 UINT32 EndLine; 939 UINT32 EndLogicalLine; 940 UINT32 AcpiBtype; 941 UINT32 AmlLength; 942 UINT32 AmlSubtreeLength; 943 UINT32 FinalAmlLength; 944 UINT32 FinalAmlOffset; 945 UINT32 CompileFlags; 946 UINT16 ParseOpcode; 947 UINT8 AmlOpcodeLength; 948 UINT8 AmlPkgLenBytes; 949 UINT8 Extra; 950 char ParseOpName[ACPI_MAX_PARSEOP_NAME]; 951 952 } ACPI_PARSE_OBJ_ASL; 953 954 typedef union acpi_parse_object 955 { 956 ACPI_PARSE_OBJ_COMMON Common; 957 ACPI_PARSE_OBJ_NAMED Named; 958 ACPI_PARSE_OBJ_ASL Asl; 959 960 } ACPI_PARSE_OBJECT; 961 962 963 /* 964 * Parse state - one state per parser invocation and each control 965 * method. 966 */ 967 typedef struct acpi_parse_state 968 { 969 UINT8 *AmlStart; /* First AML byte */ 970 UINT8 *Aml; /* Next AML byte */ 971 UINT8 *AmlEnd; /* (last + 1) AML byte */ 972 UINT8 *PkgStart; /* Current package begin */ 973 UINT8 *PkgEnd; /* Current package end */ 974 union acpi_parse_object *StartOp; /* Root of parse tree */ 975 struct acpi_namespace_node *StartNode; 976 union acpi_generic_state *Scope; /* Current scope */ 977 union acpi_parse_object *StartScope; 978 UINT32 AmlSize; 979 980 } ACPI_PARSE_STATE; 981 982 983 /* Parse object flags */ 984 985 #define ACPI_PARSEOP_GENERIC 0x01 986 #define ACPI_PARSEOP_NAMED 0x02 987 #define ACPI_PARSEOP_DEFERRED 0x04 988 #define ACPI_PARSEOP_BYTELIST 0x08 989 #define ACPI_PARSEOP_IN_STACK 0x10 990 #define ACPI_PARSEOP_TARGET 0x20 991 #define ACPI_PARSEOP_IN_CACHE 0x80 992 993 /* Parse object DisasmFlags */ 994 995 #define ACPI_PARSEOP_IGNORE 0x01 996 #define ACPI_PARSEOP_PARAMLIST 0x02 997 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 998 #define ACPI_PARSEOP_PREDEF_CHECKED 0x08 999 #define ACPI_PARSEOP_SPECIAL 0x10 1000 1001 1002 /***************************************************************************** 1003 * 1004 * Hardware (ACPI registers) and PNP 1005 * 1006 ****************************************************************************/ 1007 1008 typedef struct acpi_bit_register_info 1009 { 1010 UINT8 ParentRegister; 1011 UINT8 BitPosition; 1012 UINT16 AccessBitMask; 1013 1014 } ACPI_BIT_REGISTER_INFO; 1015 1016 1017 /* 1018 * Some ACPI registers have bits that must be ignored -- meaning that they 1019 * must be preserved. 1020 */ 1021 #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 1022 1023 /* Write-only bits must be zeroed by software */ 1024 1025 #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */ 1026 1027 /* For control registers, both ignored and reserved bits must be preserved */ 1028 1029 /* 1030 * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the 1031 * ACPI specification to be a "preserved" bit - "OSPM always preserves this 1032 * bit position", section 4.7.3.2.1. However, on some machines the OS must 1033 * write a one to this bit after resume for the machine to work properly. 1034 * To enable this, we no longer attempt to preserve this bit. No machines 1035 * are known to fail if the bit is not preserved. (May 2009) 1036 */ 1037 #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */ 1038 #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 1039 #define ACPI_PM1_CONTROL_PRESERVED_BITS \ 1040 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 1041 1042 #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */ 1043 1044 /* 1045 * Register IDs 1046 * These are the full ACPI registers 1047 */ 1048 #define ACPI_REGISTER_PM1_STATUS 0x01 1049 #define ACPI_REGISTER_PM1_ENABLE 0x02 1050 #define ACPI_REGISTER_PM1_CONTROL 0x03 1051 #define ACPI_REGISTER_PM2_CONTROL 0x04 1052 #define ACPI_REGISTER_PM_TIMER 0x05 1053 #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06 1054 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07 1055 1056 1057 /* Masks used to access the BitRegisters */ 1058 1059 #define ACPI_BITMASK_TIMER_STATUS 0x0001 1060 #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 1061 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 1062 #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 1063 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 1064 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 1065 #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 1066 #define ACPI_BITMASK_WAKE_STATUS 0x8000 1067 1068 #define ACPI_BITMASK_ALL_FIXED_STATUS (\ 1069 ACPI_BITMASK_TIMER_STATUS | \ 1070 ACPI_BITMASK_BUS_MASTER_STATUS | \ 1071 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 1072 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 1073 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 1074 ACPI_BITMASK_RT_CLOCK_STATUS | \ 1075 ACPI_BITMASK_PCIEXP_WAKE_STATUS | \ 1076 ACPI_BITMASK_WAKE_STATUS) 1077 1078 #define ACPI_BITMASK_TIMER_ENABLE 0x0001 1079 #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 1080 #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 1081 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 1082 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 1083 #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 1084 1085 #define ACPI_BITMASK_SCI_ENABLE 0x0001 1086 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 1087 #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 1088 #define ACPI_BITMASK_SLEEP_TYPE 0x1C00 1089 #define ACPI_BITMASK_SLEEP_ENABLE 0x2000 1090 1091 #define ACPI_BITMASK_ARB_DISABLE 0x0001 1092 1093 1094 /* Raw bit position of each BitRegister */ 1095 1096 #define ACPI_BITPOSITION_TIMER_STATUS 0x00 1097 #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 1098 #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 1099 #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 1100 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 1101 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 1102 #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 1103 #define ACPI_BITPOSITION_WAKE_STATUS 0x0F 1104 1105 #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 1106 #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 1107 #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 1108 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 1109 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 1110 #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 1111 1112 #define ACPI_BITPOSITION_SCI_ENABLE 0x00 1113 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 1114 #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 1115 #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A 1116 #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D 1117 1118 #define ACPI_BITPOSITION_ARB_DISABLE 0x00 1119 1120 1121 /* Structs and definitions for _OSI support and I/O port validation */ 1122 1123 #define ACPI_OSI_WIN_2000 0x01 1124 #define ACPI_OSI_WIN_XP 0x02 1125 #define ACPI_OSI_WIN_XP_SP1 0x03 1126 #define ACPI_OSI_WINSRV_2003 0x04 1127 #define ACPI_OSI_WIN_XP_SP2 0x05 1128 #define ACPI_OSI_WINSRV_2003_SP1 0x06 1129 #define ACPI_OSI_WIN_VISTA 0x07 1130 #define ACPI_OSI_WINSRV_2008 0x08 1131 #define ACPI_OSI_WIN_VISTA_SP1 0x09 1132 #define ACPI_OSI_WIN_VISTA_SP2 0x0A 1133 #define ACPI_OSI_WIN_7 0x0B 1134 #define ACPI_OSI_WIN_8 0x0C 1135 1136 #define ACPI_ALWAYS_ILLEGAL 0x00 1137 1138 typedef struct acpi_interface_info 1139 { 1140 char *Name; 1141 struct acpi_interface_info *Next; 1142 UINT8 Flags; 1143 UINT8 Value; 1144 1145 } ACPI_INTERFACE_INFO; 1146 1147 #define ACPI_OSI_INVALID 0x01 1148 #define ACPI_OSI_DYNAMIC 0x02 1149 1150 typedef struct acpi_port_info 1151 { 1152 char *Name; 1153 UINT16 Start; 1154 UINT16 End; 1155 UINT8 OsiDependency; 1156 1157 } ACPI_PORT_INFO; 1158 1159 1160 /***************************************************************************** 1161 * 1162 * Resource descriptors 1163 * 1164 ****************************************************************************/ 1165 1166 /* ResourceType values */ 1167 1168 #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 1169 #define ACPI_ADDRESS_TYPE_IO_RANGE 1 1170 #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 1171 1172 /* Resource descriptor types and masks */ 1173 1174 #define ACPI_RESOURCE_NAME_LARGE 0x80 1175 #define ACPI_RESOURCE_NAME_SMALL 0x00 1176 1177 #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ 1178 #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ 1179 #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ 1180 1181 1182 /* 1183 * Small resource descriptor "names" as defined by the ACPI specification. 1184 * Note: Bits 2:0 are used for the descriptor length 1185 */ 1186 #define ACPI_RESOURCE_NAME_IRQ 0x20 1187 #define ACPI_RESOURCE_NAME_DMA 0x28 1188 #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 1189 #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 1190 #define ACPI_RESOURCE_NAME_IO 0x40 1191 #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 1192 #define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 1193 #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 1194 #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 1195 #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 1196 #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 1197 #define ACPI_RESOURCE_NAME_END_TAG 0x78 1198 1199 /* 1200 * Large resource descriptor "names" as defined by the ACPI specification. 1201 * Note: includes the Large Descriptor bit in bit[7] 1202 */ 1203 #define ACPI_RESOURCE_NAME_MEMORY24 0x81 1204 #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 1205 #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 1206 #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 1207 #define ACPI_RESOURCE_NAME_MEMORY32 0x85 1208 #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 1209 #define ACPI_RESOURCE_NAME_ADDRESS32 0x87 1210 #define ACPI_RESOURCE_NAME_ADDRESS16 0x88 1211 #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 1212 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1213 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 1214 #define ACPI_RESOURCE_NAME_GPIO 0x8C 1215 #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1216 #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E 1217 1218 1219 /***************************************************************************** 1220 * 1221 * Miscellaneous 1222 * 1223 ****************************************************************************/ 1224 1225 #define ACPI_ASCII_ZERO 0x30 1226 1227 1228 /***************************************************************************** 1229 * 1230 * Disassembler 1231 * 1232 ****************************************************************************/ 1233 1234 typedef struct acpi_external_list 1235 { 1236 char *Path; 1237 char *InternalPath; 1238 struct acpi_external_list *Next; 1239 UINT32 Value; 1240 UINT16 Length; 1241 UINT8 Type; 1242 UINT8 Flags; 1243 BOOLEAN Resolved; 1244 1245 } ACPI_EXTERNAL_LIST; 1246 1247 /* Values for Flags field above */ 1248 1249 #define ACPI_IPATH_ALLOCATED 0x01 1250 1251 1252 typedef struct acpi_external_file 1253 { 1254 char *Path; 1255 struct acpi_external_file *Next; 1256 1257 } ACPI_EXTERNAL_FILE; 1258 1259 1260 /***************************************************************************** 1261 * 1262 * Debugger 1263 * 1264 ****************************************************************************/ 1265 1266 typedef struct acpi_db_method_info 1267 { 1268 ACPI_HANDLE Method; 1269 ACPI_HANDLE MainThreadGate; 1270 ACPI_HANDLE ThreadCompleteGate; 1271 ACPI_HANDLE InfoGate; 1272 ACPI_THREAD_ID *Threads; 1273 UINT32 NumThreads; 1274 UINT32 NumCreated; 1275 UINT32 NumCompleted; 1276 1277 char *Name; 1278 UINT32 Flags; 1279 UINT32 NumLoops; 1280 char Pathname[128]; 1281 char **Args; 1282 ACPI_OBJECT_TYPE *Types; 1283 1284 /* 1285 * Arguments to be passed to method for the command 1286 * Threads - 1287 * the Number of threads, ID of current thread and 1288 * Index of current thread inside all them created. 1289 */ 1290 char InitArgs; 1291 ACPI_OBJECT_TYPE ArgTypes[4]; 1292 char *Arguments[4]; 1293 char NumThreadsStr[11]; 1294 char IdOfThreadStr[11]; 1295 char IndexOfThreadStr[11]; 1296 1297 } ACPI_DB_METHOD_INFO; 1298 1299 typedef struct acpi_integrity_info 1300 { 1301 UINT32 Nodes; 1302 UINT32 Objects; 1303 1304 } ACPI_INTEGRITY_INFO; 1305 1306 1307 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1308 #define ACPI_DB_CONSOLE_OUTPUT 0x02 1309 #define ACPI_DB_DUPLICATE_OUTPUT 0x03 1310 1311 1312 /***************************************************************************** 1313 * 1314 * Debug 1315 * 1316 ****************************************************************************/ 1317 1318 /* Entry for a memory allocation (debug only) */ 1319 1320 #define ACPI_MEM_MALLOC 0 1321 #define ACPI_MEM_CALLOC 1 1322 #define ACPI_MAX_MODULE_NAME 16 1323 1324 #define ACPI_COMMON_DEBUG_MEM_HEADER \ 1325 struct acpi_debug_mem_block *Previous; \ 1326 struct acpi_debug_mem_block *Next; \ 1327 UINT32 Size; \ 1328 UINT32 Component; \ 1329 UINT32 Line; \ 1330 char Module[ACPI_MAX_MODULE_NAME]; \ 1331 UINT8 AllocType; 1332 1333 typedef struct acpi_debug_mem_header 1334 { 1335 ACPI_COMMON_DEBUG_MEM_HEADER 1336 1337 } ACPI_DEBUG_MEM_HEADER; 1338 1339 typedef struct acpi_debug_mem_block 1340 { 1341 ACPI_COMMON_DEBUG_MEM_HEADER 1342 UINT64 UserSpace; 1343 1344 } ACPI_DEBUG_MEM_BLOCK; 1345 1346 1347 #define ACPI_MEM_LIST_GLOBAL 0 1348 #define ACPI_MEM_LIST_NSNODE 1 1349 #define ACPI_MEM_LIST_MAX 1 1350 #define ACPI_NUM_MEM_LISTS 2 1351 1352 1353 /***************************************************************************** 1354 * 1355 * Info/help support 1356 * 1357 ****************************************************************************/ 1358 1359 typedef struct ah_predefined_name 1360 { 1361 char *Name; 1362 char *Description; 1363 #ifndef ACPI_ASL_COMPILER 1364 char *Action; 1365 #endif 1366 1367 } AH_PREDEFINED_NAME; 1368 1369 #endif /* __ACLOCAL_H__ */ 1370