Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/drivers/acpi/aclocal.h need to be fixed.

0001 /******************************************************************************
0002  *
0003  * Name: aclocal.h - Internal data types used across the ACPI subsystem
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights.  You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code.  No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision.  In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change.  Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee.  Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution.  In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government.  In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************/
0115 
0116 #ifndef __ACLOCAL_H__
0117 #define __ACLOCAL_H__
0118 
0119 
0120 /* acpisrc:StructDefs -- for acpisrc conversion */
0121 
0122 #define ACPI_SERIALIZED                 0xFF
0123 
0124 typedef UINT32                          ACPI_MUTEX_HANDLE;
0125 #define ACPI_GLOBAL_LOCK                (ACPI_SEMAPHORE) (-1)
0126 
0127 /* Total number of aml opcodes defined */
0128 
0129 #define AML_NUM_OPCODES                 0x7F
0130 
0131 
0132 /* Forward declarations */
0133 
0134 struct acpi_walk_state;
0135 struct acpi_obj_mutex;
0136 union acpi_parse_object;
0137 
0138 
0139 /*****************************************************************************
0140  *
0141  * Mutex typedefs and structs
0142  *
0143  ****************************************************************************/
0144 
0145 
0146 /*
0147  * Predefined handles for the mutex objects used within the subsystem
0148  * All mutex objects are automatically created by AcpiUtMutexInitialize.
0149  *
0150  * The acquire/release ordering protocol is implied via this list. Mutexes
0151  * with a lower value must be acquired before mutexes with a higher value.
0152  *
0153  * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
0154  * table below also!
0155  */
0156 #define ACPI_MTX_INTERPRETER            0   /* AML Interpreter, main lock */
0157 #define ACPI_MTX_NAMESPACE              1   /* ACPI Namespace */
0158 #define ACPI_MTX_TABLES                 2   /* Data for ACPI tables */
0159 #define ACPI_MTX_EVENTS                 3   /* Data for ACPI events */
0160 #define ACPI_MTX_CACHES                 4   /* Internal caches, general purposes */
0161 #define ACPI_MTX_MEMORY                 5   /* Debug memory tracking lists */
0162 #define ACPI_MTX_DEBUG_CMD_COMPLETE     6   /* AML debugger */
0163 #define ACPI_MTX_DEBUG_CMD_READY        7   /* AML debugger */
0164 
0165 #define ACPI_MAX_MUTEX                  7
0166 #define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
0167 
0168 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
0169 #ifdef DEFINE_ACPI_GLOBALS
0170 
0171 /* Debug names for the mutexes above */
0172 
0173 static char                 *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
0174 {
0175     "ACPI_MTX_Interpreter",
0176     "ACPI_MTX_Namespace",
0177     "ACPI_MTX_Tables",
0178     "ACPI_MTX_Events",
0179     "ACPI_MTX_Caches",
0180     "ACPI_MTX_Memory",
0181     "ACPI_MTX_CommandComplete",
0182     "ACPI_MTX_CommandReady"
0183 };
0184 
0185 #endif
0186 #endif
0187 
0188 /* Lock structure for reader/writer interfaces */
0189 
0190 typedef struct acpi_rw_lock
0191 {
0192     ACPI_MUTEX              WriterMutex;
0193     ACPI_MUTEX              ReaderMutex;
0194     UINT32                  NumReaders;
0195 
0196 } ACPI_RW_LOCK;
0197 
0198 
0199 /*
0200  * Predefined handles for spinlocks used within the subsystem.
0201  * These spinlocks are created by AcpiUtMutexInitialize
0202  */
0203 #define ACPI_LOCK_GPES                  0
0204 #define ACPI_LOCK_HARDWARE              1
0205 
0206 #define ACPI_MAX_LOCK                   1
0207 #define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
0208 
0209 
0210 /* This Thread ID means that the mutex is not in use (unlocked) */
0211 
0212 #define ACPI_MUTEX_NOT_ACQUIRED         (ACPI_THREAD_ID) -1
0213 
0214 /* Table for the global mutexes */
0215 
0216 typedef struct acpi_mutex_info
0217 {
0218     ACPI_MUTEX                      Mutex;
0219     UINT32                          UseCount;
0220     ACPI_THREAD_ID                  ThreadId;
0221 
0222 } ACPI_MUTEX_INFO;
0223 
0224 
0225 /* Lock flag parameter for various interfaces */
0226 
0227 #define ACPI_MTX_DO_NOT_LOCK            0
0228 #define ACPI_MTX_LOCK                   1
0229 
0230 
0231 /* Field access granularities */
0232 
0233 #define ACPI_FIELD_BYTE_GRANULARITY     1
0234 #define ACPI_FIELD_WORD_GRANULARITY     2
0235 #define ACPI_FIELD_DWORD_GRANULARITY    4
0236 #define ACPI_FIELD_QWORD_GRANULARITY    8
0237 
0238 
0239 #define ACPI_ENTRY_NOT_FOUND            NULL
0240 
0241 
0242 /*****************************************************************************
0243  *
0244  * Namespace typedefs and structs
0245  *
0246  ****************************************************************************/
0247 
0248 /* Operational modes of the AML interpreter/scanner */
0249 
0250 typedef enum
0251 {
0252     ACPI_IMODE_LOAD_PASS1           = 0x01,
0253     ACPI_IMODE_LOAD_PASS2           = 0x02,
0254     ACPI_IMODE_EXECUTE              = 0x03
0255 
0256 } ACPI_INTERPRETER_MODE;
0257 
0258 
0259 /*
0260  * The Namespace Node describes a named object that appears in the AML.
0261  * DescriptorType is used to differentiate between internal descriptors.
0262  *
0263  * The node is optimized for both 32-bit and 64-bit platforms:
0264  * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
0265  *
0266  * Note: The DescriptorType and Type fields must appear in the identical
0267  * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
0268  * structures.
0269  */
0270 typedef struct acpi_namespace_node
0271 {
0272     union acpi_operand_object       *Object;        /* Interpreter object */
0273     UINT8                           DescriptorType; /* Differentiate object descriptor types */
0274     UINT8                           Type;           /* ACPI Type associated with this name */
0275     UINT8                           Flags;          /* Miscellaneous flags */
0276     ACPI_OWNER_ID                   OwnerId;        /* Node creator */
0277     ACPI_NAME_UNION                 Name;           /* ACPI Name, always 4 chars per ACPI spec */
0278     struct acpi_namespace_node      *Child;         /* First child */
0279     struct acpi_namespace_node      *Peer;          /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
0280 
0281     /*
0282      * The following fields are used by the ASL compiler and disassembler only
0283      */
0284 #ifdef ACPI_LARGE_NAMESPACE_NODE
0285     union acpi_parse_object         *Op;
0286     UINT32                          Value;
0287     UINT32                          Length;
0288 #endif
0289 
0290 } ACPI_NAMESPACE_NODE;
0291 
0292 
0293 /* Namespace Node flags */
0294 
0295 #define ANOBJ_END_OF_PEER_LIST          0x01    /* End-of-list, Peer field points to parent */
0296 #define ANOBJ_TEMPORARY                 0x02    /* Node is create by a method and is temporary */
0297 #define ANOBJ_METHOD_ARG                0x04    /* Node is a method argument */
0298 #define ANOBJ_METHOD_LOCAL              0x08    /* Node is a method local */
0299 #define ANOBJ_SUBTREE_HAS_INI           0x10    /* Used to optimize device initialization */
0300 #define ANOBJ_EVALUATED                 0x20    /* Set on first evaluation of node */
0301 #define ANOBJ_ALLOCATED_BUFFER          0x40    /* Method AML buffer is dynamic (InstallMethod) */
0302 
0303 #define ANOBJ_IS_EXTERNAL               0x08    /* iASL only: This object created via External() */
0304 #define ANOBJ_METHOD_NO_RETVAL          0x10    /* iASL only: Method has no return value */
0305 #define ANOBJ_METHOD_SOME_NO_RETVAL     0x20    /* iASL only: Method has at least one return value */
0306 #define ANOBJ_IS_BIT_OFFSET             0x40    /* iASL only: Reference is a bit offset */
0307 #define ANOBJ_IS_REFERENCED             0x80    /* iASL only: Object was referenced */
0308 
0309 
0310 /* One internal RSDT for table management */
0311 
0312 typedef struct acpi_internal_rsdt
0313 {
0314     ACPI_TABLE_DESC                 *Tables;
0315     UINT32                          Count;
0316     UINT32                          Size;
0317     UINT8                           Flags;
0318 
0319 } ACPI_INTERNAL_RSDT;
0320 
0321 /* Flags for above */
0322 
0323 #define ACPI_ROOT_ORIGIN_UNKNOWN        (0)     /* ~ORIGIN_ALLOCATED */
0324 #define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
0325 #define ACPI_ROOT_ALLOW_RESIZE          (2)
0326 
0327 
0328 /* Predefined (fixed) table indexes */
0329 
0330 #define ACPI_TABLE_INDEX_DSDT           (0)
0331 #define ACPI_TABLE_INDEX_FACS           (1)
0332 
0333 
0334 typedef struct acpi_find_context
0335 {
0336     char                            *SearchFor;
0337     ACPI_HANDLE                     *List;
0338     UINT32                          *Count;
0339 
0340 } ACPI_FIND_CONTEXT;
0341 
0342 
0343 typedef struct acpi_ns_search_data
0344 {
0345     ACPI_NAMESPACE_NODE             *Node;
0346 
0347 } ACPI_NS_SEARCH_DATA;
0348 
0349 
0350 /* Object types used during package copies */
0351 
0352 #define ACPI_COPY_TYPE_SIMPLE           0
0353 #define ACPI_COPY_TYPE_PACKAGE          1
0354 
0355 
0356 /* Info structure used to convert external<->internal namestrings */
0357 
0358 typedef struct acpi_namestring_info
0359 {
0360     const char                      *ExternalName;
0361     const char                      *NextExternalChar;
0362     char                            *InternalName;
0363     UINT32                          Length;
0364     UINT32                          NumSegments;
0365     UINT32                          NumCarats;
0366     BOOLEAN                         FullyQualified;
0367 
0368 } ACPI_NAMESTRING_INFO;
0369 
0370 
0371 /* Field creation info */
0372 
0373 typedef struct acpi_create_field_info
0374 {
0375     ACPI_NAMESPACE_NODE             *RegionNode;
0376     ACPI_NAMESPACE_NODE             *FieldNode;
0377     ACPI_NAMESPACE_NODE             *RegisterNode;
0378     ACPI_NAMESPACE_NODE             *DataRegisterNode;
0379     UINT32                          BankValue;
0380     UINT32                          FieldBitPosition;
0381     UINT32                          FieldBitLength;
0382     UINT8                           FieldFlags;
0383     UINT8                           Attribute;
0384     UINT8                           FieldType;
0385 
0386 } ACPI_CREATE_FIELD_INFO;
0387 
0388 
0389 typedef
0390 ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
0391     struct acpi_walk_state          *WalkState);
0392 
0393 
0394 /*
0395  * Bitmapped ACPI types.  Used internally only
0396  */
0397 #define ACPI_BTYPE_ANY                  0x00000000
0398 #define ACPI_BTYPE_INTEGER              0x00000001
0399 #define ACPI_BTYPE_STRING               0x00000002
0400 #define ACPI_BTYPE_BUFFER               0x00000004
0401 #define ACPI_BTYPE_PACKAGE              0x00000008
0402 #define ACPI_BTYPE_FIELD_UNIT           0x00000010
0403 #define ACPI_BTYPE_DEVICE               0x00000020
0404 #define ACPI_BTYPE_EVENT                0x00000040
0405 #define ACPI_BTYPE_METHOD               0x00000080
0406 #define ACPI_BTYPE_MUTEX                0x00000100
0407 #define ACPI_BTYPE_REGION               0x00000200
0408 #define ACPI_BTYPE_POWER                0x00000400
0409 #define ACPI_BTYPE_PROCESSOR            0x00000800
0410 #define ACPI_BTYPE_THERMAL              0x00001000
0411 #define ACPI_BTYPE_BUFFER_FIELD         0x00002000
0412 #define ACPI_BTYPE_DDB_HANDLE           0x00004000
0413 #define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
0414 #define ACPI_BTYPE_REFERENCE            0x00010000
0415 #define ACPI_BTYPE_RESOURCE             0x00020000
0416 
0417 #define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
0418 
0419 #define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
0420 #define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
0421 #define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
0422 #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF  /* ARG or LOCAL */
0423 #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
0424 
0425 
0426 /*
0427  * Information structure for ACPI predefined names.
0428  * Each entry in the table contains the following items:
0429  *
0430  * Name                 - The ACPI reserved name
0431  * ParamCount           - Number of arguments to the method
0432  * ExpectedReturnBtypes - Allowed type(s) for the return value
0433  */
0434 typedef struct acpi_name_info
0435 {
0436     char                        Name[ACPI_NAME_SIZE];
0437     UINT8                       ParamCount;
0438     UINT8                       ExpectedBtypes;
0439 
0440 } ACPI_NAME_INFO;
0441 
0442 /*
0443  * Secondary information structures for ACPI predefined objects that return
0444  * package objects. This structure appears as the next entry in the table
0445  * after the NAME_INFO structure above.
0446  *
0447  * The reason for this is to minimize the size of the predefined name table.
0448  */
0449 
0450 /*
0451  * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
0452  * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
0453  */
0454 typedef struct acpi_package_info
0455 {
0456     UINT8                       Type;
0457     UINT8                       ObjectType1;
0458     UINT8                       Count1;
0459     UINT8                       ObjectType2;
0460     UINT8                       Count2;
0461     UINT8                       Reserved;
0462 
0463 } ACPI_PACKAGE_INFO;
0464 
0465 /* Used for ACPI_PTYPE2_FIXED */
0466 
0467 typedef struct acpi_package_info2
0468 {
0469     UINT8                       Type;
0470     UINT8                       Count;
0471     UINT8                       ObjectType[4];
0472 
0473 } ACPI_PACKAGE_INFO2;
0474 
0475 /* Used for ACPI_PTYPE1_OPTION */
0476 
0477 typedef struct acpi_package_info3
0478 {
0479     UINT8                       Type;
0480     UINT8                       Count;
0481     UINT8                       ObjectType[2];
0482     UINT8                       TailObjectType;
0483     UINT8                       Reserved;
0484 
0485 } ACPI_PACKAGE_INFO3;
0486 
0487 typedef union acpi_predefined_info
0488 {
0489     ACPI_NAME_INFO              Info;
0490     ACPI_PACKAGE_INFO           RetInfo;
0491     ACPI_PACKAGE_INFO2          RetInfo2;
0492     ACPI_PACKAGE_INFO3          RetInfo3;
0493 
0494 } ACPI_PREDEFINED_INFO;
0495 
0496 
0497 /* Data block used during object validation */
0498 
0499 typedef struct acpi_predefined_data
0500 {
0501     char                        *Pathname;
0502     const ACPI_PREDEFINED_INFO  *Predefined;
0503     UINT32                      Flags;
0504     UINT8                       NodeFlags;
0505 
0506 } ACPI_PREDEFINED_DATA;
0507 
0508 /* Defines for Flags field above */
0509 
0510 #define ACPI_OBJECT_REPAIRED    1
0511 
0512 
0513 /*
0514  * Bitmapped return value types
0515  * Note: the actual data types must be contiguous, a loop in nspredef.c
0516  * depends on this.
0517  */
0518 #define ACPI_RTYPE_ANY                  0x00
0519 #define ACPI_RTYPE_NONE                 0x01
0520 #define ACPI_RTYPE_INTEGER              0x02
0521 #define ACPI_RTYPE_STRING               0x04
0522 #define ACPI_RTYPE_BUFFER               0x08
0523 #define ACPI_RTYPE_PACKAGE              0x10
0524 #define ACPI_RTYPE_REFERENCE            0x20
0525 #define ACPI_RTYPE_ALL                  0x3F
0526 
0527 #define ACPI_NUM_RTYPES                 5   /* Number of actual object types */
0528 
0529 
0530 /*****************************************************************************
0531  *
0532  * Event typedefs and structs
0533  *
0534  ****************************************************************************/
0535 
0536 /* Dispatch info for each GPE -- either a method or handler, cannot be both */
0537 
0538 typedef struct acpi_handler_info
0539 {
0540     ACPI_EVENT_HANDLER              Address;        /* Address of handler, if any */
0541     void                            *Context;       /* Context to be passed to handler */
0542     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level (saved) */
0543 
0544 } ACPI_HANDLER_INFO;
0545 
0546 typedef union acpi_gpe_dispatch_info
0547 {
0548     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level */
0549     struct acpi_handler_info        *Handler;
0550 
0551 } ACPI_GPE_DISPATCH_INFO;
0552 
0553 /*
0554  * Information about a GPE, one per each GPE in an array.
0555  * NOTE: Important to keep this struct as small as possible.
0556  */
0557 typedef struct acpi_gpe_event_info
0558 {
0559     union acpi_gpe_dispatch_info    Dispatch;       /* Either Method or Handler */
0560     struct acpi_gpe_register_info   *RegisterInfo;  /* Backpointer to register info */
0561     UINT8                           Flags;          /* Misc info about this GPE */
0562     UINT8                           GpeNumber;      /* This GPE */
0563 
0564 } ACPI_GPE_EVENT_INFO;
0565 
0566 /* Information about a GPE register pair, one per each status/enable pair in an array */
0567 
0568 typedef struct acpi_gpe_register_info
0569 {
0570     ACPI_GENERIC_ADDRESS            StatusAddress;  /* Address of status reg */
0571     ACPI_GENERIC_ADDRESS            EnableAddress;  /* Address of enable reg */
0572     UINT8                           EnableForWake;  /* GPEs to keep enabled when sleeping */
0573     UINT8                           EnableForRun;   /* GPEs to keep enabled when running */
0574     UINT8                           BaseGpeNumber;  /* Base GPE number for this register */
0575 
0576 } ACPI_GPE_REGISTER_INFO;
0577 
0578 /*
0579  * Information about a GPE register block, one per each installed block --
0580  * GPE0, GPE1, and one per each installed GPE Block Device.
0581  */
0582 typedef struct acpi_gpe_block_info
0583 {
0584     ACPI_NAMESPACE_NODE             *Node;
0585     struct acpi_gpe_block_info      *Previous;
0586     struct acpi_gpe_block_info      *Next;
0587     struct acpi_gpe_xrupt_info      *XruptBlock;    /* Backpointer to interrupt block */
0588     ACPI_GPE_REGISTER_INFO          *RegisterInfo;  /* One per GPE register pair */
0589     ACPI_GPE_EVENT_INFO             *EventInfo;     /* One for each GPE */
0590     ACPI_GENERIC_ADDRESS            BlockAddress;   /* Base address of the block */
0591     UINT32                          RegisterCount;  /* Number of register pairs in block */
0592     UINT8                           BlockBaseNumber;/* Base GPE number for this block */
0593 
0594 } ACPI_GPE_BLOCK_INFO;
0595 
0596 /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
0597 
0598 typedef struct acpi_gpe_xrupt_info
0599 {
0600     struct acpi_gpe_xrupt_info      *Previous;
0601     struct acpi_gpe_xrupt_info      *Next;
0602     ACPI_GPE_BLOCK_INFO             *GpeBlockListHead;  /* List of GPE blocks for this xrupt */
0603     UINT32                          InterruptNumber;    /* System interrupt number */
0604 
0605 } ACPI_GPE_XRUPT_INFO;
0606 
0607 typedef struct acpi_gpe_walk_info
0608 {
0609     ACPI_NAMESPACE_NODE             *GpeDevice;
0610     ACPI_GPE_BLOCK_INFO             *GpeBlock;
0611 
0612 } ACPI_GPE_WALK_INFO;
0613 
0614 typedef struct acpi_gpe_device_info
0615 {
0616     UINT32                          Index;
0617     UINT32                          NextBlockBaseIndex;
0618     ACPI_STATUS                     Status;
0619     ACPI_NAMESPACE_NODE             *GpeDevice;
0620 
0621 } ACPI_GPE_DEVICE_INFO;
0622 
0623 typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
0624     ACPI_GPE_XRUPT_INFO             *GpeXruptInfo,
0625     ACPI_GPE_BLOCK_INFO             *GpeBlock,
0626     void                            *Context);
0627 
0628 
0629 /* Information about each particular fixed event */
0630 
0631 typedef struct acpi_fixed_event_handler
0632 {
0633     ACPI_EVENT_HANDLER              Handler;        /* Address of handler. */
0634     void                            *Context;       /* Context to be passed to handler */
0635 
0636 } ACPI_FIXED_EVENT_HANDLER;
0637 
0638 typedef struct acpi_fixed_event_info
0639 {
0640     UINT8                           StatusRegisterId;
0641     UINT8                           EnableRegisterId;
0642     UINT16                          StatusBitMask;
0643     UINT16                          EnableBitMask;
0644 
0645 } ACPI_FIXED_EVENT_INFO;
0646 
0647 /* Information used during field processing */
0648 
0649 typedef struct acpi_field_info
0650 {
0651     UINT8                           SkipField;
0652     UINT8                           FieldFlag;
0653     UINT32                          PkgLength;
0654 
0655 } ACPI_FIELD_INFO;
0656 
0657 
0658 /*****************************************************************************
0659  *
0660  * Generic "state" object for stacks
0661  *
0662  ****************************************************************************/
0663 
0664 #define ACPI_CONTROL_NORMAL                  0xC0
0665 #define ACPI_CONTROL_CONDITIONAL_EXECUTING   0xC1
0666 #define ACPI_CONTROL_PREDICATE_EXECUTING     0xC2
0667 #define ACPI_CONTROL_PREDICATE_FALSE         0xC3
0668 #define ACPI_CONTROL_PREDICATE_TRUE          0xC4
0669 
0670 
0671 #define ACPI_STATE_COMMON \
0672     void                            *Next; \
0673     UINT8                           DescriptorType; /* To differentiate various internal objs */\
0674     UINT8                           Flags; \
0675     UINT16                          Value; \
0676     UINT16                          State;
0677 
0678     /* There are 2 bytes available here until the next natural alignment boundary */
0679 
0680 typedef struct acpi_common_state
0681 {
0682     ACPI_STATE_COMMON
0683 } ACPI_COMMON_STATE;
0684 
0685 
0686 /*
0687  * Update state - used to traverse complex objects such as packages
0688  */
0689 typedef struct acpi_update_state
0690 {
0691     ACPI_STATE_COMMON
0692     union acpi_operand_object       *Object;
0693 
0694 } ACPI_UPDATE_STATE;
0695 
0696 
0697 /*
0698  * Pkg state - used to traverse nested package structures
0699  */
0700 typedef struct acpi_pkg_state
0701 {
0702     ACPI_STATE_COMMON
0703     UINT16                          Index;
0704     union acpi_operand_object       *SourceObject;
0705     union acpi_operand_object       *DestObject;
0706     struct acpi_walk_state          *WalkState;
0707     void                            *ThisTargetObj;
0708     UINT32                          NumPackages;
0709 
0710 } ACPI_PKG_STATE;
0711 
0712 
0713 /*
0714  * Control state - one per if/else and while constructs.
0715  * Allows nesting of these constructs
0716  */
0717 typedef struct acpi_control_state
0718 {
0719     ACPI_STATE_COMMON
0720     UINT16                          Opcode;
0721     union acpi_parse_object         *PredicateOp;
0722     UINT8                           *AmlPredicateStart;     /* Start of if/while predicate */
0723     UINT8                           *PackageEnd;            /* End of if/while block */
0724     UINT32                          LoopCount;              /* While() loop counter */
0725 
0726 } ACPI_CONTROL_STATE;
0727 
0728 
0729 /*
0730  * Scope state - current scope during namespace lookups
0731  */
0732 typedef struct acpi_scope_state
0733 {
0734     ACPI_STATE_COMMON
0735     ACPI_NAMESPACE_NODE             *Node;
0736 
0737 } ACPI_SCOPE_STATE;
0738 
0739 
0740 typedef struct acpi_pscope_state
0741 {
0742     ACPI_STATE_COMMON
0743     UINT32                          ArgCount;               /* Number of fixed arguments */
0744     union acpi_parse_object         *Op;                    /* Current op being parsed */
0745     UINT8                           *ArgEnd;                /* Current argument end */
0746     UINT8                           *PkgEnd;                /* Current package end */
0747     UINT32                          ArgList;                /* Next argument to parse */
0748 
0749 } ACPI_PSCOPE_STATE;
0750 
0751 
0752 /*
0753  * Thread state - one per thread across multiple walk states.  Multiple walk
0754  * states are created when there are nested control methods executing.
0755  */
0756 typedef struct acpi_thread_state
0757 {
0758     ACPI_STATE_COMMON
0759     UINT8                           CurrentSyncLevel;       /* Mutex Sync (nested acquire) level */
0760     struct acpi_walk_state          *WalkStateList;         /* Head of list of WalkStates for this thread */
0761     union acpi_operand_object       *AcquiredMutexList;     /* List of all currently acquired mutexes */
0762     ACPI_THREAD_ID                  ThreadId;               /* Running thread ID */
0763 
0764 } ACPI_THREAD_STATE;
0765 
0766 
0767 /*
0768  * Result values - used to accumulate the results of nested
0769  * AML arguments
0770  */
0771 typedef struct acpi_result_values
0772 {
0773     ACPI_STATE_COMMON
0774     union acpi_operand_object       *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM];
0775 
0776 } ACPI_RESULT_VALUES;
0777 
0778 
0779 typedef
0780 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
0781     struct acpi_walk_state          *WalkState,
0782     union acpi_parse_object         **OutOp);
0783 
0784 typedef
0785 ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
0786     struct acpi_walk_state          *WalkState);
0787 
0788 
0789 /*
0790  * Notify info - used to pass info to the deferred notify
0791  * handler/dispatcher.
0792  */
0793 typedef struct acpi_notify_info
0794 {
0795     ACPI_STATE_COMMON
0796     ACPI_NAMESPACE_NODE             *Node;
0797     union acpi_operand_object       *HandlerObj;
0798 
0799 } ACPI_NOTIFY_INFO;
0800 
0801 
0802 /* Generic state is union of structs above */
0803 
0804 typedef union acpi_generic_state
0805 {
0806     ACPI_COMMON_STATE               Common;
0807     ACPI_CONTROL_STATE              Control;
0808     ACPI_UPDATE_STATE               Update;
0809     ACPI_SCOPE_STATE                Scope;
0810     ACPI_PSCOPE_STATE               ParseScope;
0811     ACPI_PKG_STATE                  Pkg;
0812     ACPI_THREAD_STATE               Thread;
0813     ACPI_RESULT_VALUES              Results;
0814     ACPI_NOTIFY_INFO                Notify;
0815 
0816 } ACPI_GENERIC_STATE;
0817 
0818 
0819 /*****************************************************************************
0820  *
0821  * Interpreter typedefs and structs
0822  *
0823  ****************************************************************************/
0824 
0825 typedef
0826 ACPI_STATUS (*ACPI_EXECUTE_OP) (
0827     struct acpi_walk_state          *WalkState);
0828 
0829 
0830 /*****************************************************************************
0831  *
0832  * Parser typedefs and structs
0833  *
0834  ****************************************************************************/
0835 
0836 /*
0837  * AML opcode, name, and argument layout
0838  */
0839 typedef struct acpi_opcode_info
0840 {
0841 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
0842     char                            *Name;          /* Opcode name (disassembler/debug only) */
0843 #endif
0844     UINT32                          ParseArgs;      /* Grammar/Parse time arguments */
0845     UINT32                          RuntimeArgs;    /* Interpret time arguments */
0846     UINT16                          Flags;          /* Misc flags */
0847     UINT8                           ObjectType;     /* Corresponding internal object type */
0848     UINT8                           Class;          /* Opcode class */
0849     UINT8                           Type;           /* Opcode type */
0850 
0851 } ACPI_OPCODE_INFO;
0852 
0853 typedef union acpi_parse_value
0854 {
0855     ACPI_INTEGER                    Integer;        /* Integer constant (Up to 64 bits) */
0856     UINT64_STRUCT                   Integer64;      /* Structure overlay for 2 32-bit Dwords */
0857     UINT32                          Size;           /* bytelist or field size */
0858     char                            *String;        /* NULL terminated string */
0859     UINT8                           *Buffer;        /* buffer or string */
0860     char                            *Name;          /* NULL terminated string */
0861     union acpi_parse_object         *Arg;           /* arguments and contained ops */
0862 
0863 } ACPI_PARSE_VALUE;
0864 
0865 
0866 #ifdef ACPI_DISASSEMBLER
0867 #define ACPI_DISASM_ONLY_MEMBERS(a)     a;
0868 #else
0869 #define ACPI_DISASM_ONLY_MEMBERS(a)
0870 #endif
0871 
0872 #define ACPI_PARSE_COMMON \
0873     union acpi_parse_object         *Parent;        /* Parent op */\
0874     UINT8                           DescriptorType; /* To differentiate various internal objs */\
0875     UINT8                           Flags;          /* Type of Op */\
0876     UINT16                          AmlOpcode;      /* AML opcode */\
0877     UINT32                          AmlOffset;      /* Offset of declaration in AML */\
0878     union acpi_parse_object         *Next;          /* Next op */\
0879     ACPI_NAMESPACE_NODE             *Node;          /* For use by interpreter */\
0880     ACPI_PARSE_VALUE                Value;          /* Value or args associated with the opcode */\
0881     UINT8                           ArgListLength;  /* Number of elements in the arg list */\
0882     ACPI_DISASM_ONLY_MEMBERS (\
0883     UINT8                           DisasmFlags;    /* Used during AML disassembly */\
0884     UINT8                           DisasmOpcode;   /* Subtype used for disassembly */\
0885     char                            AmlOpName[16])  /* Op name (debug only) */
0886 
0887 
0888 #define ACPI_DASM_BUFFER                0x00
0889 #define ACPI_DASM_RESOURCE              0x01
0890 #define ACPI_DASM_STRING                0x02
0891 #define ACPI_DASM_UNICODE               0x03
0892 #define ACPI_DASM_EISAID                0x04
0893 #define ACPI_DASM_MATCHOP               0x05
0894 #define ACPI_DASM_LNOT_PREFIX           0x06
0895 #define ACPI_DASM_LNOT_SUFFIX           0x07
0896 #define ACPI_DASM_IGNORE                0x08
0897 
0898 /*
0899  * Generic operation (for example:  If, While, Store)
0900  */
0901 typedef struct acpi_parse_obj_common
0902 {
0903     ACPI_PARSE_COMMON
0904 } ACPI_PARSE_OBJ_COMMON;
0905 
0906 
0907 /*
0908  * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
0909  * and bytelists.
0910  */
0911 typedef struct acpi_parse_obj_named
0912 {
0913     ACPI_PARSE_COMMON
0914     UINT8                           *Path;
0915     UINT8                           *Data;          /* AML body or bytelist data */
0916     UINT32                          Length;         /* AML length */
0917     UINT32                          Name;           /* 4-byte name or zero if no name */
0918 
0919 } ACPI_PARSE_OBJ_NAMED;
0920 
0921 
0922 /* This version is used by the iASL compiler only */
0923 
0924 #define ACPI_MAX_PARSEOP_NAME   20
0925 
0926 typedef struct acpi_parse_obj_asl
0927 {
0928     ACPI_PARSE_COMMON
0929     union acpi_parse_object         *Child;
0930     union acpi_parse_object         *ParentMethod;
0931     char                            *Filename;
0932     char                            *ExternalName;
0933     char                            *Namepath;
0934     char                            NameSeg[4];
0935     UINT32                          ExtraValue;
0936     UINT32                          Column;
0937     UINT32                          LineNumber;
0938     UINT32                          LogicalLineNumber;
0939     UINT32                          LogicalByteOffset;
0940     UINT32                          EndLine;
0941     UINT32                          EndLogicalLine;
0942     UINT32                          AcpiBtype;
0943     UINT32                          AmlLength;
0944     UINT32                          AmlSubtreeLength;
0945     UINT32                          FinalAmlLength;
0946     UINT32                          FinalAmlOffset;
0947     UINT32                          CompileFlags;
0948     UINT16                          ParseOpcode;
0949     UINT8                           AmlOpcodeLength;
0950     UINT8                           AmlPkgLenBytes;
0951     UINT8                           Extra;
0952     char                            ParseOpName[ACPI_MAX_PARSEOP_NAME];
0953 
0954 } ACPI_PARSE_OBJ_ASL;
0955 
0956 typedef union acpi_parse_object
0957 {
0958     ACPI_PARSE_OBJ_COMMON           Common;
0959     ACPI_PARSE_OBJ_NAMED            Named;
0960     ACPI_PARSE_OBJ_ASL              Asl;
0961 
0962 } ACPI_PARSE_OBJECT;
0963 
0964 
0965 /*
0966  * Parse state - one state per parser invocation and each control
0967  * method.
0968  */
0969 typedef struct acpi_parse_state
0970 {
0971     UINT8                           *AmlStart;      /* First AML byte */
0972     UINT8                           *Aml;           /* Next AML byte */
0973     UINT8                           *AmlEnd;        /* (last + 1) AML byte */
0974     UINT8                           *PkgStart;      /* Current package begin */
0975     UINT8                           *PkgEnd;        /* Current package end */
0976     union acpi_parse_object         *StartOp;       /* Root of parse tree */
0977     struct acpi_namespace_node      *StartNode;
0978     union acpi_generic_state        *Scope;         /* Current scope */
0979     union acpi_parse_object         *StartScope;
0980     UINT32                          AmlSize;
0981 
0982 } ACPI_PARSE_STATE;
0983 
0984 
0985 /* Parse object flags */
0986 
0987 #define ACPI_PARSEOP_GENERIC            0x01
0988 #define ACPI_PARSEOP_NAMED              0x02
0989 #define ACPI_PARSEOP_DEFERRED           0x04
0990 #define ACPI_PARSEOP_BYTELIST           0x08
0991 #define ACPI_PARSEOP_IN_STACK           0x10
0992 #define ACPI_PARSEOP_TARGET             0x20
0993 #define ACPI_PARSEOP_IN_CACHE           0x80
0994 
0995 /* Parse object DisasmFlags */
0996 
0997 #define ACPI_PARSEOP_IGNORE             0x01
0998 #define ACPI_PARSEOP_PARAMLIST          0x02
0999 #define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
1000 #define ACPI_PARSEOP_SPECIAL            0x10
1001 
1002 
1003 /*****************************************************************************
1004  *
1005  * Hardware (ACPI registers) and PNP
1006  *
1007  ****************************************************************************/
1008 
1009 typedef struct acpi_bit_register_info
1010 {
1011     UINT8                           ParentRegister;
1012     UINT8                           BitPosition;
1013     UINT16                          AccessBitMask;
1014 
1015 } ACPI_BIT_REGISTER_INFO;
1016 
1017 
1018 /*
1019  * Some ACPI registers have bits that must be ignored -- meaning that they
1020  * must be preserved.
1021  */
1022 #define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800  /* Bit 11 */
1023 
1024 /* Write-only bits must be zeroed by software */
1025 
1026 #define ACPI_PM1_CONTROL_WRITEONLY_BITS         0x2004  /* Bits 13, 2 */
1027 
1028 /* For control registers, both ignored and reserved bits must be preserved */
1029 
1030 /*
1031  * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
1032  * ACPI specification to be a "preserved" bit - "OSPM always preserves this
1033  * bit position", section 4.7.3.2.1. However, on some machines the OS must
1034  * write a one to this bit after resume for the machine to work properly.
1035  * To enable this, we no longer attempt to preserve this bit. No machines
1036  * are known to fail if the bit is not preserved. (May 2009)
1037  */
1038 #define ACPI_PM1_CONTROL_IGNORED_BITS           0x0200  /* Bit 9 */
1039 #define ACPI_PM1_CONTROL_RESERVED_BITS          0xC1F8  /* Bits 14-15, 3-8 */
1040 #define ACPI_PM1_CONTROL_PRESERVED_BITS \
1041          (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
1042 
1043 #define ACPI_PM2_CONTROL_PRESERVED_BITS         0xFFFFFFFE /* All except bit 0 */
1044 
1045 /*
1046  * Register IDs
1047  * These are the full ACPI registers
1048  */
1049 #define ACPI_REGISTER_PM1_STATUS                0x01
1050 #define ACPI_REGISTER_PM1_ENABLE                0x02
1051 #define ACPI_REGISTER_PM1_CONTROL               0x03
1052 #define ACPI_REGISTER_PM2_CONTROL               0x04
1053 #define ACPI_REGISTER_PM_TIMER                  0x05
1054 #define ACPI_REGISTER_PROCESSOR_BLOCK           0x06
1055 #define ACPI_REGISTER_SMI_COMMAND_BLOCK         0x07
1056 
1057 
1058 /* Masks used to access the BitRegisters */
1059 
1060 #define ACPI_BITMASK_TIMER_STATUS               0x0001
1061 #define ACPI_BITMASK_BUS_MASTER_STATUS          0x0010
1062 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS         0x0020
1063 #define ACPI_BITMASK_POWER_BUTTON_STATUS        0x0100
1064 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS        0x0200
1065 #define ACPI_BITMASK_RT_CLOCK_STATUS            0x0400
1066 #define ACPI_BITMASK_PCIEXP_WAKE_STATUS         0x4000    /* ACPI 3.0 */
1067 #define ACPI_BITMASK_WAKE_STATUS                0x8000
1068 
1069 #define ACPI_BITMASK_ALL_FIXED_STATUS           (\
1070     ACPI_BITMASK_TIMER_STATUS          | \
1071     ACPI_BITMASK_BUS_MASTER_STATUS     | \
1072     ACPI_BITMASK_GLOBAL_LOCK_STATUS    | \
1073     ACPI_BITMASK_POWER_BUTTON_STATUS   | \
1074     ACPI_BITMASK_SLEEP_BUTTON_STATUS   | \
1075     ACPI_BITMASK_RT_CLOCK_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 
1131 #define ACPI_ALWAYS_ILLEGAL             0x00
1132 
1133 typedef struct acpi_interface_info
1134 {
1135     char                    *Name;
1136     UINT8                   Value;
1137 
1138 } ACPI_INTERFACE_INFO;
1139 
1140 typedef struct acpi_port_info
1141 {
1142     char                    *Name;
1143     UINT16                  Start;
1144     UINT16                  End;
1145     UINT8                   OsiDependency;
1146 
1147 } ACPI_PORT_INFO;
1148 
1149 
1150 /*****************************************************************************
1151  *
1152  * Resource descriptors
1153  *
1154  ****************************************************************************/
1155 
1156 /* ResourceType values */
1157 
1158 #define ACPI_ADDRESS_TYPE_MEMORY_RANGE          0
1159 #define ACPI_ADDRESS_TYPE_IO_RANGE              1
1160 #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE      2
1161 
1162 /* Resource descriptor types and masks */
1163 
1164 #define ACPI_RESOURCE_NAME_LARGE                0x80
1165 #define ACPI_RESOURCE_NAME_SMALL                0x00
1166 
1167 #define ACPI_RESOURCE_NAME_SMALL_MASK           0x78 /* Bits 6:3 contain the type */
1168 #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK    0x07 /* Bits 2:0 contain the length */
1169 #define ACPI_RESOURCE_NAME_LARGE_MASK           0x7F /* Bits 6:0 contain the type */
1170 
1171 
1172 /*
1173  * Small resource descriptor "names" as defined by the ACPI specification.
1174  * Note: Bits 2:0 are used for the descriptor length
1175  */
1176 #define ACPI_RESOURCE_NAME_IRQ                  0x20
1177 #define ACPI_RESOURCE_NAME_DMA                  0x28
1178 #define ACPI_RESOURCE_NAME_START_DEPENDENT      0x30
1179 #define ACPI_RESOURCE_NAME_END_DEPENDENT        0x38
1180 #define ACPI_RESOURCE_NAME_IO                   0x40
1181 #define ACPI_RESOURCE_NAME_FIXED_IO             0x48
1182 #define ACPI_RESOURCE_NAME_RESERVED_S1          0x50
1183 #define ACPI_RESOURCE_NAME_RESERVED_S2          0x58
1184 #define ACPI_RESOURCE_NAME_RESERVED_S3          0x60
1185 #define ACPI_RESOURCE_NAME_RESERVED_S4          0x68
1186 #define ACPI_RESOURCE_NAME_VENDOR_SMALL         0x70
1187 #define ACPI_RESOURCE_NAME_END_TAG              0x78
1188 
1189 /*
1190  * Large resource descriptor "names" as defined by the ACPI specification.
1191  * Note: includes the Large Descriptor bit in bit[7]
1192  */
1193 #define ACPI_RESOURCE_NAME_MEMORY24             0x81
1194 #define ACPI_RESOURCE_NAME_GENERIC_REGISTER     0x82
1195 #define ACPI_RESOURCE_NAME_RESERVED_L1          0x83
1196 #define ACPI_RESOURCE_NAME_VENDOR_LARGE         0x84
1197 #define ACPI_RESOURCE_NAME_MEMORY32             0x85
1198 #define ACPI_RESOURCE_NAME_FIXED_MEMORY32       0x86
1199 #define ACPI_RESOURCE_NAME_ADDRESS32            0x87
1200 #define ACPI_RESOURCE_NAME_ADDRESS16            0x88
1201 #define ACPI_RESOURCE_NAME_EXTENDED_IRQ         0x89
1202 #define ACPI_RESOURCE_NAME_ADDRESS64            0x8A
1203 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64   0x8B
1204 #define ACPI_RESOURCE_NAME_LARGE_MAX            0x8B
1205 
1206 
1207 /*****************************************************************************
1208  *
1209  * Miscellaneous
1210  *
1211  ****************************************************************************/
1212 
1213 #define ACPI_ASCII_ZERO                 0x30
1214 
1215 
1216 /*****************************************************************************
1217  *
1218  * Debugger
1219  *
1220  ****************************************************************************/
1221 
1222 typedef struct acpi_db_method_info
1223 {
1224     ACPI_HANDLE                     MainThreadGate;
1225     ACPI_HANDLE                     ThreadCompleteGate;
1226     ACPI_HANDLE                     InfoGate;
1227     UINT32                          *Threads;
1228     UINT32                          NumThreads;
1229     UINT32                          NumCreated;
1230     UINT32                          NumCompleted;
1231 
1232     char                            *Name;
1233     UINT32                          Flags;
1234     UINT32                          NumLoops;
1235     char                            Pathname[128];
1236     char                            **Args;
1237 
1238     /*
1239      * Arguments to be passed to method for the command
1240      * Threads -
1241      *   the Number of threads, ID of current thread and
1242      *   Index of current thread inside all them created.
1243      */
1244     char                            InitArgs;
1245     char                            *Arguments[4];
1246     char                            NumThreadsStr[11];
1247     char                            IdOfThreadStr[11];
1248     char                            IndexOfThreadStr[11];
1249 
1250 } ACPI_DB_METHOD_INFO;
1251 
1252 typedef struct acpi_integrity_info
1253 {
1254     UINT32                          Nodes;
1255     UINT32                          Objects;
1256 
1257 } ACPI_INTEGRITY_INFO;
1258 
1259 
1260 #define ACPI_DB_REDIRECTABLE_OUTPUT     0x01
1261 #define ACPI_DB_CONSOLE_OUTPUT          0x02
1262 #define ACPI_DB_DUPLICATE_OUTPUT        0x03
1263 
1264 
1265 /*****************************************************************************
1266  *
1267  * Debug
1268  *
1269  ****************************************************************************/
1270 
1271 /* Entry for a memory allocation (debug only) */
1272 
1273 #define ACPI_MEM_MALLOC                 0
1274 #define ACPI_MEM_CALLOC                 1
1275 #define ACPI_MAX_MODULE_NAME            16
1276 
1277 #define ACPI_COMMON_DEBUG_MEM_HEADER \
1278     struct acpi_debug_mem_block     *Previous; \
1279     struct acpi_debug_mem_block     *Next; \
1280     UINT32                          Size; \
1281     UINT32                          Component; \
1282     UINT32                          Line; \
1283     char                            Module[ACPI_MAX_MODULE_NAME]; \
1284     UINT8                           AllocType;
1285 
1286 typedef struct acpi_debug_mem_header
1287 {
1288     ACPI_COMMON_DEBUG_MEM_HEADER
1289 
1290 } ACPI_DEBUG_MEM_HEADER;
1291 
1292 typedef struct acpi_debug_mem_block
1293 {
1294     ACPI_COMMON_DEBUG_MEM_HEADER
1295     UINT64                          UserSpace;
1296 
1297 } ACPI_DEBUG_MEM_BLOCK;
1298 
1299 
1300 #define ACPI_MEM_LIST_GLOBAL            0
1301 #define ACPI_MEM_LIST_NSNODE            1
1302 #define ACPI_MEM_LIST_MAX               1
1303 #define ACPI_NUM_MEM_LISTS              2
1304 
1305 
1306 #endif /* __ACLOCAL_H__ */