Home | History | Annotate | Line # | Download | only in include
acobject.h revision 1.1.1.21
      1       1.1    jruoho /******************************************************************************
      2       1.1    jruoho  *
      3       1.1    jruoho  * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT  (Internal object only)
      4       1.1    jruoho  *
      5       1.1    jruoho  *****************************************************************************/
      6       1.1    jruoho 
      7  1.1.1.20  christos /******************************************************************************
      8  1.1.1.20  christos  *
      9  1.1.1.20  christos  * 1. Copyright Notice
     10  1.1.1.20  christos  *
     11  1.1.1.21  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.1.1.20  christos  * 2. License
     15  1.1.1.20  christos  *
     16  1.1.1.20  christos  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.1.1.20  christos  * rights. You may have additional license terms from the party that provided
     18  1.1.1.20  christos  * you this software, covering your right to use that party's intellectual
     19  1.1.1.20  christos  * property rights.
     20  1.1.1.20  christos  *
     21  1.1.1.20  christos  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.1.1.20  christos  * copy of the source code appearing in this file ("Covered Code") an
     23  1.1.1.20  christos  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.1.1.20  christos  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.1.1.20  christos  * make derivatives, distribute, use and display any portion of the Covered
     26  1.1.1.20  christos  * Code in any form, with the right to sublicense such rights; and
     27  1.1.1.20  christos  *
     28  1.1.1.20  christos  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.1.1.20  christos  * license (with the right to sublicense), under only those claims of Intel
     30  1.1.1.20  christos  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.1.1.20  christos  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.1.1.20  christos  * solely to the minimum extent necessary to exercise the above copyright
     33  1.1.1.20  christos  * license, and in no event shall the patent license extend to any additions
     34  1.1.1.20  christos  * to or modifications of the Original Intel Code. No other license or right
     35  1.1.1.20  christos  * is granted directly or by implication, estoppel or otherwise;
     36  1.1.1.20  christos  *
     37  1.1.1.20  christos  * The above copyright and patent license is granted only if the following
     38  1.1.1.20  christos  * conditions are met:
     39  1.1.1.20  christos  *
     40  1.1.1.20  christos  * 3. Conditions
     41  1.1.1.20  christos  *
     42  1.1.1.20  christos  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.1.1.20  christos  * Redistribution of source code of any substantial portion of the Covered
     44  1.1.1.20  christos  * Code or modification with rights to further distribute source must include
     45  1.1.1.20  christos  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.1.1.20  christos  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.1.1.20  christos  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.1.1.20  christos  * contain a file documenting the changes Licensee made to create that Covered
     49  1.1.1.20  christos  * Code and the date of any change. Licensee must include in that file the
     50  1.1.1.20  christos  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.1.1.20  christos  * must include a prominent statement that the modification is derived,
     52  1.1.1.20  christos  * directly or indirectly, from Original Intel Code.
     53  1.1.1.20  christos  *
     54  1.1.1.20  christos  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.1.1.20  christos  * Redistribution of source code of any substantial portion of the Covered
     56  1.1.1.20  christos  * Code or modification without rights to further distribute source must
     57  1.1.1.20  christos  * include the following Disclaimer and Export Compliance provision in the
     58  1.1.1.20  christos  * documentation and/or other materials provided with distribution. In
     59  1.1.1.20  christos  * addition, Licensee may not authorize further sublicense of source of any
     60  1.1.1.20  christos  * portion of the Covered Code, and must include terms to the effect that the
     61  1.1.1.20  christos  * license from Licensee to its licensee is limited to the intellectual
     62  1.1.1.20  christos  * property embodied in the software Licensee provides to its licensee, and
     63  1.1.1.20  christos  * not to intellectual property embodied in modifications its licensee may
     64  1.1.1.20  christos  * make.
     65  1.1.1.20  christos  *
     66  1.1.1.20  christos  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.1.1.20  christos  * substantial portion of the Covered Code or modification must reproduce the
     68  1.1.1.20  christos  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.1.1.20  christos  * provision in the documentation and/or other materials provided with the
     70  1.1.1.20  christos  * distribution.
     71  1.1.1.20  christos  *
     72  1.1.1.20  christos  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.1.1.20  christos  * Intel Code.
     74  1.1.1.20  christos  *
     75  1.1.1.20  christos  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.1.1.20  christos  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.1.1.20  christos  * other dealings in products derived from or relating to the Covered Code
     78  1.1.1.20  christos  * without prior written authorization from Intel.
     79  1.1.1.20  christos  *
     80  1.1.1.20  christos  * 4. Disclaimer and Export Compliance
     81  1.1.1.20  christos  *
     82  1.1.1.20  christos  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.1.1.20  christos  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.1.1.20  christos  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.1.1.20  christos  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.1.1.20  christos  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.1.1.20  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.1.1.20  christos  * PARTICULAR PURPOSE.
     89  1.1.1.20  christos  *
     90  1.1.1.20  christos  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.1.1.20  christos  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.1.1.20  christos  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.1.1.20  christos  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.1.1.20  christos  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.1.1.20  christos  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.1.1.20  christos  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.1.1.20  christos  * LIMITED REMEDY.
     98  1.1.1.20  christos  *
     99  1.1.1.20  christos  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.1.1.20  christos  * software or system incorporating such software without first obtaining any
    101  1.1.1.20  christos  * required license or other approval from the U. S. Department of Commerce or
    102  1.1.1.20  christos  * any other agency or department of the United States Government. In the
    103  1.1.1.20  christos  * event Licensee exports any such software from the United States or
    104  1.1.1.20  christos  * re-exports any such software from a foreign destination, Licensee shall
    105  1.1.1.20  christos  * ensure that the distribution and export/re-export of the software is in
    106  1.1.1.20  christos  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.1.1.20  christos  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.1.1.20  christos  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.1.1.20  christos  * software, or service, directly or indirectly, to any country for which the
    110  1.1.1.20  christos  * United States government or any agency thereof requires an export license,
    111  1.1.1.20  christos  * other governmental approval, or letter of assurance, without first obtaining
    112  1.1.1.20  christos  * such license, approval or letter.
    113  1.1.1.20  christos  *
    114  1.1.1.20  christos  *****************************************************************************
    115  1.1.1.20  christos  *
    116  1.1.1.20  christos  * Alternatively, you may choose to be licensed under the terms of the
    117  1.1.1.20  christos  * following license:
    118  1.1.1.20  christos  *
    119   1.1.1.2    jruoho  * Redistribution and use in source and binary forms, with or without
    120   1.1.1.2    jruoho  * modification, are permitted provided that the following conditions
    121   1.1.1.2    jruoho  * are met:
    122   1.1.1.2    jruoho  * 1. Redistributions of source code must retain the above copyright
    123   1.1.1.2    jruoho  *    notice, this list of conditions, and the following disclaimer,
    124   1.1.1.2    jruoho  *    without modification.
    125   1.1.1.2    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126   1.1.1.2    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
    127   1.1.1.2    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
    128   1.1.1.2    jruoho  *    including a substantially similar Disclaimer requirement for further
    129   1.1.1.2    jruoho  *    binary redistribution.
    130   1.1.1.2    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
    131   1.1.1.2    jruoho  *    of any contributors may be used to endorse or promote products derived
    132   1.1.1.2    jruoho  *    from this software without specific prior written permission.
    133   1.1.1.2    jruoho  *
    134   1.1.1.2    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135   1.1.1.2    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136  1.1.1.15  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137   1.1.1.2    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.1.1.20  christos  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.1.1.20  christos  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.1.1.20  christos  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.1.1.20  christos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.1.1.20  christos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.1.1.20  christos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.1.1.20  christos  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.1.1.20  christos  *
    146  1.1.1.20  christos  * Alternatively, you may choose to be licensed under the terms of the
    147  1.1.1.20  christos  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.1.1.20  christos  * Software Foundation.
    149  1.1.1.20  christos  *
    150  1.1.1.20  christos  *****************************************************************************/
    151       1.1    jruoho 
    152       1.1    jruoho #ifndef _ACOBJECT_H
    153       1.1    jruoho #define _ACOBJECT_H
    154       1.1    jruoho 
    155       1.1    jruoho /* acpisrc:StructDefs -- for acpisrc conversion */
    156       1.1    jruoho 
    157       1.1    jruoho 
    158       1.1    jruoho /*
    159       1.1    jruoho  * The ACPI_OPERAND_OBJECT is used to pass AML operands from the dispatcher
    160       1.1    jruoho  * to the interpreter, and to keep track of the various handlers such as
    161       1.1    jruoho  * address space handlers and notify handlers. The object is a constant
    162       1.1    jruoho  * size in order to allow it to be cached and reused.
    163       1.1    jruoho  *
    164       1.1    jruoho  * Note: The object is optimized to be aligned and will not work if it is
    165       1.1    jruoho  * byte-packed.
    166       1.1    jruoho  */
    167       1.1    jruoho #if ACPI_MACHINE_WIDTH == 64
    168       1.1    jruoho #pragma pack(8)
    169       1.1    jruoho #else
    170       1.1    jruoho #pragma pack(4)
    171       1.1    jruoho #endif
    172       1.1    jruoho 
    173       1.1    jruoho /*******************************************************************************
    174       1.1    jruoho  *
    175       1.1    jruoho  * Common Descriptors
    176       1.1    jruoho  *
    177       1.1    jruoho  ******************************************************************************/
    178       1.1    jruoho 
    179       1.1    jruoho /*
    180       1.1    jruoho  * Common area for all objects.
    181       1.1    jruoho  *
    182       1.1    jruoho  * DescriptorType is used to differentiate between internal descriptors, and
    183       1.1    jruoho  * must be in the same place across all descriptors
    184       1.1    jruoho  *
    185       1.1    jruoho  * Note: The DescriptorType and Type fields must appear in the identical
    186       1.1    jruoho  * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
    187       1.1    jruoho  * structures.
    188       1.1    jruoho  */
    189       1.1    jruoho #define ACPI_OBJECT_COMMON_HEADER \
    190       1.1    jruoho     union acpi_operand_object       *NextObject;        /* Objects linked to parent NS node */\
    191       1.1    jruoho     UINT8                           DescriptorType;     /* To differentiate various internal objs */\
    192       1.1    jruoho     UINT8                           Type;               /* ACPI_OBJECT_TYPE */\
    193       1.1    jruoho     UINT16                          ReferenceCount;     /* For object deletion management */\
    194  1.1.1.19  christos     UINT8                           Flags
    195       1.1    jruoho     /*
    196       1.1    jruoho      * Note: There are 3 bytes available here before the
    197       1.1    jruoho      * next natural alignment boundary (for both 32/64 cases)
    198       1.1    jruoho      */
    199       1.1    jruoho 
    200       1.1    jruoho /* Values for Flag byte above */
    201       1.1    jruoho 
    202       1.1    jruoho #define AOPOBJ_AML_CONSTANT         0x01    /* Integer is an AML constant */
    203       1.1    jruoho #define AOPOBJ_STATIC_POINTER       0x02    /* Data is part of an ACPI table, don't delete */
    204   1.1.1.3  christos #define AOPOBJ_DATA_VALID           0x04    /* Object is initialized and data is valid */
    205   1.1.1.7  christos #define AOPOBJ_OBJECT_INITIALIZED   0x08    /* Region is initialized */
    206   1.1.1.7  christos #define AOPOBJ_REG_CONNECTED        0x10    /* _REG was run */
    207   1.1.1.7  christos #define AOPOBJ_SETUP_COMPLETE       0x20    /* Region setup is complete */
    208   1.1.1.7  christos #define AOPOBJ_INVALID              0x40    /* Host OS won't allow a Region address */
    209       1.1    jruoho 
    210       1.1    jruoho 
    211       1.1    jruoho /******************************************************************************
    212       1.1    jruoho  *
    213       1.1    jruoho  * Basic data types
    214       1.1    jruoho  *
    215       1.1    jruoho  *****************************************************************************/
    216       1.1    jruoho 
    217       1.1    jruoho typedef struct acpi_object_common
    218       1.1    jruoho {
    219  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    220       1.1    jruoho 
    221       1.1    jruoho } ACPI_OBJECT_COMMON;
    222       1.1    jruoho 
    223       1.1    jruoho 
    224       1.1    jruoho typedef struct acpi_object_integer
    225       1.1    jruoho {
    226  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    227       1.1    jruoho     UINT8                           Fill[3];            /* Prevent warning on some compilers */
    228       1.1    jruoho     UINT64                          Value;
    229       1.1    jruoho 
    230       1.1    jruoho } ACPI_OBJECT_INTEGER;
    231       1.1    jruoho 
    232       1.1    jruoho 
    233       1.1    jruoho /*
    234   1.1.1.3  christos  * Note: The String and Buffer object must be identical through the
    235   1.1.1.3  christos  * pointer and length elements. There is code that depends on this.
    236       1.1    jruoho  *
    237       1.1    jruoho  * Fields common to both Strings and Buffers
    238       1.1    jruoho  */
    239       1.1    jruoho #define ACPI_COMMON_BUFFER_INFO(_Type) \
    240       1.1    jruoho     _Type                           *Pointer; \
    241  1.1.1.19  christos     UINT32                          Length
    242       1.1    jruoho 
    243       1.1    jruoho 
    244   1.1.1.9  christos /* Null terminated, ASCII characters only */
    245   1.1.1.9  christos 
    246   1.1.1.9  christos typedef struct acpi_object_string
    247       1.1    jruoho {
    248  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    249  1.1.1.19  christos     ACPI_COMMON_BUFFER_INFO(char);              /* String in AML stream or allocated string */
    250       1.1    jruoho 
    251       1.1    jruoho } ACPI_OBJECT_STRING;
    252       1.1    jruoho 
    253       1.1    jruoho 
    254       1.1    jruoho typedef struct acpi_object_buffer
    255       1.1    jruoho {
    256  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    257  1.1.1.19  christos     ACPI_COMMON_BUFFER_INFO(UINT8);      /* Buffer in AML stream or allocated buffer */
    258       1.1    jruoho     UINT32                          AmlLength;
    259       1.1    jruoho     UINT8                           *AmlStart;
    260       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Link back to parent node */
    261       1.1    jruoho 
    262       1.1    jruoho } ACPI_OBJECT_BUFFER;
    263       1.1    jruoho 
    264       1.1    jruoho 
    265       1.1    jruoho typedef struct acpi_object_package
    266       1.1    jruoho {
    267  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    268       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Link back to parent node */
    269       1.1    jruoho     union acpi_operand_object       **Elements;         /* Array of pointers to AcpiObjects */
    270       1.1    jruoho     UINT8                           *AmlStart;
    271       1.1    jruoho     UINT32                          AmlLength;
    272       1.1    jruoho     UINT32                          Count;              /* # of elements in package */
    273       1.1    jruoho 
    274       1.1    jruoho } ACPI_OBJECT_PACKAGE;
    275       1.1    jruoho 
    276       1.1    jruoho 
    277       1.1    jruoho /******************************************************************************
    278       1.1    jruoho  *
    279       1.1    jruoho  * Complex data types
    280       1.1    jruoho  *
    281       1.1    jruoho  *****************************************************************************/
    282       1.1    jruoho 
    283       1.1    jruoho typedef struct acpi_object_event
    284       1.1    jruoho {
    285  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    286       1.1    jruoho     ACPI_SEMAPHORE                  OsSemaphore;        /* Actual OS synchronization object */
    287       1.1    jruoho 
    288       1.1    jruoho } ACPI_OBJECT_EVENT;
    289       1.1    jruoho 
    290       1.1    jruoho 
    291       1.1    jruoho typedef struct acpi_object_mutex
    292       1.1    jruoho {
    293  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    294       1.1    jruoho     UINT8                           SyncLevel;          /* 0-15, specified in Mutex() call */
    295       1.1    jruoho     UINT16                          AcquisitionDepth;   /* Allow multiple Acquires, same thread */
    296       1.1    jruoho     ACPI_MUTEX                      OsMutex;            /* Actual OS synchronization object */
    297       1.1    jruoho     ACPI_THREAD_ID                  ThreadId;           /* Current owner of the mutex */
    298       1.1    jruoho     struct acpi_thread_state        *OwnerThread;       /* Current owner of the mutex */
    299       1.1    jruoho     union acpi_operand_object       *Prev;              /* Link for list of acquired mutexes */
    300       1.1    jruoho     union acpi_operand_object       *Next;              /* Link for list of acquired mutexes */
    301       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Containing namespace node */
    302       1.1    jruoho     UINT8                           OriginalSyncLevel;  /* Owner's original sync level (0-15) */
    303       1.1    jruoho 
    304       1.1    jruoho } ACPI_OBJECT_MUTEX;
    305       1.1    jruoho 
    306       1.1    jruoho 
    307       1.1    jruoho typedef struct acpi_object_region
    308       1.1    jruoho {
    309  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    310       1.1    jruoho     UINT8                           SpaceId;
    311       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Containing namespace node */
    312       1.1    jruoho     union acpi_operand_object       *Handler;           /* Handler for region access */
    313       1.1    jruoho     union acpi_operand_object       *Next;
    314       1.1    jruoho     ACPI_PHYSICAL_ADDRESS           Address;
    315       1.1    jruoho     UINT32                          Length;
    316  1.1.1.16  christos     void                            *Pointer;           /* Only for data table regions */
    317       1.1    jruoho 
    318       1.1    jruoho } ACPI_OBJECT_REGION;
    319       1.1    jruoho 
    320       1.1    jruoho 
    321       1.1    jruoho typedef struct acpi_object_method
    322       1.1    jruoho {
    323  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    324   1.1.1.2    jruoho     UINT8                           InfoFlags;
    325       1.1    jruoho     UINT8                           ParamCount;
    326       1.1    jruoho     UINT8                           SyncLevel;
    327       1.1    jruoho     union acpi_operand_object       *Mutex;
    328   1.1.1.6  christos     union acpi_operand_object       *Node;
    329       1.1    jruoho     UINT8                           *AmlStart;
    330       1.1    jruoho     union
    331       1.1    jruoho     {
    332       1.1    jruoho         ACPI_INTERNAL_METHOD            Implementation;
    333       1.1    jruoho         union acpi_operand_object       *Handler;
    334   1.1.1.2    jruoho     } Dispatch;
    335       1.1    jruoho 
    336       1.1    jruoho     UINT32                          AmlLength;
    337       1.1    jruoho     ACPI_OWNER_ID                   OwnerId;
    338  1.1.1.12  christos     UINT8                           ThreadCount;
    339       1.1    jruoho 
    340       1.1    jruoho } ACPI_OBJECT_METHOD;
    341       1.1    jruoho 
    342   1.1.1.2    jruoho /* Flags for InfoFlags field above */
    343   1.1.1.2    jruoho 
    344   1.1.1.2    jruoho #define ACPI_METHOD_MODULE_LEVEL        0x01    /* Method is actually module-level code */
    345   1.1.1.2    jruoho #define ACPI_METHOD_INTERNAL_ONLY       0x02    /* Method is implemented internally (_OSI) */
    346   1.1.1.2    jruoho #define ACPI_METHOD_SERIALIZED          0x04    /* Method is serialized */
    347   1.1.1.2    jruoho #define ACPI_METHOD_SERIALIZED_PENDING  0x08    /* Method is to be marked serialized */
    348   1.1.1.4  christos #define ACPI_METHOD_IGNORE_SYNC_LEVEL   0x10    /* Method was auto-serialized at table load time */
    349   1.1.1.4  christos #define ACPI_METHOD_MODIFIED_NAMESPACE  0x20    /* Method modified the namespace */
    350   1.1.1.2    jruoho 
    351       1.1    jruoho 
    352       1.1    jruoho /******************************************************************************
    353       1.1    jruoho  *
    354   1.1.1.3  christos  * Objects that can be notified. All share a common NotifyInfo area.
    355       1.1    jruoho  *
    356       1.1    jruoho  *****************************************************************************/
    357       1.1    jruoho 
    358       1.1    jruoho /*
    359       1.1    jruoho  * Common fields for objects that support ASL notifications
    360       1.1    jruoho  */
    361       1.1    jruoho #define ACPI_COMMON_NOTIFY_INFO \
    362   1.1.1.3  christos     union acpi_operand_object       *NotifyList[2];     /* Handlers for system/device notifies */\
    363  1.1.1.19  christos     union acpi_operand_object       *Handler           /* Handler for Address space */
    364       1.1    jruoho 
    365   1.1.1.9  christos /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
    366       1.1    jruoho 
    367   1.1.1.9  christos typedef struct acpi_object_notify_common
    368       1.1    jruoho {
    369  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    370  1.1.1.19  christos     ACPI_COMMON_NOTIFY_INFO;
    371       1.1    jruoho 
    372       1.1    jruoho } ACPI_OBJECT_NOTIFY_COMMON;
    373       1.1    jruoho 
    374       1.1    jruoho 
    375       1.1    jruoho typedef struct acpi_object_device
    376       1.1    jruoho {
    377  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    378  1.1.1.19  christos     ACPI_COMMON_NOTIFY_INFO;
    379       1.1    jruoho     ACPI_GPE_BLOCK_INFO             *GpeBlock;
    380       1.1    jruoho 
    381       1.1    jruoho } ACPI_OBJECT_DEVICE;
    382       1.1    jruoho 
    383       1.1    jruoho 
    384       1.1    jruoho typedef struct acpi_object_power_resource
    385       1.1    jruoho {
    386  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    387  1.1.1.19  christos     ACPI_COMMON_NOTIFY_INFO;
    388       1.1    jruoho     UINT32                          SystemLevel;
    389       1.1    jruoho     UINT32                          ResourceOrder;
    390       1.1    jruoho 
    391       1.1    jruoho } ACPI_OBJECT_POWER_RESOURCE;
    392       1.1    jruoho 
    393       1.1    jruoho 
    394       1.1    jruoho typedef struct acpi_object_processor
    395       1.1    jruoho {
    396  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    397       1.1    jruoho 
    398       1.1    jruoho     /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
    399       1.1    jruoho 
    400       1.1    jruoho     UINT8                           ProcId;
    401       1.1    jruoho     UINT8                           Length;
    402  1.1.1.19  christos     ACPI_COMMON_NOTIFY_INFO;
    403       1.1    jruoho     ACPI_IO_ADDRESS                 Address;
    404       1.1    jruoho 
    405       1.1    jruoho } ACPI_OBJECT_PROCESSOR;
    406       1.1    jruoho 
    407       1.1    jruoho 
    408       1.1    jruoho typedef struct acpi_object_thermal_zone
    409       1.1    jruoho {
    410  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    411  1.1.1.19  christos     ACPI_COMMON_NOTIFY_INFO;
    412       1.1    jruoho 
    413       1.1    jruoho } ACPI_OBJECT_THERMAL_ZONE;
    414       1.1    jruoho 
    415       1.1    jruoho 
    416       1.1    jruoho /******************************************************************************
    417       1.1    jruoho  *
    418   1.1.1.3  christos  * Fields. All share a common header/info field.
    419       1.1    jruoho  *
    420       1.1    jruoho  *****************************************************************************/
    421       1.1    jruoho 
    422       1.1    jruoho /*
    423       1.1    jruoho  * Common bitfield for the field objects
    424       1.1    jruoho  * "Field Datum"  -- a datum from the actual field object
    425       1.1    jruoho  * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
    426       1.1    jruoho  */
    427       1.1    jruoho #define ACPI_COMMON_FIELD_INFO \
    428       1.1    jruoho     UINT8                           FieldFlags;         /* Access, update, and lock bits */\
    429       1.1    jruoho     UINT8                           Attribute;          /* From AccessAs keyword */\
    430       1.1    jruoho     UINT8                           AccessByteWidth;    /* Read/Write size in bytes */\
    431       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Link back to parent node */\
    432       1.1    jruoho     UINT32                          BitLength;          /* Length of field in bits */\
    433       1.1    jruoho     UINT32                          BaseByteOffset;     /* Byte offset within containing object */\
    434       1.1    jruoho     UINT32                          Value;              /* Value to store into the Bank or Index register */\
    435       1.1    jruoho     UINT8                           StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
    436  1.1.1.19  christos     UINT8                           AccessLength       /* For serial regions/fields */
    437       1.1    jruoho 
    438   1.1.1.9  christos /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
    439       1.1    jruoho 
    440   1.1.1.9  christos typedef struct acpi_object_field_common
    441       1.1    jruoho {
    442  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    443  1.1.1.19  christos     ACPI_COMMON_FIELD_INFO;
    444       1.1    jruoho     union acpi_operand_object       *RegionObj;         /* Parent Operation Region object (REGION/BANK fields only) */
    445       1.1    jruoho 
    446       1.1    jruoho } ACPI_OBJECT_FIELD_COMMON;
    447       1.1    jruoho 
    448       1.1    jruoho 
    449       1.1    jruoho typedef struct acpi_object_region_field
    450       1.1    jruoho {
    451  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    452  1.1.1.19  christos     ACPI_COMMON_FIELD_INFO;
    453   1.1.1.3  christos     UINT16                          ResourceLength;
    454       1.1    jruoho     union acpi_operand_object       *RegionObj;         /* Containing OpRegion object */
    455   1.1.1.3  christos     UINT8                           *ResourceBuffer;    /* ResourceTemplate for serial regions/fields */
    456   1.1.1.4  christos     UINT16                          PinNumberIndex;     /* Index relative to previous Connection/Template */
    457  1.1.1.11  christos     UINT8                           *InternalPccBuffer; /* Internal buffer for fields associated with PCC */
    458       1.1    jruoho 
    459       1.1    jruoho } ACPI_OBJECT_REGION_FIELD;
    460       1.1    jruoho 
    461       1.1    jruoho 
    462       1.1    jruoho typedef struct acpi_object_bank_field
    463       1.1    jruoho {
    464  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    465  1.1.1.19  christos     ACPI_COMMON_FIELD_INFO;
    466       1.1    jruoho     union acpi_operand_object       *RegionObj;         /* Containing OpRegion object */
    467       1.1    jruoho     union acpi_operand_object       *BankObj;           /* BankSelect Register object */
    468       1.1    jruoho 
    469       1.1    jruoho } ACPI_OBJECT_BANK_FIELD;
    470       1.1    jruoho 
    471       1.1    jruoho 
    472       1.1    jruoho typedef struct acpi_object_index_field
    473       1.1    jruoho {
    474  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    475  1.1.1.19  christos     ACPI_COMMON_FIELD_INFO;
    476       1.1    jruoho 
    477       1.1    jruoho     /*
    478       1.1    jruoho      * No "RegionObj" pointer needed since the Index and Data registers
    479       1.1    jruoho      * are each field definitions unto themselves.
    480       1.1    jruoho      */
    481       1.1    jruoho     union acpi_operand_object       *IndexObj;          /* Index register */
    482       1.1    jruoho     union acpi_operand_object       *DataObj;           /* Data register */
    483       1.1    jruoho 
    484       1.1    jruoho } ACPI_OBJECT_INDEX_FIELD;
    485       1.1    jruoho 
    486       1.1    jruoho 
    487       1.1    jruoho /* The BufferField is different in that it is part of a Buffer, not an OpRegion */
    488       1.1    jruoho 
    489       1.1    jruoho typedef struct acpi_object_buffer_field
    490       1.1    jruoho {
    491  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    492  1.1.1.19  christos     ACPI_COMMON_FIELD_INFO;
    493  1.1.1.13  christos     BOOLEAN                         IsCreateField;      /* Special case for objects created by CreateField() */
    494       1.1    jruoho     union acpi_operand_object       *BufferObj;         /* Containing Buffer object */
    495       1.1    jruoho 
    496       1.1    jruoho } ACPI_OBJECT_BUFFER_FIELD;
    497       1.1    jruoho 
    498       1.1    jruoho 
    499       1.1    jruoho /******************************************************************************
    500       1.1    jruoho  *
    501       1.1    jruoho  * Objects for handlers
    502       1.1    jruoho  *
    503       1.1    jruoho  *****************************************************************************/
    504       1.1    jruoho 
    505       1.1    jruoho typedef struct acpi_object_notify_handler
    506       1.1    jruoho {
    507  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    508       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Parent device */
    509   1.1.1.3  christos     UINT32                          HandlerType;        /* Type: Device/System/Both */
    510   1.1.1.3  christos     ACPI_NOTIFY_HANDLER             Handler;            /* Handler address */
    511       1.1    jruoho     void                            *Context;
    512   1.1.1.3  christos     union acpi_operand_object       *Next[2];           /* Device and System handler lists */
    513       1.1    jruoho 
    514       1.1    jruoho } ACPI_OBJECT_NOTIFY_HANDLER;
    515       1.1    jruoho 
    516       1.1    jruoho 
    517       1.1    jruoho typedef struct acpi_object_addr_handler
    518       1.1    jruoho {
    519  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    520       1.1    jruoho     UINT8                           SpaceId;
    521       1.1    jruoho     UINT8                           HandlerFlags;
    522       1.1    jruoho     ACPI_ADR_SPACE_HANDLER          Handler;
    523       1.1    jruoho     ACPI_NAMESPACE_NODE             *Node;              /* Parent device */
    524       1.1    jruoho     void                            *Context;
    525  1.1.1.15  christos     ACPI_MUTEX                      ContextMutex;
    526       1.1    jruoho     ACPI_ADR_SPACE_SETUP            Setup;
    527   1.1.1.3  christos     union acpi_operand_object       *RegionList;        /* Regions using this handler */
    528       1.1    jruoho     union acpi_operand_object       *Next;
    529       1.1    jruoho 
    530       1.1    jruoho } ACPI_OBJECT_ADDR_HANDLER;
    531       1.1    jruoho 
    532       1.1    jruoho /* Flags for address handler (HandlerFlags) */
    533       1.1    jruoho 
    534       1.1    jruoho #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED  0x01
    535       1.1    jruoho 
    536       1.1    jruoho 
    537       1.1    jruoho /******************************************************************************
    538       1.1    jruoho  *
    539       1.1    jruoho  * Special internal objects
    540       1.1    jruoho  *
    541       1.1    jruoho  *****************************************************************************/
    542       1.1    jruoho 
    543       1.1    jruoho /*
    544       1.1    jruoho  * The Reference object is used for these opcodes:
    545       1.1    jruoho  * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp
    546       1.1    jruoho  * The Reference.Class differentiates these types.
    547       1.1    jruoho  */
    548       1.1    jruoho typedef struct acpi_object_reference
    549       1.1    jruoho {
    550  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    551   1.1.1.6  christos     UINT8                           Class;              /* Reference Class */
    552   1.1.1.6  christos     UINT8                           TargetType;         /* Used for Index Op */
    553   1.1.1.9  christos     UINT8                           Resolved;           /* Reference has been resolved to a value */
    554   1.1.1.6  christos     void                            *Object;            /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
    555   1.1.1.6  christos     ACPI_NAMESPACE_NODE             *Node;              /* RefOf or Namepath */
    556   1.1.1.6  christos     union acpi_operand_object       **Where;            /* Target of Index */
    557   1.1.1.6  christos     UINT8                           *IndexPointer;      /* Used for Buffers and Strings */
    558   1.1.1.9  christos     UINT8                           *Aml;               /* Used for deferred resolution of the ref */
    559   1.1.1.6  christos     UINT32                          Value;              /* Used for Local/Arg/Index/DdbHandle */
    560       1.1    jruoho 
    561       1.1    jruoho } ACPI_OBJECT_REFERENCE;
    562       1.1    jruoho 
    563       1.1    jruoho /* Values for Reference.Class above */
    564       1.1    jruoho 
    565       1.1    jruoho typedef enum
    566       1.1    jruoho {
    567       1.1    jruoho     ACPI_REFCLASS_LOCAL             = 0,        /* Method local */
    568       1.1    jruoho     ACPI_REFCLASS_ARG               = 1,        /* Method argument */
    569       1.1    jruoho     ACPI_REFCLASS_REFOF             = 2,        /* Result of RefOf() TBD: Split to Ref/Node and Ref/OperandObj? */
    570       1.1    jruoho     ACPI_REFCLASS_INDEX             = 3,        /* Result of Index() */
    571       1.1    jruoho     ACPI_REFCLASS_TABLE             = 4,        /* DdbHandle - Load(), LoadTable() */
    572       1.1    jruoho     ACPI_REFCLASS_NAME              = 5,        /* Reference to a named object */
    573       1.1    jruoho     ACPI_REFCLASS_DEBUG             = 6,        /* Debug object */
    574       1.1    jruoho 
    575       1.1    jruoho     ACPI_REFCLASS_MAX               = 6
    576       1.1    jruoho 
    577       1.1    jruoho } ACPI_REFERENCE_CLASSES;
    578       1.1    jruoho 
    579       1.1    jruoho /*
    580       1.1    jruoho  * Extra object is used as additional storage for types that
    581       1.1    jruoho  * have AML code in their declarations (TermArgs) that must be
    582       1.1    jruoho  * evaluated at run time.
    583       1.1    jruoho  *
    584       1.1    jruoho  * Currently: Region and FieldUnit types
    585       1.1    jruoho  */
    586       1.1    jruoho typedef struct acpi_object_extra
    587       1.1    jruoho {
    588  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    589       1.1    jruoho     ACPI_NAMESPACE_NODE             *Method_REG;        /* _REG method for this region (if any) */
    590   1.1.1.3  christos     ACPI_NAMESPACE_NODE             *ScopeNode;
    591       1.1    jruoho     void                            *RegionContext;     /* Region-specific data */
    592       1.1    jruoho     UINT8                           *AmlStart;
    593       1.1    jruoho     UINT32                          AmlLength;
    594       1.1    jruoho 
    595       1.1    jruoho } ACPI_OBJECT_EXTRA;
    596       1.1    jruoho 
    597       1.1    jruoho 
    598       1.1    jruoho /* Additional data that can be attached to namespace nodes */
    599       1.1    jruoho 
    600       1.1    jruoho typedef struct acpi_object_data
    601       1.1    jruoho {
    602  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    603       1.1    jruoho     ACPI_OBJECT_HANDLER             Handler;
    604       1.1    jruoho     void                            *Pointer;
    605       1.1    jruoho 
    606       1.1    jruoho } ACPI_OBJECT_DATA;
    607       1.1    jruoho 
    608       1.1    jruoho 
    609       1.1    jruoho /* Structure used when objects are cached for reuse */
    610       1.1    jruoho 
    611       1.1    jruoho typedef struct acpi_object_cache_list
    612       1.1    jruoho {
    613  1.1.1.19  christos     ACPI_OBJECT_COMMON_HEADER;
    614       1.1    jruoho     union acpi_operand_object       *Next;              /* Link for object cache and internal lists*/
    615       1.1    jruoho 
    616       1.1    jruoho } ACPI_OBJECT_CACHE_LIST;
    617       1.1    jruoho 
    618       1.1    jruoho 
    619       1.1    jruoho /******************************************************************************
    620       1.1    jruoho  *
    621       1.1    jruoho  * ACPI_OPERAND_OBJECT Descriptor - a giant union of all of the above
    622       1.1    jruoho  *
    623       1.1    jruoho  *****************************************************************************/
    624       1.1    jruoho 
    625       1.1    jruoho typedef union acpi_operand_object
    626       1.1    jruoho {
    627       1.1    jruoho     ACPI_OBJECT_COMMON                  Common;
    628       1.1    jruoho     ACPI_OBJECT_INTEGER                 Integer;
    629       1.1    jruoho     ACPI_OBJECT_STRING                  String;
    630       1.1    jruoho     ACPI_OBJECT_BUFFER                  Buffer;
    631       1.1    jruoho     ACPI_OBJECT_PACKAGE                 Package;
    632       1.1    jruoho     ACPI_OBJECT_EVENT                   Event;
    633       1.1    jruoho     ACPI_OBJECT_METHOD                  Method;
    634       1.1    jruoho     ACPI_OBJECT_MUTEX                   Mutex;
    635       1.1    jruoho     ACPI_OBJECT_REGION                  Region;
    636       1.1    jruoho     ACPI_OBJECT_NOTIFY_COMMON           CommonNotify;
    637       1.1    jruoho     ACPI_OBJECT_DEVICE                  Device;
    638       1.1    jruoho     ACPI_OBJECT_POWER_RESOURCE          PowerResource;
    639       1.1    jruoho     ACPI_OBJECT_PROCESSOR               Processor;
    640       1.1    jruoho     ACPI_OBJECT_THERMAL_ZONE            ThermalZone;
    641       1.1    jruoho     ACPI_OBJECT_FIELD_COMMON            CommonField;
    642       1.1    jruoho     ACPI_OBJECT_REGION_FIELD            Field;
    643       1.1    jruoho     ACPI_OBJECT_BUFFER_FIELD            BufferField;
    644       1.1    jruoho     ACPI_OBJECT_BANK_FIELD              BankField;
    645       1.1    jruoho     ACPI_OBJECT_INDEX_FIELD             IndexField;
    646       1.1    jruoho     ACPI_OBJECT_NOTIFY_HANDLER          Notify;
    647       1.1    jruoho     ACPI_OBJECT_ADDR_HANDLER            AddressSpace;
    648       1.1    jruoho     ACPI_OBJECT_REFERENCE               Reference;
    649       1.1    jruoho     ACPI_OBJECT_EXTRA                   Extra;
    650       1.1    jruoho     ACPI_OBJECT_DATA                    Data;
    651       1.1    jruoho     ACPI_OBJECT_CACHE_LIST              Cache;
    652       1.1    jruoho 
    653       1.1    jruoho     /*
    654       1.1    jruoho      * Add namespace node to union in order to simplify code that accepts both
    655       1.1    jruoho      * ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share
    656       1.1    jruoho      * a common DescriptorType field in order to differentiate them.
    657       1.1    jruoho      */
    658       1.1    jruoho     ACPI_NAMESPACE_NODE                 Node;
    659       1.1    jruoho 
    660       1.1    jruoho } ACPI_OPERAND_OBJECT;
    661       1.1    jruoho 
    662       1.1    jruoho 
    663       1.1    jruoho /******************************************************************************
    664       1.1    jruoho  *
    665       1.1    jruoho  * ACPI_DESCRIPTOR - objects that share a common descriptor identifier
    666       1.1    jruoho  *
    667       1.1    jruoho  *****************************************************************************/
    668       1.1    jruoho 
    669       1.1    jruoho /* Object descriptor types */
    670       1.1    jruoho 
    671       1.1    jruoho #define ACPI_DESC_TYPE_CACHED           0x01        /* Used only when object is cached */
    672       1.1    jruoho #define ACPI_DESC_TYPE_STATE            0x02
    673       1.1    jruoho #define ACPI_DESC_TYPE_STATE_UPDATE     0x03
    674       1.1    jruoho #define ACPI_DESC_TYPE_STATE_PACKAGE    0x04
    675       1.1    jruoho #define ACPI_DESC_TYPE_STATE_CONTROL    0x05
    676       1.1    jruoho #define ACPI_DESC_TYPE_STATE_RPSCOPE    0x06
    677       1.1    jruoho #define ACPI_DESC_TYPE_STATE_PSCOPE     0x07
    678       1.1    jruoho #define ACPI_DESC_TYPE_STATE_WSCOPE     0x08
    679       1.1    jruoho #define ACPI_DESC_TYPE_STATE_RESULT     0x09
    680       1.1    jruoho #define ACPI_DESC_TYPE_STATE_NOTIFY     0x0A
    681       1.1    jruoho #define ACPI_DESC_TYPE_STATE_THREAD     0x0B
    682       1.1    jruoho #define ACPI_DESC_TYPE_WALK             0x0C
    683       1.1    jruoho #define ACPI_DESC_TYPE_PARSER           0x0D
    684       1.1    jruoho #define ACPI_DESC_TYPE_OPERAND          0x0E
    685       1.1    jruoho #define ACPI_DESC_TYPE_NAMED            0x0F
    686       1.1    jruoho #define ACPI_DESC_TYPE_MAX              0x0F
    687       1.1    jruoho 
    688       1.1    jruoho 
    689       1.1    jruoho typedef struct acpi_common_descriptor
    690       1.1    jruoho {
    691       1.1    jruoho     void                            *CommonPointer;
    692       1.1    jruoho     UINT8                           DescriptorType; /* To differentiate various internal objs */
    693       1.1    jruoho 
    694       1.1    jruoho } ACPI_COMMON_DESCRIPTOR;
    695       1.1    jruoho 
    696       1.1    jruoho typedef union acpi_descriptor
    697       1.1    jruoho {
    698       1.1    jruoho     ACPI_COMMON_DESCRIPTOR          Common;
    699       1.1    jruoho     ACPI_OPERAND_OBJECT             Object;
    700       1.1    jruoho     ACPI_NAMESPACE_NODE             Node;
    701       1.1    jruoho     ACPI_PARSE_OBJECT               Op;
    702       1.1    jruoho 
    703       1.1    jruoho } ACPI_DESCRIPTOR;
    704       1.1    jruoho 
    705       1.1    jruoho #pragma pack()
    706       1.1    jruoho 
    707       1.1    jruoho #endif /* _ACOBJECT_H */
    708