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