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