xref: /minix3/minix/drivers/power/acpi/include/aclocal.h (revision 29492bb71c7148a089a5afafa0c99409161218df)
1433d6423SLionel Sambuc /******************************************************************************
2433d6423SLionel Sambuc  *
3433d6423SLionel Sambuc  * Name: aclocal.h - Internal data types used across the ACPI subsystem
4433d6423SLionel Sambuc  *
5433d6423SLionel Sambuc  *****************************************************************************/
6433d6423SLionel Sambuc 
7*29492bb7SDavid van Moolenbroek /*
8*29492bb7SDavid van Moolenbroek  * Copyright (C) 2000 - 2014, Intel Corp.
9433d6423SLionel Sambuc  * All rights reserved.
10433d6423SLionel Sambuc  *
11*29492bb7SDavid van Moolenbroek  * Redistribution and use in source and binary forms, with or without
12*29492bb7SDavid van Moolenbroek  * modification, are permitted provided that the following conditions
13*29492bb7SDavid van Moolenbroek  * are met:
14*29492bb7SDavid van Moolenbroek  * 1. Redistributions of source code must retain the above copyright
15*29492bb7SDavid van Moolenbroek  *    notice, this list of conditions, and the following disclaimer,
16*29492bb7SDavid van Moolenbroek  *    without modification.
17*29492bb7SDavid van Moolenbroek  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*29492bb7SDavid van Moolenbroek  *    substantially similar to the "NO WARRANTY" disclaimer below
19*29492bb7SDavid van Moolenbroek  *    ("Disclaimer") and any redistribution must be conditioned upon
20*29492bb7SDavid van Moolenbroek  *    including a substantially similar Disclaimer requirement for further
21*29492bb7SDavid van Moolenbroek  *    binary redistribution.
22*29492bb7SDavid van Moolenbroek  * 3. Neither the names of the above-listed copyright holders nor the names
23*29492bb7SDavid van Moolenbroek  *    of any contributors may be used to endorse or promote products derived
24*29492bb7SDavid van Moolenbroek  *    from this software without specific prior written permission.
25433d6423SLionel Sambuc  *
26*29492bb7SDavid van Moolenbroek  * Alternatively, this software may be distributed under the terms of the
27*29492bb7SDavid van Moolenbroek  * GNU General Public License ("GPL") version 2 as published by the Free
28*29492bb7SDavid van Moolenbroek  * Software Foundation.
29433d6423SLionel Sambuc  *
30*29492bb7SDavid van Moolenbroek  * NO WARRANTY
31*29492bb7SDavid van Moolenbroek  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*29492bb7SDavid van Moolenbroek  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*29492bb7SDavid van Moolenbroek  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*29492bb7SDavid van Moolenbroek  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*29492bb7SDavid van Moolenbroek  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*29492bb7SDavid van Moolenbroek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*29492bb7SDavid van Moolenbroek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*29492bb7SDavid van Moolenbroek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*29492bb7SDavid van Moolenbroek  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*29492bb7SDavid van Moolenbroek  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*29492bb7SDavid van Moolenbroek  * POSSIBILITY OF SUCH DAMAGES.
42*29492bb7SDavid van Moolenbroek  */
43433d6423SLionel Sambuc 
44433d6423SLionel Sambuc #ifndef __ACLOCAL_H__
45433d6423SLionel Sambuc #define __ACLOCAL_H__
46433d6423SLionel Sambuc 
47433d6423SLionel Sambuc 
48433d6423SLionel Sambuc /* acpisrc:StructDefs -- for acpisrc conversion */
49433d6423SLionel Sambuc 
50433d6423SLionel Sambuc #define ACPI_SERIALIZED                 0xFF
51433d6423SLionel Sambuc 
52433d6423SLionel Sambuc typedef UINT32                          ACPI_MUTEX_HANDLE;
53433d6423SLionel Sambuc #define ACPI_GLOBAL_LOCK                (ACPI_SEMAPHORE) (-1)
54433d6423SLionel Sambuc 
55433d6423SLionel Sambuc /* Total number of aml opcodes defined */
56433d6423SLionel Sambuc 
57*29492bb7SDavid van Moolenbroek #define AML_NUM_OPCODES                 0x81
58433d6423SLionel Sambuc 
59433d6423SLionel Sambuc 
60433d6423SLionel Sambuc /* Forward declarations */
61433d6423SLionel Sambuc 
62433d6423SLionel Sambuc struct acpi_walk_state;
63433d6423SLionel Sambuc struct acpi_obj_mutex;
64433d6423SLionel Sambuc union acpi_parse_object;
65433d6423SLionel Sambuc 
66433d6423SLionel Sambuc 
67433d6423SLionel Sambuc /*****************************************************************************
68433d6423SLionel Sambuc  *
69433d6423SLionel Sambuc  * Mutex typedefs and structs
70433d6423SLionel Sambuc  *
71433d6423SLionel Sambuc  ****************************************************************************/
72433d6423SLionel Sambuc 
73433d6423SLionel Sambuc 
74433d6423SLionel Sambuc /*
75433d6423SLionel Sambuc  * Predefined handles for the mutex objects used within the subsystem
76433d6423SLionel Sambuc  * All mutex objects are automatically created by AcpiUtMutexInitialize.
77433d6423SLionel Sambuc  *
78433d6423SLionel Sambuc  * The acquire/release ordering protocol is implied via this list. Mutexes
79433d6423SLionel Sambuc  * with a lower value must be acquired before mutexes with a higher value.
80433d6423SLionel Sambuc  *
81433d6423SLionel Sambuc  * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
82433d6423SLionel Sambuc  * table below also!
83433d6423SLionel Sambuc  */
84433d6423SLionel Sambuc #define ACPI_MTX_INTERPRETER            0   /* AML Interpreter, main lock */
85433d6423SLionel Sambuc #define ACPI_MTX_NAMESPACE              1   /* ACPI Namespace */
86433d6423SLionel Sambuc #define ACPI_MTX_TABLES                 2   /* Data for ACPI tables */
87433d6423SLionel Sambuc #define ACPI_MTX_EVENTS                 3   /* Data for ACPI events */
88433d6423SLionel Sambuc #define ACPI_MTX_CACHES                 4   /* Internal caches, general purposes */
89433d6423SLionel Sambuc #define ACPI_MTX_MEMORY                 5   /* Debug memory tracking lists */
90433d6423SLionel Sambuc #define ACPI_MTX_DEBUG_CMD_COMPLETE     6   /* AML debugger */
91433d6423SLionel Sambuc #define ACPI_MTX_DEBUG_CMD_READY        7   /* AML debugger */
92433d6423SLionel Sambuc 
93433d6423SLionel Sambuc #define ACPI_MAX_MUTEX                  7
94433d6423SLionel Sambuc #define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
95433d6423SLionel Sambuc 
96433d6423SLionel Sambuc 
97433d6423SLionel Sambuc /* Lock structure for reader/writer interfaces */
98433d6423SLionel Sambuc 
99433d6423SLionel Sambuc typedef struct acpi_rw_lock
100433d6423SLionel Sambuc {
101433d6423SLionel Sambuc     ACPI_MUTEX              WriterMutex;
102433d6423SLionel Sambuc     ACPI_MUTEX              ReaderMutex;
103433d6423SLionel Sambuc     UINT32                  NumReaders;
104433d6423SLionel Sambuc 
105433d6423SLionel Sambuc } ACPI_RW_LOCK;
106433d6423SLionel Sambuc 
107433d6423SLionel Sambuc 
108433d6423SLionel Sambuc /*
109433d6423SLionel Sambuc  * Predefined handles for spinlocks used within the subsystem.
110433d6423SLionel Sambuc  * These spinlocks are created by AcpiUtMutexInitialize
111433d6423SLionel Sambuc  */
112433d6423SLionel Sambuc #define ACPI_LOCK_GPES                  0
113433d6423SLionel Sambuc #define ACPI_LOCK_HARDWARE              1
114433d6423SLionel Sambuc 
115433d6423SLionel Sambuc #define ACPI_MAX_LOCK                   1
116433d6423SLionel Sambuc #define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
117433d6423SLionel Sambuc 
118433d6423SLionel Sambuc 
119433d6423SLionel Sambuc /* This Thread ID means that the mutex is not in use (unlocked) */
120433d6423SLionel Sambuc 
121433d6423SLionel Sambuc #define ACPI_MUTEX_NOT_ACQUIRED         (ACPI_THREAD_ID) -1
122433d6423SLionel Sambuc 
123433d6423SLionel Sambuc /* Table for the global mutexes */
124433d6423SLionel Sambuc 
125433d6423SLionel Sambuc typedef struct acpi_mutex_info
126433d6423SLionel Sambuc {
127433d6423SLionel Sambuc     ACPI_MUTEX                      Mutex;
128433d6423SLionel Sambuc     UINT32                          UseCount;
129433d6423SLionel Sambuc     ACPI_THREAD_ID                  ThreadId;
130433d6423SLionel Sambuc 
131433d6423SLionel Sambuc } ACPI_MUTEX_INFO;
132433d6423SLionel Sambuc 
133433d6423SLionel Sambuc 
134433d6423SLionel Sambuc /* Lock flag parameter for various interfaces */
135433d6423SLionel Sambuc 
136433d6423SLionel Sambuc #define ACPI_MTX_DO_NOT_LOCK            0
137433d6423SLionel Sambuc #define ACPI_MTX_LOCK                   1
138433d6423SLionel Sambuc 
139433d6423SLionel Sambuc 
140433d6423SLionel Sambuc /* Field access granularities */
141433d6423SLionel Sambuc 
142433d6423SLionel Sambuc #define ACPI_FIELD_BYTE_GRANULARITY     1
143433d6423SLionel Sambuc #define ACPI_FIELD_WORD_GRANULARITY     2
144433d6423SLionel Sambuc #define ACPI_FIELD_DWORD_GRANULARITY    4
145433d6423SLionel Sambuc #define ACPI_FIELD_QWORD_GRANULARITY    8
146433d6423SLionel Sambuc 
147433d6423SLionel Sambuc 
148433d6423SLionel Sambuc #define ACPI_ENTRY_NOT_FOUND            NULL
149433d6423SLionel Sambuc 
150433d6423SLionel Sambuc 
151433d6423SLionel Sambuc /*****************************************************************************
152433d6423SLionel Sambuc  *
153433d6423SLionel Sambuc  * Namespace typedefs and structs
154433d6423SLionel Sambuc  *
155433d6423SLionel Sambuc  ****************************************************************************/
156433d6423SLionel Sambuc 
157433d6423SLionel Sambuc /* Operational modes of the AML interpreter/scanner */
158433d6423SLionel Sambuc 
159433d6423SLionel Sambuc typedef enum
160433d6423SLionel Sambuc {
161433d6423SLionel Sambuc     ACPI_IMODE_LOAD_PASS1           = 0x01,
162433d6423SLionel Sambuc     ACPI_IMODE_LOAD_PASS2           = 0x02,
163433d6423SLionel Sambuc     ACPI_IMODE_EXECUTE              = 0x03
164433d6423SLionel Sambuc 
165433d6423SLionel Sambuc } ACPI_INTERPRETER_MODE;
166433d6423SLionel Sambuc 
167433d6423SLionel Sambuc 
168433d6423SLionel Sambuc /*
169433d6423SLionel Sambuc  * The Namespace Node describes a named object that appears in the AML.
170433d6423SLionel Sambuc  * DescriptorType is used to differentiate between internal descriptors.
171433d6423SLionel Sambuc  *
172433d6423SLionel Sambuc  * The node is optimized for both 32-bit and 64-bit platforms:
173433d6423SLionel Sambuc  * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
174433d6423SLionel Sambuc  *
175433d6423SLionel Sambuc  * Note: The DescriptorType and Type fields must appear in the identical
176433d6423SLionel Sambuc  * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
177433d6423SLionel Sambuc  * structures.
178433d6423SLionel Sambuc  */
179433d6423SLionel Sambuc typedef struct acpi_namespace_node
180433d6423SLionel Sambuc {
181433d6423SLionel Sambuc     union acpi_operand_object       *Object;        /* Interpreter object */
182433d6423SLionel Sambuc     UINT8                           DescriptorType; /* Differentiate object descriptor types */
183433d6423SLionel Sambuc     UINT8                           Type;           /* ACPI Type associated with this name */
184433d6423SLionel Sambuc     UINT8                           Flags;          /* Miscellaneous flags */
185433d6423SLionel Sambuc     ACPI_OWNER_ID                   OwnerId;        /* Node creator */
186433d6423SLionel Sambuc     ACPI_NAME_UNION                 Name;           /* ACPI Name, always 4 chars per ACPI spec */
187433d6423SLionel Sambuc     struct acpi_namespace_node      *Parent;        /* Parent node */
188433d6423SLionel Sambuc     struct acpi_namespace_node      *Child;         /* First child */
189433d6423SLionel Sambuc     struct acpi_namespace_node      *Peer;          /* First peer */
190433d6423SLionel Sambuc 
191433d6423SLionel Sambuc     /*
192433d6423SLionel Sambuc      * The following fields are used by the ASL compiler and disassembler only
193433d6423SLionel Sambuc      */
194433d6423SLionel Sambuc #ifdef ACPI_LARGE_NAMESPACE_NODE
195433d6423SLionel Sambuc     union acpi_parse_object         *Op;
196433d6423SLionel Sambuc     UINT32                          Value;
197433d6423SLionel Sambuc     UINT32                          Length;
198433d6423SLionel Sambuc #endif
199433d6423SLionel Sambuc 
200433d6423SLionel Sambuc } ACPI_NAMESPACE_NODE;
201433d6423SLionel Sambuc 
202433d6423SLionel Sambuc 
203433d6423SLionel Sambuc /* Namespace Node flags */
204433d6423SLionel Sambuc 
205433d6423SLionel Sambuc #define ANOBJ_RESERVED                  0x01    /* Available for use */
206433d6423SLionel Sambuc #define ANOBJ_TEMPORARY                 0x02    /* Node is create by a method and is temporary */
207433d6423SLionel Sambuc #define ANOBJ_METHOD_ARG                0x04    /* Node is a method argument */
208433d6423SLionel Sambuc #define ANOBJ_METHOD_LOCAL              0x08    /* Node is a method local */
209433d6423SLionel Sambuc #define ANOBJ_SUBTREE_HAS_INI           0x10    /* Used to optimize device initialization */
210433d6423SLionel Sambuc #define ANOBJ_EVALUATED                 0x20    /* Set on first evaluation of node */
211433d6423SLionel Sambuc #define ANOBJ_ALLOCATED_BUFFER          0x40    /* Method AML buffer is dynamic (InstallMethod) */
212433d6423SLionel Sambuc 
213433d6423SLionel Sambuc #define ANOBJ_IS_EXTERNAL               0x08    /* iASL only: This object created via External() */
214433d6423SLionel Sambuc #define ANOBJ_METHOD_NO_RETVAL          0x10    /* iASL only: Method has no return value */
215433d6423SLionel Sambuc #define ANOBJ_METHOD_SOME_NO_RETVAL     0x20    /* iASL only: Method has at least one return value */
216433d6423SLionel Sambuc #define ANOBJ_IS_REFERENCED             0x80    /* iASL only: Object was referenced */
217433d6423SLionel Sambuc 
218433d6423SLionel Sambuc 
219433d6423SLionel Sambuc /* Internal ACPI table management - master table list */
220433d6423SLionel Sambuc 
221433d6423SLionel Sambuc typedef struct acpi_table_list
222433d6423SLionel Sambuc {
223433d6423SLionel Sambuc     ACPI_TABLE_DESC                 *Tables;            /* Table descriptor array */
224433d6423SLionel Sambuc     UINT32                          CurrentTableCount;  /* Tables currently in the array */
225433d6423SLionel Sambuc     UINT32                          MaxTableCount;      /* Max tables array will hold */
226433d6423SLionel Sambuc     UINT8                           Flags;
227433d6423SLionel Sambuc 
228433d6423SLionel Sambuc } ACPI_TABLE_LIST;
229433d6423SLionel Sambuc 
230433d6423SLionel Sambuc /* Flags for above */
231433d6423SLionel Sambuc 
232433d6423SLionel Sambuc #define ACPI_ROOT_ORIGIN_UNKNOWN        (0)     /* ~ORIGIN_ALLOCATED */
233433d6423SLionel Sambuc #define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
234433d6423SLionel Sambuc #define ACPI_ROOT_ALLOW_RESIZE          (2)
235433d6423SLionel Sambuc 
236433d6423SLionel Sambuc 
237433d6423SLionel Sambuc /* Predefined (fixed) table indexes */
238433d6423SLionel Sambuc 
239433d6423SLionel Sambuc #define ACPI_TABLE_INDEX_DSDT           (0)
240433d6423SLionel Sambuc #define ACPI_TABLE_INDEX_FACS           (1)
241433d6423SLionel Sambuc 
242433d6423SLionel Sambuc 
243433d6423SLionel Sambuc typedef struct acpi_find_context
244433d6423SLionel Sambuc {
245433d6423SLionel Sambuc     char                            *SearchFor;
246433d6423SLionel Sambuc     ACPI_HANDLE                     *List;
247433d6423SLionel Sambuc     UINT32                          *Count;
248433d6423SLionel Sambuc 
249433d6423SLionel Sambuc } ACPI_FIND_CONTEXT;
250433d6423SLionel Sambuc 
251433d6423SLionel Sambuc 
252433d6423SLionel Sambuc typedef struct acpi_ns_search_data
253433d6423SLionel Sambuc {
254433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *Node;
255433d6423SLionel Sambuc 
256433d6423SLionel Sambuc } ACPI_NS_SEARCH_DATA;
257433d6423SLionel Sambuc 
258433d6423SLionel Sambuc 
259433d6423SLionel Sambuc /* Object types used during package copies */
260433d6423SLionel Sambuc 
261433d6423SLionel Sambuc #define ACPI_COPY_TYPE_SIMPLE           0
262433d6423SLionel Sambuc #define ACPI_COPY_TYPE_PACKAGE          1
263433d6423SLionel Sambuc 
264433d6423SLionel Sambuc 
265433d6423SLionel Sambuc /* Info structure used to convert external<->internal namestrings */
266433d6423SLionel Sambuc 
267433d6423SLionel Sambuc typedef struct acpi_namestring_info
268433d6423SLionel Sambuc {
269433d6423SLionel Sambuc     const char                      *ExternalName;
270433d6423SLionel Sambuc     const char                      *NextExternalChar;
271433d6423SLionel Sambuc     char                            *InternalName;
272433d6423SLionel Sambuc     UINT32                          Length;
273433d6423SLionel Sambuc     UINT32                          NumSegments;
274433d6423SLionel Sambuc     UINT32                          NumCarats;
275433d6423SLionel Sambuc     BOOLEAN                         FullyQualified;
276433d6423SLionel Sambuc 
277433d6423SLionel Sambuc } ACPI_NAMESTRING_INFO;
278433d6423SLionel Sambuc 
279433d6423SLionel Sambuc 
280433d6423SLionel Sambuc /* Field creation info */
281433d6423SLionel Sambuc 
282433d6423SLionel Sambuc typedef struct acpi_create_field_info
283433d6423SLionel Sambuc {
284433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *RegionNode;
285433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *FieldNode;
286433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *RegisterNode;
287433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *DataRegisterNode;
288*29492bb7SDavid van Moolenbroek     ACPI_NAMESPACE_NODE             *ConnectionNode;
289*29492bb7SDavid van Moolenbroek     UINT8                           *ResourceBuffer;
290433d6423SLionel Sambuc     UINT32                          BankValue;
291433d6423SLionel Sambuc     UINT32                          FieldBitPosition;
292433d6423SLionel Sambuc     UINT32                          FieldBitLength;
293*29492bb7SDavid van Moolenbroek     UINT16                          ResourceLength;
294*29492bb7SDavid van Moolenbroek     UINT16                          PinNumberIndex;
295433d6423SLionel Sambuc     UINT8                           FieldFlags;
296433d6423SLionel Sambuc     UINT8                           Attribute;
297433d6423SLionel Sambuc     UINT8                           FieldType;
298*29492bb7SDavid van Moolenbroek     UINT8                           AccessLength;
299433d6423SLionel Sambuc 
300433d6423SLionel Sambuc } ACPI_CREATE_FIELD_INFO;
301433d6423SLionel Sambuc 
302433d6423SLionel Sambuc 
303433d6423SLionel Sambuc typedef
304433d6423SLionel Sambuc ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
305433d6423SLionel Sambuc     struct acpi_walk_state          *WalkState);
306433d6423SLionel Sambuc 
307433d6423SLionel Sambuc 
308433d6423SLionel Sambuc /*
309433d6423SLionel Sambuc  * Bitmapped ACPI types. Used internally only
310433d6423SLionel Sambuc  */
311433d6423SLionel Sambuc #define ACPI_BTYPE_ANY                  0x00000000
312433d6423SLionel Sambuc #define ACPI_BTYPE_INTEGER              0x00000001
313433d6423SLionel Sambuc #define ACPI_BTYPE_STRING               0x00000002
314433d6423SLionel Sambuc #define ACPI_BTYPE_BUFFER               0x00000004
315433d6423SLionel Sambuc #define ACPI_BTYPE_PACKAGE              0x00000008
316433d6423SLionel Sambuc #define ACPI_BTYPE_FIELD_UNIT           0x00000010
317433d6423SLionel Sambuc #define ACPI_BTYPE_DEVICE               0x00000020
318433d6423SLionel Sambuc #define ACPI_BTYPE_EVENT                0x00000040
319433d6423SLionel Sambuc #define ACPI_BTYPE_METHOD               0x00000080
320433d6423SLionel Sambuc #define ACPI_BTYPE_MUTEX                0x00000100
321433d6423SLionel Sambuc #define ACPI_BTYPE_REGION               0x00000200
322433d6423SLionel Sambuc #define ACPI_BTYPE_POWER                0x00000400
323433d6423SLionel Sambuc #define ACPI_BTYPE_PROCESSOR            0x00000800
324433d6423SLionel Sambuc #define ACPI_BTYPE_THERMAL              0x00001000
325433d6423SLionel Sambuc #define ACPI_BTYPE_BUFFER_FIELD         0x00002000
326433d6423SLionel Sambuc #define ACPI_BTYPE_DDB_HANDLE           0x00004000
327433d6423SLionel Sambuc #define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
328433d6423SLionel Sambuc #define ACPI_BTYPE_REFERENCE            0x00010000
329433d6423SLionel Sambuc #define ACPI_BTYPE_RESOURCE             0x00020000
330433d6423SLionel Sambuc 
331433d6423SLionel Sambuc #define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
332433d6423SLionel Sambuc 
333433d6423SLionel Sambuc #define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
334433d6423SLionel Sambuc #define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
335433d6423SLionel Sambuc #define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
336433d6423SLionel Sambuc #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF  /* ARG or LOCAL */
337433d6423SLionel Sambuc #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
338433d6423SLionel Sambuc 
339*29492bb7SDavid van Moolenbroek #pragma pack(1)
340433d6423SLionel Sambuc 
341433d6423SLionel Sambuc /*
342433d6423SLionel Sambuc  * Information structure for ACPI predefined names.
343433d6423SLionel Sambuc  * Each entry in the table contains the following items:
344433d6423SLionel Sambuc  *
345433d6423SLionel Sambuc  * Name                 - The ACPI reserved name
346433d6423SLionel Sambuc  * ParamCount           - Number of arguments to the method
347433d6423SLionel Sambuc  * ExpectedReturnBtypes - Allowed type(s) for the return value
348433d6423SLionel Sambuc  */
349433d6423SLionel Sambuc typedef struct acpi_name_info
350433d6423SLionel Sambuc {
351433d6423SLionel Sambuc     char                        Name[ACPI_NAME_SIZE];
352*29492bb7SDavid van Moolenbroek     UINT16                      ArgumentList;
353433d6423SLionel Sambuc     UINT8                       ExpectedBtypes;
354433d6423SLionel Sambuc 
355433d6423SLionel Sambuc } ACPI_NAME_INFO;
356433d6423SLionel Sambuc 
357433d6423SLionel Sambuc /*
358433d6423SLionel Sambuc  * Secondary information structures for ACPI predefined objects that return
359433d6423SLionel Sambuc  * package objects. This structure appears as the next entry in the table
360433d6423SLionel Sambuc  * after the NAME_INFO structure above.
361433d6423SLionel Sambuc  *
362433d6423SLionel Sambuc  * The reason for this is to minimize the size of the predefined name table.
363433d6423SLionel Sambuc  */
364433d6423SLionel Sambuc 
365433d6423SLionel Sambuc /*
366433d6423SLionel Sambuc  * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
367*29492bb7SDavid van Moolenbroek  * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
368*29492bb7SDavid van Moolenbroek  * ACPI_PTYPE2_FIX_VAR
369433d6423SLionel Sambuc  */
370433d6423SLionel Sambuc typedef struct acpi_package_info
371433d6423SLionel Sambuc {
372433d6423SLionel Sambuc     UINT8                       Type;
373433d6423SLionel Sambuc     UINT8                       ObjectType1;
374433d6423SLionel Sambuc     UINT8                       Count1;
375433d6423SLionel Sambuc     UINT8                       ObjectType2;
376433d6423SLionel Sambuc     UINT8                       Count2;
377*29492bb7SDavid van Moolenbroek     UINT16                      Reserved;
378433d6423SLionel Sambuc 
379433d6423SLionel Sambuc } ACPI_PACKAGE_INFO;
380433d6423SLionel Sambuc 
381433d6423SLionel Sambuc /* Used for ACPI_PTYPE2_FIXED */
382433d6423SLionel Sambuc 
383433d6423SLionel Sambuc typedef struct acpi_package_info2
384433d6423SLionel Sambuc {
385433d6423SLionel Sambuc     UINT8                       Type;
386433d6423SLionel Sambuc     UINT8                       Count;
387433d6423SLionel Sambuc     UINT8                       ObjectType[4];
388*29492bb7SDavid van Moolenbroek     UINT8                       Reserved;
389433d6423SLionel Sambuc 
390433d6423SLionel Sambuc } ACPI_PACKAGE_INFO2;
391433d6423SLionel Sambuc 
392433d6423SLionel Sambuc /* Used for ACPI_PTYPE1_OPTION */
393433d6423SLionel Sambuc 
394433d6423SLionel Sambuc typedef struct acpi_package_info3
395433d6423SLionel Sambuc {
396433d6423SLionel Sambuc     UINT8                       Type;
397433d6423SLionel Sambuc     UINT8                       Count;
398433d6423SLionel Sambuc     UINT8                       ObjectType[2];
399433d6423SLionel Sambuc     UINT8                       TailObjectType;
400*29492bb7SDavid van Moolenbroek     UINT16                      Reserved;
401433d6423SLionel Sambuc 
402433d6423SLionel Sambuc } ACPI_PACKAGE_INFO3;
403433d6423SLionel Sambuc 
404433d6423SLionel Sambuc typedef union acpi_predefined_info
405433d6423SLionel Sambuc {
406433d6423SLionel Sambuc     ACPI_NAME_INFO              Info;
407433d6423SLionel Sambuc     ACPI_PACKAGE_INFO           RetInfo;
408433d6423SLionel Sambuc     ACPI_PACKAGE_INFO2          RetInfo2;
409433d6423SLionel Sambuc     ACPI_PACKAGE_INFO3          RetInfo3;
410433d6423SLionel Sambuc 
411433d6423SLionel Sambuc } ACPI_PREDEFINED_INFO;
412433d6423SLionel Sambuc 
413*29492bb7SDavid van Moolenbroek /* Reset to default packing */
414433d6423SLionel Sambuc 
415*29492bb7SDavid van Moolenbroek #pragma pack()
416433d6423SLionel Sambuc 
417*29492bb7SDavid van Moolenbroek 
418*29492bb7SDavid van Moolenbroek /* Return object auto-repair info */
419*29492bb7SDavid van Moolenbroek 
420*29492bb7SDavid van Moolenbroek typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
421*29492bb7SDavid van Moolenbroek     union acpi_operand_object   *OriginalObject,
422*29492bb7SDavid van Moolenbroek     union acpi_operand_object   **ConvertedObject);
423*29492bb7SDavid van Moolenbroek 
424*29492bb7SDavid van Moolenbroek typedef struct acpi_simple_repair_info
425433d6423SLionel Sambuc {
426*29492bb7SDavid van Moolenbroek     char                        Name[ACPI_NAME_SIZE];
427*29492bb7SDavid van Moolenbroek     UINT32                      UnexpectedBtypes;
428*29492bb7SDavid van Moolenbroek     UINT32                      PackageIndex;
429*29492bb7SDavid van Moolenbroek     ACPI_OBJECT_CONVERTER       ObjectConverter;
430433d6423SLionel Sambuc 
431*29492bb7SDavid van Moolenbroek } ACPI_SIMPLE_REPAIR_INFO;
432433d6423SLionel Sambuc 
433433d6423SLionel Sambuc 
434433d6423SLionel Sambuc /*
435433d6423SLionel Sambuc  * Bitmapped return value types
436433d6423SLionel Sambuc  * Note: the actual data types must be contiguous, a loop in nspredef.c
437433d6423SLionel Sambuc  * depends on this.
438433d6423SLionel Sambuc  */
439433d6423SLionel Sambuc #define ACPI_RTYPE_ANY                  0x00
440433d6423SLionel Sambuc #define ACPI_RTYPE_NONE                 0x01
441433d6423SLionel Sambuc #define ACPI_RTYPE_INTEGER              0x02
442433d6423SLionel Sambuc #define ACPI_RTYPE_STRING               0x04
443433d6423SLionel Sambuc #define ACPI_RTYPE_BUFFER               0x08
444433d6423SLionel Sambuc #define ACPI_RTYPE_PACKAGE              0x10
445433d6423SLionel Sambuc #define ACPI_RTYPE_REFERENCE            0x20
446433d6423SLionel Sambuc #define ACPI_RTYPE_ALL                  0x3F
447433d6423SLionel Sambuc 
448433d6423SLionel Sambuc #define ACPI_NUM_RTYPES                 5   /* Number of actual object types */
449433d6423SLionel Sambuc 
450433d6423SLionel Sambuc 
451433d6423SLionel Sambuc /*****************************************************************************
452433d6423SLionel Sambuc  *
453433d6423SLionel Sambuc  * Event typedefs and structs
454433d6423SLionel Sambuc  *
455433d6423SLionel Sambuc  ****************************************************************************/
456433d6423SLionel Sambuc 
457*29492bb7SDavid van Moolenbroek /* Dispatch info for each host-installed SCI handler */
458*29492bb7SDavid van Moolenbroek 
459*29492bb7SDavid van Moolenbroek typedef struct acpi_sci_handler_info
460*29492bb7SDavid van Moolenbroek {
461*29492bb7SDavid van Moolenbroek     struct acpi_sci_handler_info    *Next;
462*29492bb7SDavid van Moolenbroek     ACPI_SCI_HANDLER                Address;        /* Address of handler */
463*29492bb7SDavid van Moolenbroek     void                            *Context;       /* Context to be passed to handler */
464*29492bb7SDavid van Moolenbroek 
465*29492bb7SDavid van Moolenbroek } ACPI_SCI_HANDLER_INFO;
466*29492bb7SDavid van Moolenbroek 
467433d6423SLionel Sambuc /* Dispatch info for each GPE -- either a method or handler, cannot be both */
468433d6423SLionel Sambuc 
469*29492bb7SDavid van Moolenbroek typedef struct acpi_gpe_handler_info
470433d6423SLionel Sambuc {
471*29492bb7SDavid van Moolenbroek     ACPI_GPE_HANDLER                Address;        /* Address of handler, if any */
472433d6423SLionel Sambuc     void                            *Context;       /* Context to be passed to handler */
473433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level (saved) */
474*29492bb7SDavid van Moolenbroek     UINT8                           OriginalFlags;  /* Original (pre-handler) GPE info */
475*29492bb7SDavid van Moolenbroek     BOOLEAN                         OriginallyEnabled; /* True if GPE was originally enabled */
476433d6423SLionel Sambuc 
477*29492bb7SDavid van Moolenbroek } ACPI_GPE_HANDLER_INFO;
478433d6423SLionel Sambuc 
479*29492bb7SDavid van Moolenbroek /* Notify info for implicit notify, multiple device objects */
480*29492bb7SDavid van Moolenbroek 
481*29492bb7SDavid van Moolenbroek typedef struct acpi_gpe_notify_info
482*29492bb7SDavid van Moolenbroek {
483*29492bb7SDavid van Moolenbroek     ACPI_NAMESPACE_NODE             *DeviceNode;    /* Device to be notified */
484*29492bb7SDavid van Moolenbroek     struct acpi_gpe_notify_info     *Next;
485*29492bb7SDavid van Moolenbroek 
486*29492bb7SDavid van Moolenbroek } ACPI_GPE_NOTIFY_INFO;
487*29492bb7SDavid van Moolenbroek 
488*29492bb7SDavid van Moolenbroek /*
489*29492bb7SDavid van Moolenbroek  * GPE dispatch info. At any time, the GPE can have at most one type
490*29492bb7SDavid van Moolenbroek  * of dispatch - Method, Handler, or Implicit Notify.
491*29492bb7SDavid van Moolenbroek  */
492433d6423SLionel Sambuc typedef union acpi_gpe_dispatch_info
493433d6423SLionel Sambuc {
494433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *MethodNode;    /* Method node for this GPE level */
495*29492bb7SDavid van Moolenbroek     ACPI_GPE_HANDLER_INFO           *Handler;       /* Installed GPE handler */
496*29492bb7SDavid van Moolenbroek     ACPI_GPE_NOTIFY_INFO            *NotifyList;    /* List of _PRW devices for implicit notifies */
497433d6423SLionel Sambuc 
498433d6423SLionel Sambuc } ACPI_GPE_DISPATCH_INFO;
499433d6423SLionel Sambuc 
500433d6423SLionel Sambuc /*
501433d6423SLionel Sambuc  * Information about a GPE, one per each GPE in an array.
502433d6423SLionel Sambuc  * NOTE: Important to keep this struct as small as possible.
503433d6423SLionel Sambuc  */
504433d6423SLionel Sambuc typedef struct acpi_gpe_event_info
505433d6423SLionel Sambuc {
506*29492bb7SDavid van Moolenbroek     union acpi_gpe_dispatch_info    Dispatch;       /* Either Method, Handler, or NotifyList */
507433d6423SLionel Sambuc     struct acpi_gpe_register_info   *RegisterInfo;  /* Backpointer to register info */
508433d6423SLionel Sambuc     UINT8                           Flags;          /* Misc info about this GPE */
509433d6423SLionel Sambuc     UINT8                           GpeNumber;      /* This GPE */
510433d6423SLionel Sambuc     UINT8                           RuntimeCount;   /* References to a run GPE */
511433d6423SLionel Sambuc 
512433d6423SLionel Sambuc } ACPI_GPE_EVENT_INFO;
513433d6423SLionel Sambuc 
514433d6423SLionel Sambuc /* Information about a GPE register pair, one per each status/enable pair in an array */
515433d6423SLionel Sambuc 
516433d6423SLionel Sambuc typedef struct acpi_gpe_register_info
517433d6423SLionel Sambuc {
518433d6423SLionel Sambuc     ACPI_GENERIC_ADDRESS            StatusAddress;  /* Address of status reg */
519433d6423SLionel Sambuc     ACPI_GENERIC_ADDRESS            EnableAddress;  /* Address of enable reg */
520*29492bb7SDavid van Moolenbroek     UINT16                          BaseGpeNumber;  /* Base GPE number for this register */
521433d6423SLionel Sambuc     UINT8                           EnableForWake;  /* GPEs to keep enabled when sleeping */
522433d6423SLionel Sambuc     UINT8                           EnableForRun;   /* GPEs to keep enabled when running */
523433d6423SLionel Sambuc 
524433d6423SLionel Sambuc } ACPI_GPE_REGISTER_INFO;
525433d6423SLionel Sambuc 
526433d6423SLionel Sambuc /*
527433d6423SLionel Sambuc  * Information about a GPE register block, one per each installed block --
528433d6423SLionel Sambuc  * GPE0, GPE1, and one per each installed GPE Block Device.
529433d6423SLionel Sambuc  */
530433d6423SLionel Sambuc typedef struct acpi_gpe_block_info
531433d6423SLionel Sambuc {
532433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *Node;
533433d6423SLionel Sambuc     struct acpi_gpe_block_info      *Previous;
534433d6423SLionel Sambuc     struct acpi_gpe_block_info      *Next;
535433d6423SLionel Sambuc     struct acpi_gpe_xrupt_info      *XruptBlock;    /* Backpointer to interrupt block */
536433d6423SLionel Sambuc     ACPI_GPE_REGISTER_INFO          *RegisterInfo;  /* One per GPE register pair */
537433d6423SLionel Sambuc     ACPI_GPE_EVENT_INFO             *EventInfo;     /* One for each GPE */
538*29492bb7SDavid van Moolenbroek     UINT64                          Address;        /* Base address of the block */
539433d6423SLionel Sambuc     UINT32                          RegisterCount;  /* Number of register pairs in block */
540433d6423SLionel Sambuc     UINT16                          GpeCount;       /* Number of individual GPEs in block */
541*29492bb7SDavid van Moolenbroek     UINT16                          BlockBaseNumber;/* Base GPE number for this block */
542*29492bb7SDavid van Moolenbroek     UINT8                           SpaceId;
543*29492bb7SDavid van Moolenbroek     BOOLEAN                         Initialized;    /* TRUE if this block is initialized */
544433d6423SLionel Sambuc 
545433d6423SLionel Sambuc } ACPI_GPE_BLOCK_INFO;
546433d6423SLionel Sambuc 
547433d6423SLionel Sambuc /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
548433d6423SLionel Sambuc 
549433d6423SLionel Sambuc typedef struct acpi_gpe_xrupt_info
550433d6423SLionel Sambuc {
551433d6423SLionel Sambuc     struct acpi_gpe_xrupt_info      *Previous;
552433d6423SLionel Sambuc     struct acpi_gpe_xrupt_info      *Next;
553433d6423SLionel Sambuc     ACPI_GPE_BLOCK_INFO             *GpeBlockListHead;  /* List of GPE blocks for this xrupt */
554433d6423SLionel Sambuc     UINT32                          InterruptNumber;    /* System interrupt number */
555433d6423SLionel Sambuc 
556433d6423SLionel Sambuc } ACPI_GPE_XRUPT_INFO;
557433d6423SLionel Sambuc 
558433d6423SLionel Sambuc typedef struct acpi_gpe_walk_info
559433d6423SLionel Sambuc {
560433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *GpeDevice;
561433d6423SLionel Sambuc     ACPI_GPE_BLOCK_INFO             *GpeBlock;
562433d6423SLionel Sambuc     UINT16                          Count;
563433d6423SLionel Sambuc     ACPI_OWNER_ID                   OwnerId;
564433d6423SLionel Sambuc     BOOLEAN                         ExecuteByOwnerId;
565433d6423SLionel Sambuc 
566433d6423SLionel Sambuc } ACPI_GPE_WALK_INFO;
567433d6423SLionel Sambuc 
568433d6423SLionel Sambuc typedef struct acpi_gpe_device_info
569433d6423SLionel Sambuc {
570433d6423SLionel Sambuc     UINT32                          Index;
571433d6423SLionel Sambuc     UINT32                          NextBlockBaseIndex;
572433d6423SLionel Sambuc     ACPI_STATUS                     Status;
573433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *GpeDevice;
574433d6423SLionel Sambuc 
575433d6423SLionel Sambuc } ACPI_GPE_DEVICE_INFO;
576433d6423SLionel Sambuc 
577433d6423SLionel Sambuc typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
578433d6423SLionel Sambuc     ACPI_GPE_XRUPT_INFO             *GpeXruptInfo,
579433d6423SLionel Sambuc     ACPI_GPE_BLOCK_INFO             *GpeBlock,
580433d6423SLionel Sambuc     void                            *Context);
581433d6423SLionel Sambuc 
582433d6423SLionel Sambuc 
583433d6423SLionel Sambuc /* Information about each particular fixed event */
584433d6423SLionel Sambuc 
585433d6423SLionel Sambuc typedef struct acpi_fixed_event_handler
586433d6423SLionel Sambuc {
587433d6423SLionel Sambuc     ACPI_EVENT_HANDLER              Handler;        /* Address of handler. */
588433d6423SLionel Sambuc     void                            *Context;       /* Context to be passed to handler */
589433d6423SLionel Sambuc 
590433d6423SLionel Sambuc } ACPI_FIXED_EVENT_HANDLER;
591433d6423SLionel Sambuc 
592433d6423SLionel Sambuc typedef struct acpi_fixed_event_info
593433d6423SLionel Sambuc {
594433d6423SLionel Sambuc     UINT8                           StatusRegisterId;
595433d6423SLionel Sambuc     UINT8                           EnableRegisterId;
596433d6423SLionel Sambuc     UINT16                          StatusBitMask;
597433d6423SLionel Sambuc     UINT16                          EnableBitMask;
598433d6423SLionel Sambuc 
599433d6423SLionel Sambuc } ACPI_FIXED_EVENT_INFO;
600433d6423SLionel Sambuc 
601433d6423SLionel Sambuc /* Information used during field processing */
602433d6423SLionel Sambuc 
603433d6423SLionel Sambuc typedef struct acpi_field_info
604433d6423SLionel Sambuc {
605433d6423SLionel Sambuc     UINT8                           SkipField;
606433d6423SLionel Sambuc     UINT8                           FieldFlag;
607433d6423SLionel Sambuc     UINT32                          PkgLength;
608433d6423SLionel Sambuc 
609433d6423SLionel Sambuc } ACPI_FIELD_INFO;
610433d6423SLionel Sambuc 
611433d6423SLionel Sambuc 
612433d6423SLionel Sambuc /*****************************************************************************
613433d6423SLionel Sambuc  *
614433d6423SLionel Sambuc  * Generic "state" object for stacks
615433d6423SLionel Sambuc  *
616433d6423SLionel Sambuc  ****************************************************************************/
617433d6423SLionel Sambuc 
618433d6423SLionel Sambuc #define ACPI_CONTROL_NORMAL                  0xC0
619433d6423SLionel Sambuc #define ACPI_CONTROL_CONDITIONAL_EXECUTING   0xC1
620433d6423SLionel Sambuc #define ACPI_CONTROL_PREDICATE_EXECUTING     0xC2
621433d6423SLionel Sambuc #define ACPI_CONTROL_PREDICATE_FALSE         0xC3
622433d6423SLionel Sambuc #define ACPI_CONTROL_PREDICATE_TRUE          0xC4
623433d6423SLionel Sambuc 
624433d6423SLionel Sambuc 
625433d6423SLionel Sambuc #define ACPI_STATE_COMMON \
626433d6423SLionel Sambuc     void                            *Next; \
627433d6423SLionel Sambuc     UINT8                           DescriptorType; /* To differentiate various internal objs */\
628433d6423SLionel Sambuc     UINT8                           Flags; \
629433d6423SLionel Sambuc     UINT16                          Value; \
630433d6423SLionel Sambuc     UINT16                          State;
631433d6423SLionel Sambuc 
632433d6423SLionel Sambuc     /* There are 2 bytes available here until the next natural alignment boundary */
633433d6423SLionel Sambuc 
634433d6423SLionel Sambuc typedef struct acpi_common_state
635433d6423SLionel Sambuc {
636433d6423SLionel Sambuc     ACPI_STATE_COMMON
637433d6423SLionel Sambuc } ACPI_COMMON_STATE;
638433d6423SLionel Sambuc 
639433d6423SLionel Sambuc 
640433d6423SLionel Sambuc /*
641433d6423SLionel Sambuc  * Update state - used to traverse complex objects such as packages
642433d6423SLionel Sambuc  */
643433d6423SLionel Sambuc typedef struct acpi_update_state
644433d6423SLionel Sambuc {
645433d6423SLionel Sambuc     ACPI_STATE_COMMON
646433d6423SLionel Sambuc     union acpi_operand_object       *Object;
647433d6423SLionel Sambuc 
648433d6423SLionel Sambuc } ACPI_UPDATE_STATE;
649433d6423SLionel Sambuc 
650433d6423SLionel Sambuc 
651433d6423SLionel Sambuc /*
652433d6423SLionel Sambuc  * Pkg state - used to traverse nested package structures
653433d6423SLionel Sambuc  */
654433d6423SLionel Sambuc typedef struct acpi_pkg_state
655433d6423SLionel Sambuc {
656433d6423SLionel Sambuc     ACPI_STATE_COMMON
657433d6423SLionel Sambuc     UINT16                          Index;
658433d6423SLionel Sambuc     union acpi_operand_object       *SourceObject;
659433d6423SLionel Sambuc     union acpi_operand_object       *DestObject;
660433d6423SLionel Sambuc     struct acpi_walk_state          *WalkState;
661433d6423SLionel Sambuc     void                            *ThisTargetObj;
662433d6423SLionel Sambuc     UINT32                          NumPackages;
663433d6423SLionel Sambuc 
664433d6423SLionel Sambuc } ACPI_PKG_STATE;
665433d6423SLionel Sambuc 
666433d6423SLionel Sambuc 
667433d6423SLionel Sambuc /*
668433d6423SLionel Sambuc  * Control state - one per if/else and while constructs.
669433d6423SLionel Sambuc  * Allows nesting of these constructs
670433d6423SLionel Sambuc  */
671433d6423SLionel Sambuc typedef struct acpi_control_state
672433d6423SLionel Sambuc {
673433d6423SLionel Sambuc     ACPI_STATE_COMMON
674433d6423SLionel Sambuc     UINT16                          Opcode;
675433d6423SLionel Sambuc     union acpi_parse_object         *PredicateOp;
676433d6423SLionel Sambuc     UINT8                           *AmlPredicateStart;     /* Start of if/while predicate */
677433d6423SLionel Sambuc     UINT8                           *PackageEnd;            /* End of if/while block */
678433d6423SLionel Sambuc     UINT32                          LoopCount;              /* While() loop counter */
679433d6423SLionel Sambuc 
680433d6423SLionel Sambuc } ACPI_CONTROL_STATE;
681433d6423SLionel Sambuc 
682433d6423SLionel Sambuc 
683433d6423SLionel Sambuc /*
684433d6423SLionel Sambuc  * Scope state - current scope during namespace lookups
685433d6423SLionel Sambuc  */
686433d6423SLionel Sambuc typedef struct acpi_scope_state
687433d6423SLionel Sambuc {
688433d6423SLionel Sambuc     ACPI_STATE_COMMON
689433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *Node;
690433d6423SLionel Sambuc 
691433d6423SLionel Sambuc } ACPI_SCOPE_STATE;
692433d6423SLionel Sambuc 
693433d6423SLionel Sambuc 
694433d6423SLionel Sambuc typedef struct acpi_pscope_state
695433d6423SLionel Sambuc {
696433d6423SLionel Sambuc     ACPI_STATE_COMMON
697433d6423SLionel Sambuc     UINT32                          ArgCount;               /* Number of fixed arguments */
698433d6423SLionel Sambuc     union acpi_parse_object         *Op;                    /* Current op being parsed */
699433d6423SLionel Sambuc     UINT8                           *ArgEnd;                /* Current argument end */
700433d6423SLionel Sambuc     UINT8                           *PkgEnd;                /* Current package end */
701433d6423SLionel Sambuc     UINT32                          ArgList;                /* Next argument to parse */
702433d6423SLionel Sambuc 
703433d6423SLionel Sambuc } ACPI_PSCOPE_STATE;
704433d6423SLionel Sambuc 
705433d6423SLionel Sambuc 
706433d6423SLionel Sambuc /*
707433d6423SLionel Sambuc  * Thread state - one per thread across multiple walk states. Multiple walk
708433d6423SLionel Sambuc  * states are created when there are nested control methods executing.
709433d6423SLionel Sambuc  */
710433d6423SLionel Sambuc typedef struct acpi_thread_state
711433d6423SLionel Sambuc {
712433d6423SLionel Sambuc     ACPI_STATE_COMMON
713433d6423SLionel Sambuc     UINT8                           CurrentSyncLevel;       /* Mutex Sync (nested acquire) level */
714433d6423SLionel Sambuc     struct acpi_walk_state          *WalkStateList;         /* Head of list of WalkStates for this thread */
715433d6423SLionel Sambuc     union acpi_operand_object       *AcquiredMutexList;     /* List of all currently acquired mutexes */
716433d6423SLionel Sambuc     ACPI_THREAD_ID                  ThreadId;               /* Running thread ID */
717433d6423SLionel Sambuc 
718433d6423SLionel Sambuc } ACPI_THREAD_STATE;
719433d6423SLionel Sambuc 
720433d6423SLionel Sambuc 
721433d6423SLionel Sambuc /*
722433d6423SLionel Sambuc  * Result values - used to accumulate the results of nested
723433d6423SLionel Sambuc  * AML arguments
724433d6423SLionel Sambuc  */
725433d6423SLionel Sambuc typedef struct acpi_result_values
726433d6423SLionel Sambuc {
727433d6423SLionel Sambuc     ACPI_STATE_COMMON
728433d6423SLionel Sambuc     union acpi_operand_object       *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM];
729433d6423SLionel Sambuc 
730433d6423SLionel Sambuc } ACPI_RESULT_VALUES;
731433d6423SLionel Sambuc 
732433d6423SLionel Sambuc 
733433d6423SLionel Sambuc typedef
734433d6423SLionel Sambuc ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
735433d6423SLionel Sambuc     struct acpi_walk_state          *WalkState,
736433d6423SLionel Sambuc     union acpi_parse_object         **OutOp);
737433d6423SLionel Sambuc 
738433d6423SLionel Sambuc typedef
739433d6423SLionel Sambuc ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
740433d6423SLionel Sambuc     struct acpi_walk_state          *WalkState);
741433d6423SLionel Sambuc 
742433d6423SLionel Sambuc 
743*29492bb7SDavid van Moolenbroek /* Global handlers for AML Notifies */
744*29492bb7SDavid van Moolenbroek 
745*29492bb7SDavid van Moolenbroek typedef struct acpi_global_notify_handler
746*29492bb7SDavid van Moolenbroek {
747*29492bb7SDavid van Moolenbroek     ACPI_NOTIFY_HANDLER             Handler;
748*29492bb7SDavid van Moolenbroek     void                            *Context;
749*29492bb7SDavid van Moolenbroek 
750*29492bb7SDavid van Moolenbroek } ACPI_GLOBAL_NOTIFY_HANDLER;
751*29492bb7SDavid van Moolenbroek 
752433d6423SLionel Sambuc /*
753433d6423SLionel Sambuc  * Notify info - used to pass info to the deferred notify
754433d6423SLionel Sambuc  * handler/dispatcher.
755433d6423SLionel Sambuc  */
756433d6423SLionel Sambuc typedef struct acpi_notify_info
757433d6423SLionel Sambuc {
758433d6423SLionel Sambuc     ACPI_STATE_COMMON
759*29492bb7SDavid van Moolenbroek     UINT8                           HandlerListId;
760433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *Node;
761*29492bb7SDavid van Moolenbroek     union acpi_operand_object       *HandlerListHead;
762*29492bb7SDavid van Moolenbroek     ACPI_GLOBAL_NOTIFY_HANDLER      *Global;
763433d6423SLionel Sambuc 
764433d6423SLionel Sambuc } ACPI_NOTIFY_INFO;
765433d6423SLionel Sambuc 
766433d6423SLionel Sambuc 
767433d6423SLionel Sambuc /* Generic state is union of structs above */
768433d6423SLionel Sambuc 
769433d6423SLionel Sambuc typedef union acpi_generic_state
770433d6423SLionel Sambuc {
771433d6423SLionel Sambuc     ACPI_COMMON_STATE               Common;
772433d6423SLionel Sambuc     ACPI_CONTROL_STATE              Control;
773433d6423SLionel Sambuc     ACPI_UPDATE_STATE               Update;
774433d6423SLionel Sambuc     ACPI_SCOPE_STATE                Scope;
775433d6423SLionel Sambuc     ACPI_PSCOPE_STATE               ParseScope;
776433d6423SLionel Sambuc     ACPI_PKG_STATE                  Pkg;
777433d6423SLionel Sambuc     ACPI_THREAD_STATE               Thread;
778433d6423SLionel Sambuc     ACPI_RESULT_VALUES              Results;
779433d6423SLionel Sambuc     ACPI_NOTIFY_INFO                Notify;
780433d6423SLionel Sambuc 
781433d6423SLionel Sambuc } ACPI_GENERIC_STATE;
782433d6423SLionel Sambuc 
783433d6423SLionel Sambuc 
784433d6423SLionel Sambuc /*****************************************************************************
785433d6423SLionel Sambuc  *
786433d6423SLionel Sambuc  * Interpreter typedefs and structs
787433d6423SLionel Sambuc  *
788433d6423SLionel Sambuc  ****************************************************************************/
789433d6423SLionel Sambuc 
790433d6423SLionel Sambuc typedef
791433d6423SLionel Sambuc ACPI_STATUS (*ACPI_EXECUTE_OP) (
792433d6423SLionel Sambuc     struct acpi_walk_state          *WalkState);
793433d6423SLionel Sambuc 
794*29492bb7SDavid van Moolenbroek /* Address Range info block */
795*29492bb7SDavid van Moolenbroek 
796*29492bb7SDavid van Moolenbroek typedef struct acpi_address_range
797*29492bb7SDavid van Moolenbroek {
798*29492bb7SDavid van Moolenbroek     struct acpi_address_range   *Next;
799*29492bb7SDavid van Moolenbroek     ACPI_NAMESPACE_NODE         *RegionNode;
800*29492bb7SDavid van Moolenbroek     ACPI_PHYSICAL_ADDRESS       StartAddress;
801*29492bb7SDavid van Moolenbroek     ACPI_PHYSICAL_ADDRESS       EndAddress;
802*29492bb7SDavid van Moolenbroek 
803*29492bb7SDavid van Moolenbroek } ACPI_ADDRESS_RANGE;
804*29492bb7SDavid van Moolenbroek 
805433d6423SLionel Sambuc 
806433d6423SLionel Sambuc /*****************************************************************************
807433d6423SLionel Sambuc  *
808433d6423SLionel Sambuc  * Parser typedefs and structs
809433d6423SLionel Sambuc  *
810433d6423SLionel Sambuc  ****************************************************************************/
811433d6423SLionel Sambuc 
812433d6423SLionel Sambuc /*
813433d6423SLionel Sambuc  * AML opcode, name, and argument layout
814433d6423SLionel Sambuc  */
815433d6423SLionel Sambuc typedef struct acpi_opcode_info
816433d6423SLionel Sambuc {
817433d6423SLionel Sambuc #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
818433d6423SLionel Sambuc     char                            *Name;          /* Opcode name (disassembler/debug only) */
819433d6423SLionel Sambuc #endif
820433d6423SLionel Sambuc     UINT32                          ParseArgs;      /* Grammar/Parse time arguments */
821433d6423SLionel Sambuc     UINT32                          RuntimeArgs;    /* Interpret time arguments */
822433d6423SLionel Sambuc     UINT16                          Flags;          /* Misc flags */
823433d6423SLionel Sambuc     UINT8                           ObjectType;     /* Corresponding internal object type */
824433d6423SLionel Sambuc     UINT8                           Class;          /* Opcode class */
825433d6423SLionel Sambuc     UINT8                           Type;           /* Opcode type */
826433d6423SLionel Sambuc 
827433d6423SLionel Sambuc } ACPI_OPCODE_INFO;
828433d6423SLionel Sambuc 
829*29492bb7SDavid van Moolenbroek /* Structure for Resource Tag information */
830*29492bb7SDavid van Moolenbroek 
831*29492bb7SDavid van Moolenbroek typedef struct acpi_tag_info
832*29492bb7SDavid van Moolenbroek {
833*29492bb7SDavid van Moolenbroek     UINT32                          BitOffset;
834*29492bb7SDavid van Moolenbroek     UINT32                          BitLength;
835*29492bb7SDavid van Moolenbroek 
836*29492bb7SDavid van Moolenbroek } ACPI_TAG_INFO;
837*29492bb7SDavid van Moolenbroek 
838*29492bb7SDavid van Moolenbroek /* Value associated with the parse object */
839*29492bb7SDavid van Moolenbroek 
840433d6423SLionel Sambuc typedef union acpi_parse_value
841433d6423SLionel Sambuc {
842433d6423SLionel Sambuc     UINT64                          Integer;        /* Integer constant (Up to 64 bits) */
843433d6423SLionel Sambuc     UINT32                          Size;           /* bytelist or field size */
844433d6423SLionel Sambuc     char                            *String;        /* NULL terminated string */
845433d6423SLionel Sambuc     UINT8                           *Buffer;        /* buffer or string */
846433d6423SLionel Sambuc     char                            *Name;          /* NULL terminated string */
847433d6423SLionel Sambuc     union acpi_parse_object         *Arg;           /* arguments and contained ops */
848*29492bb7SDavid van Moolenbroek     ACPI_TAG_INFO                   Tag;            /* Resource descriptor tag info  */
849433d6423SLionel Sambuc 
850433d6423SLionel Sambuc } ACPI_PARSE_VALUE;
851433d6423SLionel Sambuc 
852433d6423SLionel Sambuc 
853433d6423SLionel Sambuc #ifdef ACPI_DISASSEMBLER
854433d6423SLionel Sambuc #define ACPI_DISASM_ONLY_MEMBERS(a)     a;
855433d6423SLionel Sambuc #else
856433d6423SLionel Sambuc #define ACPI_DISASM_ONLY_MEMBERS(a)
857433d6423SLionel Sambuc #endif
858433d6423SLionel Sambuc 
859433d6423SLionel Sambuc #define ACPI_PARSE_COMMON \
860433d6423SLionel Sambuc     union acpi_parse_object         *Parent;        /* Parent op */\
861433d6423SLionel Sambuc     UINT8                           DescriptorType; /* To differentiate various internal objs */\
862433d6423SLionel Sambuc     UINT8                           Flags;          /* Type of Op */\
863433d6423SLionel Sambuc     UINT16                          AmlOpcode;      /* AML opcode */\
864433d6423SLionel Sambuc     UINT32                          AmlOffset;      /* Offset of declaration in AML */\
865433d6423SLionel Sambuc     union acpi_parse_object         *Next;          /* Next op */\
866433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE             *Node;          /* For use by interpreter */\
867433d6423SLionel Sambuc     ACPI_PARSE_VALUE                Value;          /* Value or args associated with the opcode */\
868433d6423SLionel Sambuc     UINT8                           ArgListLength;  /* Number of elements in the arg list */\
869433d6423SLionel Sambuc     ACPI_DISASM_ONLY_MEMBERS (\
870433d6423SLionel Sambuc     UINT8                           DisasmFlags;    /* Used during AML disassembly */\
871433d6423SLionel Sambuc     UINT8                           DisasmOpcode;   /* Subtype used for disassembly */\
872*29492bb7SDavid van Moolenbroek     char                            *OperatorSymbol;/* Used for C-style operator name strings */\
873433d6423SLionel Sambuc     char                            AmlOpName[16])  /* Op name (debug only) */
874433d6423SLionel Sambuc 
875433d6423SLionel Sambuc 
876*29492bb7SDavid van Moolenbroek /* Flags for DisasmFlags field  above */
877*29492bb7SDavid van Moolenbroek 
878*29492bb7SDavid van Moolenbroek #define ACPI_DASM_BUFFER                0x00        /* Buffer is a simple data buffer */
879*29492bb7SDavid van Moolenbroek #define ACPI_DASM_RESOURCE              0x01        /* Buffer is a Resource Descriptor */
880*29492bb7SDavid van Moolenbroek #define ACPI_DASM_STRING                0x02        /* Buffer is a ASCII string */
881*29492bb7SDavid van Moolenbroek #define ACPI_DASM_UNICODE               0x03        /* Buffer is a Unicode string */
882*29492bb7SDavid van Moolenbroek #define ACPI_DASM_PLD_METHOD            0x04        /* Buffer is a _PLD method bit-packed buffer */
883*29492bb7SDavid van Moolenbroek #define ACPI_DASM_UUID                  0x05        /* Buffer is a UUID/GUID */
884*29492bb7SDavid van Moolenbroek #define ACPI_DASM_EISAID                0x06        /* Integer is an EISAID */
885*29492bb7SDavid van Moolenbroek #define ACPI_DASM_MATCHOP               0x07        /* Parent opcode is a Match() operator */
886*29492bb7SDavid van Moolenbroek #define ACPI_DASM_LNOT_PREFIX           0x08        /* Start of a LNotEqual (etc.) pair of opcodes */
887*29492bb7SDavid van Moolenbroek #define ACPI_DASM_LNOT_SUFFIX           0x09        /* End  of a LNotEqual (etc.) pair of opcodes */
888*29492bb7SDavid van Moolenbroek #define ACPI_DASM_HID_STRING            0x0A        /* String is a _HID or _CID */
889*29492bb7SDavid van Moolenbroek #define ACPI_DASM_IGNORE                0x0B        /* Not used at this time */
890433d6423SLionel Sambuc 
891433d6423SLionel Sambuc /*
892433d6423SLionel Sambuc  * Generic operation (for example:  If, While, Store)
893433d6423SLionel Sambuc  */
894433d6423SLionel Sambuc typedef struct acpi_parse_obj_common
895433d6423SLionel Sambuc {
896433d6423SLionel Sambuc     ACPI_PARSE_COMMON
897433d6423SLionel Sambuc } ACPI_PARSE_OBJ_COMMON;
898433d6423SLionel Sambuc 
899433d6423SLionel Sambuc 
900433d6423SLionel Sambuc /*
901433d6423SLionel Sambuc  * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
902433d6423SLionel Sambuc  * and bytelists.
903433d6423SLionel Sambuc  */
904433d6423SLionel Sambuc typedef struct acpi_parse_obj_named
905433d6423SLionel Sambuc {
906433d6423SLionel Sambuc     ACPI_PARSE_COMMON
907433d6423SLionel Sambuc     UINT8                           *Path;
908433d6423SLionel Sambuc     UINT8                           *Data;          /* AML body or bytelist data */
909433d6423SLionel Sambuc     UINT32                          Length;         /* AML length */
910433d6423SLionel Sambuc     UINT32                          Name;           /* 4-byte name or zero if no name */
911433d6423SLionel Sambuc 
912433d6423SLionel Sambuc } ACPI_PARSE_OBJ_NAMED;
913433d6423SLionel Sambuc 
914433d6423SLionel Sambuc 
915433d6423SLionel Sambuc /* This version is used by the iASL compiler only */
916433d6423SLionel Sambuc 
917433d6423SLionel Sambuc #define ACPI_MAX_PARSEOP_NAME   20
918433d6423SLionel Sambuc 
919433d6423SLionel Sambuc typedef struct acpi_parse_obj_asl
920433d6423SLionel Sambuc {
921433d6423SLionel Sambuc     ACPI_PARSE_COMMON
922433d6423SLionel Sambuc     union acpi_parse_object         *Child;
923433d6423SLionel Sambuc     union acpi_parse_object         *ParentMethod;
924433d6423SLionel Sambuc     char                            *Filename;
925433d6423SLionel Sambuc     char                            *ExternalName;
926433d6423SLionel Sambuc     char                            *Namepath;
927433d6423SLionel Sambuc     char                            NameSeg[4];
928433d6423SLionel Sambuc     UINT32                          ExtraValue;
929433d6423SLionel Sambuc     UINT32                          Column;
930433d6423SLionel Sambuc     UINT32                          LineNumber;
931433d6423SLionel Sambuc     UINT32                          LogicalLineNumber;
932433d6423SLionel Sambuc     UINT32                          LogicalByteOffset;
933433d6423SLionel Sambuc     UINT32                          EndLine;
934433d6423SLionel Sambuc     UINT32                          EndLogicalLine;
935433d6423SLionel Sambuc     UINT32                          AcpiBtype;
936433d6423SLionel Sambuc     UINT32                          AmlLength;
937433d6423SLionel Sambuc     UINT32                          AmlSubtreeLength;
938433d6423SLionel Sambuc     UINT32                          FinalAmlLength;
939433d6423SLionel Sambuc     UINT32                          FinalAmlOffset;
940433d6423SLionel Sambuc     UINT32                          CompileFlags;
941433d6423SLionel Sambuc     UINT16                          ParseOpcode;
942433d6423SLionel Sambuc     UINT8                           AmlOpcodeLength;
943433d6423SLionel Sambuc     UINT8                           AmlPkgLenBytes;
944433d6423SLionel Sambuc     UINT8                           Extra;
945433d6423SLionel Sambuc     char                            ParseOpName[ACPI_MAX_PARSEOP_NAME];
946433d6423SLionel Sambuc 
947433d6423SLionel Sambuc } ACPI_PARSE_OBJ_ASL;
948433d6423SLionel Sambuc 
949433d6423SLionel Sambuc typedef union acpi_parse_object
950433d6423SLionel Sambuc {
951433d6423SLionel Sambuc     ACPI_PARSE_OBJ_COMMON           Common;
952433d6423SLionel Sambuc     ACPI_PARSE_OBJ_NAMED            Named;
953433d6423SLionel Sambuc     ACPI_PARSE_OBJ_ASL              Asl;
954433d6423SLionel Sambuc 
955433d6423SLionel Sambuc } ACPI_PARSE_OBJECT;
956433d6423SLionel Sambuc 
957433d6423SLionel Sambuc 
958433d6423SLionel Sambuc /*
959433d6423SLionel Sambuc  * Parse state - one state per parser invocation and each control
960433d6423SLionel Sambuc  * method.
961433d6423SLionel Sambuc  */
962433d6423SLionel Sambuc typedef struct acpi_parse_state
963433d6423SLionel Sambuc {
964433d6423SLionel Sambuc     UINT8                           *AmlStart;      /* First AML byte */
965433d6423SLionel Sambuc     UINT8                           *Aml;           /* Next AML byte */
966433d6423SLionel Sambuc     UINT8                           *AmlEnd;        /* (last + 1) AML byte */
967433d6423SLionel Sambuc     UINT8                           *PkgStart;      /* Current package begin */
968433d6423SLionel Sambuc     UINT8                           *PkgEnd;        /* Current package end */
969433d6423SLionel Sambuc     union acpi_parse_object         *StartOp;       /* Root of parse tree */
970433d6423SLionel Sambuc     struct acpi_namespace_node      *StartNode;
971433d6423SLionel Sambuc     union acpi_generic_state        *Scope;         /* Current scope */
972433d6423SLionel Sambuc     union acpi_parse_object         *StartScope;
973433d6423SLionel Sambuc     UINT32                          AmlSize;
974433d6423SLionel Sambuc 
975433d6423SLionel Sambuc } ACPI_PARSE_STATE;
976433d6423SLionel Sambuc 
977433d6423SLionel Sambuc 
978433d6423SLionel Sambuc /* Parse object flags */
979433d6423SLionel Sambuc 
980433d6423SLionel Sambuc #define ACPI_PARSEOP_GENERIC            0x01
981433d6423SLionel Sambuc #define ACPI_PARSEOP_NAMED              0x02
982433d6423SLionel Sambuc #define ACPI_PARSEOP_DEFERRED           0x04
983433d6423SLionel Sambuc #define ACPI_PARSEOP_BYTELIST           0x08
984433d6423SLionel Sambuc #define ACPI_PARSEOP_IN_STACK           0x10
985433d6423SLionel Sambuc #define ACPI_PARSEOP_TARGET             0x20
986433d6423SLionel Sambuc #define ACPI_PARSEOP_IN_CACHE           0x80
987433d6423SLionel Sambuc 
988433d6423SLionel Sambuc /* Parse object DisasmFlags */
989433d6423SLionel Sambuc 
990433d6423SLionel Sambuc #define ACPI_PARSEOP_IGNORE             0x01
991433d6423SLionel Sambuc #define ACPI_PARSEOP_PARAMLIST          0x02
992433d6423SLionel Sambuc #define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
993*29492bb7SDavid van Moolenbroek #define ACPI_PARSEOP_PREDEF_CHECKED     0x08
994433d6423SLionel Sambuc #define ACPI_PARSEOP_SPECIAL            0x10
995*29492bb7SDavid van Moolenbroek #define ACPI_PARSEOP_COMPOUND           0x20
996*29492bb7SDavid van Moolenbroek #define ACPI_PARSEOP_ASSIGNMENT         0x40
997433d6423SLionel Sambuc 
998433d6423SLionel Sambuc 
999433d6423SLionel Sambuc /*****************************************************************************
1000433d6423SLionel Sambuc  *
1001433d6423SLionel Sambuc  * Hardware (ACPI registers) and PNP
1002433d6423SLionel Sambuc  *
1003433d6423SLionel Sambuc  ****************************************************************************/
1004433d6423SLionel Sambuc 
1005433d6423SLionel Sambuc typedef struct acpi_bit_register_info
1006433d6423SLionel Sambuc {
1007433d6423SLionel Sambuc     UINT8                           ParentRegister;
1008433d6423SLionel Sambuc     UINT8                           BitPosition;
1009433d6423SLionel Sambuc     UINT16                          AccessBitMask;
1010433d6423SLionel Sambuc 
1011433d6423SLionel Sambuc } ACPI_BIT_REGISTER_INFO;
1012433d6423SLionel Sambuc 
1013433d6423SLionel Sambuc 
1014433d6423SLionel Sambuc /*
1015433d6423SLionel Sambuc  * Some ACPI registers have bits that must be ignored -- meaning that they
1016433d6423SLionel Sambuc  * must be preserved.
1017433d6423SLionel Sambuc  */
1018433d6423SLionel Sambuc #define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800  /* Bit 11 */
1019433d6423SLionel Sambuc 
1020433d6423SLionel Sambuc /* Write-only bits must be zeroed by software */
1021433d6423SLionel Sambuc 
1022433d6423SLionel Sambuc #define ACPI_PM1_CONTROL_WRITEONLY_BITS         0x2004  /* Bits 13, 2 */
1023433d6423SLionel Sambuc 
1024433d6423SLionel Sambuc /* For control registers, both ignored and reserved bits must be preserved */
1025433d6423SLionel Sambuc 
1026433d6423SLionel Sambuc /*
1027433d6423SLionel Sambuc  * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
1028433d6423SLionel Sambuc  * ACPI specification to be a "preserved" bit - "OSPM always preserves this
1029433d6423SLionel Sambuc  * bit position", section 4.7.3.2.1. However, on some machines the OS must
1030433d6423SLionel Sambuc  * write a one to this bit after resume for the machine to work properly.
1031433d6423SLionel Sambuc  * To enable this, we no longer attempt to preserve this bit. No machines
1032433d6423SLionel Sambuc  * are known to fail if the bit is not preserved. (May 2009)
1033433d6423SLionel Sambuc  */
1034433d6423SLionel Sambuc #define ACPI_PM1_CONTROL_IGNORED_BITS           0x0200  /* Bit 9 */
1035433d6423SLionel Sambuc #define ACPI_PM1_CONTROL_RESERVED_BITS          0xC1F8  /* Bits 14-15, 3-8 */
1036433d6423SLionel Sambuc #define ACPI_PM1_CONTROL_PRESERVED_BITS \
1037433d6423SLionel Sambuc          (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
1038433d6423SLionel Sambuc 
1039433d6423SLionel Sambuc #define ACPI_PM2_CONTROL_PRESERVED_BITS         0xFFFFFFFE /* All except bit 0 */
1040433d6423SLionel Sambuc 
1041433d6423SLionel Sambuc /*
1042433d6423SLionel Sambuc  * Register IDs
1043433d6423SLionel Sambuc  * These are the full ACPI registers
1044433d6423SLionel Sambuc  */
1045433d6423SLionel Sambuc #define ACPI_REGISTER_PM1_STATUS                0x01
1046433d6423SLionel Sambuc #define ACPI_REGISTER_PM1_ENABLE                0x02
1047433d6423SLionel Sambuc #define ACPI_REGISTER_PM1_CONTROL               0x03
1048433d6423SLionel Sambuc #define ACPI_REGISTER_PM2_CONTROL               0x04
1049433d6423SLionel Sambuc #define ACPI_REGISTER_PM_TIMER                  0x05
1050433d6423SLionel Sambuc #define ACPI_REGISTER_PROCESSOR_BLOCK           0x06
1051433d6423SLionel Sambuc #define ACPI_REGISTER_SMI_COMMAND_BLOCK         0x07
1052433d6423SLionel Sambuc 
1053433d6423SLionel Sambuc 
1054433d6423SLionel Sambuc /* Masks used to access the BitRegisters */
1055433d6423SLionel Sambuc 
1056433d6423SLionel Sambuc #define ACPI_BITMASK_TIMER_STATUS               0x0001
1057433d6423SLionel Sambuc #define ACPI_BITMASK_BUS_MASTER_STATUS          0x0010
1058433d6423SLionel Sambuc #define ACPI_BITMASK_GLOBAL_LOCK_STATUS         0x0020
1059433d6423SLionel Sambuc #define ACPI_BITMASK_POWER_BUTTON_STATUS        0x0100
1060433d6423SLionel Sambuc #define ACPI_BITMASK_SLEEP_BUTTON_STATUS        0x0200
1061433d6423SLionel Sambuc #define ACPI_BITMASK_RT_CLOCK_STATUS            0x0400
1062433d6423SLionel Sambuc #define ACPI_BITMASK_PCIEXP_WAKE_STATUS         0x4000    /* ACPI 3.0 */
1063433d6423SLionel Sambuc #define ACPI_BITMASK_WAKE_STATUS                0x8000
1064433d6423SLionel Sambuc 
1065433d6423SLionel Sambuc #define ACPI_BITMASK_ALL_FIXED_STATUS           (\
1066433d6423SLionel Sambuc     ACPI_BITMASK_TIMER_STATUS          | \
1067433d6423SLionel Sambuc     ACPI_BITMASK_BUS_MASTER_STATUS     | \
1068433d6423SLionel Sambuc     ACPI_BITMASK_GLOBAL_LOCK_STATUS    | \
1069433d6423SLionel Sambuc     ACPI_BITMASK_POWER_BUTTON_STATUS   | \
1070433d6423SLionel Sambuc     ACPI_BITMASK_SLEEP_BUTTON_STATUS   | \
1071433d6423SLionel Sambuc     ACPI_BITMASK_RT_CLOCK_STATUS       | \
1072*29492bb7SDavid van Moolenbroek     ACPI_BITMASK_PCIEXP_WAKE_STATUS    | \
1073433d6423SLionel Sambuc     ACPI_BITMASK_WAKE_STATUS)
1074433d6423SLionel Sambuc 
1075433d6423SLionel Sambuc #define ACPI_BITMASK_TIMER_ENABLE               0x0001
1076433d6423SLionel Sambuc #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE         0x0020
1077433d6423SLionel Sambuc #define ACPI_BITMASK_POWER_BUTTON_ENABLE        0x0100
1078433d6423SLionel Sambuc #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE        0x0200
1079433d6423SLionel Sambuc #define ACPI_BITMASK_RT_CLOCK_ENABLE            0x0400
1080433d6423SLionel Sambuc #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE        0x4000    /* ACPI 3.0 */
1081433d6423SLionel Sambuc 
1082433d6423SLionel Sambuc #define ACPI_BITMASK_SCI_ENABLE                 0x0001
1083433d6423SLionel Sambuc #define ACPI_BITMASK_BUS_MASTER_RLD             0x0002
1084433d6423SLionel Sambuc #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE        0x0004
1085433d6423SLionel Sambuc #define ACPI_BITMASK_SLEEP_TYPE                 0x1C00
1086433d6423SLionel Sambuc #define ACPI_BITMASK_SLEEP_ENABLE               0x2000
1087433d6423SLionel Sambuc 
1088433d6423SLionel Sambuc #define ACPI_BITMASK_ARB_DISABLE                0x0001
1089433d6423SLionel Sambuc 
1090433d6423SLionel Sambuc 
1091433d6423SLionel Sambuc /* Raw bit position of each BitRegister */
1092433d6423SLionel Sambuc 
1093433d6423SLionel Sambuc #define ACPI_BITPOSITION_TIMER_STATUS           0x00
1094433d6423SLionel Sambuc #define ACPI_BITPOSITION_BUS_MASTER_STATUS      0x04
1095433d6423SLionel Sambuc #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS     0x05
1096433d6423SLionel Sambuc #define ACPI_BITPOSITION_POWER_BUTTON_STATUS    0x08
1097433d6423SLionel Sambuc #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS    0x09
1098433d6423SLionel Sambuc #define ACPI_BITPOSITION_RT_CLOCK_STATUS        0x0A
1099433d6423SLionel Sambuc #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS     0x0E    /* ACPI 3.0 */
1100433d6423SLionel Sambuc #define ACPI_BITPOSITION_WAKE_STATUS            0x0F
1101433d6423SLionel Sambuc 
1102433d6423SLionel Sambuc #define ACPI_BITPOSITION_TIMER_ENABLE           0x00
1103433d6423SLionel Sambuc #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE     0x05
1104433d6423SLionel Sambuc #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE    0x08
1105433d6423SLionel Sambuc #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE    0x09
1106433d6423SLionel Sambuc #define ACPI_BITPOSITION_RT_CLOCK_ENABLE        0x0A
1107433d6423SLionel Sambuc #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE    0x0E    /* ACPI 3.0 */
1108433d6423SLionel Sambuc 
1109433d6423SLionel Sambuc #define ACPI_BITPOSITION_SCI_ENABLE             0x00
1110433d6423SLionel Sambuc #define ACPI_BITPOSITION_BUS_MASTER_RLD         0x01
1111433d6423SLionel Sambuc #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE    0x02
1112433d6423SLionel Sambuc #define ACPI_BITPOSITION_SLEEP_TYPE             0x0A
1113433d6423SLionel Sambuc #define ACPI_BITPOSITION_SLEEP_ENABLE           0x0D
1114433d6423SLionel Sambuc 
1115433d6423SLionel Sambuc #define ACPI_BITPOSITION_ARB_DISABLE            0x00
1116433d6423SLionel Sambuc 
1117433d6423SLionel Sambuc 
1118433d6423SLionel Sambuc /* Structs and definitions for _OSI support and I/O port validation */
1119433d6423SLionel Sambuc 
1120433d6423SLionel Sambuc #define ACPI_ALWAYS_ILLEGAL             0x00
1121433d6423SLionel Sambuc 
1122433d6423SLionel Sambuc typedef struct acpi_interface_info
1123433d6423SLionel Sambuc {
1124433d6423SLionel Sambuc     char                        *Name;
1125*29492bb7SDavid van Moolenbroek     struct acpi_interface_info  *Next;
1126*29492bb7SDavid van Moolenbroek     UINT8                       Flags;
1127433d6423SLionel Sambuc     UINT8                       Value;
1128433d6423SLionel Sambuc 
1129433d6423SLionel Sambuc } ACPI_INTERFACE_INFO;
1130433d6423SLionel Sambuc 
1131*29492bb7SDavid van Moolenbroek #define ACPI_OSI_INVALID                0x01
1132*29492bb7SDavid van Moolenbroek #define ACPI_OSI_DYNAMIC                0x02
1133*29492bb7SDavid van Moolenbroek #define ACPI_OSI_FEATURE                0x04
1134*29492bb7SDavid van Moolenbroek #define ACPI_OSI_DEFAULT_INVALID        0x08
1135*29492bb7SDavid van Moolenbroek #define ACPI_OSI_OPTIONAL_FEATURE       (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
1136*29492bb7SDavid van Moolenbroek 
1137433d6423SLionel Sambuc typedef struct acpi_port_info
1138433d6423SLionel Sambuc {
1139433d6423SLionel Sambuc     char                    *Name;
1140433d6423SLionel Sambuc     UINT16                  Start;
1141433d6423SLionel Sambuc     UINT16                  End;
1142433d6423SLionel Sambuc     UINT8                   OsiDependency;
1143433d6423SLionel Sambuc 
1144433d6423SLionel Sambuc } ACPI_PORT_INFO;
1145433d6423SLionel Sambuc 
1146433d6423SLionel Sambuc 
1147433d6423SLionel Sambuc /*****************************************************************************
1148433d6423SLionel Sambuc  *
1149433d6423SLionel Sambuc  * Resource descriptors
1150433d6423SLionel Sambuc  *
1151433d6423SLionel Sambuc  ****************************************************************************/
1152433d6423SLionel Sambuc 
1153433d6423SLionel Sambuc /* ResourceType values */
1154433d6423SLionel Sambuc 
1155433d6423SLionel Sambuc #define ACPI_ADDRESS_TYPE_MEMORY_RANGE          0
1156433d6423SLionel Sambuc #define ACPI_ADDRESS_TYPE_IO_RANGE              1
1157433d6423SLionel Sambuc #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE      2
1158433d6423SLionel Sambuc 
1159433d6423SLionel Sambuc /* Resource descriptor types and masks */
1160433d6423SLionel Sambuc 
1161433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_LARGE                0x80
1162433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_SMALL                0x00
1163433d6423SLionel Sambuc 
1164433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_SMALL_MASK           0x78 /* Bits 6:3 contain the type */
1165433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK    0x07 /* Bits 2:0 contain the length */
1166433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_LARGE_MASK           0x7F /* Bits 6:0 contain the type */
1167433d6423SLionel Sambuc 
1168433d6423SLionel Sambuc 
1169433d6423SLionel Sambuc /*
1170433d6423SLionel Sambuc  * Small resource descriptor "names" as defined by the ACPI specification.
1171433d6423SLionel Sambuc  * Note: Bits 2:0 are used for the descriptor length
1172433d6423SLionel Sambuc  */
1173433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_IRQ                  0x20
1174433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_DMA                  0x28
1175433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_START_DEPENDENT      0x30
1176433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_END_DEPENDENT        0x38
1177433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_IO                   0x40
1178433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_FIXED_IO             0x48
1179*29492bb7SDavid van Moolenbroek #define ACPI_RESOURCE_NAME_FIXED_DMA            0x50
1180433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_RESERVED_S2          0x58
1181433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_RESERVED_S3          0x60
1182433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_RESERVED_S4          0x68
1183433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_VENDOR_SMALL         0x70
1184433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_END_TAG              0x78
1185433d6423SLionel Sambuc 
1186433d6423SLionel Sambuc /*
1187433d6423SLionel Sambuc  * Large resource descriptor "names" as defined by the ACPI specification.
1188433d6423SLionel Sambuc  * Note: includes the Large Descriptor bit in bit[7]
1189433d6423SLionel Sambuc  */
1190433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_MEMORY24             0x81
1191433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_GENERIC_REGISTER     0x82
1192433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_RESERVED_L1          0x83
1193433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_VENDOR_LARGE         0x84
1194433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_MEMORY32             0x85
1195433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_FIXED_MEMORY32       0x86
1196433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_ADDRESS32            0x87
1197433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_ADDRESS16            0x88
1198433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_EXTENDED_IRQ         0x89
1199433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_ADDRESS64            0x8A
1200433d6423SLionel Sambuc #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64   0x8B
1201*29492bb7SDavid van Moolenbroek #define ACPI_RESOURCE_NAME_GPIO                 0x8C
1202*29492bb7SDavid van Moolenbroek #define ACPI_RESOURCE_NAME_SERIAL_BUS           0x8E
1203*29492bb7SDavid van Moolenbroek #define ACPI_RESOURCE_NAME_LARGE_MAX            0x8E
1204433d6423SLionel Sambuc 
1205433d6423SLionel Sambuc 
1206433d6423SLionel Sambuc /*****************************************************************************
1207433d6423SLionel Sambuc  *
1208433d6423SLionel Sambuc  * Miscellaneous
1209433d6423SLionel Sambuc  *
1210433d6423SLionel Sambuc  ****************************************************************************/
1211433d6423SLionel Sambuc 
1212433d6423SLionel Sambuc #define ACPI_ASCII_ZERO                 0x30
1213433d6423SLionel Sambuc 
1214433d6423SLionel Sambuc 
1215433d6423SLionel Sambuc /*****************************************************************************
1216433d6423SLionel Sambuc  *
1217433d6423SLionel Sambuc  * Disassembler
1218433d6423SLionel Sambuc  *
1219433d6423SLionel Sambuc  ****************************************************************************/
1220433d6423SLionel Sambuc 
1221433d6423SLionel Sambuc typedef struct acpi_external_list
1222433d6423SLionel Sambuc {
1223433d6423SLionel Sambuc     char                        *Path;
1224433d6423SLionel Sambuc     char                        *InternalPath;
1225433d6423SLionel Sambuc     struct acpi_external_list   *Next;
1226433d6423SLionel Sambuc     UINT32                      Value;
1227433d6423SLionel Sambuc     UINT16                      Length;
1228*29492bb7SDavid van Moolenbroek     UINT16                      Flags;
1229433d6423SLionel Sambuc     UINT8                       Type;
1230433d6423SLionel Sambuc 
1231433d6423SLionel Sambuc } ACPI_EXTERNAL_LIST;
1232433d6423SLionel Sambuc 
1233433d6423SLionel Sambuc /* Values for Flags field above */
1234433d6423SLionel Sambuc 
1235*29492bb7SDavid van Moolenbroek #define ACPI_EXT_RESOLVED_REFERENCE         0x01    /* Object was resolved during cross ref */
1236*29492bb7SDavid van Moolenbroek #define ACPI_EXT_ORIGIN_FROM_FILE           0x02    /* External came from a file */
1237*29492bb7SDavid van Moolenbroek #define ACPI_EXT_INTERNAL_PATH_ALLOCATED    0x04    /* Deallocate internal path on completion */
1238*29492bb7SDavid van Moolenbroek #define ACPI_EXT_EXTERNAL_EMITTED           0x08    /* External() statement has been emitted */
1239*29492bb7SDavid van Moolenbroek 
1240*29492bb7SDavid van Moolenbroek 
1241*29492bb7SDavid van Moolenbroek typedef struct acpi_external_file
1242*29492bb7SDavid van Moolenbroek {
1243*29492bb7SDavid van Moolenbroek     char                        *Path;
1244*29492bb7SDavid van Moolenbroek     struct acpi_external_file   *Next;
1245*29492bb7SDavid van Moolenbroek 
1246*29492bb7SDavid van Moolenbroek } ACPI_EXTERNAL_FILE;
1247433d6423SLionel Sambuc 
1248433d6423SLionel Sambuc 
1249433d6423SLionel Sambuc /*****************************************************************************
1250433d6423SLionel Sambuc  *
1251433d6423SLionel Sambuc  * Debugger
1252433d6423SLionel Sambuc  *
1253433d6423SLionel Sambuc  ****************************************************************************/
1254433d6423SLionel Sambuc 
1255433d6423SLionel Sambuc typedef struct acpi_db_method_info
1256433d6423SLionel Sambuc {
1257*29492bb7SDavid van Moolenbroek     ACPI_HANDLE                     Method;
1258433d6423SLionel Sambuc     ACPI_HANDLE                     MainThreadGate;
1259433d6423SLionel Sambuc     ACPI_HANDLE                     ThreadCompleteGate;
1260433d6423SLionel Sambuc     ACPI_HANDLE                     InfoGate;
1261*29492bb7SDavid van Moolenbroek     ACPI_THREAD_ID                  *Threads;
1262433d6423SLionel Sambuc     UINT32                          NumThreads;
1263433d6423SLionel Sambuc     UINT32                          NumCreated;
1264433d6423SLionel Sambuc     UINT32                          NumCompleted;
1265433d6423SLionel Sambuc 
1266433d6423SLionel Sambuc     char                            *Name;
1267433d6423SLionel Sambuc     UINT32                          Flags;
1268433d6423SLionel Sambuc     UINT32                          NumLoops;
1269*29492bb7SDavid van Moolenbroek     char                            Pathname[ACPI_DB_LINE_BUFFER_SIZE];
1270433d6423SLionel Sambuc     char                            **Args;
1271*29492bb7SDavid van Moolenbroek     ACPI_OBJECT_TYPE                *Types;
1272433d6423SLionel Sambuc 
1273433d6423SLionel Sambuc     /*
1274433d6423SLionel Sambuc      * Arguments to be passed to method for the command
1275433d6423SLionel Sambuc      * Threads -
1276433d6423SLionel Sambuc      *   the Number of threads, ID of current thread and
1277433d6423SLionel Sambuc      *   Index of current thread inside all them created.
1278433d6423SLionel Sambuc      */
1279433d6423SLionel Sambuc     char                            InitArgs;
1280*29492bb7SDavid van Moolenbroek     ACPI_OBJECT_TYPE                ArgTypes[4];
1281433d6423SLionel Sambuc     char                            *Arguments[4];
1282433d6423SLionel Sambuc     char                            NumThreadsStr[11];
1283433d6423SLionel Sambuc     char                            IdOfThreadStr[11];
1284433d6423SLionel Sambuc     char                            IndexOfThreadStr[11];
1285433d6423SLionel Sambuc 
1286433d6423SLionel Sambuc } ACPI_DB_METHOD_INFO;
1287433d6423SLionel Sambuc 
1288433d6423SLionel Sambuc typedef struct acpi_integrity_info
1289433d6423SLionel Sambuc {
1290433d6423SLionel Sambuc     UINT32                          Nodes;
1291433d6423SLionel Sambuc     UINT32                          Objects;
1292433d6423SLionel Sambuc 
1293433d6423SLionel Sambuc } ACPI_INTEGRITY_INFO;
1294433d6423SLionel Sambuc 
1295433d6423SLionel Sambuc 
1296*29492bb7SDavid van Moolenbroek #define ACPI_DB_DISABLE_OUTPUT          0x00
1297433d6423SLionel Sambuc #define ACPI_DB_REDIRECTABLE_OUTPUT     0x01
1298433d6423SLionel Sambuc #define ACPI_DB_CONSOLE_OUTPUT          0x02
1299433d6423SLionel Sambuc #define ACPI_DB_DUPLICATE_OUTPUT        0x03
1300433d6423SLionel Sambuc 
1301433d6423SLionel Sambuc 
1302433d6423SLionel Sambuc /*****************************************************************************
1303433d6423SLionel Sambuc  *
1304433d6423SLionel Sambuc  * Debug
1305433d6423SLionel Sambuc  *
1306433d6423SLionel Sambuc  ****************************************************************************/
1307433d6423SLionel Sambuc 
1308433d6423SLionel Sambuc /* Entry for a memory allocation (debug only) */
1309433d6423SLionel Sambuc 
1310433d6423SLionel Sambuc #define ACPI_MEM_MALLOC                 0
1311433d6423SLionel Sambuc #define ACPI_MEM_CALLOC                 1
1312433d6423SLionel Sambuc #define ACPI_MAX_MODULE_NAME            16
1313433d6423SLionel Sambuc 
1314433d6423SLionel Sambuc #define ACPI_COMMON_DEBUG_MEM_HEADER \
1315433d6423SLionel Sambuc     struct acpi_debug_mem_block     *Previous; \
1316433d6423SLionel Sambuc     struct acpi_debug_mem_block     *Next; \
1317433d6423SLionel Sambuc     UINT32                          Size; \
1318433d6423SLionel Sambuc     UINT32                          Component; \
1319433d6423SLionel Sambuc     UINT32                          Line; \
1320433d6423SLionel Sambuc     char                            Module[ACPI_MAX_MODULE_NAME]; \
1321433d6423SLionel Sambuc     UINT8                           AllocType;
1322433d6423SLionel Sambuc 
1323433d6423SLionel Sambuc typedef struct acpi_debug_mem_header
1324433d6423SLionel Sambuc {
1325433d6423SLionel Sambuc     ACPI_COMMON_DEBUG_MEM_HEADER
1326433d6423SLionel Sambuc 
1327433d6423SLionel Sambuc } ACPI_DEBUG_MEM_HEADER;
1328433d6423SLionel Sambuc 
1329433d6423SLionel Sambuc typedef struct acpi_debug_mem_block
1330433d6423SLionel Sambuc {
1331433d6423SLionel Sambuc     ACPI_COMMON_DEBUG_MEM_HEADER
1332433d6423SLionel Sambuc     UINT64                          UserSpace;
1333433d6423SLionel Sambuc 
1334433d6423SLionel Sambuc } ACPI_DEBUG_MEM_BLOCK;
1335433d6423SLionel Sambuc 
1336433d6423SLionel Sambuc 
1337433d6423SLionel Sambuc #define ACPI_MEM_LIST_GLOBAL            0
1338433d6423SLionel Sambuc #define ACPI_MEM_LIST_NSNODE            1
1339433d6423SLionel Sambuc #define ACPI_MEM_LIST_MAX               1
1340433d6423SLionel Sambuc #define ACPI_NUM_MEM_LISTS              2
1341433d6423SLionel Sambuc 
1342433d6423SLionel Sambuc 
1343*29492bb7SDavid van Moolenbroek /*****************************************************************************
1344*29492bb7SDavid van Moolenbroek  *
1345*29492bb7SDavid van Moolenbroek  * Info/help support
1346*29492bb7SDavid van Moolenbroek  *
1347*29492bb7SDavid van Moolenbroek  ****************************************************************************/
1348*29492bb7SDavid van Moolenbroek 
1349*29492bb7SDavid van Moolenbroek typedef struct ah_predefined_name
1350*29492bb7SDavid van Moolenbroek {
1351*29492bb7SDavid van Moolenbroek     char            *Name;
1352*29492bb7SDavid van Moolenbroek     char            *Description;
1353*29492bb7SDavid van Moolenbroek #ifndef ACPI_ASL_COMPILER
1354*29492bb7SDavid van Moolenbroek     char            *Action;
1355*29492bb7SDavid van Moolenbroek #endif
1356*29492bb7SDavid van Moolenbroek 
1357*29492bb7SDavid van Moolenbroek } AH_PREDEFINED_NAME;
1358*29492bb7SDavid van Moolenbroek 
1359*29492bb7SDavid van Moolenbroek typedef struct ah_device_id
1360*29492bb7SDavid van Moolenbroek {
1361*29492bb7SDavid van Moolenbroek     char            *Name;
1362*29492bb7SDavid van Moolenbroek     char            *Description;
1363*29492bb7SDavid van Moolenbroek 
1364*29492bb7SDavid van Moolenbroek } AH_DEVICE_ID;
1365*29492bb7SDavid van Moolenbroek 
1366*29492bb7SDavid van Moolenbroek typedef struct ah_uuid
1367*29492bb7SDavid van Moolenbroek {
1368*29492bb7SDavid van Moolenbroek     char            *Description;
1369*29492bb7SDavid van Moolenbroek     char            *String;
1370*29492bb7SDavid van Moolenbroek 
1371*29492bb7SDavid van Moolenbroek } AH_UUID;
1372*29492bb7SDavid van Moolenbroek 
1373433d6423SLionel Sambuc #endif /* __ACLOCAL_H__ */
1374