xref: /illumos-gate/usr/src/uts/intel/sys/acpi/aclocal.h (revision 35786f68)
17c478bd9Sstevel@tonic-gate /******************************************************************************
27c478bd9Sstevel@tonic-gate  *
37c478bd9Sstevel@tonic-gate  * Name: aclocal.h - Internal data types used across the ACPI subsystem
47c478bd9Sstevel@tonic-gate  *
57c478bd9Sstevel@tonic-gate  *****************************************************************************/
67c478bd9Sstevel@tonic-gate 
7*35786f68SRobert Mustacchi /******************************************************************************
8*35786f68SRobert Mustacchi  *
9*35786f68SRobert Mustacchi  * 1. Copyright Notice
10*35786f68SRobert Mustacchi  *
11*35786f68SRobert Mustacchi  * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
127c478bd9Sstevel@tonic-gate  * All rights reserved.
137c478bd9Sstevel@tonic-gate  *
14*35786f68SRobert Mustacchi  * 2. License
15*35786f68SRobert Mustacchi  *
16*35786f68SRobert Mustacchi  * 2.1. This is your license from Intel Corp. under its intellectual property
17*35786f68SRobert Mustacchi  * rights. You may have additional license terms from the party that provided
18*35786f68SRobert Mustacchi  * you this software, covering your right to use that party's intellectual
19*35786f68SRobert Mustacchi  * property rights.
20*35786f68SRobert Mustacchi  *
21*35786f68SRobert Mustacchi  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22*35786f68SRobert Mustacchi  * copy of the source code appearing in this file ("Covered Code") an
23*35786f68SRobert Mustacchi  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24*35786f68SRobert Mustacchi  * base code distributed originally by Intel ("Original Intel Code") to copy,
25*35786f68SRobert Mustacchi  * make derivatives, distribute, use and display any portion of the Covered
26*35786f68SRobert Mustacchi  * Code in any form, with the right to sublicense such rights; and
27*35786f68SRobert Mustacchi  *
28*35786f68SRobert Mustacchi  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29*35786f68SRobert Mustacchi  * license (with the right to sublicense), under only those claims of Intel
30*35786f68SRobert Mustacchi  * patents that are infringed by the Original Intel Code, to make, use, sell,
31*35786f68SRobert Mustacchi  * offer to sell, and import the Covered Code and derivative works thereof
32*35786f68SRobert Mustacchi  * solely to the minimum extent necessary to exercise the above copyright
33*35786f68SRobert Mustacchi  * license, and in no event shall the patent license extend to any additions
34*35786f68SRobert Mustacchi  * to or modifications of the Original Intel Code. No other license or right
35*35786f68SRobert Mustacchi  * is granted directly or by implication, estoppel or otherwise;
36*35786f68SRobert Mustacchi  *
37*35786f68SRobert Mustacchi  * The above copyright and patent license is granted only if the following
38*35786f68SRobert Mustacchi  * conditions are met:
39*35786f68SRobert Mustacchi  *
40*35786f68SRobert Mustacchi  * 3. Conditions
41*35786f68SRobert Mustacchi  *
42*35786f68SRobert Mustacchi  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43*35786f68SRobert Mustacchi  * Redistribution of source code of any substantial portion of the Covered
44*35786f68SRobert Mustacchi  * Code or modification with rights to further distribute source must include
45*35786f68SRobert Mustacchi  * the above Copyright Notice, the above License, this list of Conditions,
46*35786f68SRobert Mustacchi  * and the following Disclaimer and Export Compliance provision. In addition,
47*35786f68SRobert Mustacchi  * Licensee must cause all Covered Code to which Licensee contributes to
48*35786f68SRobert Mustacchi  * contain a file documenting the changes Licensee made to create that Covered
49*35786f68SRobert Mustacchi  * Code and the date of any change. Licensee must include in that file the
50*35786f68SRobert Mustacchi  * documentation of any changes made by any predecessor Licensee. Licensee
51*35786f68SRobert Mustacchi  * must include a prominent statement that the modification is derived,
52*35786f68SRobert Mustacchi  * directly or indirectly, from Original Intel Code.
53*35786f68SRobert Mustacchi  *
54*35786f68SRobert Mustacchi  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55*35786f68SRobert Mustacchi  * Redistribution of source code of any substantial portion of the Covered
56*35786f68SRobert Mustacchi  * Code or modification without rights to further distribute source must
57*35786f68SRobert Mustacchi  * include the following Disclaimer and Export Compliance provision in the
58*35786f68SRobert Mustacchi  * documentation and/or other materials provided with distribution. In
59*35786f68SRobert Mustacchi  * addition, Licensee may not authorize further sublicense of source of any
60*35786f68SRobert Mustacchi  * portion of the Covered Code, and must include terms to the effect that the
61*35786f68SRobert Mustacchi  * license from Licensee to its licensee is limited to the intellectual
62*35786f68SRobert Mustacchi  * property embodied in the software Licensee provides to its licensee, and
63*35786f68SRobert Mustacchi  * not to intellectual property embodied in modifications its licensee may
64*35786f68SRobert Mustacchi  * make.
65*35786f68SRobert Mustacchi  *
66*35786f68SRobert Mustacchi  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67*35786f68SRobert Mustacchi  * substantial portion of the Covered Code or modification must reproduce the
68*35786f68SRobert Mustacchi  * above Copyright Notice, and the following Disclaimer and Export Compliance
69*35786f68SRobert Mustacchi  * provision in the documentation and/or other materials provided with the
70*35786f68SRobert Mustacchi  * distribution.
71*35786f68SRobert Mustacchi  *
72*35786f68SRobert Mustacchi  * 3.4. Intel retains all right, title, and interest in and to the Original
73*35786f68SRobert Mustacchi  * Intel Code.
74*35786f68SRobert Mustacchi  *
75*35786f68SRobert Mustacchi  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76*35786f68SRobert Mustacchi  * Intel shall be used in advertising or otherwise to promote the sale, use or
77*35786f68SRobert Mustacchi  * other dealings in products derived from or relating to the Covered Code
78*35786f68SRobert Mustacchi  * without prior written authorization from Intel.
79*35786f68SRobert Mustacchi  *
80*35786f68SRobert Mustacchi  * 4. Disclaimer and Export Compliance
81*35786f68SRobert Mustacchi  *
82*35786f68SRobert Mustacchi  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83*35786f68SRobert Mustacchi  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84*35786f68SRobert Mustacchi  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85*35786f68SRobert Mustacchi  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86*35786f68SRobert Mustacchi  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87*35786f68SRobert Mustacchi  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88*35786f68SRobert Mustacchi  * PARTICULAR PURPOSE.
89*35786f68SRobert Mustacchi  *
90*35786f68SRobert Mustacchi  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91*35786f68SRobert Mustacchi  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92*35786f68SRobert Mustacchi  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93*35786f68SRobert Mustacchi  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94*35786f68SRobert Mustacchi  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95*35786f68SRobert Mustacchi  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96*35786f68SRobert Mustacchi  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97*35786f68SRobert Mustacchi  * LIMITED REMEDY.
98*35786f68SRobert Mustacchi  *
99*35786f68SRobert Mustacchi  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100*35786f68SRobert Mustacchi  * software or system incorporating such software without first obtaining any
101*35786f68SRobert Mustacchi  * required license or other approval from the U. S. Department of Commerce or
102*35786f68SRobert Mustacchi  * any other agency or department of the United States Government. In the
103*35786f68SRobert Mustacchi  * event Licensee exports any such software from the United States or
104*35786f68SRobert Mustacchi  * re-exports any such software from a foreign destination, Licensee shall
105*35786f68SRobert Mustacchi  * ensure that the distribution and export/re-export of the software is in
106*35786f68SRobert Mustacchi  * compliance with all laws, regulations, orders, or other restrictions of the
107*35786f68SRobert Mustacchi  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108*35786f68SRobert Mustacchi  * any of its subsidiaries will export/re-export any technical data, process,
109*35786f68SRobert Mustacchi  * software, or service, directly or indirectly, to any country for which the
110*35786f68SRobert Mustacchi  * United States government or any agency thereof requires an export license,
111*35786f68SRobert Mustacchi  * other governmental approval, or letter of assurance, without first obtaining
112*35786f68SRobert Mustacchi  * such license, approval or letter.
113*35786f68SRobert Mustacchi  *
114*35786f68SRobert Mustacchi  *****************************************************************************
115*35786f68SRobert Mustacchi  *
116*35786f68SRobert Mustacchi  * Alternatively, you may choose to be licensed under the terms of the
117*35786f68SRobert Mustacchi  * following license:
118*35786f68SRobert Mustacchi  *
11926f3cdf0SGordon Ross  * Redistribution and use in source and binary forms, with or without
12026f3cdf0SGordon Ross  * modification, are permitted provided that the following conditions
12126f3cdf0SGordon Ross  * are met:
12226f3cdf0SGordon Ross  * 1. Redistributions of source code must retain the above copyright
12326f3cdf0SGordon Ross  *    notice, this list of conditions, and the following disclaimer,
12426f3cdf0SGordon Ross  *    without modification.
12526f3cdf0SGordon Ross  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12626f3cdf0SGordon Ross  *    substantially similar to the "NO WARRANTY" disclaimer below
12726f3cdf0SGordon Ross  *    ("Disclaimer") and any redistribution must be conditioned upon
12826f3cdf0SGordon Ross  *    including a substantially similar Disclaimer requirement for further
12926f3cdf0SGordon Ross  *    binary redistribution.
13026f3cdf0SGordon Ross  * 3. Neither the names of the above-listed copyright holders nor the names
13126f3cdf0SGordon Ross  *    of any contributors may be used to endorse or promote products derived
13226f3cdf0SGordon Ross  *    from this software without specific prior written permission.
1337c478bd9Sstevel@tonic-gate  *
13426f3cdf0SGordon Ross  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13526f3cdf0SGordon Ross  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136*35786f68SRobert Mustacchi  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
13726f3cdf0SGordon Ross  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138*35786f68SRobert Mustacchi  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139*35786f68SRobert Mustacchi  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140*35786f68SRobert Mustacchi  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141*35786f68SRobert Mustacchi  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142*35786f68SRobert Mustacchi  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143*35786f68SRobert Mustacchi  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144*35786f68SRobert Mustacchi  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145*35786f68SRobert Mustacchi  *
146*35786f68SRobert Mustacchi  * Alternatively, you may choose to be licensed under the terms of the
147*35786f68SRobert Mustacchi  * GNU General Public License ("GPL") version 2 as published by the Free
148*35786f68SRobert Mustacchi  * Software Foundation.
149*35786f68SRobert Mustacchi  *
150*35786f68SRobert Mustacchi  *****************************************************************************/
1517c478bd9Sstevel@tonic-gate 
1527c478bd9Sstevel@tonic-gate #ifndef __ACLOCAL_H__
1537c478bd9Sstevel@tonic-gate #define __ACLOCAL_H__
1547c478bd9Sstevel@tonic-gate 
155aa2aa9a6SDana Myers 
15627f7c583Smyers /* acpisrc:StructDefs -- for acpisrc conversion */
1577c478bd9Sstevel@tonic-gate 
15827f7c583Smyers #define ACPI_SERIALIZED                 0xFF
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate typedef UINT32                          ACPI_MUTEX_HANDLE;
161db2bae30SDana Myers #define ACPI_GLOBAL_LOCK                (ACPI_SEMAPHORE) (-1)
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate /* Total number of aml opcodes defined */
1647c478bd9Sstevel@tonic-gate 
165*35786f68SRobert Mustacchi #define AML_NUM_OPCODES                 0x83
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate 
168450d6964Smyers /* Forward declarations */
169450d6964Smyers 
170450d6964Smyers struct acpi_walk_state;
171450d6964Smyers struct acpi_obj_mutex;
172450d6964Smyers union acpi_parse_object;
173450d6964Smyers 
174450d6964Smyers 
1757c478bd9Sstevel@tonic-gate /*****************************************************************************
1767c478bd9Sstevel@tonic-gate  *
1777c478bd9Sstevel@tonic-gate  * Mutex typedefs and structs
1787c478bd9Sstevel@tonic-gate  *
1797c478bd9Sstevel@tonic-gate  ****************************************************************************/
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate /*
1837c478bd9Sstevel@tonic-gate  * Predefined handles for the mutex objects used within the subsystem
1847c478bd9Sstevel@tonic-gate  * All mutex objects are automatically created by AcpiUtMutexInitialize.
1857c478bd9Sstevel@tonic-gate  *
18627f7c583Smyers  * The acquire/release ordering protocol is implied via this list. Mutexes
1877c478bd9Sstevel@tonic-gate  * with a lower value must be acquired before mutexes with a higher value.
1887c478bd9Sstevel@tonic-gate  *
18927f7c583Smyers  * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
19027f7c583Smyers  * table below also!
1917c478bd9Sstevel@tonic-gate  */
19227f7c583Smyers #define ACPI_MTX_INTERPRETER            0   /* AML Interpreter, main lock */
193db2bae30SDana Myers #define ACPI_MTX_NAMESPACE              1   /* ACPI Namespace */
194db2bae30SDana Myers #define ACPI_MTX_TABLES                 2   /* Data for ACPI tables */
19527f7c583Smyers #define ACPI_MTX_EVENTS                 3   /* Data for ACPI events */
19627f7c583Smyers #define ACPI_MTX_CACHES                 4   /* Internal caches, general purposes */
19727f7c583Smyers #define ACPI_MTX_MEMORY                 5   /* Debug memory tracking lists */
19827f7c583Smyers 
1997b1019a6SJerry Jelinek #define ACPI_MAX_MUTEX                  5
2007b1019a6SJerry Jelinek #define ACPI_NUM_MUTEX                  (ACPI_MAX_MUTEX+1)
2017c478bd9Sstevel@tonic-gate 
2027c478bd9Sstevel@tonic-gate 
203aa2aa9a6SDana Myers /* Lock structure for reader/writer interfaces */
204aa2aa9a6SDana Myers 
205aa2aa9a6SDana Myers typedef struct acpi_rw_lock
206aa2aa9a6SDana Myers {
207aa2aa9a6SDana Myers     ACPI_MUTEX              WriterMutex;
208aa2aa9a6SDana Myers     ACPI_MUTEX              ReaderMutex;
209aa2aa9a6SDana Myers     UINT32                  NumReaders;
210aa2aa9a6SDana Myers 
211aa2aa9a6SDana Myers } ACPI_RW_LOCK;
212aa2aa9a6SDana Myers 
2137c478bd9Sstevel@tonic-gate 
21427f7c583Smyers /*
21527f7c583Smyers  * Predefined handles for spinlocks used within the subsystem.
21627f7c583Smyers  * These spinlocks are created by AcpiUtMutexInitialize
21727f7c583Smyers  */
21827f7c583Smyers #define ACPI_LOCK_GPES                  0
21927f7c583Smyers #define ACPI_LOCK_HARDWARE              1
22027f7c583Smyers 
22127f7c583Smyers #define ACPI_MAX_LOCK                   1
2227b1019a6SJerry Jelinek #define ACPI_NUM_LOCK                   (ACPI_MAX_LOCK+1)
22327f7c583Smyers 
22427f7c583Smyers 
225450d6964Smyers /* This Thread ID means that the mutex is not in use (unlocked) */
226450d6964Smyers 
2277b1019a6SJerry Jelinek #define ACPI_MUTEX_NOT_ACQUIRED         ((ACPI_THREAD_ID) -1)
2287b1019a6SJerry Jelinek 
2297b1019a6SJerry Jelinek /* This Thread ID means an invalid thread ID */
2307b1019a6SJerry Jelinek 
2317b1019a6SJerry Jelinek #ifdef ACPI_OS_INVALID_THREAD_ID
2327b1019a6SJerry Jelinek #define ACPI_INVALID_THREAD_ID          ACPI_OS_INVALID_THREAD_ID
2337b1019a6SJerry Jelinek #else
2347b1019a6SJerry Jelinek #define ACPI_INVALID_THREAD_ID          ((ACPI_THREAD_ID) 0xFFFFFFFF)
2357b1019a6SJerry Jelinek #endif
236450d6964Smyers 
2377c478bd9Sstevel@tonic-gate /* Table for the global mutexes */
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate typedef struct acpi_mutex_info
2407c478bd9Sstevel@tonic-gate {
24127f7c583Smyers     ACPI_MUTEX                      Mutex;
24227f7c583Smyers     UINT32                          UseCount;
24327f7c583Smyers     ACPI_THREAD_ID                  ThreadId;
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate } ACPI_MUTEX_INFO;
2467c478bd9Sstevel@tonic-gate 
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate /* Lock flag parameter for various interfaces */
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate #define ACPI_MTX_DO_NOT_LOCK            0
2517c478bd9Sstevel@tonic-gate #define ACPI_MTX_LOCK                   1
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate /* Field access granularities */
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate #define ACPI_FIELD_BYTE_GRANULARITY     1
2577c478bd9Sstevel@tonic-gate #define ACPI_FIELD_WORD_GRANULARITY     2
2587c478bd9Sstevel@tonic-gate #define ACPI_FIELD_DWORD_GRANULARITY    4
2597c478bd9Sstevel@tonic-gate #define ACPI_FIELD_QWORD_GRANULARITY    8
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate 
26227f7c583Smyers #define ACPI_ENTRY_NOT_FOUND            NULL
26327f7c583Smyers 
26427f7c583Smyers 
2657c478bd9Sstevel@tonic-gate /*****************************************************************************
2667c478bd9Sstevel@tonic-gate  *
2677c478bd9Sstevel@tonic-gate  * Namespace typedefs and structs
2687c478bd9Sstevel@tonic-gate  *
2697c478bd9Sstevel@tonic-gate  ****************************************************************************/
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate /* Operational modes of the AML interpreter/scanner */
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate typedef enum
2747c478bd9Sstevel@tonic-gate {
27527f7c583Smyers     ACPI_IMODE_LOAD_PASS1           = 0x01,
27627f7c583Smyers     ACPI_IMODE_LOAD_PASS2           = 0x02,
277db2bae30SDana Myers     ACPI_IMODE_EXECUTE              = 0x03
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate } ACPI_INTERPRETER_MODE;
2807c478bd9Sstevel@tonic-gate 
28127f7c583Smyers 
28227f7c583Smyers /*
28327f7c583Smyers  * The Namespace Node describes a named object that appears in the AML.
28427f7c583Smyers  * DescriptorType is used to differentiate between internal descriptors.
28527f7c583Smyers  *
28627f7c583Smyers  * The node is optimized for both 32-bit and 64-bit platforms:
28727f7c583Smyers  * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
28827f7c583Smyers  *
28927f7c583Smyers  * Note: The DescriptorType and Type fields must appear in the identical
29027f7c583Smyers  * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
29127f7c583Smyers  * structures.
29227f7c583Smyers  */
2937c478bd9Sstevel@tonic-gate typedef struct acpi_namespace_node
2947c478bd9Sstevel@tonic-gate {
29527f7c583Smyers     union acpi_operand_object       *Object;        /* Interpreter object */
29627f7c583Smyers     UINT8                           DescriptorType; /* Differentiate object descriptor types */
29727f7c583Smyers     UINT8                           Type;           /* ACPI Type associated with this name */
29827f7c583Smyers     UINT8                           Flags;          /* Miscellaneous flags */
29927f7c583Smyers     ACPI_OWNER_ID                   OwnerId;        /* Node creator */
30027f7c583Smyers     ACPI_NAME_UNION                 Name;           /* ACPI Name, always 4 chars per ACPI spec */
30126f3cdf0SGordon Ross     struct acpi_namespace_node      *Parent;        /* Parent node */
30227f7c583Smyers     struct acpi_namespace_node      *Child;         /* First child */
30326f3cdf0SGordon Ross     struct acpi_namespace_node      *Peer;          /* First peer */
30427f7c583Smyers 
30527f7c583Smyers     /*
30627f7c583Smyers      * The following fields are used by the ASL compiler and disassembler only
30727f7c583Smyers      */
30827f7c583Smyers #ifdef ACPI_LARGE_NAMESPACE_NODE
30927f7c583Smyers     union acpi_parse_object         *Op;
3107b1019a6SJerry Jelinek     void                            *MethodLocals;
3117b1019a6SJerry Jelinek     void                            *MethodArgs;
31227f7c583Smyers     UINT32                          Value;
31327f7c583Smyers     UINT32                          Length;
3147b1019a6SJerry Jelinek     UINT8                           ArgCount;
3157b1019a6SJerry Jelinek 
316450d6964Smyers #endif
317450d6964Smyers 
3187c478bd9Sstevel@tonic-gate } ACPI_NAMESPACE_NODE;
3197c478bd9Sstevel@tonic-gate 
3207c478bd9Sstevel@tonic-gate 
32127f7c583Smyers /* Namespace Node flags */
3227c478bd9Sstevel@tonic-gate 
32326f3cdf0SGordon Ross #define ANOBJ_RESERVED                  0x01    /* Available for use */
324db2bae30SDana Myers #define ANOBJ_TEMPORARY                 0x02    /* Node is create by a method and is temporary */
32527f7c583Smyers #define ANOBJ_METHOD_ARG                0x04    /* Node is a method argument */
32627f7c583Smyers #define ANOBJ_METHOD_LOCAL              0x08    /* Node is a method local */
32727f7c583Smyers #define ANOBJ_SUBTREE_HAS_INI           0x10    /* Used to optimize device initialization */
328aa2aa9a6SDana Myers #define ANOBJ_EVALUATED                 0x20    /* Set on first evaluation of node */
329aa2aa9a6SDana Myers #define ANOBJ_ALLOCATED_BUFFER          0x40    /* Method AML buffer is dynamic (InstallMethod) */
3307c478bd9Sstevel@tonic-gate 
33127f7c583Smyers #define ANOBJ_IS_EXTERNAL               0x08    /* iASL only: This object created via External() */
33227f7c583Smyers #define ANOBJ_METHOD_NO_RETVAL          0x10    /* iASL only: Method has no return value */
33327f7c583Smyers #define ANOBJ_METHOD_SOME_NO_RETVAL     0x20    /* iASL only: Method has at least one return value */
33427f7c583Smyers #define ANOBJ_IS_REFERENCED             0x80    /* iASL only: Object was referenced */
3357c478bd9Sstevel@tonic-gate 
336db2bae30SDana Myers 
33726f3cdf0SGordon Ross /* Internal ACPI table management - master table list */
338db2bae30SDana Myers 
33926f3cdf0SGordon Ross typedef struct acpi_table_list
3407c478bd9Sstevel@tonic-gate {
34126f3cdf0SGordon Ross     ACPI_TABLE_DESC                 *Tables;            /* Table descriptor array */
34226f3cdf0SGordon Ross     UINT32                          CurrentTableCount;  /* Tables currently in the array */
34326f3cdf0SGordon Ross     UINT32                          MaxTableCount;      /* Max tables array will hold */
344db2bae30SDana Myers     UINT8                           Flags;
345db2bae30SDana Myers 
34626f3cdf0SGordon Ross } ACPI_TABLE_LIST;
347db2bae30SDana Myers 
348db2bae30SDana Myers /* Flags for above */
349db2bae30SDana Myers 
350db2bae30SDana Myers #define ACPI_ROOT_ORIGIN_UNKNOWN        (0)     /* ~ORIGIN_ALLOCATED */
351db2bae30SDana Myers #define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
352db2bae30SDana Myers #define ACPI_ROOT_ALLOW_RESIZE          (2)
3537c478bd9Sstevel@tonic-gate 
354db2bae30SDana Myers 
3557b1019a6SJerry Jelinek /* List to manage incoming ACPI tables */
3567b1019a6SJerry Jelinek 
3577b1019a6SJerry Jelinek typedef struct acpi_new_table_desc
3587b1019a6SJerry Jelinek {
3597b1019a6SJerry Jelinek     ACPI_TABLE_HEADER               *Table;
3607b1019a6SJerry Jelinek     struct acpi_new_table_desc      *Next;
3617b1019a6SJerry Jelinek 
3627b1019a6SJerry Jelinek } ACPI_NEW_TABLE_DESC;
3637b1019a6SJerry Jelinek 
3647b1019a6SJerry Jelinek 
3657b1019a6SJerry Jelinek /* Predefined table indexes */
366db2bae30SDana Myers 
3677b1019a6SJerry Jelinek #define ACPI_INVALID_TABLE_INDEX        (0xFFFFFFFF)
3687c478bd9Sstevel@tonic-gate 
3697c478bd9Sstevel@tonic-gate 
3707c478bd9Sstevel@tonic-gate typedef struct acpi_find_context
3717c478bd9Sstevel@tonic-gate {
37227f7c583Smyers     char                            *SearchFor;
37327f7c583Smyers     ACPI_HANDLE                     *List;
37427f7c583Smyers     UINT32                          *Count;
3757c478bd9Sstevel@tonic-gate 
3767c478bd9Sstevel@tonic-gate } ACPI_FIND_CONTEXT;
3777c478bd9Sstevel@tonic-gate 
3787c478bd9Sstevel@tonic-gate 
3797c478bd9Sstevel@tonic-gate typedef struct acpi_ns_search_data
3807c478bd9Sstevel@tonic-gate {
38127f7c583Smyers     ACPI_NAMESPACE_NODE             *Node;
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate } ACPI_NS_SEARCH_DATA;
3847c478bd9Sstevel@tonic-gate 
3857c478bd9Sstevel@tonic-gate 
3867c478bd9Sstevel@tonic-gate /* Object types used during package copies */
3877c478bd9Sstevel@tonic-gate 
3887c478bd9Sstevel@tonic-gate #define ACPI_COPY_TYPE_SIMPLE           0
3897c478bd9Sstevel@tonic-gate #define ACPI_COPY_TYPE_PACKAGE          1
3907c478bd9Sstevel@tonic-gate 
39127f7c583Smyers 
3927c478bd9Sstevel@tonic-gate /* Info structure used to convert external<->internal namestrings */
3937c478bd9Sstevel@tonic-gate 
3947c478bd9Sstevel@tonic-gate typedef struct acpi_namestring_info
3957c478bd9Sstevel@tonic-gate {
396db2bae30SDana Myers     const char                      *ExternalName;
397db2bae30SDana Myers     const char                      *NextExternalChar;
39827f7c583Smyers     char                            *InternalName;
39927f7c583Smyers     UINT32                          Length;
40027f7c583Smyers     UINT32                          NumSegments;
40127f7c583Smyers     UINT32                          NumCarats;
40227f7c583Smyers     BOOLEAN                         FullyQualified;
4037c478bd9Sstevel@tonic-gate 
4047c478bd9Sstevel@tonic-gate } ACPI_NAMESTRING_INFO;
4057c478bd9Sstevel@tonic-gate 
4067c478bd9Sstevel@tonic-gate 
4077c478bd9Sstevel@tonic-gate /* Field creation info */
4087c478bd9Sstevel@tonic-gate 
4097c478bd9Sstevel@tonic-gate typedef struct acpi_create_field_info
4107c478bd9Sstevel@tonic-gate {
41127f7c583Smyers     ACPI_NAMESPACE_NODE             *RegionNode;
41227f7c583Smyers     ACPI_NAMESPACE_NODE             *FieldNode;
41327f7c583Smyers     ACPI_NAMESPACE_NODE             *RegisterNode;
41427f7c583Smyers     ACPI_NAMESPACE_NODE             *DataRegisterNode;
4157b1019a6SJerry Jelinek     ACPI_NAMESPACE_NODE             *ConnectionNode;
4167b1019a6SJerry Jelinek     UINT8                           *ResourceBuffer;
41727f7c583Smyers     UINT32                          BankValue;
41827f7c583Smyers     UINT32                          FieldBitPosition;
41927f7c583Smyers     UINT32                          FieldBitLength;
4207b1019a6SJerry Jelinek     UINT16                          ResourceLength;
4217b1019a6SJerry Jelinek     UINT16                          PinNumberIndex;
42227f7c583Smyers     UINT8                           FieldFlags;
42327f7c583Smyers     UINT8                           Attribute;
42427f7c583Smyers     UINT8                           FieldType;
4257b1019a6SJerry Jelinek     UINT8                           AccessLength;
4267c478bd9Sstevel@tonic-gate 
4277c478bd9Sstevel@tonic-gate } ACPI_CREATE_FIELD_INFO;
4287c478bd9Sstevel@tonic-gate 
4297c478bd9Sstevel@tonic-gate 
43027f7c583Smyers typedef
43127f7c583Smyers ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
43227f7c583Smyers     struct acpi_walk_state          *WalkState);
43327f7c583Smyers 
43427f7c583Smyers 
43530082d0cSmyers /*
4367b1019a6SJerry Jelinek  * Bitmapped ACPI types. Used internally only
43730082d0cSmyers  */
43830082d0cSmyers #define ACPI_BTYPE_ANY                  0x00000000
43930082d0cSmyers #define ACPI_BTYPE_INTEGER              0x00000001
44030082d0cSmyers #define ACPI_BTYPE_STRING               0x00000002
44130082d0cSmyers #define ACPI_BTYPE_BUFFER               0x00000004
44230082d0cSmyers #define ACPI_BTYPE_PACKAGE              0x00000008
44330082d0cSmyers #define ACPI_BTYPE_FIELD_UNIT           0x00000010
44430082d0cSmyers #define ACPI_BTYPE_DEVICE               0x00000020
44530082d0cSmyers #define ACPI_BTYPE_EVENT                0x00000040
44630082d0cSmyers #define ACPI_BTYPE_METHOD               0x00000080
44730082d0cSmyers #define ACPI_BTYPE_MUTEX                0x00000100
44830082d0cSmyers #define ACPI_BTYPE_REGION               0x00000200
44930082d0cSmyers #define ACPI_BTYPE_POWER                0x00000400
45030082d0cSmyers #define ACPI_BTYPE_PROCESSOR            0x00000800
45130082d0cSmyers #define ACPI_BTYPE_THERMAL              0x00001000
45230082d0cSmyers #define ACPI_BTYPE_BUFFER_FIELD         0x00002000
45330082d0cSmyers #define ACPI_BTYPE_DDB_HANDLE           0x00004000
45430082d0cSmyers #define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
4557b1019a6SJerry Jelinek #define ACPI_BTYPE_REFERENCE_OBJECT     0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */
45630082d0cSmyers #define ACPI_BTYPE_RESOURCE             0x00020000
4577b1019a6SJerry Jelinek #define ACPI_BTYPE_NAMED_REFERENCE      0x00040000 /* Generic unresolved Name or Namepath */
45830082d0cSmyers 
45930082d0cSmyers #define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
46030082d0cSmyers 
46130082d0cSmyers #define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
4627b1019a6SJerry Jelinek 
4637b1019a6SJerry Jelinek     /* Used by Copy, DeRefOf, Store, Printf, Fprintf */
4647b1019a6SJerry Jelinek 
4657b1019a6SJerry Jelinek #define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE)
46630082d0cSmyers #define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
46730082d0cSmyers #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF  /* ARG or LOCAL */
46830082d0cSmyers #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
46930082d0cSmyers 
4707b1019a6SJerry Jelinek #pragma pack(1)
47130082d0cSmyers 
472aa2aa9a6SDana Myers /*
473aa2aa9a6SDana Myers  * Information structure for ACPI predefined names.
474aa2aa9a6SDana Myers  * Each entry in the table contains the following items:
475aa2aa9a6SDana Myers  *
476aa2aa9a6SDana Myers  * Name                 - The ACPI reserved name
477aa2aa9a6SDana Myers  * ParamCount           - Number of arguments to the method
478aa2aa9a6SDana Myers  * ExpectedReturnBtypes - Allowed type(s) for the return value
479aa2aa9a6SDana Myers  */
480aa2aa9a6SDana Myers typedef struct acpi_name_info
481aa2aa9a6SDana Myers {
482aa2aa9a6SDana Myers     char                        Name[ACPI_NAME_SIZE];
4837b1019a6SJerry Jelinek     UINT16                      ArgumentList;
484aa2aa9a6SDana Myers     UINT8                       ExpectedBtypes;
485aa2aa9a6SDana Myers 
486aa2aa9a6SDana Myers } ACPI_NAME_INFO;
487aa2aa9a6SDana Myers 
488aa2aa9a6SDana Myers /*
489aa2aa9a6SDana Myers  * Secondary information structures for ACPI predefined objects that return
490aa2aa9a6SDana Myers  * package objects. This structure appears as the next entry in the table
491aa2aa9a6SDana Myers  * after the NAME_INFO structure above.
492aa2aa9a6SDana Myers  *
493aa2aa9a6SDana Myers  * The reason for this is to minimize the size of the predefined name table.
494aa2aa9a6SDana Myers  */
495aa2aa9a6SDana Myers 
496aa2aa9a6SDana Myers /*
497aa2aa9a6SDana Myers  * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
4987b1019a6SJerry Jelinek  * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
4997b1019a6SJerry Jelinek  * ACPI_PTYPE2_FIX_VAR
500aa2aa9a6SDana Myers  */
501aa2aa9a6SDana Myers typedef struct acpi_package_info
502aa2aa9a6SDana Myers {
503aa2aa9a6SDana Myers     UINT8                       Type;
504aa2aa9a6SDana Myers     UINT8                       ObjectType1;
505aa2aa9a6SDana Myers     UINT8                       Count1;
506aa2aa9a6SDana Myers     UINT8                       ObjectType2;
507aa2aa9a6SDana Myers     UINT8                       Count2;
5087b1019a6SJerry Jelinek     UINT16                      Reserved;
509aa2aa9a6SDana Myers 
510aa2aa9a6SDana Myers } ACPI_PACKAGE_INFO;
511aa2aa9a6SDana Myers 
512aa2aa9a6SDana Myers /* Used for ACPI_PTYPE2_FIXED */
513aa2aa9a6SDana Myers 
514aa2aa9a6SDana Myers typedef struct acpi_package_info2
515aa2aa9a6SDana Myers {
516aa2aa9a6SDana Myers     UINT8                       Type;
517aa2aa9a6SDana Myers     UINT8                       Count;
518aa2aa9a6SDana Myers     UINT8                       ObjectType[4];
5197b1019a6SJerry Jelinek     UINT8                       Reserved;
520aa2aa9a6SDana Myers 
521aa2aa9a6SDana Myers } ACPI_PACKAGE_INFO2;
522aa2aa9a6SDana Myers 
523aa2aa9a6SDana Myers /* Used for ACPI_PTYPE1_OPTION */
524aa2aa9a6SDana Myers 
525aa2aa9a6SDana Myers typedef struct acpi_package_info3
526aa2aa9a6SDana Myers {
527aa2aa9a6SDana Myers     UINT8                       Type;
528aa2aa9a6SDana Myers     UINT8                       Count;
529aa2aa9a6SDana Myers     UINT8                       ObjectType[2];
530aa2aa9a6SDana Myers     UINT8                       TailObjectType;
5317b1019a6SJerry Jelinek     UINT16                      Reserved;
532aa2aa9a6SDana Myers 
533aa2aa9a6SDana Myers } ACPI_PACKAGE_INFO3;
534aa2aa9a6SDana Myers 
5357b1019a6SJerry Jelinek typedef struct acpi_package_info4
5367b1019a6SJerry Jelinek {
5377b1019a6SJerry Jelinek     UINT8                       Type;
5387b1019a6SJerry Jelinek     UINT8                       ObjectType1;
5397b1019a6SJerry Jelinek     UINT8                       Count1;
5407b1019a6SJerry Jelinek     UINT8                       SubObjectTypes;
5417b1019a6SJerry Jelinek     UINT8                       PkgCount;
5427b1019a6SJerry Jelinek     UINT16                      Reserved;
5437b1019a6SJerry Jelinek 
5447b1019a6SJerry Jelinek } ACPI_PACKAGE_INFO4;
5457b1019a6SJerry Jelinek 
546aa2aa9a6SDana Myers typedef union acpi_predefined_info
547aa2aa9a6SDana Myers {
548aa2aa9a6SDana Myers     ACPI_NAME_INFO              Info;
549aa2aa9a6SDana Myers     ACPI_PACKAGE_INFO           RetInfo;
550aa2aa9a6SDana Myers     ACPI_PACKAGE_INFO2          RetInfo2;
551aa2aa9a6SDana Myers     ACPI_PACKAGE_INFO3          RetInfo3;
5527b1019a6SJerry Jelinek     ACPI_PACKAGE_INFO4          RetInfo4;
553aa2aa9a6SDana Myers 
554aa2aa9a6SDana Myers } ACPI_PREDEFINED_INFO;
555aa2aa9a6SDana Myers 
5567b1019a6SJerry Jelinek /* Reset to default packing */
55757190917SDana Myers 
5587b1019a6SJerry Jelinek #pragma pack()
55957190917SDana Myers 
56057190917SDana Myers 
5617b1019a6SJerry Jelinek /* Return object auto-repair info */
5627b1019a6SJerry Jelinek 
5637b1019a6SJerry Jelinek typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
5647b1019a6SJerry Jelinek     struct acpi_namespace_node  *Scope,
5657b1019a6SJerry Jelinek     union acpi_operand_object   *OriginalObject,
5667b1019a6SJerry Jelinek     union acpi_operand_object   **ConvertedObject);
56757190917SDana Myers 
5687b1019a6SJerry Jelinek typedef struct acpi_simple_repair_info
5697b1019a6SJerry Jelinek {
5707b1019a6SJerry Jelinek     char                        Name[ACPI_NAME_SIZE];
5717b1019a6SJerry Jelinek     UINT32                      UnexpectedBtypes;
5727b1019a6SJerry Jelinek     UINT32                      PackageIndex;
5737b1019a6SJerry Jelinek     ACPI_OBJECT_CONVERTER       ObjectConverter;
57457190917SDana Myers 
5757b1019a6SJerry Jelinek } ACPI_SIMPLE_REPAIR_INFO;
57657190917SDana Myers 
57757190917SDana Myers 
578aa2aa9a6SDana Myers /*
579aa2aa9a6SDana Myers  * Bitmapped return value types
580aa2aa9a6SDana Myers  * Note: the actual data types must be contiguous, a loop in nspredef.c
581aa2aa9a6SDana Myers  * depends on this.
582aa2aa9a6SDana Myers  */
583aa2aa9a6SDana Myers #define ACPI_RTYPE_ANY                  0x00
584aa2aa9a6SDana Myers #define ACPI_RTYPE_NONE                 0x01
585aa2aa9a6SDana Myers #define ACPI_RTYPE_INTEGER              0x02
586aa2aa9a6SDana Myers #define ACPI_RTYPE_STRING               0x04
587aa2aa9a6SDana Myers #define ACPI_RTYPE_BUFFER               0x08
588aa2aa9a6SDana Myers #define ACPI_RTYPE_PACKAGE              0x10
589aa2aa9a6SDana Myers #define ACPI_RTYPE_REFERENCE            0x20
590aa2aa9a6SDana Myers #define ACPI_RTYPE_ALL                  0x3F
591aa2aa9a6SDana Myers 
592aa2aa9a6SDana Myers #define ACPI_NUM_RTYPES                 5   /* Number of actual object types */
593aa2aa9a6SDana Myers 
594aa2aa9a6SDana Myers 
5957b1019a6SJerry Jelinek /* Info for running the _REG methods */
5967b1019a6SJerry Jelinek 
5977b1019a6SJerry Jelinek typedef struct acpi_reg_walk_info
5987b1019a6SJerry Jelinek {
5997b1019a6SJerry Jelinek     ACPI_ADR_SPACE_TYPE     SpaceId;
6007b1019a6SJerry Jelinek     UINT32                  Function;
6017b1019a6SJerry Jelinek     UINT32                  RegRunCount;
6027b1019a6SJerry Jelinek 
6037b1019a6SJerry Jelinek } ACPI_REG_WALK_INFO;
6047b1019a6SJerry Jelinek 
6057b1019a6SJerry Jelinek 
6067c478bd9Sstevel@tonic-gate /*****************************************************************************
6077c478bd9Sstevel@tonic-gate  *
6087c478bd9Sstevel@tonic-gate  * Event typedefs and structs
6097c478bd9Sstevel@tonic-gate  *
6107c478bd9Sstevel@tonic-gate  ****************************************************************************/
6117c478bd9Sstevel@tonic-gate 
6127b1019a6SJerry Jelinek /* Dispatch info for each host-installed SCI handler */
6137b1019a6SJerry Jelinek 
6147b1019a6SJerry Jelinek typedef struct acpi_sci_handler_info
6157b1019a6SJerry Jelinek {
6167b1019a6SJerry Jelinek     struct acpi_sci_handler_info    *Next;
6177b1019a6SJerry Jelinek     ACPI_SCI_HANDLER                Address;        /* Address of handler */
6187b1019a6SJerry Jelinek     void                            *Context;       /* Context to be passed to handler */
6197b1019a6SJerry Jelinek 
6207b1019a6SJerry Jelinek } ACPI_SCI_HANDLER_INFO;
6217b1019a6SJerry Jelinek 
6227c478bd9Sstevel@tonic-gate /* Dispatch info for each GPE -- either a method or handler, cannot be both */
6237c478bd9Sstevel@tonic-gate 
62426f3cdf0SGordon Ross typedef struct acpi_gpe_handler_info
6257c478bd9Sstevel@tonic-gate {
62626f3cdf0SGordon Ross     ACPI_GPE_HANDLER                Address;        /* Address of handler, if any */
6277c478bd9Sstevel@tonic-gate     void                            *Context;       /* Context to be passed to handler */
6287c478bd9Sstevel@tonic-gate     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level (saved) */
62926f3cdf0SGordon Ross     UINT8                           OriginalFlags;  /* Original (pre-handler) GPE info */
63026f3cdf0SGordon Ross     BOOLEAN                         OriginallyEnabled; /* True if GPE was originally enabled */
6317c478bd9Sstevel@tonic-gate 
63226f3cdf0SGordon Ross } ACPI_GPE_HANDLER_INFO;
6337c478bd9Sstevel@tonic-gate 
6347b1019a6SJerry Jelinek /* Notify info for implicit notify, multiple device objects */
6357b1019a6SJerry Jelinek 
6367b1019a6SJerry Jelinek typedef struct acpi_gpe_notify_info
6377b1019a6SJerry Jelinek {
6387b1019a6SJerry Jelinek     ACPI_NAMESPACE_NODE             *DeviceNode;    /* Device to be notified */
6397b1019a6SJerry Jelinek     struct acpi_gpe_notify_info     *Next;
6407b1019a6SJerry Jelinek 
6417b1019a6SJerry Jelinek } ACPI_GPE_NOTIFY_INFO;
6427b1019a6SJerry Jelinek 
64326f3cdf0SGordon Ross /*
64426f3cdf0SGordon Ross  * GPE dispatch info. At any time, the GPE can have at most one type
64526f3cdf0SGordon Ross  * of dispatch - Method, Handler, or Implicit Notify.
64626f3cdf0SGordon Ross  */
6477c478bd9Sstevel@tonic-gate typedef union acpi_gpe_dispatch_info
6487c478bd9Sstevel@tonic-gate {
6497c478bd9Sstevel@tonic-gate     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level */
6507b1019a6SJerry Jelinek     ACPI_GPE_HANDLER_INFO           *Handler;       /* Installed GPE handler */
6517b1019a6SJerry Jelinek     ACPI_GPE_NOTIFY_INFO            *NotifyList;    /* List of _PRW devices for implicit notifies */
6527c478bd9Sstevel@tonic-gate 
6537c478bd9Sstevel@tonic-gate } ACPI_GPE_DISPATCH_INFO;
6547c478bd9Sstevel@tonic-gate 
6557c478bd9Sstevel@tonic-gate /*
6567c478bd9Sstevel@tonic-gate  * Information about a GPE, one per each GPE in an array.
6577c478bd9Sstevel@tonic-gate  * NOTE: Important to keep this struct as small as possible.
6587c478bd9Sstevel@tonic-gate  */
6597c478bd9Sstevel@tonic-gate typedef struct acpi_gpe_event_info
6607c478bd9Sstevel@tonic-gate {
661*35786f68SRobert Mustacchi     union acpi_gpe_dispatch_info    Dispatch;           /* Either Method, Handler, or NotifyList */
662*35786f68SRobert Mustacchi     struct acpi_gpe_register_info   *RegisterInfo;      /* Backpointer to register info */
663*35786f68SRobert Mustacchi     UINT8                           Flags;              /* Misc info about this GPE */
664*35786f68SRobert Mustacchi     UINT8                           GpeNumber;          /* This GPE */
665*35786f68SRobert Mustacchi     UINT8                           RuntimeCount;       /* References to a run GPE */
666*35786f68SRobert Mustacchi     BOOLEAN                         DisableForDispatch; /* Masked during dispatching */
6677c478bd9Sstevel@tonic-gate 
6687c478bd9Sstevel@tonic-gate } ACPI_GPE_EVENT_INFO;
6697c478bd9Sstevel@tonic-gate 
6707c478bd9Sstevel@tonic-gate /* Information about a GPE register pair, one per each status/enable pair in an array */
6717c478bd9Sstevel@tonic-gate 
6727c478bd9Sstevel@tonic-gate typedef struct acpi_gpe_register_info
6737c478bd9Sstevel@tonic-gate {
6747c478bd9Sstevel@tonic-gate     ACPI_GENERIC_ADDRESS            StatusAddress;  /* Address of status reg */
6757c478bd9Sstevel@tonic-gate     ACPI_GENERIC_ADDRESS            EnableAddress;  /* Address of enable reg */
6767b1019a6SJerry Jelinek     UINT16                          BaseGpeNumber;  /* Base GPE number for this register */
6777c478bd9Sstevel@tonic-gate     UINT8                           EnableForWake;  /* GPEs to keep enabled when sleeping */
6787c478bd9Sstevel@tonic-gate     UINT8                           EnableForRun;   /* GPEs to keep enabled when running */
679*35786f68SRobert Mustacchi     UINT8                           MaskForRun;     /* GPEs to keep masked when running */
6807b1019a6SJerry Jelinek     UINT8                           EnableMask;     /* Current mask of enabled GPEs */
6817c478bd9Sstevel@tonic-gate 
6827c478bd9Sstevel@tonic-gate } ACPI_GPE_REGISTER_INFO;
6837c478bd9Sstevel@tonic-gate 
6847c478bd9Sstevel@tonic-gate /*
6857c478bd9Sstevel@tonic-gate  * Information about a GPE register block, one per each installed block --
6867c478bd9Sstevel@tonic-gate  * GPE0, GPE1, and one per each installed GPE Block Device.
6877c478bd9Sstevel@tonic-gate  */
6887c478bd9Sstevel@tonic-gate typedef struct acpi_gpe_block_info
6897c478bd9Sstevel@tonic-gate {
6907c478bd9Sstevel@tonic-gate     ACPI_NAMESPACE_NODE             *Node;
6917c478bd9Sstevel@tonic-gate     struct acpi_gpe_block_info      *Previous;
6927c478bd9Sstevel@tonic-gate     struct acpi_gpe_block_info      *Next;
6937c478bd9Sstevel@tonic-gate     struct acpi_gpe_xrupt_info      *XruptBlock;    /* Backpointer to interrupt block */
6947c478bd9Sstevel@tonic-gate     ACPI_GPE_REGISTER_INFO          *RegisterInfo;  /* One per GPE register pair */
6957c478bd9Sstevel@tonic-gate     ACPI_GPE_EVENT_INFO             *EventInfo;     /* One for each GPE */
6967b1019a6SJerry Jelinek     UINT64                          Address;        /* Base address of the block */
6977c478bd9Sstevel@tonic-gate     UINT32                          RegisterCount;  /* Number of register pairs in block */
69826f3cdf0SGordon Ross     UINT16                          GpeCount;       /* Number of individual GPEs in block */
6997b1019a6SJerry Jelinek     UINT16                          BlockBaseNumber;/* Base GPE number for this block */
7007b1019a6SJerry Jelinek     UINT8                           SpaceId;
70126f3cdf0SGordon Ross     BOOLEAN                         Initialized;    /* TRUE if this block is initialized */
7027c478bd9Sstevel@tonic-gate 
7037c478bd9Sstevel@tonic-gate } ACPI_GPE_BLOCK_INFO;
7047c478bd9Sstevel@tonic-gate 
7057c478bd9Sstevel@tonic-gate /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
7067c478bd9Sstevel@tonic-gate 
7077c478bd9Sstevel@tonic-gate typedef struct acpi_gpe_xrupt_info
7087c478bd9Sstevel@tonic-gate {
7097c478bd9Sstevel@tonic-gate     struct acpi_gpe_xrupt_info      *Previous;
7107c478bd9Sstevel@tonic-gate     struct acpi_gpe_xrupt_info      *Next;
7117c478bd9Sstevel@tonic-gate     ACPI_GPE_BLOCK_INFO             *GpeBlockListHead;  /* List of GPE blocks for this xrupt */
712450d6964Smyers     UINT32                          InterruptNumber;    /* System interrupt number */
7137c478bd9Sstevel@tonic-gate 
7147c478bd9Sstevel@tonic-gate } ACPI_GPE_XRUPT_INFO;
7157c478bd9Sstevel@tonic-gate 
7167c478bd9Sstevel@tonic-gate typedef struct acpi_gpe_walk_info
7177c478bd9Sstevel@tonic-gate {
7187c478bd9Sstevel@tonic-gate     ACPI_NAMESPACE_NODE             *GpeDevice;
7197c478bd9Sstevel@tonic-gate     ACPI_GPE_BLOCK_INFO             *GpeBlock;
72026f3cdf0SGordon Ross     UINT16                          Count;
72126f3cdf0SGordon Ross     ACPI_OWNER_ID                   OwnerId;
72226f3cdf0SGordon Ross     BOOLEAN                         ExecuteByOwnerId;
7237c478bd9Sstevel@tonic-gate 
7247c478bd9Sstevel@tonic-gate } ACPI_GPE_WALK_INFO;
7257c478bd9Sstevel@tonic-gate 
726aa2aa9a6SDana Myers typedef struct acpi_gpe_device_info
727aa2aa9a6SDana Myers {
728aa2aa9a6SDana Myers     UINT32                          Index;
729aa2aa9a6SDana Myers     UINT32                          NextBlockBaseIndex;
730aa2aa9a6SDana Myers     ACPI_STATUS                     Status;
731aa2aa9a6SDana Myers     ACPI_NAMESPACE_NODE             *GpeDevice;
732aa2aa9a6SDana Myers 
733aa2aa9a6SDana Myers } ACPI_GPE_DEVICE_INFO;
7347c478bd9Sstevel@tonic-gate 
7357c478bd9Sstevel@tonic-gate typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
73627f7c583Smyers     ACPI_GPE_XRUPT_INFO             *GpeXruptInfo,
737aa2aa9a6SDana Myers     ACPI_GPE_BLOCK_INFO             *GpeBlock,
738