Home | History | Annotate | Line # | Download | only in include
      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.27  christos /******************************************************************************
      8  1.27  christos  *
      9  1.27  christos  * 1. Copyright Notice
     10  1.27  christos  *
     11  1.28  christos  * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
     12   1.1    jruoho  * All rights reserved.
     13   1.1    jruoho  *
     14  1.27  christos  * 2. License
     15  1.27  christos  *
     16  1.27  christos  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.27  christos  * rights. You may have additional license terms from the party that provided
     18  1.27  christos  * you this software, covering your right to use that party's intellectual
     19  1.27  christos  * property rights.
     20  1.27  christos  *
     21  1.27  christos  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.27  christos  * copy of the source code appearing in this file ("Covered Code") an
     23  1.27  christos  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.27  christos  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.27  christos  * make derivatives, distribute, use and display any portion of the Covered
     26  1.27  christos  * Code in any form, with the right to sublicense such rights; and
     27  1.27  christos  *
     28  1.27  christos  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.27  christos  * license (with the right to sublicense), under only those claims of Intel
     30  1.27  christos  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.27  christos  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.27  christos  * solely to the minimum extent necessary to exercise the above copyright
     33  1.27  christos  * license, and in no event shall the patent license extend to any additions
     34  1.27  christos  * to or modifications of the Original Intel Code. No other license or right
     35  1.27  christos  * is granted directly or by implication, estoppel or otherwise;
     36  1.27  christos  *
     37  1.27  christos  * The above copyright and patent license is granted only if the following
     38  1.27  christos  * conditions are met:
     39  1.27  christos  *
     40  1.27  christos  * 3. Conditions
     41  1.27  christos  *
     42  1.27  christos  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.27  christos  * Redistribution of source code of any substantial portion of the Covered
     44  1.27  christos  * Code or modification with rights to further distribute source must include
     45  1.27  christos  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.27  christos  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.27  christos  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.27  christos  * contain a file documenting the changes Licensee made to create that Covered
     49  1.27  christos  * Code and the date of any change. Licensee must include in that file the
     50  1.27  christos  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.27  christos  * must include a prominent statement that the modification is derived,
     52  1.27  christos  * directly or indirectly, from Original Intel Code.
     53  1.27  christos  *
     54  1.27  christos  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.27  christos  * Redistribution of source code of any substantial portion of the Covered
     56  1.27  christos  * Code or modification without rights to further distribute source must
     57  1.27  christos  * include the following Disclaimer and Export Compliance provision in the
     58  1.27  christos  * documentation and/or other materials provided with distribution. In
     59  1.27  christos  * addition, Licensee may not authorize further sublicense of source of any
     60  1.27  christos  * portion of the Covered Code, and must include terms to the effect that the
     61  1.27  christos  * license from Licensee to its licensee is limited to the intellectual
     62  1.27  christos  * property embodied in the software Licensee provides to its licensee, and
     63  1.27  christos  * not to intellectual property embodied in modifications its licensee may
     64  1.27  christos  * make.
     65  1.27  christos  *
     66  1.27  christos  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.27  christos  * substantial portion of the Covered Code or modification must reproduce the
     68  1.27  christos  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.27  christos  * provision in the documentation and/or other materials provided with the
     70  1.27  christos  * distribution.
     71  1.27  christos  *
     72  1.27  christos  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.27  christos  * Intel Code.
     74  1.27  christos  *
     75  1.27  christos  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.27  christos  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.27  christos  * other dealings in products derived from or relating to the Covered Code
     78  1.27  christos  * without prior written authorization from Intel.
     79  1.27  christos  *
     80  1.27  christos  * 4. Disclaimer and Export Compliance
     81  1.27  christos  *
     82  1.27  christos  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.27  christos  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.27  christos  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.27  christos  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.27  christos  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.27  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.27  christos  * PARTICULAR PURPOSE.
     89  1.27  christos  *
     90  1.27  christos  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.27  christos  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.27  christos  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.27  christos  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.27  christos  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.27  christos  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.27  christos  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.27  christos  * LIMITED REMEDY.
     98  1.27  christos  *
     99  1.27  christos  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.27  christos  * software or system incorporating such software without first obtaining any
    101  1.27  christos  * required license or other approval from the U. S. Department of Commerce or
    102  1.27  christos  * any other agency or department of the United States Government. In the
    103  1.27  christos  * event Licensee exports any such software from the United States or
    104  1.27  christos  * re-exports any such software from a foreign destination, Licensee shall
    105  1.27  christos  * ensure that the distribution and export/re-export of the software is in
    106  1.27  christos  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.27  christos  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.27  christos  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.27  christos  * software, or service, directly or indirectly, to any country for which the
    110  1.27  christos  * United States government or any agency thereof requires an export license,
    111  1.27  christos  * other governmental approval, or letter of assurance, without first obtaining
    112  1.27  christos  * such license, approval or letter.
    113  1.27  christos  *
    114  1.27  christos  *****************************************************************************
    115  1.27  christos  *
    116  1.27  christos  * Alternatively, you may choose to be licensed under the terms of the
    117  1.27  christos  * following license:
    118  1.27  christos  *
    119   1.3    jruoho  * Redistribution and use in source and binary forms, with or without
    120   1.3    jruoho  * modification, are permitted provided that the following conditions
    121   1.3    jruoho  * are met:
    122   1.3    jruoho  * 1. Redistributions of source code must retain the above copyright
    123   1.3    jruoho  *    notice, this list of conditions, and the following disclaimer,
    124   1.3    jruoho  *    without modification.
    125   1.3    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126   1.3    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
    127   1.3    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
    128   1.3    jruoho  *    including a substantially similar Disclaimer requirement for further
    129   1.3    jruoho  *    binary redistribution.
    130   1.3    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
    131   1.3    jruoho  *    of any contributors may be used to endorse or promote products derived
    132   1.3    jruoho  *    from this software without specific prior written permission.
    133   1.3    jruoho  *
    134   1.3    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135   1.3    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136  1.23  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137   1.3    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.27  christos  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.27  christos  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.27  christos  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.27  christos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.27  christos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.27  christos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.27  christos  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.27  christos  *
    146  1.27  christos  * Alternatively, you may choose to be licensed under the terms of the
    147  1.27  christos  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.27  christos  * Software Foundation.
    149  1.27  christos  *
    150  1.27  christos  *****************************************************************************/
    151   1.1    jruoho 
    152   1.1    jruoho #ifndef __ACLOCAL_H__
    153   1.1    jruoho #define __ACLOCAL_H__
    154   1.1    jruoho 
    155   1.1    jruoho 
    156   1.1    jruoho /* acpisrc:StructDefs -- for acpisrc conversion */
    157   1.1    jruoho 
    158   1.1    jruoho #define ACPI_SERIALIZED                 0xFF
    159   1.1    jruoho 
    160   1.1    jruoho typedef UINT32                          ACPI_MUTEX_HANDLE;
    161   1.1    jruoho #define ACPI_GLOBAL_LOCK                (ACPI_SEMAPHORE) (-1)
    162   1.1    jruoho 
    163   1.1    jruoho /* Total number of aml opcodes defined */
    164   1.1    jruoho 
    165  1.13  christos #define AML_NUM_OPCODES                 0x83
    166   1.1    jruoho 
    167   1.1    jruoho 
    168   1.1    jruoho /* Forward declarations */
    169   1.1    jruoho 
    170   1.1    jruoho struct acpi_walk_state;
    171   1.1    jruoho struct acpi_obj_mutex;
    172   1.1    jruoho union acpi_parse_object;
    173   1.1    jruoho 
    174   1.1    jruoho 
    175   1.1    jruoho /*****************************************************************************
    176   1.1    jruoho  *
    177   1.1    jruoho  * Mutex typedefs and structs
    178   1.1    jruoho  *
    179   1.1    jruoho  ****************************************************************************/
    180   1.1    jruoho 
    181   1.1    jruoho 
    182   1.1    jruoho /*
    183   1.1    jruoho  * Predefined handles for the mutex objects used within the subsystem
    184   1.1    jruoho  * All mutex objects are automatically created by AcpiUtMutexInitialize.
    185   1.1    jruoho  *
    186   1.1    jruoho  * The acquire/release ordering protocol is implied via this list. Mutexes
    187   1.1    jruoho  * with a lower value must be acquired before mutexes with a higher value.
    188   1.1    jruoho  *
    189   1.1    jruoho  * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
    190   1.1    jruoho  * table below also!
    191   1.1    jruoho  */
    192   1.1    jruoho #define ACPI_MTX_INTERPRETER            0   /* AML Interpreter, main lock */
    193   1.1    jruoho #define ACPI_MTX_NAMESPACE              1   /* ACPI Namespace */
    194   1.1    jruoho #define ACPI_MTX_TABLES                 2   /* Data for ACPI tables */
    195   1.1    jruoho #define ACPI_MTX_EVENTS                 3   /* Data for ACPI events */
    196   1.1    jruoho #define ACPI_MTX_CACHES                 4   /* Internal caches, general purposes */
    197   1.1    jruoho #define ACPI_MTX_MEMORY                 5   /* Debug memory tracking lists */
    198   1.1    jruoho 
    199   1.9  christos #define ACPI_MAX_MUTEX                  5
    200  1.10  christos #define ACPI_NUM_MUTEX                  (ACPI_MAX_MUTEX+1)
    201   1.1    jruoho 
    202  1.22       rin 
    203   1.1    jruoho /* Lock structure for reader/writer interfaces */
    204   1.1    jruoho 
    205   1.1    jruoho typedef struct acpi_rw_lock
    206   1.1    jruoho {
    207   1.1    jruoho     ACPI_MUTEX              WriterMutex;
    208   1.1    jruoho     ACPI_MUTEX              ReaderMutex;
    209   1.1    jruoho     UINT32                  NumReaders;
    210   1.1    jruoho 
    211   1.1    jruoho } ACPI_RW_LOCK;
    212   1.1    jruoho 
    213   1.1    jruoho 
    214   1.1    jruoho /*
    215   1.1    jruoho  * Predefined handles for spinlocks used within the subsystem.
    216   1.1    jruoho  * These spinlocks are created by AcpiUtMutexInitialize
    217   1.1    jruoho  */
    218   1.1    jruoho #define ACPI_LOCK_GPES                  0
    219   1.1    jruoho #define ACPI_LOCK_HARDWARE              1
    220   1.1    jruoho 
    221   1.1    jruoho #define ACPI_MAX_LOCK                   1
    222  1.10  christos #define ACPI_NUM_LOCK                   (ACPI_MAX_LOCK+1)
    223   1.1    jruoho 
    224   1.1    jruoho 
    225   1.1    jruoho /* This Thread ID means that the mutex is not in use (unlocked) */
    226   1.1    jruoho 
    227  1.10  christos #define ACPI_MUTEX_NOT_ACQUIRED         ((ACPI_THREAD_ID) -1)
    228   1.1    jruoho 
    229   1.9  christos /* This Thread ID means an invalid thread ID */
    230   1.9  christos 
    231   1.9  christos #ifdef ACPI_OS_INVALID_THREAD_ID
    232   1.9  christos #define ACPI_INVALID_THREAD_ID          ACPI_OS_INVALID_THREAD_ID
    233   1.9  christos #else
    234   1.9  christos #define ACPI_INVALID_THREAD_ID          ((ACPI_THREAD_ID) 0xFFFFFFFF)
    235   1.9  christos #endif
    236   1.9  christos 
    237   1.1    jruoho /* Table for the global mutexes */
    238   1.1    jruoho 
    239   1.1    jruoho typedef struct acpi_mutex_info
    240   1.1    jruoho {
    241   1.1    jruoho     ACPI_MUTEX                      Mutex;
    242   1.1    jruoho     UINT32                          UseCount;
    243   1.1    jruoho     ACPI_THREAD_ID                  ThreadId;
    244   1.1    jruoho 
    245   1.1    jruoho } ACPI_MUTEX_INFO;
    246   1.1    jruoho 
    247   1.1    jruoho 
    248   1.1    jruoho /* Lock flag parameter for various interfaces */
    249   1.1    jruoho 
    250   1.1    jruoho #define ACPI_MTX_DO_NOT_LOCK            0
    251   1.1    jruoho #define ACPI_MTX_LOCK                   1
    252   1.1    jruoho 
    253   1.1    jruoho 
    254   1.1    jruoho /* Field access granularities */
    255   1.1    jruoho 
    256   1.1    jruoho #define ACPI_FIELD_BYTE_GRANULARITY     1
    257   1.1    jruoho #define ACPI_FIELD_WORD_GRANULARITY     2
    258   1.1    jruoho #define ACPI_FIELD_DWORD_GRANULARITY    4
    259   1.1    jruoho #define ACPI_FIELD_QWORD_GRANULARITY    8
    260   1.1    jruoho 
    261   1.1    jruoho 
    262   1.1    jruoho #define ACPI_ENTRY_NOT_FOUND            NULL
    263   1.1    jruoho 
    264   1.1    jruoho 
    265   1.1    jruoho /*****************************************************************************
    266   1.1    jruoho  *
    267   1.1    jruoho  * Namespace typedefs and structs
    268   1.1    jruoho  *
    269   1.1    jruoho  ****************************************************************************/
    270   1.1    jruoho 
    271   1.1    jruoho /* Operational modes of the AML interpreter/scanner */
    272   1.1    jruoho 
    273   1.1    jruoho typedef enum
    274   1.1    jruoho {
    275   1.1    jruoho     ACPI_IMODE_LOAD_PASS1           = 0x01,
    276   1.1    jruoho     ACPI_IMODE_LOAD_PASS2           = 0x02,
    277   1.1    jruoho     ACPI_IMODE_EXECUTE              = 0x03
    278   1.1    jruoho 
    279   1.1    jruoho } ACPI_INTERPRETER_MODE;
    280   1.1    jruoho 
    281   1.1    jruoho 
    282   1.1    jruoho /*
    283   1.1    jruoho  * The Namespace Node describes a named object that appears in the AML.
    284   1.1    jruoho  * DescriptorType is used to differentiate between internal descriptors.
    285   1.1    jruoho  *
    286   1.1    jruoho  * The node is optimized for both 32-bit and 64-bit platforms:
    287   1.1    jruoho  * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
    288   1.1    jruoho  *
    289   1.1    jruoho  * Note: The DescriptorType and Type fields must appear in the identical
    290   1.1    jruoho  * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
    291   1.1    jruoho  * structures.
    292   1.1    jruoho  */
    293   1.1    jruoho typedef struct acpi_namespace_node
    294   1.1    jruoho {
    295   1.1    jruoho     union acpi_operand_object       *Object;        /* Interpreter object */
    296   1.1    jruoho     UINT8                           DescriptorType; /* Differentiate object descriptor types */
    297   1.1    jruoho     UINT8                           Type;           /* ACPI Type associated with this name */
    298  1.20  christos     UINT16                          Flags;          /* Miscellaneous flags */
    299   1.1    jruoho     ACPI_NAME_UNION                 Name;           /* ACPI Name, always 4 chars per ACPI spec */
    300   1.1    jruoho     struct acpi_namespace_node      *Parent;        /* Parent node */
    301   1.1    jruoho     struct acpi_namespace_node      *Child;         /* First child */
    302   1.1    jruoho     struct acpi_namespace_node      *Peer;          /* First peer */
    303  1.20  christos     ACPI_OWNER_ID                   OwnerId;        /* Node creator */
    304   1.1    jruoho 
    305   1.1    jruoho     /*
    306   1.1    jruoho      * The following fields are used by the ASL compiler and disassembler only
    307   1.1    jruoho      */
    308   1.1    jruoho #ifdef ACPI_LARGE_NAMESPACE_NODE
    309   1.1    jruoho     union acpi_parse_object         *Op;
    310   1.8  christos     void                            *MethodLocals;
    311   1.8  christos     void                            *MethodArgs;
    312   1.1    jruoho     UINT32                          Value;
    313   1.1    jruoho     UINT32                          Length;
    314   1.8  christos     UINT8                           ArgCount;
    315   1.8  christos 
    316   1.1    jruoho #endif
    317   1.1    jruoho 
    318   1.1    jruoho } ACPI_NAMESPACE_NODE;
    319   1.1    jruoho 
    320   1.1    jruoho 
    321   1.1    jruoho /* Namespace Node flags */
    322   1.1    jruoho 
    323   1.1    jruoho #define ANOBJ_RESERVED                  0x01    /* Available for use */
    324   1.1    jruoho #define ANOBJ_TEMPORARY                 0x02    /* Node is create by a method and is temporary */
    325   1.1    jruoho #define ANOBJ_METHOD_ARG                0x04    /* Node is a method argument */
    326   1.1    jruoho #define ANOBJ_METHOD_LOCAL              0x08    /* Node is a method local */
    327   1.1    jruoho #define ANOBJ_SUBTREE_HAS_INI           0x10    /* Used to optimize device initialization */
    328   1.1    jruoho #define ANOBJ_EVALUATED                 0x20    /* Set on first evaluation of node */
    329   1.1    jruoho #define ANOBJ_ALLOCATED_BUFFER          0x40    /* Method AML buffer is dynamic (InstallMethod) */
    330  1.17  christos #define ANOBJ_NODE_EARLY_INIT           0x80    /* AcpiExec only: Node was create via init file (-fi) */
    331   1.1    jruoho 
    332   1.1    jruoho #define ANOBJ_IS_EXTERNAL               0x08    /* iASL only: This object created via External() */
    333   1.1    jruoho #define ANOBJ_METHOD_NO_RETVAL          0x10    /* iASL only: Method has no return value */
    334   1.1    jruoho #define ANOBJ_METHOD_SOME_NO_RETVAL     0x20    /* iASL only: Method has at least one return value */
    335   1.1    jruoho #define ANOBJ_IS_REFERENCED             0x80    /* iASL only: Object was referenced */
    336   1.1    jruoho 
    337   1.1    jruoho 
    338   1.1    jruoho /* Internal ACPI table management - master table list */
    339   1.1    jruoho 
    340   1.1    jruoho typedef struct acpi_table_list
    341   1.1    jruoho {
    342   1.1    jruoho     ACPI_TABLE_DESC                 *Tables;            /* Table descriptor array */
    343   1.1    jruoho     UINT32                          CurrentTableCount;  /* Tables currently in the array */
    344   1.1    jruoho     UINT32                          MaxTableCount;      /* Max tables array will hold */
    345   1.1    jruoho     UINT8                           Flags;
    346   1.1    jruoho 
    347   1.1    jruoho } ACPI_TABLE_LIST;
    348   1.1    jruoho 
    349   1.1    jruoho /* Flags for above */
    350   1.1    jruoho 
    351   1.1    jruoho #define ACPI_ROOT_ORIGIN_UNKNOWN        (0)     /* ~ORIGIN_ALLOCATED */
    352   1.1    jruoho #define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
    353   1.1    jruoho #define ACPI_ROOT_ALLOW_RESIZE          (2)
    354   1.1    jruoho 
    355   1.1    jruoho 
    356   1.9  christos /* List to manage incoming ACPI tables */
    357   1.9  christos 
    358   1.9  christos typedef struct acpi_new_table_desc
    359   1.9  christos {
    360   1.9  christos     ACPI_TABLE_HEADER               *Table;
    361   1.9  christos     struct acpi_new_table_desc      *Next;
    362   1.9  christos 
    363   1.9  christos } ACPI_NEW_TABLE_DESC;
    364   1.9  christos 
    365   1.1    jruoho 
    366   1.9  christos /* Predefined table indexes */
    367   1.9  christos 
    368   1.9  christos #define ACPI_INVALID_TABLE_INDEX        (0xFFFFFFFF)
    369   1.1    jruoho 
    370   1.1    jruoho 
    371   1.1    jruoho typedef struct acpi_find_context
    372   1.1    jruoho {
    373   1.1    jruoho     char                            *SearchFor;
    374   1.1    jruoho     ACPI_HANDLE                     *List;
    375   1.1    jruoho     UINT32                          *Count;
    376   1.1    jruoho 
    377   1.1    jruoho } ACPI_FIND_CONTEXT;
    378   1.1    jruoho 
    379   1.1    jruoho 
    380   1.1    jruoho typedef struct acpi_ns_search_data
    381   1.1    jruoho {
    382   1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;
    383   1.1    jruoho 
    384   1.1    jruoho } ACPI_NS_SEARCH_DATA;
    385   1.1    jruoho 
    386   1.1    jruoho 
    387   1.1    jruoho /* Object types used during package copies */
    388   1.1    jruoho 
    389   1.1    jruoho #define ACPI_COPY_TYPE_SIMPLE           0
    390   1.1    jruoho #define ACPI_COPY_TYPE_PACKAGE          1
    391   1.1    jruoho 
    392   1.1    jruoho 
    393   1.1    jruoho /* Info structure used to convert external<->internal namestrings */
    394   1.1    jruoho 
    395   1.1    jruoho typedef struct acpi_namestring_info
    396   1.1    jruoho {
    397   1.1    jruoho     const char                      *ExternalName;
    398   1.1    jruoho     const char                      *NextExternalChar;
    399   1.1    jruoho     char                            *InternalName;
    400   1.1    jruoho     UINT32                          Length;
    401   1.1    jruoho     UINT32                          NumSegments;
    402   1.1    jruoho     UINT32                          NumCarats;
    403   1.1    jruoho     BOOLEAN                         FullyQualified;
    404   1.1    jruoho 
    405   1.1    jruoho } ACPI_NAMESTRING_INFO;
    406   1.1    jruoho 
    407   1.1    jruoho 
    408   1.1    jruoho /* Field creation info */
    409   1.1    jruoho 
    410   1.1    jruoho typedef struct acpi_create_field_info
    411   1.1    jruoho {
    412   1.1    jruoho     ACPI_NAMESPACE_NODE             *RegionNode;
    413   1.1    jruoho     ACPI_NAMESPACE_NODE             *FieldNode;
    414   1.1    jruoho     ACPI_NAMESPACE_NODE             *RegisterNode;
    415   1.1    jruoho     ACPI_NAMESPACE_NODE             *DataRegisterNode;
    416   1.5  christos     ACPI_NAMESPACE_NODE             *ConnectionNode;
    417   1.5  christos     UINT8                           *ResourceBuffer;
    418   1.1    jruoho     UINT32                          BankValue;
    419   1.1    jruoho     UINT32                          FieldBitPosition;
    420   1.1    jruoho     UINT32                          FieldBitLength;
    421   1.5  christos     UINT16                          ResourceLength;
    422   1.6  christos     UINT16                          PinNumberIndex;
    423   1.1    jruoho     UINT8                           FieldFlags;
    424   1.1    jruoho     UINT8                           Attribute;
    425   1.1    jruoho     UINT8                           FieldType;
    426   1.5  christos     UINT8                           AccessLength;
    427   1.1    jruoho 
    428   1.1    jruoho } ACPI_CREATE_FIELD_INFO;
    429   1.1    jruoho 
    430   1.1    jruoho 
    431   1.1    jruoho typedef
    432   1.1    jruoho ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
    433   1.1    jruoho     struct acpi_walk_state          *WalkState);
    434   1.1    jruoho 
    435   1.1    jruoho 
    436   1.1    jruoho /*
    437   1.5  christos  * Bitmapped ACPI types. Used internally only
    438   1.1    jruoho  */
    439   1.1    jruoho #define ACPI_BTYPE_ANY                  0x00000000
    440   1.1    jruoho #define ACPI_BTYPE_INTEGER              0x00000001
    441   1.1    jruoho #define ACPI_BTYPE_STRING               0x00000002
    442   1.1    jruoho #define ACPI_BTYPE_BUFFER               0x00000004
    443   1.1    jruoho #define ACPI_BTYPE_PACKAGE              0x00000008
    444   1.1    jruoho #define ACPI_BTYPE_FIELD_UNIT           0x00000010
    445   1.1    jruoho #define ACPI_BTYPE_DEVICE               0x00000020
    446   1.1    jruoho #define ACPI_BTYPE_EVENT                0x00000040
    447   1.1    jruoho #define ACPI_BTYPE_METHOD               0x00000080
    448   1.1    jruoho #define ACPI_BTYPE_MUTEX                0x00000100
    449   1.1    jruoho #define ACPI_BTYPE_REGION               0x00000200
    450   1.1    jruoho #define ACPI_BTYPE_POWER                0x00000400
    451   1.1    jruoho #define ACPI_BTYPE_PROCESSOR            0x00000800
    452   1.1    jruoho #define ACPI_BTYPE_THERMAL              0x00001000
    453   1.1    jruoho #define ACPI_BTYPE_BUFFER_FIELD         0x00002000
    454   1.1    jruoho #define ACPI_BTYPE_DDB_HANDLE           0x00004000
    455   1.1    jruoho #define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
    456   1.9  christos #define ACPI_BTYPE_REFERENCE_OBJECT     0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */
    457   1.1    jruoho #define ACPI_BTYPE_RESOURCE             0x00020000
    458   1.9  christos #define ACPI_BTYPE_NAMED_REFERENCE      0x00040000 /* Generic unresolved Name or Namepath */
    459   1.1    jruoho 
    460   1.1    jruoho #define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
    461   1.1    jruoho 
    462   1.1    jruoho #define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
    463   1.9  christos 
    464   1.9  christos     /* Used by Copy, DeRefOf, Store, Printf, Fprintf */
    465   1.9  christos 
    466   1.9  christos #define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE)
    467   1.1    jruoho #define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
    468   1.1    jruoho #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF  /* ARG or LOCAL */
    469   1.1    jruoho #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
    470   1.1    jruoho 
    471   1.5  christos #pragma pack(1)
    472   1.1    jruoho 
    473   1.1    jruoho /*
    474   1.1    jruoho  * Information structure for ACPI predefined names.
    475   1.1    jruoho  * Each entry in the table contains the following items:
    476   1.1    jruoho  *
    477   1.1    jruoho  * Name                 - The ACPI reserved name
    478   1.1    jruoho  * ParamCount           - Number of arguments to the method
    479   1.1    jruoho  * ExpectedReturnBtypes - Allowed type(s) for the return value
    480   1.1    jruoho  */
    481   1.1    jruoho typedef struct acpi_name_info
    482   1.1    jruoho {
    483  1.28  christos     char                        Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
    484   1.5  christos     UINT16                      ArgumentList;
    485   1.1    jruoho     UINT8                       ExpectedBtypes;
    486   1.1    jruoho 
    487   1.1    jruoho } ACPI_NAME_INFO;
    488   1.1    jruoho 
    489   1.1    jruoho /*
    490   1.1    jruoho  * Secondary information structures for ACPI predefined objects that return
    491   1.1    jruoho  * package objects. This structure appears as the next entry in the table
    492   1.1    jruoho  * after the NAME_INFO structure above.
    493   1.1    jruoho  *
    494   1.1    jruoho  * The reason for this is to minimize the size of the predefined name table.
    495   1.1    jruoho  */
    496   1.1    jruoho 
    497   1.1    jruoho /*
    498   1.1    jruoho  * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
    499   1.5  christos  * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
    500   1.5  christos  * ACPI_PTYPE2_FIX_VAR
    501   1.1    jruoho  */
    502   1.1    jruoho typedef struct acpi_package_info
    503   1.1    jruoho {
    504   1.1    jruoho     UINT8                       Type;
    505   1.1    jruoho     UINT8                       ObjectType1;
    506   1.1    jruoho     UINT8                       Count1;
    507   1.1    jruoho     UINT8                       ObjectType2;
    508   1.1    jruoho     UINT8                       Count2;
    509   1.5  christos     UINT16                      Reserved;
    510   1.1    jruoho 
    511   1.1    jruoho } ACPI_PACKAGE_INFO;
    512   1.1    jruoho 
    513   1.1    jruoho /* Used for ACPI_PTYPE2_FIXED */
    514   1.1    jruoho 
    515   1.1    jruoho typedef struct acpi_package_info2
    516   1.1    jruoho {
    517   1.1    jruoho     UINT8                       Type;
    518   1.1    jruoho     UINT8                       Count;
    519   1.1    jruoho     UINT8                       ObjectType[4];
    520   1.5  christos     UINT8                       Reserved;
    521   1.1    jruoho 
    522   1.1    jruoho } ACPI_PACKAGE_INFO2;
    523   1.1    jruoho 
    524   1.1    jruoho /* Used for ACPI_PTYPE1_OPTION */
    525   1.1    jruoho 
    526   1.1    jruoho typedef struct acpi_package_info3
    527   1.1    jruoho {
    528   1.1    jruoho     UINT8                       Type;
    529   1.1    jruoho     UINT8                       Count;
    530   1.1    jruoho     UINT8                       ObjectType[2];
    531   1.1    jruoho     UINT8                       TailObjectType;
    532   1.5  christos     UINT16                      Reserved;
    533   1.1    jruoho 
    534   1.1    jruoho } ACPI_PACKAGE_INFO3;
    535   1.1    jruoho 
    536   1.8  christos typedef struct acpi_package_info4
    537   1.8  christos {
    538   1.8  christos     UINT8                       Type;
    539   1.8  christos     UINT8                       ObjectType1;
    540   1.8  christos     UINT8                       Count1;
    541   1.8  christos     UINT8                       SubObjectTypes;
    542   1.8  christos     UINT8                       PkgCount;
    543   1.8  christos     UINT16                      Reserved;
    544   1.8  christos 
    545   1.8  christos } ACPI_PACKAGE_INFO4;
    546   1.8  christos 
    547   1.1    jruoho typedef union acpi_predefined_info
    548   1.1    jruoho {
    549   1.1    jruoho     ACPI_NAME_INFO              Info;
    550   1.1    jruoho     ACPI_PACKAGE_INFO           RetInfo;
    551   1.1    jruoho     ACPI_PACKAGE_INFO2          RetInfo2;
    552   1.1    jruoho     ACPI_PACKAGE_INFO3          RetInfo3;
    553   1.8  christos     ACPI_PACKAGE_INFO4          RetInfo4;
    554   1.1    jruoho 
    555   1.1    jruoho } ACPI_PREDEFINED_INFO;
    556   1.1    jruoho 
    557   1.5  christos /* Reset to default packing */
    558   1.1    jruoho 
    559   1.5  christos #pragma pack()
    560   1.1    jruoho 
    561   1.1    jruoho 
    562   1.5  christos /* Return object auto-repair info */
    563   1.1    jruoho 
    564   1.5  christos typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
    565   1.9  christos     struct acpi_namespace_node  *Scope,
    566   1.5  christos     union acpi_operand_object   *OriginalObject,
    567   1.5  christos     union acpi_operand_object   **ConvertedObject);
    568   1.1    jruoho 
    569   1.5  christos typedef struct acpi_simple_repair_info
    570   1.5  christos {
    571  1.28  christos     char                        Name[ACPI_NAMESEG_SIZE] ACPI_NONSTRING;
    572   1.5  christos     UINT32                      UnexpectedBtypes;
    573   1.5  christos     UINT32                      PackageIndex;
    574   1.5  christos     ACPI_OBJECT_CONVERTER       ObjectConverter;
    575   1.5  christos 
    576   1.5  christos } ACPI_SIMPLE_REPAIR_INFO;
    577   1.1    jruoho 
    578   1.1    jruoho 
    579   1.1    jruoho /*
    580   1.1    jruoho  * Bitmapped return value types
    581   1.1    jruoho  * Note: the actual data types must be contiguous, a loop in nspredef.c
    582   1.1    jruoho  * depends on this.
    583   1.1    jruoho  */
    584   1.1    jruoho #define ACPI_RTYPE_ANY                  0x00
    585   1.1    jruoho #define ACPI_RTYPE_NONE                 0x01
    586   1.1    jruoho #define ACPI_RTYPE_INTEGER              0x02
    587   1.1    jruoho #define ACPI_RTYPE_STRING               0x04
    588   1.1    jruoho #define ACPI_RTYPE_BUFFER               0x08
    589   1.1    jruoho #define ACPI_RTYPE_PACKAGE              0x10
    590   1.1    jruoho #define ACPI_RTYPE_REFERENCE            0x20
    591   1.1    jruoho #define ACPI_RTYPE_ALL                  0x3F
    592   1.1    jruoho 
    593   1.1    jruoho #define ACPI_NUM_RTYPES                 5   /* Number of actual object types */
    594   1.1    jruoho 
    595   1.1    jruoho 
    596   1.9  christos /* Info for running the _REG methods */
    597   1.9  christos 
    598   1.9  christos typedef struct acpi_reg_walk_info
    599   1.9  christos {
    600   1.9  christos     UINT32                  Function;
    601   1.9  christos     UINT32                  RegRunCount;
    602  1.18  christos     ACPI_ADR_SPACE_TYPE     SpaceId;
    603   1.9  christos 
    604   1.9  christos } ACPI_REG_WALK_INFO;
    605   1.9  christos 
    606   1.9  christos 
    607   1.1    jruoho /*****************************************************************************
    608   1.1    jruoho  *
    609   1.1    jruoho  * Event typedefs and structs
    610   1.1    jruoho  *
    611   1.1    jruoho  ****************************************************************************/
    612   1.1    jruoho 
    613   1.5  christos /* Dispatch info for each host-installed SCI handler */
    614   1.5  christos 
    615   1.5  christos typedef struct acpi_sci_handler_info
    616   1.5  christos {
    617   1.5  christos     struct acpi_sci_handler_info    *Next;
    618   1.5  christos     ACPI_SCI_HANDLER                Address;        /* Address of handler */
    619   1.5  christos     void                            *Context;       /* Context to be passed to handler */
    620   1.5  christos 
    621   1.5  christos } ACPI_SCI_HANDLER_INFO;
    622   1.5  christos 
    623   1.1    jruoho /* Dispatch info for each GPE -- either a method or handler, cannot be both */
    624   1.1    jruoho 
    625   1.3    jruoho typedef struct acpi_gpe_handler_info
    626   1.1    jruoho {
    627   1.3    jruoho     ACPI_GPE_HANDLER                Address;        /* Address of handler, if any */
    628   1.1    jruoho     void                            *Context;       /* Context to be passed to handler */
    629   1.1    jruoho     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level (saved) */
    630   1.3    jruoho     UINT8                           OriginalFlags;  /* Original (pre-handler) GPE info */
    631   1.3    jruoho     BOOLEAN                         OriginallyEnabled; /* True if GPE was originally enabled */
    632   1.1    jruoho 
    633   1.3    jruoho } ACPI_GPE_HANDLER_INFO;
    634   1.1    jruoho 
    635   1.5  christos /* Notify info for implicit notify, multiple device objects */
    636   1.5  christos 
    637   1.5  christos typedef struct acpi_gpe_notify_info
    638   1.5  christos {
    639   1.5  christos     ACPI_NAMESPACE_NODE             *DeviceNode;    /* Device to be notified */
    640   1.5  christos     struct acpi_gpe_notify_info     *Next;
    641   1.5  christos 
    642   1.5  christos } ACPI_GPE_NOTIFY_INFO;
    643   1.5  christos 
    644   1.3    jruoho /*
    645   1.3    jruoho  * GPE dispatch info. At any time, the GPE can have at most one type
    646   1.3    jruoho  * of dispatch - Method, Handler, or Implicit Notify.
    647   1.3    jruoho  */
    648   1.1    jruoho typedef union acpi_gpe_dispatch_info
    649   1.1    jruoho {
    650   1.1    jruoho     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level */
    651   1.5  christos     ACPI_GPE_HANDLER_INFO           *Handler;       /* Installed GPE handler */
    652   1.5  christos     ACPI_GPE_NOTIFY_INFO            *NotifyList;    /* List of _PRW devices for implicit notifies */
    653   1.1    jruoho 
    654   1.1    jruoho } ACPI_GPE_DISPATCH_INFO;
    655   1.1    jruoho 
    656   1.1    jruoho /*
    657   1.1    jruoho  * Information about a GPE, one per each GPE in an array.
    658   1.1    jruoho  * NOTE: Important to keep this struct as small as possible.
    659   1.1    jruoho  */
    660   1.1    jruoho typedef struct acpi_gpe_event_info
    661   1.1    jruoho {
    662  1.11  christos     union acpi_gpe_dispatch_info    Dispatch;           /* Either Method, Handler, or NotifyList */
    663  1.11  christos     struct acpi_gpe_register_info   *RegisterInfo;      /* Backpointer to register info */
    664  1.11  christos     UINT8                           Flags;              /* Misc info about this GPE */
    665  1.11  christos     UINT8                           GpeNumber;          /* This GPE */
    666  1.11  christos     UINT8                           RuntimeCount;       /* References to a run GPE */
    667  1.11  christos     BOOLEAN                         DisableForDispatch; /* Masked during dispatching */
    668   1.1    jruoho 
    669   1.1    jruoho } ACPI_GPE_EVENT_INFO;
    670   1.1    jruoho 
    671   1.1    jruoho /* Information about a GPE register pair, one per each status/enable pair in an array */
    672   1.1    jruoho 
    673   1.1    jruoho typedef struct acpi_gpe_register_info
    674   1.1    jruoho {
    675   1.1    jruoho     ACPI_GENERIC_ADDRESS            StatusAddress;  /* Address of status reg */
    676   1.1    jruoho     ACPI_GENERIC_ADDRESS            EnableAddress;  /* Address of enable reg */
    677   1.6  christos     UINT16                          BaseGpeNumber;  /* Base GPE number for this register */
    678   1.1    jruoho     UINT8                           EnableForWake;  /* GPEs to keep enabled when sleeping */
    679   1.1    jruoho     UINT8                           EnableForRun;   /* GPEs to keep enabled when running */
    680  1.11  christos     UINT8                           MaskForRun;     /* GPEs to keep masked when running */
    681   1.7  christos     UINT8                           EnableMask;     /* Current mask of enabled GPEs */
    682   1.1    jruoho 
    683   1.1    jruoho } ACPI_GPE_REGISTER_INFO;
    684   1.1    jruoho 
    685   1.1    jruoho /*
    686   1.1    jruoho  * Information about a GPE register block, one per each installed block --
    687   1.1    jruoho  * GPE0, GPE1, and one per each installed GPE Block Device.
    688   1.1    jruoho  */
    689   1.1    jruoho typedef struct acpi_gpe_block_info
    690   1.1    jruoho {
    691   1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;
    692   1.1    jruoho     struct acpi_gpe_block_info      *Previous;
    693   1.1    jruoho     struct acpi_gpe_block_info      *Next;
    694   1.1    jruoho     struct acpi_gpe_xrupt_info      *XruptBlock;    /* Backpointer to interrupt block */
    695   1.1    jruoho     ACPI_GPE_REGISTER_INFO          *RegisterInfo;  /* One per GPE register pair */
    696   1.1    jruoho     ACPI_GPE_EVENT_INFO             *EventInfo;     /* One for each GPE */
    697   1.6  christos     UINT64                          Address;        /* Base address of the block */
    698   1.1    jruoho     UINT32                          RegisterCount;  /* Number of register pairs in block */
    699   1.1    jruoho     UINT16                          GpeCount;       /* Number of individual GPEs in block */
    700   1.6  christos     UINT16                          BlockBaseNumber;/* Base GPE number for this block */
    701   1.6  christos     UINT8                           SpaceId;
    702   1.3    jruoho     BOOLEAN                         Initialized;    /* TRUE if this block is initialized */
    703   1.1    jruoho 
    704   1.1    jruoho } ACPI_GPE_BLOCK_INFO;
    705   1.1    jruoho 
    706   1.1    jruoho /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
    707   1.1    jruoho 
    708   1.1    jruoho typedef struct acpi_gpe_xrupt_info
    709   1.1    jruoho {
    710   1.1    jruoho     struct acpi_gpe_xrupt_info      *Previous;
    711   1.1    jruoho     struct acpi_gpe_xrupt_info      *Next;
    712   1.1    jruoho     ACPI_GPE_BLOCK_INFO             *GpeBlockListHead;  /* List of GPE blocks for this xrupt */
    713   1.1    jruoho     UINT32                          InterruptNumber;    /* System interrupt number */
    714   1.1    jruoho 
    715   1.1    jruoho } ACPI_GPE_XRUPT_INFO;
    716   1.1    jruoho 
    717   1.1    jruoho typedef struct acpi_gpe_walk_info
    718   1.1    jruoho {
    719   1.1    jruoho     ACPI_NAMESPACE_NODE             *GpeDevice;
    720   1.1    jruoho     ACPI_GPE_BLOCK_INFO             *GpeBlock;
    721   1.1    jruoho     UINT16                          Count;
    722   1.1    jruoho     ACPI_OWNER_ID                   OwnerId;
    723   1.1    jruoho     BOOLEAN                         ExecuteByOwnerId;
    724   1.1    jruoho 
    725   1.1    jruoho } ACPI_GPE_WALK_INFO;
    726   1.1    jruoho 
    727   1.1    jruoho typedef struct acpi_gpe_device_info
    728   1.1    jruoho {
    729   1.1    jruoho     UINT32                          Index;
    730   1.1    jruoho     UINT32                          NextBlockBaseIndex;
    731   1.1    jruoho     ACPI_STATUS                     Status;
    732   1.1    jruoho     ACPI_NAMESPACE_NODE             *GpeDevice;
    733   1.1    jruoho 
    734   1.1    jruoho } ACPI_GPE_DEVICE_INFO;
    735   1.1    jruoho 
    736   1.1    jruoho typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
    737   1.1    jruoho     ACPI_GPE_XRUPT_INFO             *GpeXruptInfo,
    738   1.1    jruoho     ACPI_GPE_BLOCK_INFO             *GpeBlock,
    739   1.1    jruoho     void                            *Context);
    740   1.1    jruoho 
    741   1.1    jruoho 
    742   1.1    jruoho /* Information about each particular fixed event */
    743   1.1    jruoho 
    744   1.1    jruoho typedef struct acpi_fixed_event_handler
    745   1.1    jruoho {
    746   1.1    jruoho     ACPI_EVENT_HANDLER              Handler;        /* Address of handler. */
    747   1.1    jruoho     void                            *Context;       /* Context to be passed to handler */
    748   1.1    jruoho 
    749   1.1    jruoho } ACPI_FIXED_EVENT_HANDLER;
    750   1.1    jruoho 
    751   1.1    jruoho typedef struct acpi_fixed_event_info
    752   1.1    jruoho {
    753   1.1    jruoho     UINT8                           StatusRegisterId;
    754   1.1    jruoho     UINT8                           EnableRegisterId;
    755   1.1    jruoho     UINT16                          StatusBitMask;
    756   1.1    jruoho     UINT16                          EnableBitMask;
    757   1.1    jruoho 
    758   1.1    jruoho } ACPI_FIXED_EVENT_INFO;
    759   1.1    jruoho 
    760   1.1    jruoho /* Information used during field processing */
    761   1.1    jruoho 
    762   1.1    jruoho typedef struct acpi_field_info
    763   1.1    jruoho {
    764   1.1    jruoho     UINT8                           SkipField;
    765   1.1    jruoho     UINT8                           FieldFlag;
    766   1.1    jruoho     UINT32                          PkgLength;
    767   1.1    jruoho 
    768   1.1    jruoho } ACPI_FIELD_INFO;
    769   1.1    jruoho 
    770  1.25  christos /* Information about the interrupt ID and _EVT of a GED device */
    771  1.25  christos 
    772  1.25  christos typedef struct acpi_ged_handler_info
    773  1.25  christos {
    774  1.25  christos     struct acpi_ged_handler_info    *Next;
    775  1.27  christos     UINT32                          IntId;      /* The interrupt ID that triggers the execution ofthe EvtMethod. */
    776  1.25  christos     ACPI_NAMESPACE_NODE             *EvtMethod; /* The _EVT method to be executed when an interrupt with ID = IntID is received */
    777  1.25  christos 
    778  1.25  christos } ACPI_GED_HANDLER_INFO;
    779   1.1    jruoho 
    780   1.1    jruoho /*****************************************************************************
    781   1.1    jruoho  *
    782   1.1    jruoho  * Generic "state" object for stacks
    783   1.1    jruoho  *
    784   1.1    jruoho  ****************************************************************************/
    785   1.1    jruoho 
    786   1.1    jruoho #define ACPI_CONTROL_NORMAL                  0xC0
    787   1.1    jruoho #define ACPI_CONTROL_CONDITIONAL_EXECUTING   0xC1
    788   1.1    jruoho #define ACPI_CONTROL_PREDICATE_EXECUTING     0xC2
    789   1.1    jruoho #define ACPI_CONTROL_PREDICATE_FALSE         0xC3
    790   1.1    jruoho #define ACPI_CONTROL_PREDICATE_TRUE          0xC4
    791   1.1    jruoho 
    792   1.1    jruoho 
    793   1.1    jruoho #define ACPI_STATE_COMMON \
    794   1.1    jruoho     void                            *Next; \
    795   1.1    jruoho     UINT8                           DescriptorType; /* To differentiate various internal objs */\
    796   1.1    jruoho     UINT8                           Flags; \
    797   1.1    jruoho     UINT16                          Value; \
    798  1.25  christos     UINT16                          State
    799   1.1    jruoho 
    800   1.1    jruoho     /* There are 2 bytes available here until the next natural alignment boundary */
    801   1.1    jruoho 
    802   1.1    jruoho typedef struct acpi_common_state
    803   1.1    jruoho {
    804  1.25  christos     ACPI_STATE_COMMON;
    805   1.1    jruoho } ACPI_COMMON_STATE;
    806   1.1    jruoho 
    807   1.1    jruoho 
    808   1.1    jruoho /*
    809   1.1    jruoho  * Update state - used to traverse complex objects such as packages
    810   1.1    jruoho  */
    811   1.1    jruoho typedef struct acpi_update_state
    812   1.1    jruoho {
    813  1.25  christos     ACPI_STATE_COMMON;
    814   1.1    jruoho     union acpi_operand_object       *Object;
    815   1.1    jruoho 
    816   1.1    jruoho } ACPI_UPDATE_STATE;
    817   1.1    jruoho 
    818   1.1    jruoho 
    819   1.1    jruoho /*
    820   1.1    jruoho  * Pkg state - used to traverse nested package structures
    821   1.1    jruoho  */
    822   1.1    jruoho typedef struct acpi_pkg_state
    823   1.1    jruoho {
    824  1.25  christos     ACPI_STATE_COMMON;
    825  1.14  christos     UINT32                          Index;
    826   1.1    jruoho     union acpi_operand_object       *SourceObject;
    827   1.1    jruoho     union acpi_operand_object       *DestObject;
    828   1.1    jruoho     struct acpi_walk_state          *WalkState;
    829   1.1    jruoho     void                            *ThisTargetObj;
    830   1.1    jruoho     UINT32                          NumPackages;
    831   1.1    jruoho 
    832   1.1    jruoho } ACPI_PKG_STATE;
    833   1.1    jruoho 
    834   1.1    jruoho 
    835   1.1    jruoho /*
    836   1.1    jruoho  * Control state - one per if/else and while constructs.
    837   1.1    jruoho  * Allows nesting of these constructs
    838   1.1    jruoho  */
    839   1.1    jruoho typedef struct acpi_control_state
    840   1.1    jruoho {
    841  1.25  christos     ACPI_STATE_COMMON;
    842   1.1    jruoho     UINT16                          Opcode;
    843   1.1    jruoho     union acpi_parse_object         *PredicateOp;
    844   1.1    jruoho     UINT8                           *AmlPredicateStart;     /* Start of if/while predicate */
    845   1.1    jruoho     UINT8                           *PackageEnd;            /* End of if/while block */
    846  1.15  christos     UINT64                          LoopTimeout;            /* While() loop timeout */
    847   1.1    jruoho 
    848   1.1    jruoho } ACPI_CONTROL_STATE;
    849   1.1    jruoho 
    850   1.1    jruoho 
    851   1.1    jruoho /*
    852   1.1    jruoho  * Scope state - current scope during namespace lookups
    853   1.1    jruoho  */
    854   1.1    jruoho typedef struct acpi_scope_state
    855   1.1    jruoho {
    856  1.25  christos     ACPI_STATE_COMMON;
    857   1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;
    858   1.1    jruoho 
    859   1.1    jruoho } ACPI_SCOPE_STATE;
    860   1.1    jruoho 
    861   1.1    jruoho 
    862   1.1    jruoho typedef struct acpi_pscope_state
    863   1.1    jruoho {
    864  1.25  christos     ACPI_STATE_COMMON;
    865   1.1    jruoho     UINT32                          ArgCount;               /* Number of fixed arguments */
    866   1.1    jruoho     union acpi_parse_object         *Op;                    /* Current op being parsed */
    867   1.1    jruoho     UINT8                           *ArgEnd;                /* Current argument end */
    868   1.1    jruoho     UINT8                           *PkgEnd;                /* Current package end */
    869   1.1    jruoho     UINT32                          ArgList;                /* Next argument to parse */
    870   1.1    jruoho 
    871   1.1    jruoho } ACPI_PSCOPE_STATE;
    872   1.1    jruoho 
    873   1.1    jruoho 
    874   1.1    jruoho /*
    875   1.5  christos  * Thread state - one per thread across multiple walk states. Multiple walk
    876   1.1    jruoho  * states are created when there are nested control methods executing.
    877   1.1    jruoho  */
    878   1.1    jruoho typedef struct acpi_thread_state
    879   1.1    jruoho {
    880  1.25  christos     ACPI_STATE_COMMON;
    881   1.1    jruoho     UINT8                           CurrentSyncLevel;       /* Mutex Sync (nested acquire) level */
    882   1.1    jruoho     struct acpi_walk_state          *WalkStateList;         /* Head of list of WalkStates for this thread */
    883   1.1    jruoho     union acpi_operand_object       *AcquiredMutexList;     /* List of all currently acquired mutexes */
    884   1.1    jruoho     ACPI_THREAD_ID                  ThreadId;               /* Running thread ID */
    885   1.1    jruoho 
    886   1.1    jruoho } ACPI_THREAD_STATE;
    887   1.1    jruoho 
    888   1.1    jruoho 
    889   1.1    jruoho /*
    890   1.1    jruoho  * Result values - used to accumulate the results of nested
    891   1.1    jruoho  * AML arguments
    892   1.1    jruoho  */
    893   1.1    jruoho typedef struct acpi_result_values
    894   1.1    jruoho {
    895  1.25  christos     ACPI_STATE_COMMON;
    896   1.1    jruoho     union acpi_operand_object       *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM];
    897   1.1    jruoho 
    898   1.1    jruoho } ACPI_RESULT_VALUES;
    899   1.1    jruoho 
    900   1.1    jruoho 
    901   1.1    jruoho typedef
    902   1.1    jruoho ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
    903   1.1    jruoho     struct acpi_walk_state          *WalkState,
    904   1.1    jruoho     union acpi_parse_object         **OutOp);
    905   1.1    jruoho 
    906   1.1    jruoho typedef
    907   1.1    jruoho ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
    908   1.1    jruoho     struct acpi_walk_state          *WalkState);
    909   1.1    jruoho 
    910   1.1    jruoho 
    911   1.5  christos /* Global handlers for AML Notifies */
    912   1.5  christos 
    913   1.5  christos typedef struct acpi_global_notify_handler
    914   1.5  christos {
    915   1.5  christos     ACPI_NOTIFY_HANDLER             Handler;
    916   1.5  christos     void                            *Context;
    917   1.5  christos 
    918   1.5  christos } ACPI_GLOBAL_NOTIFY_HANDLER;
    919   1.5  christos 
    920   1.1    jruoho /*
    921   1.1    jruoho  * Notify info - used to pass info to the deferred notify
    922   1.1    jruoho  * handler/dispatcher.
    923   1.1    jruoho  */
    924   1.1    jruoho typedef struct acpi_notify_info
    925   1.1    jruoho {
    926  1.25  christos     ACPI_STATE_COMMON;
    927   1.5  christos     UINT8                           HandlerListId;
    928   1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;
    929   1.5  christos     union acpi_operand_object       *HandlerListHead;
    930   1.5  christos     ACPI_GLOBAL_NOTIFY_HANDLER      *Global;
    931   1.1    jruoho 
    932   1.1    jruoho } ACPI_NOTIFY_INFO;
    933   1.1    jruoho 
    934   1.1    jruoho 
    935   1.1    jruoho /* Generic state is union of structs above */
    936   1.1    jruoho 
    937   1.1    jruoho typedef union acpi_generic_state
    938   1.1    jruoho {
    939   1.1    jruoho     ACPI_COMMON_STATE               Common;
    940   1.1    jruoho     ACPI_CONTROL_STATE              Control;
    941   1.1    jruoho     ACPI_UPDATE_STATE               Update;
    942   1.1    jruoho     ACPI_SCOPE_STATE                Scope;
    943   1.1    jruoho     ACPI_PSCOPE_STATE               ParseScope;
    944   1.1    jruoho     ACPI_PKG_STATE                  Pkg;
    945   1.1    jruoho     ACPI_THREAD_STATE               Thread;
    946   1.1    jruoho     ACPI_RESULT_VALUES              Results;
    947   1.1    jruoho     ACPI_NOTIFY_INFO                Notify;
    948   1.1    jruoho 
    949   1.1    jruoho } ACPI_GENERIC_STATE;
    950   1.1    jruoho 
    951   1.1    jruoho 
    952   1.1    jruoho /*****************************************************************************
    953   1.1    jruoho  *
    954   1.1    jruoho  * Interpreter typedefs and structs
    955   1.1    jruoho  *
    956   1.1    jruoho  ****************************************************************************/
    957   1.1    jruoho 
    958   1.1    jruoho typedef
    959   1.1    jruoho ACPI_STATUS (*ACPI_EXECUTE_OP) (
    960   1.1    jruoho     struct acpi_walk_state          *WalkState);
    961   1.1    jruoho 
    962   1.5  christos /* Address Range info block */
    963   1.5  christos 
    964   1.5  christos typedef struct acpi_address_range
    965   1.5  christos {
    966   1.5  christos     struct acpi_address_range   *Next;
    967   1.5  christos     ACPI_NAMESPACE_NODE         *RegionNode;
    968   1.5  christos     ACPI_PHYSICAL_ADDRESS       StartAddress;
    969   1.5  christos     ACPI_PHYSICAL_ADDRESS       EndAddress;
    970   1.5  christos 
    971   1.5  christos } ACPI_ADDRESS_RANGE;
    972   1.5  christos 
    973   1.1    jruoho 
    974   1.1    jruoho /*****************************************************************************
    975   1.1    jruoho  *
    976   1.1    jruoho  * Parser typedefs and structs
    977   1.1    jruoho  *
    978   1.1    jruoho  ****************************************************************************/
    979   1.1    jruoho 
    980   1.1    jruoho /*
    981   1.1    jruoho  * AML opcode, name, and argument layout
    982   1.1    jruoho  */
    983   1.1    jruoho typedef struct acpi_opcode_info
    984   1.1    jruoho {
    985   1.1    jruoho #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
    986   1.2    jruoho     const char                      *Name;          /* Opcode name (disassembler/debug only) */
    987   1.1    jruoho #endif
    988   1.1    jruoho     UINT32                          ParseArgs;      /* Grammar/Parse time arguments */
    989   1.1    jruoho     UINT32                          RuntimeArgs;    /* Interpret time arguments */
    990   1.1    jruoho     UINT16                          Flags;          /* Misc flags */
    991   1.1    jruoho     UINT8                           ObjectType;     /* Corresponding internal object type */
    992   1.1    jruoho     UINT8                           Class;          /* Opcode class */
    993   1.1    jruoho     UINT8                           Type;           /* Opcode type */
    994   1.1    jruoho 
    995   1.1    jruoho } ACPI_OPCODE_INFO;
    996   1.1    jruoho 
    997   1.5  christos /* Structure for Resource Tag information */
    998   1.5  christos 
    999   1.5  christos typedef struct acpi_tag_info
   1000   1.5  christos {
   1001   1.5  christos     UINT32                          BitOffset;
   1002   1.5  christos     UINT32                          BitLength;
   1003   1.5  christos 
   1004   1.5  christos } ACPI_TAG_INFO;
   1005   1.5  christos 
   1006   1.5  christos /* Value associated with the parse object */
   1007   1.5  christos 
   1008   1.1    jruoho typedef union acpi_parse_value
   1009   1.1    jruoho {
   1010   1.1    jruoho     UINT64                          Integer;        /* Integer constant (Up to 64 bits) */
   1011   1.1    jruoho     UINT32                          Size;           /* bytelist or field size */
   1012   1.1    jruoho     char                            *String;        /* NULL terminated string */
   1013   1.1    jruoho     UINT8                           *Buffer;        /* buffer or string */
   1014   1.1    jruoho     char                            *Name;          /* NULL terminated string */
   1015   1.1    jruoho     union acpi_parse_object         *Arg;           /* arguments and contained ops */
   1016   1.5  christos     ACPI_TAG_INFO                   Tag;            /* Resource descriptor tag info  */
   1017   1.1    jruoho 
   1018   1.1    jruoho } ACPI_PARSE_VALUE;
   1019   1.1    jruoho 
   1020   1.1    jruoho 
   1021   1.8  christos #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
   1022   1.1    jruoho #define ACPI_DISASM_ONLY_MEMBERS(a)     a;
   1023   1.1    jruoho #else
   1024   1.1    jruoho #define ACPI_DISASM_ONLY_MEMBERS(a)
   1025   1.1    jruoho #endif
   1026   1.1    jruoho 
   1027  1.13  christos #if defined(ACPI_ASL_COMPILER)
   1028  1.13  christos #define ACPI_CONVERTER_ONLY_MEMBERS(a)  a;
   1029  1.13  christos #else
   1030  1.13  christos #define ACPI_CONVERTER_ONLY_MEMBERS(a)
   1031  1.13  christos #endif
   1032  1.13  christos 
   1033   1.1    jruoho #define ACPI_PARSE_COMMON \
   1034  1.13  christos     union acpi_parse_object         *Parent;            /* Parent op */\
   1035  1.13  christos     UINT8                           DescriptorType;     /* To differentiate various internal objs */\
   1036  1.13  christos     UINT8                           Flags;              /* Type of Op */\
   1037  1.13  christos     UINT16                          AmlOpcode;          /* AML opcode */\
   1038  1.13  christos     UINT8                           *Aml;               /* Address of declaration in AML */\
   1039  1.13  christos     union acpi_parse_object         *Next;              /* Next op */\
   1040  1.13  christos     ACPI_NAMESPACE_NODE             *Node;              /* For use by interpreter */\
   1041  1.13  christos     ACPI_PARSE_VALUE                Value;              /* Value or args associated with the opcode */\
   1042  1.13  christos     UINT8                           ArgListLength;      /* Number of elements in the arg list */\
   1043  1.13  christos      ACPI_DISASM_ONLY_MEMBERS (\
   1044  1.13  christos     UINT16                          DisasmFlags;        /* Used during AML disassembly */\
   1045  1.13  christos     UINT8                           DisasmOpcode;       /* Subtype used for disassembly */\
   1046  1.13  christos     const char                      *OperatorSymbol;    /* Used for C-style operator name strings */\
   1047  1.13  christos     char                            AmlOpName[16])      /* Op name (debug only) */\
   1048  1.13  christos      ACPI_CONVERTER_ONLY_MEMBERS (\
   1049  1.13  christos     char                            *InlineComment;     /* Inline comment */\
   1050  1.13  christos     char                            *EndNodeComment;    /* End of node comment */\
   1051  1.13  christos     char                            *NameComment;       /* Comment associated with the first parameter of the name node */\
   1052  1.13  christos     char                            *CloseBraceComment; /* Comments that come after } on the same as } */\
   1053  1.13  christos     ACPI_COMMENT_NODE               *CommentList;       /* comments that appears before this node */\
   1054  1.13  christos     ACPI_COMMENT_NODE               *EndBlkComment;     /* comments that at the end of a block but before ) or } */\
   1055  1.13  christos     char                            *CvFilename;        /* Filename associated with this node. Used for ASL/ASL+ converter */\
   1056  1.13  christos     char                            *CvParentFilename)  /* Parent filename associated with this node. Used for ASL/ASL+ converter */
   1057  1.13  christos 
   1058  1.13  christos 
   1059  1.13  christos /* categories of comments */
   1060  1.13  christos 
   1061  1.13  christos typedef enum
   1062  1.13  christos {
   1063  1.13  christos     STANDARD_COMMENT = 1,
   1064  1.13  christos     INLINE_COMMENT,
   1065  1.13  christos     ENDNODE_COMMENT,
   1066  1.13  christos     OPENBRACE_COMMENT,
   1067  1.13  christos     CLOSE_BRACE_COMMENT,
   1068  1.13  christos     STD_DEFBLK_COMMENT,
   1069  1.13  christos     END_DEFBLK_COMMENT,
   1070  1.13  christos     FILENAME_COMMENT,
   1071  1.13  christos     PARENTFILENAME_COMMENT,
   1072  1.13  christos     ENDBLK_COMMENT,
   1073  1.13  christos     INCLUDE_COMMENT
   1074  1.13  christos 
   1075  1.13  christos } ASL_COMMENT_TYPES;
   1076   1.1    jruoho 
   1077   1.1    jruoho 
   1078  1.12  christos /* Internal opcodes for DisasmOpcode field above */
   1079   1.5  christos 
   1080   1.5  christos #define ACPI_DASM_BUFFER                0x00        /* Buffer is a simple data buffer */
   1081   1.5  christos #define ACPI_DASM_RESOURCE              0x01        /* Buffer is a Resource Descriptor */
   1082   1.5  christos #define ACPI_DASM_STRING                0x02        /* Buffer is a ASCII string */
   1083   1.5  christos #define ACPI_DASM_UNICODE               0x03        /* Buffer is a Unicode string */
   1084   1.5  christos #define ACPI_DASM_PLD_METHOD            0x04        /* Buffer is a _PLD method bit-packed buffer */
   1085   1.6  christos #define ACPI_DASM_UUID                  0x05        /* Buffer is a UUID/GUID */
   1086   1.6  christos #define ACPI_DASM_EISAID                0x06        /* Integer is an EISAID */
   1087   1.6  christos #define ACPI_DASM_MATCHOP               0x07        /* Parent opcode is a Match() operator */
   1088   1.6  christos #define ACPI_DASM_LNOT_PREFIX           0x08        /* Start of a LNotEqual (etc.) pair of opcodes */
   1089   1.6  christos #define ACPI_DASM_LNOT_SUFFIX           0x09        /* End  of a LNotEqual (etc.) pair of opcodes */
   1090   1.6  christos #define ACPI_DASM_HID_STRING            0x0A        /* String is a _HID or _CID */
   1091  1.12  christos #define ACPI_DASM_IGNORE_SINGLE         0x0B        /* Ignore the opcode but not it's children */
   1092  1.13  christos #define ACPI_DASM_SWITCH                0x0C        /* While is a Switch */
   1093  1.13  christos #define ACPI_DASM_SWITCH_PREDICATE      0x0D        /* Object is a predicate for a Switch or Case block */
   1094  1.13  christos #define ACPI_DASM_CASE                  0x0E        /* If/Else is a Case in a Switch/Case block */
   1095  1.13  christos #define ACPI_DASM_DEFAULT               0x0F        /* Else is a Default in a Switch/Case block */
   1096  1.13  christos 
   1097  1.13  christos 
   1098  1.13  christos /*
   1099  1.13  christos  * List struct used in the -ca option
   1100  1.13  christos  */
   1101  1.13  christos typedef struct acpi_comment_node
   1102  1.13  christos {
   1103  1.13  christos   char                      *Comment;
   1104  1.13  christos   struct acpi_comment_node  *Next;
   1105  1.13  christos 
   1106  1.13  christos } ACPI_COMMENT_NODE;
   1107  1.13  christos 
   1108  1.13  christos 
   1109  1.13  christos typedef struct acpi_comment_addr_node
   1110  1.13  christos {
   1111  1.13  christos   UINT8                                    *Addr;
   1112  1.13  christos   struct acpi_comment_addr_node            *Next;
   1113  1.13  christos } ACPI_COMMENT_ADDR_NODE;
   1114  1.13  christos 
   1115  1.13  christos /*
   1116  1.13  christos  * File node - used for "Include" operator file stack and
   1117  1.19  christos  * dependency tree for the -ca option
   1118  1.13  christos  */
   1119  1.13  christos typedef struct acpi_file_node
   1120  1.13  christos {
   1121  1.13  christos     void                    *File;
   1122  1.13  christos     char                    *Filename;
   1123  1.13  christos     char                    *FileStart;  /* Points to AML and indicates when the AML for this particular file starts. */
   1124  1.13  christos     char                    *FileEnd;    /* Points to AML and indicates when the AML for this particular file ends. */
   1125  1.13  christos     struct acpi_file_node   *Next;
   1126  1.13  christos     struct acpi_file_node   *Parent;
   1127  1.13  christos     BOOLEAN                 IncludeWritten;
   1128  1.13  christos     ACPI_COMMENT_NODE       *IncludeComment;
   1129  1.13  christos 
   1130  1.13  christos } ACPI_FILE_NODE;
   1131  1.13  christos 
   1132   1.1    jruoho 
   1133   1.1    jruoho /*
   1134   1.1    jruoho  * Generic operation (for example:  If, While, Store)
   1135   1.1    jruoho  */
   1136   1.1    jruoho typedef struct acpi_parse_obj_common
   1137   1.1    jruoho {
   1138   1.1    jruoho     ACPI_PARSE_COMMON
   1139   1.1    jruoho } ACPI_PARSE_OBJ_COMMON;
   1140   1.1    jruoho 
   1141   1.1    jruoho 
   1142   1.1    jruoho /*
   1143   1.1    jruoho  * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
   1144   1.1    jruoho  * and bytelists.
   1145   1.1    jruoho  */
   1146   1.1    jruoho typedef struct acpi_parse_obj_named
   1147   1.1    jruoho {
   1148   1.1    jruoho     ACPI_PARSE_COMMON
   1149  1.14  christos     char                            *Path;
   1150   1.1    jruoho     UINT8                           *Data;          /* AML body or bytelist data */
   1151   1.1    jruoho     UINT32                          Length;         /* AML length */
   1152   1.1    jruoho     UINT32                          Name;           /* 4-byte name or zero if no name */
   1153   1.1    jruoho 
   1154   1.1    jruoho } ACPI_PARSE_OBJ_NAMED;
   1155   1.1    jruoho 
   1156   1.1    jruoho 
   1157   1.1    jruoho /* This version is used by the iASL compiler only */
   1158   1.1    jruoho 
   1159  1.14  christos #define ACPI_MAX_PARSEOP_NAME       20
   1160   1.1    jruoho 
   1161   1.1    jruoho typedef struct acpi_parse_obj_asl
   1162   1.1    jruoho {
   1163   1.1    jruoho     ACPI_PARSE_COMMON
   1164   1.1    jruoho     union acpi_parse_object         *Child;
   1165   1.1    jruoho     union acpi_parse_object         *ParentMethod;
   1166   1.1    jruoho     char                            *Filename;
   1167  1.13  christos     BOOLEAN                         FileChanged;
   1168  1.13  christos     char                            *ParentFilename;
   1169   1.1    jruoho     char                            *ExternalName;
   1170   1.1    jruoho     char                            *Namepath;
   1171   1.1    jruoho     char                            NameSeg[4];
   1172   1.1    jruoho     UINT32                          ExtraValue;
   1173   1.1    jruoho     UINT32                          Column;
   1174   1.1    jruoho     UINT32                          LineNumber;
   1175   1.1    jruoho     UINT32                          LogicalLineNumber;
   1176   1.1    jruoho     UINT32                          LogicalByteOffset;
   1177   1.1    jruoho     UINT32                          EndLine;
   1178   1.1    jruoho     UINT32                          EndLogicalLine;
   1179   1.1    jruoho     UINT32                          AcpiBtype;
   1180   1.1    jruoho     UINT32                          AmlLength;
   1181   1.1    jruoho     UINT32                          AmlSubtreeLength;
   1182   1.1    jruoho     UINT32                          FinalAmlLength;
   1183   1.1    jruoho     UINT32                          FinalAmlOffset;
   1184   1.1    jruoho     UINT32                          CompileFlags;
   1185   1.1    jruoho     UINT16                          ParseOpcode;
   1186   1.1    jruoho     UINT8                           AmlOpcodeLength;
   1187   1.1    jruoho     UINT8                           AmlPkgLenBytes;
   1188   1.1    jruoho     UINT8                           Extra;
   1189   1.1    jruoho     char                            ParseOpName[ACPI_MAX_PARSEOP_NAME];
   1190   1.1    jruoho 
   1191   1.1    jruoho } ACPI_PARSE_OBJ_ASL;
   1192   1.1    jruoho 
   1193   1.1    jruoho typedef union acpi_parse_object
   1194   1.1    jruoho {
   1195   1.1    jruoho     ACPI_PARSE_OBJ_COMMON           Common;
   1196   1.1    jruoho     ACPI_PARSE_OBJ_NAMED            Named;
   1197   1.1    jruoho     ACPI_PARSE_OBJ_ASL              Asl;
   1198   1.1    jruoho 
   1199   1.1    jruoho } ACPI_PARSE_OBJECT;
   1200   1.1    jruoho 
   1201  1.13  christos typedef struct asl_comment_state
   1202  1.13  christos {
   1203  1.14  christos     UINT8                           CommentType;
   1204  1.14  christos     UINT32                          SpacesBefore;
   1205  1.14  christos     ACPI_PARSE_OBJECT               *LatestParseOp;
   1206  1.14  christos     ACPI_PARSE_OBJECT               *ParsingParenBraceNode;
   1207  1.14  christos     BOOLEAN                         CaptureComments;
   1208  1.14  christos 
   1209  1.13  christos } ASL_COMMENT_STATE;
   1210  1.13  christos 
   1211   1.1    jruoho 
   1212   1.1    jruoho /*
   1213   1.1    jruoho  * Parse state - one state per parser invocation and each control
   1214   1.1    jruoho  * method.
   1215   1.1    jruoho  */
   1216   1.1    jruoho typedef struct acpi_parse_state
   1217   1.1    jruoho {
   1218   1.1    jruoho     UINT8                           *AmlStart;      /* First AML byte */
   1219   1.1    jruoho     UINT8                           *Aml;           /* Next AML byte */
   1220   1.1    jruoho     UINT8                           *AmlEnd;        /* (last + 1) AML byte */
   1221   1.1    jruoho     UINT8                           *PkgStart;      /* Current package begin */
   1222   1.1    jruoho     UINT8                           *PkgEnd;        /* Current package end */
   1223   1.1    jruoho     union acpi_parse_object         *StartOp;       /* Root of parse tree */
   1224   1.1    jruoho     struct acpi_namespace_node      *StartNode;
   1225   1.1    jruoho     union acpi_generic_state        *Scope;         /* Current scope */
   1226   1.1    jruoho     union acpi_parse_object         *StartScope;
   1227   1.1    jruoho     UINT32                          AmlSize;
   1228   1.1    jruoho 
   1229   1.1    jruoho } ACPI_PARSE_STATE;
   1230   1.1    jruoho 
   1231   1.1    jruoho 
   1232   1.1    jruoho /* Parse object flags */
   1233   1.1    jruoho 
   1234  1.10  christos #define ACPI_PARSEOP_GENERIC                0x01
   1235  1.10  christos #define ACPI_PARSEOP_NAMED_OBJECT           0x02
   1236  1.10  christos #define ACPI_PARSEOP_DEFERRED               0x04
   1237  1.10  christos #define ACPI_PARSEOP_BYTELIST               0x08
   1238  1.10  christos #define ACPI_PARSEOP_IN_STACK               0x10
   1239  1.10  christos #define ACPI_PARSEOP_TARGET                 0x20
   1240  1.10  christos #define ACPI_PARSEOP_IN_CACHE               0x80
   1241   1.1    jruoho 
   1242   1.1    jruoho /* Parse object DisasmFlags */
   1243   1.1    jruoho 
   1244  1.11  christos #define ACPI_PARSEOP_IGNORE                 0x0001
   1245  1.11  christos #define ACPI_PARSEOP_PARAMETER_LIST         0x0002
   1246  1.11  christos #define ACPI_PARSEOP_EMPTY_TERMLIST         0x0004
   1247  1.11  christos #define ACPI_PARSEOP_PREDEFINED_CHECKED     0x0008
   1248  1.11  christos #define ACPI_PARSEOP_CLOSING_PAREN          0x0010
   1249  1.11  christos #define ACPI_PARSEOP_COMPOUND_ASSIGNMENT    0x0020
   1250  1.11  christos #define ACPI_PARSEOP_ASSIGNMENT             0x0040
   1251  1.11  christos #define ACPI_PARSEOP_ELSEIF                 0x0080
   1252  1.11  christos #define ACPI_PARSEOP_LEGACY_ASL_ONLY        0x0100
   1253   1.1    jruoho 
   1254   1.1    jruoho 
   1255   1.1    jruoho /*****************************************************************************
   1256   1.1    jruoho  *
   1257   1.1    jruoho  * Hardware (ACPI registers) and PNP
   1258   1.1    jruoho  *
   1259   1.1    jruoho  ****************************************************************************/
   1260   1.1    jruoho 
   1261   1.1    jruoho typedef struct acpi_bit_register_info
   1262   1.1    jruoho {
   1263   1.1    jruoho     UINT8                           ParentRegister;
   1264   1.1    jruoho     UINT8                           BitPosition;
   1265   1.1    jruoho     UINT16                          AccessBitMask;
   1266   1.1    jruoho 
   1267   1.1    jruoho } ACPI_BIT_REGISTER_INFO;
   1268   1.1    jruoho 
   1269   1.1    jruoho 
   1270   1.1    jruoho /*
   1271   1.1    jruoho  * Some ACPI registers have bits that must be ignored -- meaning that they
   1272   1.1    jruoho  * must be preserved.
   1273   1.1    jruoho  */
   1274   1.1    jruoho #define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800  /* Bit 11 */
   1275   1.1    jruoho 
   1276   1.1    jruoho /* Write-only bits must be zeroed by software */
   1277   1.1    jruoho 
   1278   1.1    jruoho #define ACPI_PM1_CONTROL_WRITEONLY_BITS         0x2004  /* Bits 13, 2 */
   1279   1.1    jruoho 
   1280   1.1    jruoho /* For control registers, both ignored and reserved bits must be preserved */
   1281   1.1    jruoho 
   1282   1.1    jruoho /*
   1283   1.1    jruoho  * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
   1284   1.1    jruoho  * ACPI specification to be a "preserved" bit - "OSPM always preserves this
   1285   1.1    jruoho  * bit position", section 4.7.3.2.1. However, on some machines the OS must
   1286   1.1    jruoho  * write a one to this bit after resume for the machine to work properly.
   1287   1.1    jruoho  * To enable this, we no longer attempt to preserve this bit. No machines
   1288   1.1    jruoho  * are known to fail if the bit is not preserved. (May 2009)
   1289   1.1    jruoho  */
   1290   1.1    jruoho #define ACPI_PM1_CONTROL_IGNORED_BITS           0x0200  /* Bit 9 */
   1291   1.1    jruoho #define ACPI_PM1_CONTROL_RESERVED_BITS          0xC1F8  /* Bits 14-15, 3-8 */
   1292   1.1    jruoho #define ACPI_PM1_CONTROL_PRESERVED_BITS \
   1293   1.1    jruoho          (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
   1294   1.1    jruoho 
   1295   1.1    jruoho #define ACPI_PM2_CONTROL_PRESERVED_BITS         0xFFFFFFFE /* All except bit 0 */
   1296   1.1    jruoho 
   1297   1.1    jruoho /*
   1298   1.1    jruoho  * Register IDs
   1299   1.1    jruoho  * These are the full ACPI registers
   1300   1.1    jruoho  */
   1301   1.1    jruoho #define ACPI_REGISTER_PM1_STATUS                0x01
   1302   1.1    jruoho #define ACPI_REGISTER_PM1_ENABLE                0x02
   1303   1.1    jruoho #define ACPI_REGISTER_PM1_CONTROL               0x03
   1304   1.1    jruoho #define ACPI_REGISTER_PM2_CONTROL               0x04
   1305   1.1    jruoho #define ACPI_REGISTER_PM_TIMER                  0x05
   1306   1.1    jruoho #define ACPI_REGISTER_PROCESSOR_BLOCK           0x06
   1307   1.1    jruoho #define ACPI_REGISTER_SMI_COMMAND_BLOCK         0x07
   1308   1.1    jruoho 
   1309   1.1    jruoho 
   1310   1.1    jruoho /* Masks used to access the BitRegisters */
   1311   1.1    jruoho 
   1312   1.1    jruoho #define ACPI_BITMASK_TIMER_STATUS               0x0001
   1313   1.1    jruoho #define ACPI_BITMASK_BUS_MASTER_STATUS          0x0010
   1314   1.1    jruoho #define ACPI_BITMASK_GLOBAL_LOCK_STATUS         0x0020
   1315   1.1    jruoho #define ACPI_BITMASK_POWER_BUTTON_STATUS        0x0100
   1316   1.1    jruoho #define ACPI_BITMASK_SLEEP_BUTTON_STATUS        0x0200
   1317   1.1    jruoho #define ACPI_BITMASK_RT_CLOCK_STATUS            0x0400
   1318   1.1    jruoho #define ACPI_BITMASK_PCIEXP_WAKE_STATUS         0x4000    /* ACPI 3.0 */
   1319   1.1    jruoho #define ACPI_BITMASK_WAKE_STATUS                0x8000
   1320   1.1    jruoho 
   1321   1.1    jruoho #define ACPI_BITMASK_ALL_FIXED_STATUS           (\
   1322   1.1    jruoho     ACPI_BITMASK_TIMER_STATUS          | \
   1323   1.1    jruoho     ACPI_BITMASK_BUS_MASTER_STATUS     | \
   1324   1.1    jruoho     ACPI_BITMASK_GLOBAL_LOCK_STATUS    | \
   1325   1.1    jruoho     ACPI_BITMASK_POWER_BUTTON_STATUS   | \
   1326   1.1    jruoho     ACPI_BITMASK_SLEEP_BUTTON_STATUS   | \
   1327   1.1    jruoho     ACPI_BITMASK_RT_CLOCK_STATUS       | \
   1328   1.3    jruoho     ACPI_BITMASK_PCIEXP_WAKE_STATUS    | \
   1329   1.1    jruoho     ACPI_BITMASK_WAKE_STATUS)
   1330   1.1    jruoho 
   1331   1.1    jruoho #define ACPI_BITMASK_TIMER_ENABLE               0x0001
   1332   1.1    jruoho #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE         0x0020
   1333   1.1    jruoho #define ACPI_BITMASK_POWER_BUTTON_ENABLE        0x0100
   1334   1.1    jruoho #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE        0x0200
   1335   1.1    jruoho #define ACPI_BITMASK_RT_CLOCK_ENABLE            0x0400
   1336   1.1    jruoho #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE        0x4000    /* ACPI 3.0 */
   1337   1.1    jruoho 
   1338   1.1    jruoho #define ACPI_BITMASK_SCI_ENABLE                 0x0001
   1339   1.1    jruoho #define ACPI_BITMASK_BUS_MASTER_RLD             0x0002
   1340   1.1    jruoho #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE        0x0004
   1341   1.1    jruoho #define ACPI_BITMASK_SLEEP_TYPE                 0x1C00
   1342   1.1    jruoho #define ACPI_BITMASK_SLEEP_ENABLE               0x2000
   1343   1.1    jruoho 
   1344   1.1    jruoho #define ACPI_BITMASK_ARB_DISABLE                0x0001
   1345   1.1    jruoho 
   1346   1.1    jruoho 
   1347   1.1    jruoho /* Raw bit position of each BitRegister */
   1348   1.1    jruoho 
   1349   1.1    jruoho #define ACPI_BITPOSITION_TIMER_STATUS           0x00
   1350   1.1    jruoho #define ACPI_BITPOSITION_BUS_MASTER_STATUS      0x04
   1351   1.1    jruoho #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS     0x05
   1352   1.1    jruoho #define ACPI_BITPOSITION_POWER_BUTTON_STATUS    0x08
   1353   1.1    jruoho #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS    0x09
   1354   1.1    jruoho #define ACPI_BITPOSITION_RT_CLOCK_STATUS        0x0A
   1355   1.1    jruoho #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS     0x0E    /* ACPI 3.0 */
   1356   1.1    jruoho #define ACPI_BITPOSITION_WAKE_STATUS            0x0F
   1357   1.1    jruoho 
   1358   1.1    jruoho #define ACPI_BITPOSITION_TIMER_ENABLE           0x00
   1359   1.1    jruoho #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE     0x05
   1360   1.1    jruoho #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE    0x08
   1361   1.1    jruoho #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE    0x09
   1362   1.1    jruoho #define ACPI_BITPOSITION_RT_CLOCK_ENABLE        0x0A
   1363   1.1    jruoho #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE    0x0E    /* ACPI 3.0 */
   1364   1.1    jruoho 
   1365   1.1    jruoho #define ACPI_BITPOSITION_SCI_ENABLE             0x00
   1366   1.1    jruoho #define ACPI_BITPOSITION_BUS_MASTER_RLD         0x01
   1367   1.1    jruoho #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE    0x02
   1368   1.1    jruoho #define ACPI_BITPOSITION_SLEEP_TYPE             0x0A
   1369   1.1    jruoho #define ACPI_BITPOSITION_SLEEP_ENABLE           0x0D
   1370   1.1    jruoho 
   1371   1.1    jruoho #define ACPI_BITPOSITION_ARB_DISABLE            0x00
   1372   1.1    jruoho 
   1373   1.1    jruoho 
   1374   1.1    jruoho /* Structs and definitions for _OSI support and I/O port validation */
   1375   1.1    jruoho 
   1376   1.1    jruoho #define ACPI_ALWAYS_ILLEGAL             0x00
   1377   1.1    jruoho 
   1378   1.1    jruoho typedef struct acpi_interface_info
   1379   1.1    jruoho {
   1380  1.16  christos     const char                  *Name;
   1381   1.3    jruoho     struct acpi_interface_info  *Next;
   1382   1.3    jruoho     UINT8                       Flags;
   1383   1.3    jruoho     UINT8                       Value;
   1384   1.1    jruoho 
   1385   1.1    jruoho } ACPI_INTERFACE_INFO;
   1386   1.1    jruoho 
   1387   1.3    jruoho #define ACPI_OSI_INVALID                0x01
   1388   1.3    jruoho #define ACPI_OSI_DYNAMIC                0x02
   1389   1.5  christos #define ACPI_OSI_FEATURE                0x04
   1390   1.5  christos #define ACPI_OSI_DEFAULT_INVALID        0x08
   1391   1.5  christos #define ACPI_OSI_OPTIONAL_FEATURE       (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
   1392   1.3    jruoho 
   1393   1.1    jruoho typedef struct acpi_port_info
   1394   1.1    jruoho {
   1395   1.2    jruoho     const char              *Name;
   1396   1.1    jruoho     UINT16                  Start;
   1397   1.1    jruoho     UINT16                  End;
   1398   1.1    jruoho     UINT8                   OsiDependency;
   1399   1.1    jruoho 
   1400   1.1    jruoho } ACPI_PORT_INFO;
   1401   1.1    jruoho 
   1402   1.1    jruoho 
   1403   1.1    jruoho /*****************************************************************************
   1404   1.1    jruoho  *
   1405   1.1    jruoho  * Resource descriptors
   1406   1.1    jruoho  *
   1407   1.1    jruoho  ****************************************************************************/
   1408   1.1    jruoho 
   1409   1.1    jruoho /* ResourceType values */
   1410   1.1    jruoho 
   1411   1.1    jruoho #define ACPI_ADDRESS_TYPE_MEMORY_RANGE          0
   1412   1.1    jruoho #define ACPI_ADDRESS_TYPE_IO_RANGE              1
   1413   1.1    jruoho #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE      2
   1414   1.1    jruoho 
   1415  1.26  christos #define ACPI_ADDRESS_TYPE_PCC_NUMBER            0xA
   1416  1.26  christos 
   1417   1.1    jruoho /* Resource descriptor types and masks */
   1418   1.1    jruoho 
   1419   1.1    jruoho #define ACPI_RESOURCE_NAME_LARGE                0x80
   1420   1.1    jruoho #define ACPI_RESOURCE_NAME_SMALL                0x00
   1421   1.1    jruoho 
   1422   1.1    jruoho #define ACPI_RESOURCE_NAME_SMALL_MASK           0x78 /* Bits 6:3 contain the type */
   1423   1.1    jruoho #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK    0x07 /* Bits 2:0 contain the length */
   1424   1.1    jruoho #define ACPI_RESOURCE_NAME_LARGE_MASK           0x7F /* Bits 6:0 contain the type */
   1425   1.1    jruoho 
   1426   1.1    jruoho 
   1427   1.1    jruoho /*
   1428   1.1    jruoho  * Small resource descriptor "names" as defined by the ACPI specification.
   1429   1.1    jruoho  * Note: Bits 2:0 are used for the descriptor length
   1430   1.1    jruoho  */
   1431   1.1    jruoho #define ACPI_RESOURCE_NAME_IRQ                  0x20
   1432   1.1    jruoho #define ACPI_RESOURCE_NAME_DMA                  0x28
   1433   1.1    jruoho #define ACPI_RESOURCE_NAME_START_DEPENDENT      0x30
   1434   1.1    jruoho #define ACPI_RESOURCE_NAME_END_DEPENDENT        0x38
   1435   1.1    jruoho #define ACPI_RESOURCE_NAME_IO                   0x40
   1436   1.1    jruoho #define ACPI_RESOURCE_NAME_FIXED_IO             0x48
   1437   1.5  christos #define ACPI_RESOURCE_NAME_FIXED_DMA            0x50
   1438   1.1    jruoho #define ACPI_RESOURCE_NAME_RESERVED_S2          0x58
   1439   1.1    jruoho #define ACPI_RESOURCE_NAME_RESERVED_S3          0x60
   1440   1.1    jruoho #define ACPI_RESOURCE_NAME_RESERVED_S4          0x68
   1441   1.1    jruoho #define ACPI_RESOURCE_NAME_VENDOR_SMALL         0x70
   1442   1.1    jruoho #define ACPI_RESOURCE_NAME_END_TAG              0x78
   1443   1.1    jruoho 
   1444   1.1    jruoho /*
   1445   1.1    jruoho  * Large resource descriptor "names" as defined by the ACPI specification.
   1446   1.1    jruoho  * Note: includes the Large Descriptor bit in bit[7]
   1447   1.1    jruoho  */
   1448   1.1    jruoho #define ACPI_RESOURCE_NAME_MEMORY24             0x81
   1449   1.1    jruoho #define ACPI_RESOURCE_NAME_GENERIC_REGISTER     0x82
   1450   1.1    jruoho #define ACPI_RESOURCE_NAME_RESERVED_L1          0x83
   1451   1.1    jruoho #define ACPI_RESOURCE_NAME_VENDOR_LARGE         0x84
   1452   1.1    jruoho #define ACPI_RESOURCE_NAME_MEMORY32             0x85
   1453   1.1    jruoho #define ACPI_RESOURCE_NAME_FIXED_MEMORY32       0x86
   1454   1.1    jruoho #define ACPI_RESOURCE_NAME_ADDRESS32            0x87
   1455   1.1    jruoho #define ACPI_RESOURCE_NAME_ADDRESS16            0x88
   1456   1.1    jruoho #define ACPI_RESOURCE_NAME_EXTENDED_IRQ         0x89
   1457   1.1    jruoho #define ACPI_RESOURCE_NAME_ADDRESS64            0x8A
   1458   1.1    jruoho #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64   0x8B
   1459   1.5  christos #define ACPI_RESOURCE_NAME_GPIO                 0x8C
   1460  1.14  christos #define ACPI_RESOURCE_NAME_PIN_FUNCTION         0x8D
   1461   1.5  christos #define ACPI_RESOURCE_NAME_SERIAL_BUS           0x8E
   1462  1.14  christos #define ACPI_RESOURCE_NAME_PIN_CONFIG           0x8F
   1463  1.14  christos #define ACPI_RESOURCE_NAME_PIN_GROUP            0x90
   1464  1.14  christos #define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION   0x91
   1465  1.14  christos #define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG     0x92
   1466  1.25  christos #define ACPI_RESOURCE_NAME_CLOCK_INPUT          0x93
   1467  1.25  christos #define ACPI_RESOURCE_NAME_LARGE_MAX            0x94
   1468   1.1    jruoho 
   1469   1.1    jruoho 
   1470   1.1    jruoho /*****************************************************************************
   1471   1.1    jruoho  *
   1472   1.1    jruoho  * Miscellaneous
   1473   1.1    jruoho  *
   1474   1.1    jruoho  ****************************************************************************/
   1475   1.1    jruoho 
   1476   1.1    jruoho #define ACPI_ASCII_ZERO                 0x30
   1477   1.1    jruoho 
   1478   1.1    jruoho 
   1479   1.1    jruoho /*****************************************************************************
   1480   1.1    jruoho  *
   1481   1.1    jruoho  * Disassembler
   1482   1.1    jruoho  *
   1483   1.1    jruoho  ****************************************************************************/
   1484   1.1    jruoho 
   1485   1.1    jruoho typedef struct acpi_external_list
   1486   1.1    jruoho {
   1487   1.1    jruoho     char                        *Path;
   1488   1.1    jruoho     char                        *InternalPath;
   1489   1.1    jruoho     struct acpi_external_list   *Next;
   1490   1.1    jruoho     UINT32                      Value;
   1491   1.1    jruoho     UINT16                      Length;
   1492   1.5  christos     UINT16                      Flags;
   1493   1.1    jruoho     UINT8                       Type;
   1494   1.1    jruoho 
   1495   1.1    jruoho } ACPI_EXTERNAL_LIST;
   1496   1.1    jruoho 
   1497   1.1    jruoho /* Values for Flags field above */
   1498   1.1    jruoho 
   1499   1.5  christos #define ACPI_EXT_RESOLVED_REFERENCE         0x01    /* Object was resolved during cross ref */
   1500   1.5  christos #define ACPI_EXT_ORIGIN_FROM_FILE           0x02    /* External came from a file */
   1501   1.5  christos #define ACPI_EXT_INTERNAL_PATH_ALLOCATED    0x04    /* Deallocate internal path on completion */
   1502   1.5  christos #define ACPI_EXT_EXTERNAL_EMITTED           0x08    /* External() statement has been emitted */
   1503  1.10  christos #define ACPI_EXT_ORIGIN_FROM_OPCODE         0x10    /* External came from a External() opcode */
   1504  1.14  christos #define ACPI_EXT_CONFLICTING_DECLARATION    0x20    /* External has a conflicting declaration within AML */
   1505   1.1    jruoho 
   1506   1.1    jruoho 
   1507   1.3    jruoho typedef struct acpi_external_file
   1508   1.3    jruoho {
   1509   1.3    jruoho     char                        *Path;
   1510   1.3    jruoho     struct acpi_external_file   *Next;
   1511   1.3    jruoho 
   1512   1.3    jruoho } ACPI_EXTERNAL_FILE;
   1513   1.3    jruoho 
   1514   1.3    jruoho 
   1515  1.14  christos typedef struct acpi_parse_object_list
   1516  1.14  christos {
   1517  1.14  christos     ACPI_PARSE_OBJECT               *Op;
   1518  1.14  christos     struct acpi_parse_object_list   *Next;
   1519  1.14  christos 
   1520  1.14  christos } ACPI_PARSE_OBJECT_LIST;
   1521  1.14  christos 
   1522   1.1    jruoho /*****************************************************************************
   1523   1.1    jruoho  *
   1524   1.1    jruoho  * Debugger
   1525   1.1    jruoho  *
   1526   1.1    jruoho  ****************************************************************************/
   1527   1.1    jruoho 
   1528   1.1    jruoho typedef struct acpi_db_method_info
   1529   1.1    jruoho {
   1530   1.5  christos     ACPI_HANDLE                     Method;
   1531   1.1    jruoho     ACPI_HANDLE                     MainThreadGate;
   1532   1.1    jruoho     ACPI_HANDLE                     ThreadCompleteGate;
   1533   1.1    jruoho     ACPI_HANDLE                     InfoGate;
   1534   1.3    jruoho     ACPI_THREAD_ID                  *Threads;
   1535   1.1    jruoho     UINT32                          NumThreads;
   1536   1.1    jruoho     UINT32                          NumCreated;
   1537   1.1    jruoho     UINT32                          NumCompleted;
   1538   1.1    jruoho 
   1539   1.1    jruoho     char                            *Name;
   1540   1.1    jruoho     UINT32                          Flags;
   1541   1.1    jruoho     UINT32                          NumLoops;
   1542   1.5  christos     char                            Pathname[ACPI_DB_LINE_BUFFER_SIZE];
   1543   1.1    jruoho     char                            **Args;
   1544   1.4    jruoho     ACPI_OBJECT_TYPE                *Types;
   1545   1.1    jruoho 
   1546   1.1    jruoho     /*
   1547  1.15  christos      * Arguments to be passed to method for the commands Threads and
   1548  1.15  christos      * Background. Note, ACPI specifies a maximum of 7 arguments (0 - 6).
   1549  1.15  christos      *
   1550  1.15  christos      * For the Threads command, the Number of threads, ID of current
   1551  1.15  christos      * thread and Index of current thread inside all them created.
   1552   1.1    jruoho      */
   1553   1.1    jruoho     char                            InitArgs;
   1554   1.8  christos #ifdef ACPI_DEBUGGER
   1555  1.15  christos     ACPI_OBJECT_TYPE                ArgTypes[ACPI_METHOD_NUM_ARGS];
   1556   1.8  christos #endif
   1557  1.15  christos     char                            *Arguments[ACPI_METHOD_NUM_ARGS];
   1558   1.1    jruoho     char                            NumThreadsStr[11];
   1559   1.1    jruoho     char                            IdOfThreadStr[11];
   1560   1.1    jruoho     char                            IndexOfThreadStr[11];
   1561   1.1    jruoho 
   1562   1.1    jruoho } ACPI_DB_METHOD_INFO;
   1563   1.1    jruoho 
   1564   1.1    jruoho typedef struct acpi_integrity_info
   1565   1.1    jruoho {
   1566   1.1    jruoho     UINT32                          Nodes;
   1567   1.1    jruoho     UINT32                          Objects;
   1568   1.1    jruoho 
   1569   1.1    jruoho } ACPI_INTEGRITY_INFO;
   1570   1.1    jruoho 
   1571   1.1    jruoho 
   1572   1.5  christos #define ACPI_DB_DISABLE_OUTPUT          0x00
   1573   1.1    jruoho #define ACPI_DB_REDIRECTABLE_OUTPUT     0x01
   1574   1.1    jruoho #define ACPI_DB_CONSOLE_OUTPUT          0x02
   1575   1.1    jruoho #define ACPI_DB_DUPLICATE_OUTPUT        0x03
   1576   1.1    jruoho 
   1577   1.1    jruoho 
   1578   1.9  christos typedef struct acpi_object_info
   1579   1.9  christos {
   1580   1.9  christos     UINT32                  Types[ACPI_TOTAL_TYPES];
   1581   1.9  christos 
   1582   1.9  christos } ACPI_OBJECT_INFO;
   1583   1.9  christos 
   1584   1.9  christos 
   1585   1.1    jruoho /*****************************************************************************
   1586   1.1    jruoho  *
   1587   1.1    jruoho  * Debug
   1588   1.1    jruoho  *
   1589   1.1    jruoho  ****************************************************************************/
   1590   1.1    jruoho 
   1591   1.1    jruoho /* Entry for a memory allocation (debug only) */
   1592   1.1    jruoho 
   1593   1.1    jruoho #define ACPI_MEM_MALLOC                 0
   1594   1.1    jruoho #define ACPI_MEM_CALLOC                 1
   1595   1.1    jruoho #define ACPI_MAX_MODULE_NAME            16
   1596   1.1    jruoho 
   1597   1.1    jruoho #define ACPI_COMMON_DEBUG_MEM_HEADER \
   1598   1.1    jruoho     struct acpi_debug_mem_block     *Previous; \
   1599   1.1    jruoho     struct acpi_debug_mem_block     *Next; \
   1600   1.1    jruoho     UINT32                          Size; \
   1601   1.1    jruoho     UINT32                          Component; \
   1602   1.1    jruoho     UINT32                          Line; \
   1603   1.1    jruoho     char                            Module[ACPI_MAX_MODULE_NAME]; \
   1604   1.1    jruoho     UINT8                           AllocType;
   1605   1.1    jruoho 
   1606   1.1    jruoho typedef struct acpi_debug_mem_header
   1607   1.1    jruoho {
   1608   1.1    jruoho     ACPI_COMMON_DEBUG_MEM_HEADER
   1609   1.1    jruoho 
   1610   1.1    jruoho } ACPI_DEBUG_MEM_HEADER;
   1611   1.1    jruoho 
   1612   1.1    jruoho typedef struct acpi_debug_mem_block
   1613   1.1    jruoho {
   1614   1.1    jruoho     ACPI_COMMON_DEBUG_MEM_HEADER
   1615   1.1    jruoho     UINT64                          UserSpace;
   1616   1.1    jruoho 
   1617   1.1    jruoho } ACPI_DEBUG_MEM_BLOCK;
   1618   1.1    jruoho 
   1619   1.1    jruoho 
   1620   1.1    jruoho #define ACPI_MEM_LIST_GLOBAL            0
   1621   1.1    jruoho #define ACPI_MEM_LIST_NSNODE            1
   1622   1.1    jruoho #define ACPI_MEM_LIST_MAX               1
   1623   1.1    jruoho #define ACPI_NUM_MEM_LISTS              2
   1624   1.1    jruoho 
   1625   1.1    jruoho 
   1626   1.5  christos /*****************************************************************************
   1627   1.5  christos  *
   1628   1.5  christos  * Info/help support
   1629   1.5  christos  *
   1630   1.5  christos  ****************************************************************************/
   1631   1.5  christos 
   1632   1.5  christos typedef struct ah_predefined_name
   1633   1.5  christos {
   1634   1.5  christos     char            *Name;
   1635   1.5  christos     char            *Description;
   1636   1.5  christos #ifndef ACPI_ASL_COMPILER
   1637   1.5  christos     char            *Action;
   1638   1.5  christos #endif
   1639   1.5  christos 
   1640   1.5  christos } AH_PREDEFINED_NAME;
   1641   1.5  christos 
   1642   1.6  christos typedef struct ah_device_id
   1643   1.6  christos {
   1644   1.6  christos     const char      *Name;
   1645   1.6  christos     const char      *Description;
   1646   1.6  christos 
   1647   1.6  christos } AH_DEVICE_ID;
   1648   1.6  christos 
   1649   1.6  christos typedef struct ah_uuid
   1650   1.6  christos {
   1651   1.6  christos     const char      *Description;
   1652   1.6  christos     const char      *String;
   1653   1.6  christos 
   1654   1.6  christos } AH_UUID;
   1655   1.6  christos 
   1656   1.8  christos typedef struct ah_table
   1657   1.8  christos {
   1658   1.8  christos     char                    *Signature;
   1659   1.8  christos     char                    *Description;
   1660   1.8  christos 
   1661   1.8  christos } AH_TABLE;
   1662   1.8  christos 
   1663   1.1    jruoho #endif /* __ACLOCAL_H__ */
   1664