xref: /linux/drivers/acpi/acpica/aclocal.h (revision 186c307f008d2a53961cd970aaf7cb9c33e79cb1)
1e2f7a777SLen Brown /******************************************************************************
2e2f7a777SLen Brown  *
3e2f7a777SLen Brown  * Name: aclocal.h - Internal data types used across the ACPI subsystem
4e2f7a777SLen Brown  *
5e2f7a777SLen Brown  *****************************************************************************/
6e2f7a777SLen Brown 
7e2f7a777SLen Brown /*
8a8357b0cSBob Moore  * Copyright (C) 2000 - 2010, Intel Corp.
9e2f7a777SLen Brown  * All rights reserved.
10e2f7a777SLen Brown  *
11e2f7a777SLen Brown  * Redistribution and use in source and binary forms, with or without
12e2f7a777SLen Brown  * modification, are permitted provided that the following conditions
13e2f7a777SLen Brown  * are met:
14e2f7a777SLen Brown  * 1. Redistributions of source code must retain the above copyright
15e2f7a777SLen Brown  *    notice, this list of conditions, and the following disclaimer,
16e2f7a777SLen Brown  *    without modification.
17e2f7a777SLen Brown  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18e2f7a777SLen Brown  *    substantially similar to the "NO WARRANTY" disclaimer below
19e2f7a777SLen Brown  *    ("Disclaimer") and any redistribution must be conditioned upon
20e2f7a777SLen Brown  *    including a substantially similar Disclaimer requirement for further
21e2f7a777SLen Brown  *    binary redistribution.
22e2f7a777SLen Brown  * 3. Neither the names of the above-listed copyright holders nor the names
23e2f7a777SLen Brown  *    of any contributors may be used to endorse or promote products derived
24e2f7a777SLen Brown  *    from this software without specific prior written permission.
25e2f7a777SLen Brown  *
26e2f7a777SLen Brown  * Alternatively, this software may be distributed under the terms of the
27e2f7a777SLen Brown  * GNU General Public License ("GPL") version 2 as published by the Free
28e2f7a777SLen Brown  * Software Foundation.
29e2f7a777SLen Brown  *
30e2f7a777SLen Brown  * NO WARRANTY
31e2f7a777SLen Brown  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32e2f7a777SLen Brown  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33e2f7a777SLen Brown  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34e2f7a777SLen Brown  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35e2f7a777SLen Brown  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36e2f7a777SLen Brown  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37e2f7a777SLen Brown  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38e2f7a777SLen Brown  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39e2f7a777SLen Brown  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40e2f7a777SLen Brown  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41e2f7a777SLen Brown  * POSSIBILITY OF SUCH DAMAGES.
42e2f7a777SLen Brown  */
43e2f7a777SLen Brown 
44e2f7a777SLen Brown #ifndef __ACLOCAL_H__
45e2f7a777SLen Brown #define __ACLOCAL_H__
46e2f7a777SLen Brown 
47e2f7a777SLen Brown /* acpisrc:struct_defs -- for acpisrc conversion */
48e2f7a777SLen Brown 
49e2f7a777SLen Brown #define ACPI_SERIALIZED                 0xFF
50e2f7a777SLen Brown 
51e2f7a777SLen Brown typedef u32 acpi_mutex_handle;
52e2f7a777SLen Brown #define ACPI_GLOBAL_LOCK                (acpi_semaphore) (-1)
53e2f7a777SLen Brown 
54e2f7a777SLen Brown /* Total number of aml opcodes defined */
55e2f7a777SLen Brown 
56e2f7a777SLen Brown #define AML_NUM_OPCODES                 0x7F
57e2f7a777SLen Brown 
58e2f7a777SLen Brown /* Forward declarations */
59e2f7a777SLen Brown 
60e2f7a777SLen Brown struct acpi_walk_state;
61e2f7a777SLen Brown struct acpi_obj_mutex;
62e2f7a777SLen Brown union acpi_parse_object;
63e2f7a777SLen Brown 
64e2f7a777SLen Brown /*****************************************************************************
65e2f7a777SLen Brown  *
66e2f7a777SLen Brown  * Mutex typedefs and structs
67e2f7a777SLen Brown  *
68e2f7a777SLen Brown  ****************************************************************************/
69e2f7a777SLen Brown 
70e2f7a777SLen Brown /*
71e2f7a777SLen Brown  * Predefined handles for the mutex objects used within the subsystem
72e2f7a777SLen Brown  * All mutex objects are automatically created by acpi_ut_mutex_initialize.
73e2f7a777SLen Brown  *
74e2f7a777SLen Brown  * The acquire/release ordering protocol is implied via this list. Mutexes
75e2f7a777SLen Brown  * with a lower value must be acquired before mutexes with a higher value.
76e2f7a777SLen Brown  *
77e2f7a777SLen Brown  * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names
78e2f7a777SLen Brown  * table below also!
79e2f7a777SLen Brown  */
80e2f7a777SLen Brown #define ACPI_MTX_INTERPRETER            0	/* AML Interpreter, main lock */
81e2f7a777SLen Brown #define ACPI_MTX_NAMESPACE              1	/* ACPI Namespace */
82e2f7a777SLen Brown #define ACPI_MTX_TABLES                 2	/* Data for ACPI tables */
83e2f7a777SLen Brown #define ACPI_MTX_EVENTS                 3	/* Data for ACPI events */
84e2f7a777SLen Brown #define ACPI_MTX_CACHES                 4	/* Internal caches, general purposes */
85e2f7a777SLen Brown #define ACPI_MTX_MEMORY                 5	/* Debug memory tracking lists */
86e2f7a777SLen Brown #define ACPI_MTX_DEBUG_CMD_COMPLETE     6	/* AML debugger */
87e2f7a777SLen Brown #define ACPI_MTX_DEBUG_CMD_READY        7	/* AML debugger */
88e2f7a777SLen Brown 
89e2f7a777SLen Brown #define ACPI_MAX_MUTEX                  7
90e2f7a777SLen Brown #define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
91e2f7a777SLen Brown 
92e2f7a777SLen Brown #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
93e2f7a777SLen Brown #ifdef DEFINE_ACPI_GLOBALS
94e2f7a777SLen Brown 
95e2f7a777SLen Brown /* Debug names for the mutexes above */
96e2f7a777SLen Brown 
97e2f7a777SLen Brown static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
98e2f7a777SLen Brown 	"ACPI_MTX_Interpreter",
99e2f7a777SLen Brown 	"ACPI_MTX_Namespace",
100e2f7a777SLen Brown 	"ACPI_MTX_Tables",
101e2f7a777SLen Brown 	"ACPI_MTX_Events",
102e2f7a777SLen Brown 	"ACPI_MTX_Caches",
103e2f7a777SLen Brown 	"ACPI_MTX_Memory",
104e2f7a777SLen Brown 	"ACPI_MTX_CommandComplete",
105e2f7a777SLen Brown 	"ACPI_MTX_CommandReady"
106e2f7a777SLen Brown };
107e2f7a777SLen Brown 
108e2f7a777SLen Brown #endif
109e2f7a777SLen Brown #endif
110e2f7a777SLen Brown 
1118a335a23SBob Moore /* Lock structure for reader/writer interfaces */
1128a335a23SBob Moore 
1138a335a23SBob Moore struct acpi_rw_lock {
1148a335a23SBob Moore 	acpi_mutex writer_mutex;
1158a335a23SBob Moore 	acpi_mutex reader_mutex;
1168a335a23SBob Moore 	u32 num_readers;
1178a335a23SBob Moore };
1188a335a23SBob Moore 
119e2f7a777SLen Brown /*
120e2f7a777SLen Brown  * Predefined handles for spinlocks used within the subsystem.
121e2f7a777SLen Brown  * These spinlocks are created by acpi_ut_mutex_initialize
122e2f7a777SLen Brown  */
123e2f7a777SLen Brown #define ACPI_LOCK_GPES                  0
124e2f7a777SLen Brown #define ACPI_LOCK_HARDWARE              1
125e2f7a777SLen Brown 
126e2f7a777SLen Brown #define ACPI_MAX_LOCK                   1
127e2f7a777SLen Brown #define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
128e2f7a777SLen Brown 
129e2f7a777SLen Brown /* This Thread ID means that the mutex is not in use (unlocked) */
130e2f7a777SLen Brown 
131e2f7a777SLen Brown #define ACPI_MUTEX_NOT_ACQUIRED         (acpi_thread_id) 0
132e2f7a777SLen Brown 
133e2f7a777SLen Brown /* Table for the global mutexes */
134e2f7a777SLen Brown 
135e2f7a777SLen Brown struct acpi_mutex_info {
136e2f7a777SLen Brown 	acpi_mutex mutex;
137e2f7a777SLen Brown 	u32 use_count;
138e2f7a777SLen Brown 	acpi_thread_id thread_id;
139e2f7a777SLen Brown };
140e2f7a777SLen Brown 
141e2f7a777SLen Brown /* Lock flag parameter for various interfaces */
142e2f7a777SLen Brown 
143e2f7a777SLen Brown #define ACPI_MTX_DO_NOT_LOCK            0
144e2f7a777SLen Brown #define ACPI_MTX_LOCK                   1
145e2f7a777SLen Brown 
146e2f7a777SLen Brown /* Field access granularities */
147e2f7a777SLen Brown 
148e2f7a777SLen Brown #define ACPI_FIELD_BYTE_GRANULARITY     1
149e2f7a777SLen Brown #define ACPI_FIELD_WORD_GRANULARITY     2
150e2f7a777SLen Brown #define ACPI_FIELD_DWORD_GRANULARITY    4
151e2f7a777SLen Brown #define ACPI_FIELD_QWORD_GRANULARITY    8
152e2f7a777SLen Brown 
153e2f7a777SLen Brown #define ACPI_ENTRY_NOT_FOUND            NULL
154e2f7a777SLen Brown 
155e2f7a777SLen Brown /*****************************************************************************
156e2f7a777SLen Brown  *
157e2f7a777SLen Brown  * Namespace typedefs and structs
158e2f7a777SLen Brown  *
159e2f7a777SLen Brown  ****************************************************************************/
160e2f7a777SLen Brown 
161e2f7a777SLen Brown /* Operational modes of the AML interpreter/scanner */
162e2f7a777SLen Brown 
163e2f7a777SLen Brown typedef enum {
164e2f7a777SLen Brown 	ACPI_IMODE_LOAD_PASS1 = 0x01,
165e2f7a777SLen Brown 	ACPI_IMODE_LOAD_PASS2 = 0x02,
166e2f7a777SLen Brown 	ACPI_IMODE_EXECUTE = 0x03
167e2f7a777SLen Brown } acpi_interpreter_mode;
168e2f7a777SLen Brown 
169e2f7a777SLen Brown /*
170e2f7a777SLen Brown  * The Namespace Node describes a named object that appears in the AML.
171e2f7a777SLen Brown  * descriptor_type is used to differentiate between internal descriptors.
172e2f7a777SLen Brown  *
173e2f7a777SLen Brown  * The node is optimized for both 32-bit and 64-bit platforms:
174e2f7a777SLen Brown  * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
175e2f7a777SLen Brown  *
176e2f7a777SLen Brown  * Note: The descriptor_type and Type fields must appear in the identical
177e2f7a777SLen Brown  * position in both the struct acpi_namespace_node and union acpi_operand_object
178e2f7a777SLen Brown  * structures.
179e2f7a777SLen Brown  */
180e2f7a777SLen Brown struct acpi_namespace_node {
181e2f7a777SLen Brown 	union acpi_operand_object *object;	/* Interpreter object */
182e2f7a777SLen Brown 	u8 descriptor_type;	/* Differentiate object descriptor types */
183e2f7a777SLen Brown 	u8 type;		/* ACPI Type associated with this name */
184e2f7a777SLen Brown 	u8 flags;		/* Miscellaneous flags */
185e2f7a777SLen Brown 	acpi_owner_id owner_id;	/* Node creator */
186e2f7a777SLen Brown 	union acpi_name_union name;	/* ACPI Name, always 4 chars per ACPI spec */
187e2f7a777SLen Brown 	struct acpi_namespace_node *child;	/* First child */
188e2f7a777SLen Brown 	struct acpi_namespace_node *peer;	/* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
189e2f7a777SLen Brown 
190e2f7a777SLen Brown 	/*
191e2f7a777SLen Brown 	 * The following fields are used by the ASL compiler and disassembler only
192e2f7a777SLen Brown 	 */
193e2f7a777SLen Brown #ifdef ACPI_LARGE_NAMESPACE_NODE
194e2f7a777SLen Brown 	union acpi_parse_object *op;
195e2f7a777SLen Brown 	u32 value;
196e2f7a777SLen Brown 	u32 length;
197e2f7a777SLen Brown #endif
198e2f7a777SLen Brown };
199e2f7a777SLen Brown 
200e2f7a777SLen Brown /* Namespace Node flags */
201e2f7a777SLen Brown 
202e2f7a777SLen Brown #define ANOBJ_END_OF_PEER_LIST          0x01	/* End-of-list, Peer field points to parent */
203e2f7a777SLen Brown #define ANOBJ_TEMPORARY                 0x02	/* Node is create by a method and is temporary */
204e2f7a777SLen Brown #define ANOBJ_METHOD_ARG                0x04	/* Node is a method argument */
205e2f7a777SLen Brown #define ANOBJ_METHOD_LOCAL              0x08	/* Node is a method local */
206e2f7a777SLen Brown #define ANOBJ_SUBTREE_HAS_INI           0x10	/* Used to optimize device initialization */
207e2f7a777SLen Brown #define ANOBJ_EVALUATED                 0x20	/* Set on first evaluation of node */
208b2f7ddcfSLin Ming #define ANOBJ_ALLOCATED_BUFFER          0x40	/* Method AML buffer is dynamic (install_method) */
209e2f7a777SLen Brown 
210e2f7a777SLen Brown #define ANOBJ_IS_EXTERNAL               0x08	/* i_aSL only: This object created via External() */
211e2f7a777SLen Brown #define ANOBJ_METHOD_NO_RETVAL          0x10	/* i_aSL only: Method has no return value */
212e2f7a777SLen Brown #define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* i_aSL only: Method has at least one return value */
213e2f7a777SLen Brown #define ANOBJ_IS_BIT_OFFSET             0x40	/* i_aSL only: Reference is a bit offset */
214e2f7a777SLen Brown #define ANOBJ_IS_REFERENCED             0x80	/* i_aSL only: Object was referenced */
215e2f7a777SLen Brown 
216b9ee2043SBob Moore /* Internal ACPI table management - master table list */
217e2f7a777SLen Brown 
218b9ee2043SBob Moore struct acpi_table_list {
219b9ee2043SBob Moore 	struct acpi_table_desc *tables;	/* Table descriptor array */
220b9ee2043SBob Moore 	u32 current_table_count;	/* Tables currently in the array */
221b9ee2043SBob Moore 	u32 max_table_count;	/* Max tables array will hold */
222e2f7a777SLen Brown 	u8 flags;
223e2f7a777SLen Brown };
224e2f7a777SLen Brown 
225e2f7a777SLen Brown /* Flags for above */
226e2f7a777SLen Brown 
227e2f7a777SLen Brown #define ACPI_ROOT_ORIGIN_UNKNOWN        (0)	/* ~ORIGIN_ALLOCATED */
228e2f7a777SLen Brown #define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
229e2f7a777SLen Brown #define ACPI_ROOT_ALLOW_RESIZE          (2)
230e2f7a777SLen Brown 
231e2f7a777SLen Brown /* Predefined (fixed) table indexes */
232e2f7a777SLen Brown 
233e2f7a777SLen Brown #define ACPI_TABLE_INDEX_DSDT           (0)
234e2f7a777SLen Brown #define ACPI_TABLE_INDEX_FACS           (1)
235e2f7a777SLen Brown 
236e2f7a777SLen Brown struct acpi_find_context {
237e2f7a777SLen Brown 	char *search_for;
238e2f7a777SLen Brown 	acpi_handle *list;
239e2f7a777SLen Brown 	u32 *count;
240e2f7a777SLen Brown };
241e2f7a777SLen Brown 
242e2f7a777SLen Brown struct acpi_ns_search_data {
243e2f7a777SLen Brown 	struct acpi_namespace_node *node;
244e2f7a777SLen Brown };
245e2f7a777SLen Brown 
246e2f7a777SLen Brown /* Object types used during package copies */
247e2f7a777SLen Brown 
248e2f7a777SLen Brown #define ACPI_COPY_TYPE_SIMPLE           0
249e2f7a777SLen Brown #define ACPI_COPY_TYPE_PACKAGE          1
250e2f7a777SLen Brown 
251e2f7a777SLen Brown /* Info structure used to convert external<->internal namestrings */
252e2f7a777SLen Brown 
253e2f7a777SLen Brown struct acpi_namestring_info {
254e2f7a777SLen Brown 	const char *external_name;
255e2f7a777SLen Brown 	const char *next_external_char;
256e2f7a777SLen Brown 	char *internal_name;
257e2f7a777SLen Brown 	u32 length;
258e2f7a777SLen Brown 	u32 num_segments;
259e2f7a777SLen Brown 	u32 num_carats;
260e2f7a777SLen Brown 	u8 fully_qualified;
261e2f7a777SLen Brown };
262e2f7a777SLen Brown 
263e2f7a777SLen Brown /* Field creation info */
264e2f7a777SLen Brown 
265e2f7a777SLen Brown struct acpi_create_field_info {
266e2f7a777SLen Brown 	struct acpi_namespace_node *region_node;
267e2f7a777SLen Brown 	struct acpi_namespace_node *field_node;
268e2f7a777SLen Brown 	struct acpi_namespace_node *register_node;
269e2f7a777SLen Brown 	struct acpi_namespace_node *data_register_node;
270e2f7a777SLen Brown 	u32 bank_value;
271e2f7a777SLen Brown 	u32 field_bit_position;
272e2f7a777SLen Brown 	u32 field_bit_length;
273e2f7a777SLen Brown 	u8 field_flags;
274e2f7a777SLen Brown 	u8 attribute;
275e2f7a777SLen Brown 	u8 field_type;
276e2f7a777SLen Brown };
277e2f7a777SLen Brown 
278e2f7a777SLen Brown typedef
279e2f7a777SLen Brown acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
280e2f7a777SLen Brown 
281e2f7a777SLen Brown /*
282e2f7a777SLen Brown  * Bitmapped ACPI types.  Used internally only
283e2f7a777SLen Brown  */
284e2f7a777SLen Brown #define ACPI_BTYPE_ANY                  0x00000000
285e2f7a777SLen Brown #define ACPI_BTYPE_INTEGER              0x00000001
286e2f7a777SLen Brown #define ACPI_BTYPE_STRING               0x00000002
287e2f7a777SLen Brown #define ACPI_BTYPE_BUFFER               0x00000004
288e2f7a777SLen Brown #define ACPI_BTYPE_PACKAGE              0x00000008
289e2f7a777SLen Brown #define ACPI_BTYPE_FIELD_UNIT           0x00000010
290e2f7a777SLen Brown #define ACPI_BTYPE_DEVICE               0x00000020
291e2f7a777SLen Brown #define ACPI_BTYPE_EVENT                0x00000040
292e2f7a777SLen Brown #define ACPI_BTYPE_METHOD               0x00000080
293e2f7a777SLen Brown #define ACPI_BTYPE_MUTEX                0x00000100
294e2f7a777SLen Brown #define ACPI_BTYPE_REGION               0x00000200
295e2f7a777SLen Brown #define ACPI_BTYPE_POWER                0x00000400
296e2f7a777SLen Brown #define ACPI_BTYPE_PROCESSOR            0x00000800
297e2f7a777SLen Brown #define ACPI_BTYPE_THERMAL              0x00001000
298e2f7a777SLen Brown #define ACPI_BTYPE_BUFFER_FIELD         0x00002000
299e2f7a777SLen Brown #define ACPI_BTYPE_DDB_HANDLE           0x00004000
300e2f7a777SLen Brown #define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
301e2f7a777SLen Brown #define ACPI_BTYPE_REFERENCE            0x00010000
302e2f7a777SLen Brown #define ACPI_BTYPE_RESOURCE             0x00020000
303e2f7a777SLen Brown 
304e2f7a777SLen Brown #define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
305e2f7a777SLen Brown 
306e2f7a777SLen Brown #define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
307e2f7a777SLen Brown #define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
308e2f7a777SLen Brown #define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
309e2f7a777SLen Brown #define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF	/* ARG or LOCAL */
310e2f7a777SLen Brown #define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
311e2f7a777SLen Brown 
312e2f7a777SLen Brown /*
313e2f7a777SLen Brown  * Information structure for ACPI predefined names.
314e2f7a777SLen Brown  * Each entry in the table contains the following items:
315e2f7a777SLen Brown  *
316e2f7a777SLen Brown  * Name                 - The ACPI reserved name
317e2f7a777SLen Brown  * param_count          - Number of arguments to the method
318e2f7a777SLen Brown  * expected_return_btypes - Allowed type(s) for the return value
319e2f7a777SLen Brown  */
320e2f7a777SLen Brown struct acpi_name_info {
321e2f7a777SLen Brown 	char name[ACPI_NAME_SIZE];
322e2f7a777SLen Brown 	u8 param_count;
323e2f7a777SLen Brown 	u8 expected_btypes;
324e2f7a777SLen Brown };
325e2f7a777SLen Brown 
326e2f7a777SLen Brown /*
327e2f7a777SLen Brown  * Secondary information structures for ACPI predefined objects that return
328e2f7a777SLen Brown  * package objects. This structure appears as the next entry in the table
329e2f7a777SLen Brown  * after the NAME_INFO structure above.
330e2f7a777SLen Brown  *
331e2f7a777SLen Brown  * The reason for this is to minimize the size of the predefined name table.
332e2f7a777SLen Brown  */
333e2f7a777SLen Brown 
334e2f7a777SLen Brown /*
335e2f7a777SLen Brown  * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
336e2f7a777SLen Brown  * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
337e2f7a777SLen Brown  */
338e2f7a777SLen Brown struct acpi_package_info {
339e2f7a777SLen Brown 	u8 type;
340e2f7a777SLen Brown 	u8 object_type1;
341e2f7a777SLen Brown 	u8 count1;
342e2f7a777SLen Brown 	u8 object_type2;
343e2f7a777SLen Brown 	u8 count2;
344e2f7a777SLen Brown 	u8 reserved;
345e2f7a777SLen Brown };
346e2f7a777SLen Brown 
347e2f7a777SLen Brown /* Used for ACPI_PTYPE2_FIXED */
348e2f7a777SLen Brown 
349e2f7a777SLen Brown struct acpi_package_info2 {
350e2f7a777SLen Brown 	u8 type;
351e2f7a777SLen Brown 	u8 count;
352e2f7a777SLen Brown 	u8 object_type[4];
353e2f7a777SLen Brown };
354e2f7a777SLen Brown 
355e2f7a777SLen Brown /* Used for ACPI_PTYPE1_OPTION */
356e2f7a777SLen Brown 
357e2f7a777SLen Brown struct acpi_package_info3 {
358e2f7a777SLen Brown 	u8 type;
359e2f7a777SLen Brown 	u8 count;
360e2f7a777SLen Brown 	u8 object_type[2];
361e2f7a777SLen Brown 	u8 tail_object_type;
362e2f7a777SLen Brown 	u8 reserved;
363e2f7a777SLen Brown };
364e2f7a777SLen Brown 
365e2f7a777SLen Brown union acpi_predefined_info {
366e2f7a777SLen Brown 	struct acpi_name_info info;
367e2f7a777SLen Brown 	struct acpi_package_info ret_info;
368e2f7a777SLen Brown 	struct acpi_package_info2 ret_info2;
369e2f7a777SLen Brown 	struct acpi_package_info3 ret_info3;
370e2f7a777SLen Brown };
371e2f7a777SLen Brown 
3720444e8f6SBob Moore /* Data block used during object validation */
3730444e8f6SBob Moore 
3740444e8f6SBob Moore struct acpi_predefined_data {
3750444e8f6SBob Moore 	char *pathname;
3760444e8f6SBob Moore 	const union acpi_predefined_info *predefined;
377091f4d71SBob Moore 	union acpi_operand_object *parent_package;
3780444e8f6SBob Moore 	u32 flags;
3790444e8f6SBob Moore 	u8 node_flags;
3800444e8f6SBob Moore };
3810444e8f6SBob Moore 
3820444e8f6SBob Moore /* Defines for Flags field above */
3830444e8f6SBob Moore 
3840444e8f6SBob Moore #define ACPI_OBJECT_REPAIRED    1
3850444e8f6SBob Moore 
386e2f7a777SLen Brown /*
387e2f7a777SLen Brown  * Bitmapped return value types
388e2f7a777SLen Brown  * Note: the actual data types must be contiguous, a loop in nspredef.c
389e2f7a777SLen Brown  * depends on this.
390e2f7a777SLen Brown  */
391e2f7a777SLen Brown #define ACPI_RTYPE_ANY                  0x00
392e2f7a777SLen Brown #define ACPI_RTYPE_NONE                 0x01
393e2f7a777SLen Brown #define ACPI_RTYPE_INTEGER              0x02
394e2f7a777SLen Brown #define ACPI_RTYPE_STRING               0x04
395e2f7a777SLen Brown #define ACPI_RTYPE_BUFFER               0x08
396e2f7a777SLen Brown #define ACPI_RTYPE_PACKAGE              0x10
397e2f7a777SLen Brown #define ACPI_RTYPE_REFERENCE            0x20
398e2f7a777SLen Brown #define ACPI_RTYPE_ALL                  0x3F
399e2f7a777SLen Brown 
400e2f7a777SLen Brown #define ACPI_NUM_RTYPES                 5	/* Number of actual object types */
401e2f7a777SLen Brown 
402e2f7a777SLen Brown /*****************************************************************************
403e2f7a777SLen Brown  *
404e2f7a777SLen Brown  * Event typedefs and structs
405e2f7a777SLen Brown  *
406e2f7a777SLen Brown  ****************************************************************************/
407e2f7a777SLen Brown 
408e2f7a777SLen Brown /* Dispatch info for each GPE -- either a method or handler, cannot be both */
409e2f7a777SLen Brown 
410e2f7a777SLen Brown struct acpi_handler_info {
411e2f7a777SLen Brown 	acpi_event_handler address;	/* Address of handler, if any */
412e2f7a777SLen Brown 	void *context;		/* Context to be passed to handler */
413e2f7a777SLen Brown 	struct acpi_namespace_node *method_node;	/* Method node for this GPE level (saved) */
414e2f7a777SLen Brown };
415e2f7a777SLen Brown 
416e2f7a777SLen Brown union acpi_gpe_dispatch_info {
417e2f7a777SLen Brown 	struct acpi_namespace_node *method_node;	/* Method node for this GPE level */
418e2f7a777SLen Brown 	struct acpi_handler_info *handler;
419e2f7a777SLen Brown };
420e2f7a777SLen Brown 
421e2f7a777SLen Brown /*
422e2f7a777SLen Brown  * Information about a GPE, one per each GPE in an array.
423e2f7a777SLen Brown  * NOTE: Important to keep this struct as small as possible.
424e2f7a777SLen Brown  */
425e2f7a777SLen Brown struct acpi_gpe_event_info {
426e2f7a777SLen Brown 	union acpi_gpe_dispatch_info dispatch;	/* Either Method or Handler */
427e2f7a777SLen Brown 	struct acpi_gpe_register_info *register_info;	/* Backpointer to register info */
428e2f7a777SLen Brown 	u8 flags;		/* Misc info about this GPE */
429e2f7a777SLen Brown 	u8 gpe_number;		/* This GPE */
4300f849d2cSLin Ming 	u8 runtime_count;	/* References to a run GPE */
4310f849d2cSLin Ming 	u8 wakeup_count;	/* References to a wake GPE */
432e2f7a777SLen Brown };
433e2f7a777SLen Brown 
434e2f7a777SLen Brown /* Information about a GPE register pair, one per each status/enable pair in an array */
435e2f7a777SLen Brown 
436e2f7a777SLen Brown struct acpi_gpe_register_info {
437e2f7a777SLen Brown 	struct acpi_generic_address status_address;	/* Address of status reg */
438e2f7a777SLen Brown 	struct acpi_generic_address enable_address;	/* Address of enable reg */
439e2f7a777SLen Brown 	u8 enable_for_wake;	/* GPEs to keep enabled when sleeping */
440e2f7a777SLen Brown 	u8 enable_for_run;	/* GPEs to keep enabled when running */
441e2f7a777SLen Brown 	u8 base_gpe_number;	/* Base GPE number for this register */
442e2f7a777SLen Brown };
443e2f7a777SLen Brown 
444e2f7a777SLen Brown /*
445e2f7a777SLen Brown  * Information about a GPE register block, one per each installed block --
446e2f7a777SLen Brown  * GPE0, GPE1, and one per each installed GPE Block Device.
447e2f7a777SLen Brown  */
448e2f7a777SLen Brown struct acpi_gpe_block_info {
449e2f7a777SLen Brown 	struct acpi_namespace_node *node;
450e2f7a777SLen Brown 	struct acpi_gpe_block_info *previous;
451e2f7a777SLen Brown 	struct acpi_gpe_block_info *next;
452e2f7a777SLen Brown 	struct acpi_gpe_xrupt_info *xrupt_block;	/* Backpointer to interrupt block */
453e2f7a777SLen Brown 	struct acpi_gpe_register_info *register_info;	/* One per GPE register pair */
454e2f7a777SLen Brown 	struct acpi_gpe_event_info *event_info;	/* One for each GPE */
455e2f7a777SLen Brown 	struct acpi_generic_address block_address;	/* Base address of the block */
456e2f7a777SLen Brown 	u32 register_count;	/* Number of register pairs in block */
4570f849d2cSLin Ming 	u16 gpe_count;		/* Number of individual GPEs in block */
458e2f7a777SLen Brown 	u8 block_base_number;	/* Base GPE number for this block */
459e2f7a777SLen Brown };
460e2f7a777SLen Brown 
461e2f7a777SLen Brown /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
462e2f7a777SLen Brown 
463e2f7a777SLen Brown struct acpi_gpe_xrupt_info {
464e2f7a777SLen Brown 	struct acpi_gpe_xrupt_info *previous;
465e2f7a777SLen Brown 	struct acpi_gpe_xrupt_info *next;
466e2f7a777SLen Brown 	struct acpi_gpe_block_info *gpe_block_list_head;	/* List of GPE blocks for this xrupt */
467e2f7a777SLen Brown 	u32 interrupt_number;	/* System interrupt number */
468e2f7a777SLen Brown };
469e2f7a777SLen Brown 
470e2f7a777SLen Brown struct acpi_gpe_walk_info {
471e2f7a777SLen Brown 	struct acpi_namespace_node *gpe_device;
472e2f7a777SLen Brown 	struct acpi_gpe_block_info *gpe_block;
473*186c307fSBob Moore 	u16 count;
474*186c307fSBob Moore 	acpi_owner_id owner_id;
475*186c307fSBob Moore 	u8 enable_this_gpe;
476*186c307fSBob Moore 	u8 execute_by_owner_id;
477e2f7a777SLen Brown };
478e2f7a777SLen Brown 
479e2f7a777SLen Brown struct acpi_gpe_device_info {
480e2f7a777SLen Brown 	u32 index;
481e2f7a777SLen Brown 	u32 next_block_base_index;
482e2f7a777SLen Brown 	acpi_status status;
483e2f7a777SLen Brown 	struct acpi_namespace_node *gpe_device;
484e2f7a777SLen Brown };
485e2f7a777SLen Brown 
486e2f7a777SLen Brown typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *gpe_xrupt_info,
487e2f7a777SLen Brown 		struct acpi_gpe_block_info *gpe_block, void *context);
488e2f7a777SLen Brown 
489e2f7a777SLen Brown /* Information about each particular fixed event */
490e2f7a777SLen Brown 
491e2f7a777SLen Brown struct acpi_fixed_event_handler {
492e2f7a777SLen Brown 	acpi_event_handler handler;	/* Address of handler. */
493e2f7a777SLen Brown 	void *context;		/* Context to be passed to handler */
494e2f7a777SLen Brown };
495e2f7a777SLen Brown 
496e2f7a777SLen Brown struct acpi_fixed_event_info {
497e2f7a777SLen Brown 	u8 status_register_id;
498e2f7a777SLen Brown 	u8 enable_register_id;
499e2f7a777SLen Brown 	u16 status_bit_mask;
500e2f7a777SLen Brown 	u16 enable_bit_mask;
501e2f7a777SLen Brown };
502e2f7a777SLen Brown 
503e2f7a777SLen Brown /* Information used during field processing */
504e2f7a777SLen Brown 
505e2f7a777SLen Brown struct acpi_field_info {
506e2f7a777SLen Brown 	u8 skip_field;
507e2f7a777SLen Brown 	u8 field_flag;
508e2f7a777SLen Brown 	u32 pkg_length;
509e2f7a777SLen Brown };
510e2f7a777SLen Brown 
511e2f7a777SLen Brown /*****************************************************************************
512e2f7a777SLen Brown  *
513e2f7a777SLen Brown  * Generic "state" object for stacks
514e2f7a777SLen Brown  *
515e2f7a777SLen Brown  ****************************************************************************/
516e2f7a777SLen Brown 
517e2f7a777SLen Brown #define ACPI_CONTROL_NORMAL                  0xC0
518e2f7a777SLen Brown #define ACPI_CONTROL_CONDITIONAL_EXECUTING   0xC1
519e2f7a777SLen Brown #define ACPI_CONTROL_PREDICATE_EXECUTING     0xC2
520e2f7a777SLen Brown #define ACPI_CONTROL_PREDICATE_FALSE         0xC3
521e2f7a777SLen Brown #define ACPI_CONTROL_PREDICATE_TRUE          0xC4
522e2f7a777SLen Brown 
523e2f7a777SLen Brown #define ACPI_STATE_COMMON \
524e2f7a777SLen Brown 	void                            *next; \
525e2f7a777SLen Brown 	u8                              descriptor_type; /* To differentiate various internal objs */\
526e2f7a777SLen Brown 	u8                              flags; \
527e2f7a777SLen Brown 	u16                             value; \
528e2f7a777SLen Brown 	u16                             state;
529e2f7a777SLen Brown 
530e2f7a777SLen Brown 	/* There are 2 bytes available here until the next natural alignment boundary */
531e2f7a777SLen Brown 
532e2f7a777SLen Brown struct acpi_common_state {
533e2f7a777SLen Brown ACPI_STATE_COMMON};
534e2f7a777SLen Brown 
535e2f7a777SLen Brown /*
536e2f7a777SLen Brown  * Update state - used to traverse complex objects such as packages
537e2f7a777SLen Brown  */
538e2f7a777SLen Brown struct acpi_update_state {
539e2f7a777SLen Brown 	ACPI_STATE_COMMON union acpi_operand_object *object;
540e2f7a777SLen Brown };
541e2f7a777SLen Brown 
542e2f7a777SLen Brown /*
543e2f7a777SLen Brown  * Pkg state - used to traverse nested package structures
544e2f7a777SLen Brown  */
545e2f7a777SLen Brown struct acpi_pkg_state {
546e2f7a777SLen Brown 	ACPI_STATE_COMMON u16 index;
547e2f7a777SLen Brown 	union acpi_operand_object *source_object;
548e2f7a777SLen Brown 	union acpi_operand_object *dest_object;
549e2f7a777SLen Brown 	struct acpi_walk_state *walk_state;
550e2f7a777SLen Brown 	void *this_target_obj;
551e2f7a777SLen Brown 	u32 num_packages;
552e2f7a777SLen Brown };
553e2f7a777SLen Brown 
554e2f7a777SLen Brown /*
555e2f7a777SLen Brown  * Control state - one per if/else and while constructs.
556e2f7a777SLen Brown  * Allows nesting of these constructs
557e2f7a777SLen Brown  */
558e2f7a777SLen Brown struct acpi_control_state {
559e2f7a777SLen Brown 	ACPI_STATE_COMMON u16 opcode;
560e2f7a777SLen Brown 	union acpi_parse_object *predicate_op;
561e2f7a777SLen Brown 	u8 *aml_predicate_start;	/* Start of if/while predicate */
562e2f7a777SLen Brown 	u8 *package_end;	/* End of if/while block */
563e2f7a777SLen Brown 	u32 loop_count;		/* While() loop counter */
564e2f7a777SLen Brown };
565e2f7a777SLen Brown 
566e2f7a777SLen Brown /*
567e2f7a777SLen Brown  * Scope state - current scope during namespace lookups
568e2f7a777SLen Brown  */
569e2f7a777SLen Brown struct acpi_scope_state {
570e2f7a777SLen Brown 	ACPI_STATE_COMMON struct acpi_namespace_node *node;
571e2f7a777SLen Brown };
572e2f7a777SLen Brown 
573e2f7a777SLen Brown struct acpi_pscope_state {
574e2f7a777SLen Brown 	ACPI_STATE_COMMON u32 arg_count;	/* Number of fixed arguments */
575e2f7a777SLen Brown 	union acpi_parse_object *op;	/* Current op being parsed */
576e2f7a777SLen Brown 	u8 *arg_end;		/* Current argument end */
577e2f7a777SLen Brown 	u8 *pkg_end;		/* Current package end */
578e2f7a777SLen Brown 	u32 arg_list;		/* Next argument to parse */
579e2f7a777SLen Brown };
580e2f7a777SLen Brown 
581e2f7a777SLen Brown /*
582e2f7a777SLen Brown  * Thread state - one per thread across multiple walk states.  Multiple walk
583e2f7a777SLen Brown  * states are created when there are nested control methods executing.
584e2f7a777SLen Brown  */
585e2f7a777SLen Brown struct acpi_thread_state {
586e2f7a777SLen Brown 	ACPI_STATE_COMMON u8 current_sync_level;	/* Mutex Sync (nested acquire) level */
587e2f7a777SLen Brown 	struct acpi_walk_state *walk_state_list;	/* Head of list of walk_states for this thread */
588e2f7a777SLen Brown 	union acpi_operand_object *acquired_mutex_list;	/* List of all currently acquired mutexes */
589e2f7a777SLen Brown 	acpi_thread_id thread_id;	/* Running thread ID */
590e2f7a777SLen Brown };
591e2f7a777SLen Brown 
592e2f7a777SLen Brown /*
593e2f7a777SLen Brown  * Result values - used to accumulate the results of nested
594e2f7a777SLen Brown  * AML arguments
595e2f7a777SLen Brown  */
596e2f7a777SLen Brown struct acpi_result_values {
597e2f7a777SLen Brown 	ACPI_STATE_COMMON
598e2f7a777SLen Brown 	    union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
599e2f7a777SLen Brown };
600e2f7a777SLen Brown 
601e2f7a777SLen Brown typedef
602e2f7a777SLen Brown acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
603e2f7a777SLen Brown 				    union acpi_parse_object ** out_op);
604e2f7a777SLen Brown 
605e2f7a777SLen Brown typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
606e2f7a777SLen Brown 
607e2f7a777SLen Brown /*
608e2f7a777SLen Brown  * Notify info - used to pass info to the deferred notify
609e2f7a777SLen Brown  * handler/dispatcher.
610e2f7a777SLen Brown  */
611e2f7a777SLen Brown struct acpi_notify_info {
612e2f7a777SLen Brown 	ACPI_STATE_COMMON struct acpi_namespace_node *node;
613e2f7a777SLen Brown 	union acpi_operand_object *handler_obj;
614e2f7a777SLen Brown };
615e2f7a777SLen Brown 
616e2f7a777SLen Brown /* Generic state is union of structs above */
617e2f7a777SLen Brown 
618e2f7a777SLen Brown union acpi_generic_state {
619e2f7a777SLen Brown 	struct acpi_common_state common;
620e2f7a777SLen Brown 	struct acpi_control_state control;
621e2f7a777SLen Brown 	struct acpi_update_state update;
622e2f7a777SLen Brown 	struct acpi_scope_state scope;
623e2f7a777SLen Brown 	struct acpi_pscope_state parse_scope;
624e2f7a777SLen Brown 	struct acpi_pkg_state pkg;
625e2f7a777SLen Brown 	struct acpi_thread_state thread;
626e2f7a777SLen Brown 	struct acpi_result_values results;
627e2f7a777SLen Brown 	struct acpi_notify_info notify;
628e2f7a777SLen Brown };
629e2f7a777SLen Brown 
630e2f7a777SLen Brown /*****************************************************************************
631e2f7a777SLen Brown  *
632e2f7a777SLen Brown  * Interpreter typedefs and structs
633e2f7a777SLen Brown  *
634e2f7a777SLen Brown  ****************************************************************************/
635e2f7a777SLen Brown 
636e2f7a777SLen Brown typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state);
637e2f7a777SLen Brown 
638e2f7a777SLen Brown /*****************************************************************************
639e2f7a777SLen Brown  *
640e2f7a777SLen Brown  * Parser typedefs and structs
641e2f7a777SLen Brown  *
642e2f7a777SLen Brown  ****************************************************************************/
643e2f7a777SLen Brown 
644e2f7a777SLen Brown /*
645e2f7a777SLen Brown  * AML opcode, name, and argument layout
646e2f7a777SLen Brown  */
647e2f7a777SLen Brown struct acpi_opcode_info {
648e2f7a777SLen Brown #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
649e2f7a777SLen Brown 	char *name;		/* Opcode name (disassembler/debug only) */
650e2f7a777SLen Brown #endif
651e2f7a777SLen Brown 	u32 parse_args;		/* Grammar/Parse time arguments */
652e2f7a777SLen Brown 	u32 runtime_args;	/* Interpret time arguments */
653e2f7a777SLen Brown 	u16 flags;		/* Misc flags */
654e2f7a777SLen Brown 	u8 object_type;		/* Corresponding internal object type */
655e2f7a777SLen Brown 	u8 class;		/* Opcode class */
656e2f7a777SLen Brown 	u8 type;		/* Opcode type */
657e2f7a777SLen Brown };
658e2f7a777SLen Brown 
659e2f7a777SLen Brown union acpi_parse_value {
6605df7e6cbSBob Moore 	u64 integer;		/* Integer constant (Up to 64 bits) */
661e2f7a777SLen Brown 	u32 size;		/* bytelist or field size */
662e2f7a777SLen Brown 	char *string;		/* NULL terminated string */
663e2f7a777SLen Brown 	u8 *buffer;		/* buffer or string */
664e2f7a777SLen Brown 	char *name;		/* NULL terminated string */
665e2f7a777SLen Brown 	union acpi_parse_object *arg;	/* arguments and contained ops */
666e2f7a777SLen Brown };
667e2f7a777SLen Brown 
668e2f7a777SLen Brown #ifdef ACPI_DISASSEMBLER
669e2f7a777SLen Brown #define ACPI_DISASM_ONLY_MEMBERS(a)     a;
670e2f7a777SLen Brown #else
671e2f7a777SLen Brown #define ACPI_DISASM_ONLY_MEMBERS(a)
672e2f7a777SLen Brown #endif
673e2f7a777SLen Brown 
674e2f7a777SLen Brown #define ACPI_PARSE_COMMON \
675e2f7a777SLen Brown 	union acpi_parse_object         *parent;        /* Parent op */\
676e2f7a777SLen Brown 	u8                              descriptor_type; /* To differentiate various internal objs */\
677e2f7a777SLen Brown 	u8                              flags;          /* Type of Op */\
678e2f7a777SLen Brown 	u16                             aml_opcode;     /* AML opcode */\
679e2f7a777SLen Brown 	u32                             aml_offset;     /* Offset of declaration in AML */\
680e2f7a777SLen Brown 	union acpi_parse_object         *next;          /* Next op */\
681e2f7a777SLen Brown 	struct acpi_namespace_node      *node;          /* For use by interpreter */\
682e2f7a777SLen Brown 	union acpi_parse_value          value;          /* Value or args associated with the opcode */\
683e2f7a777SLen Brown 	u8                              arg_list_length; /* Number of elements in the arg list */\
684e2f7a777SLen Brown 	ACPI_DISASM_ONLY_MEMBERS (\
685e2f7a777SLen Brown 	u8                              disasm_flags;   /* Used during AML disassembly */\
686e2f7a777SLen Brown 	u8                              disasm_opcode;  /* Subtype used for disassembly */\
687e2f7a777SLen Brown 	char                            aml_op_name[16])	/* Op name (debug only) */
688e2f7a777SLen Brown 
689e2f7a777SLen Brown #define ACPI_DASM_BUFFER                0x00
690e2f7a777SLen Brown #define ACPI_DASM_RESOURCE              0x01
691e2f7a777SLen Brown #define ACPI_DASM_STRING                0x02
692e2f7a777SLen Brown #define ACPI_DASM_UNICODE               0x03
693e2f7a777SLen Brown #define ACPI_DASM_EISAID                0x04
694e2f7a777SLen Brown #define ACPI_DASM_MATCHOP               0x05
695e2f7a777SLen Brown #define ACPI_DASM_LNOT_PREFIX           0x06
696e2f7a777SLen Brown #define ACPI_DASM_LNOT_SUFFIX           0x07
697e2f7a777SLen Brown #define ACPI_DASM_IGNORE                0x08
698e2f7a777SLen Brown 
699e2f7a777SLen Brown /*
700e2f7a777SLen Brown  * Generic operation (for example:  If, While, Store)
701e2f7a777SLen Brown  */
702e2f7a777SLen Brown struct acpi_parse_obj_common {
703e2f7a777SLen Brown ACPI_PARSE_COMMON};
704e2f7a777SLen Brown 
705e2f7a777SLen Brown /*
706e2f7a777SLen Brown  * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
707e2f7a777SLen Brown  * and bytelists.
708e2f7a777SLen Brown  */
709e2f7a777SLen Brown struct acpi_parse_obj_named {
710e2f7a777SLen Brown 	ACPI_PARSE_COMMON u8 *path;
711e2f7a777SLen Brown 	u8 *data;		/* AML body or bytelist data */
712e2f7a777SLen Brown 	u32 length;		/* AML length */
713e2f7a777SLen Brown 	u32 name;		/* 4-byte name or zero if no name */
714e2f7a777SLen Brown };
715e2f7a777SLen Brown 
716e2f7a777SLen Brown /* This version is used by the i_aSL compiler only */
717e2f7a777SLen Brown 
718e2f7a777SLen Brown #define ACPI_MAX_PARSEOP_NAME   20
719e2f7a777SLen Brown 
720e2f7a777SLen Brown struct acpi_parse_obj_asl {
721e2f7a777SLen Brown 	ACPI_PARSE_COMMON union acpi_parse_object *child;
722e2f7a777SLen Brown 	union acpi_parse_object *parent_method;
723e2f7a777SLen Brown 	char *filename;
724e2f7a777SLen Brown 	char *external_name;
725e2f7a777SLen Brown 	char *namepath;
726e2f7a777SLen Brown 	char name_seg[4];
727e2f7a777SLen Brown 	u32 extra_value;
728e2f7a777SLen Brown 	u32 column;
729e2f7a777SLen Brown 	u32 line_number;
730e2f7a777SLen Brown 	u32 logical_line_number;
731e2f7a777SLen Brown 	u32 logical_byte_offset;
732e2f7a777SLen Brown 	u32 end_line;
733e2f7a777SLen Brown 	u32 end_logical_line;
734e2f7a777SLen Brown 	u32 acpi_btype;
735e2f7a777SLen Brown 	u32 aml_length;
736e2f7a777SLen Brown 	u32 aml_subtree_length;
737e2f7a777SLen Brown 	u32 final_aml_length;
738e2f7a777SLen Brown 	u32 final_aml_offset;
739e2f7a777SLen Brown 	u32 compile_flags;
740e2f7a777SLen Brown 	u16 parse_opcode;
741e2f7a777SLen Brown 	u8 aml_opcode_length;
742e2f7a777SLen Brown 	u8 aml_pkg_len_bytes;
743e2f7a777SLen Brown 	u8 extra;
744e2f7a777SLen Brown 	char parse_op_name[ACPI_MAX_PARSEOP_NAME];
745e2f7a777SLen Brown };
746e2f7a777SLen Brown 
747e2f7a777SLen Brown union acpi_parse_object {
748e2f7a777SLen Brown 	struct acpi_parse_obj_common common;
749e2f7a777SLen Brown 	struct acpi_parse_obj_named named;
750e2f7a777SLen Brown 	struct acpi_parse_obj_asl asl;
751e2f7a777SLen Brown };
752e2f7a777SLen Brown 
753e2f7a777SLen Brown /*
754e2f7a777SLen Brown  * Parse state - one state per parser invocation and each control
755e2f7a777SLen Brown  * method.
756e2f7a777SLen Brown  */
757e2f7a777SLen Brown struct acpi_parse_state {
758e2f7a777SLen Brown 	u8 *aml_start;		/* First AML byte */
759e2f7a777SLen Brown 	u8 *aml;		/* Next AML byte */
760e2f7a777SLen Brown 	u8 *aml_end;		/* (last + 1) AML byte */
761e2f7a777SLen Brown 	u8 *pkg_start;		/* Current package begin */
762e2f7a777SLen Brown 	u8 *pkg_end;		/* Current package end */
763e2f7a777SLen Brown 	union acpi_parse_object *start_op;	/* Root of parse tree */
764e2f7a777SLen Brown 	struct acpi_namespace_node *start_node;
765e2f7a777SLen Brown 	union acpi_generic_state *scope;	/* Current scope */
766e2f7a777SLen Brown 	union acpi_parse_object *start_scope;
767e2f7a777SLen Brown 	u32 aml_size;
768e2f7a777SLen Brown };
769e2f7a777SLen Brown 
770e2f7a777SLen Brown /* Parse object flags */
771e2f7a777SLen Brown 
772e2f7a777SLen Brown #define ACPI_PARSEOP_GENERIC            0x01
773e2f7a777SLen Brown #define ACPI_PARSEOP_NAMED              0x02
774e2f7a777SLen Brown #define ACPI_PARSEOP_DEFERRED           0x04
775e2f7a777SLen Brown #define ACPI_PARSEOP_BYTELIST           0x08
776e2f7a777SLen Brown #define ACPI_PARSEOP_IN_STACK           0x10
777e2f7a777SLen Brown #define ACPI_PARSEOP_TARGET             0x20
778e2f7a777SLen Brown #define ACPI_PARSEOP_IN_CACHE           0x80
779e2f7a777SLen Brown 
780e2f7a777SLen Brown /* Parse object disasm_flags */
781e2f7a777SLen Brown 
782e2f7a777SLen Brown #define ACPI_PARSEOP_IGNORE             0x01
783e2f7a777SLen Brown #define ACPI_PARSEOP_PARAMLIST          0x02
784e2f7a777SLen Brown #define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
785e2f7a777SLen Brown #define ACPI_PARSEOP_SPECIAL            0x10
786e2f7a777SLen Brown 
787e2f7a777SLen Brown /*****************************************************************************
788e2f7a777SLen Brown  *
789e2f7a777SLen Brown  * Hardware (ACPI registers) and PNP
790e2f7a777SLen Brown  *
791e2f7a777SLen Brown  ****************************************************************************/
792e2f7a777SLen Brown 
793e2f7a777SLen Brown struct acpi_bit_register_info {
794e2f7a777SLen Brown 	u8 parent_register;
795e2f7a777SLen Brown 	u8 bit_position;
796e2f7a777SLen Brown 	u16 access_bit_mask;
797e2f7a777SLen Brown };
798e2f7a777SLen Brown 
799e2f7a777SLen Brown /*
800e2f7a777SLen Brown  * Some ACPI registers have bits that must be ignored -- meaning that they
801e2f7a777SLen Brown  * must be preserved.
802e2f7a777SLen Brown  */
803e2f7a777SLen Brown #define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800	/* Bit 11 */
80420869dcfSBob Moore 
805c3dd25f4SLin Ming /* Write-only bits must be zeroed by software */
806c3dd25f4SLin Ming 
807c3dd25f4SLin Ming #define ACPI_PM1_CONTROL_WRITEONLY_BITS         0x2004	/* Bits 13, 2 */
808c3dd25f4SLin Ming 
80920869dcfSBob Moore /* For control registers, both ignored and reserved bits must be preserved */
81020869dcfSBob Moore 
811975b3c47SLin Ming /*
812b1cd843bSBob Moore  * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
813b1cd843bSBob Moore  * ACPI specification to be a "preserved" bit - "OSPM always preserves this
814b1cd843bSBob Moore  * bit position", section 4.7.3.2.1. However, on some machines the OS must
815b1cd843bSBob Moore  * write a one to this bit after resume for the machine to work properly.
816b1cd843bSBob Moore  * To enable this, we no longer attempt to preserve this bit. No machines
817b1cd843bSBob Moore  * are known to fail if the bit is not preserved. (May 2009)
818975b3c47SLin Ming  */
819b1cd843bSBob Moore #define ACPI_PM1_CONTROL_IGNORED_BITS           0x0200	/* Bit 9 */
82020869dcfSBob Moore #define ACPI_PM1_CONTROL_RESERVED_BITS          0xC1F8	/* Bits 14-15, 3-8 */
82120869dcfSBob Moore #define ACPI_PM1_CONTROL_PRESERVED_BITS \
82220869dcfSBob Moore 	       (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
82320869dcfSBob Moore 
82420869dcfSBob Moore #define ACPI_PM2_CONTROL_PRESERVED_BITS         0xFFFFFFFE	/* All except bit 0 */
825e2f7a777SLen Brown 
826e2f7a777SLen Brown /*
827e2f7a777SLen Brown  * Register IDs
828e2f7a777SLen Brown  * These are the full ACPI registers
829e2f7a777SLen Brown  */
830e2f7a777SLen Brown #define ACPI_REGISTER_PM1_STATUS                0x01
831e2f7a777SLen Brown #define ACPI_REGISTER_PM1_ENABLE                0x02
832e2f7a777SLen Brown #define ACPI_REGISTER_PM1_CONTROL               0x03
83332c9ef99SBob Moore #define ACPI_REGISTER_PM2_CONTROL               0x04
83432c9ef99SBob Moore #define ACPI_REGISTER_PM_TIMER                  0x05
83532c9ef99SBob Moore #define ACPI_REGISTER_PROCESSOR_BLOCK           0x06
83632c9ef99SBob Moore #define ACPI_REGISTER_SMI_COMMAND_BLOCK         0x07
837e2f7a777SLen Brown 
838e2f7a777SLen Brown /* Masks used to access the bit_registers */
839e2f7a777SLen Brown 
840e2f7a777SLen Brown #define ACPI_BITMASK_TIMER_STATUS               0x0001
841e2f7a777SLen Brown #define ACPI_BITMASK_BUS_MASTER_STATUS          0x0010
842e2f7a777SLen Brown #define ACPI_BITMASK_GLOBAL_LOCK_STATUS         0x0020
843e2f7a777SLen Brown #define ACPI_BITMASK_POWER_BUTTON_STATUS        0x0100
844e2f7a777SLen Brown #define ACPI_BITMASK_SLEEP_BUTTON_STATUS        0x0200
845e2f7a777SLen Brown #define ACPI_BITMASK_RT_CLOCK_STATUS            0x0400
846e2f7a777SLen Brown #define ACPI_BITMASK_PCIEXP_WAKE_STATUS         0x4000	/* ACPI 3.0 */
847e2f7a777SLen Brown #define ACPI_BITMASK_WAKE_STATUS                0x8000
848e2f7a777SLen Brown 
849e2f7a777SLen Brown #define ACPI_BITMASK_ALL_FIXED_STATUS           (\
850e2f7a777SLen Brown 	ACPI_BITMASK_TIMER_STATUS          | \
851e2f7a777SLen Brown 	ACPI_BITMASK_BUS_MASTER_STATUS     | \
852e2f7a777SLen Brown 	ACPI_BITMASK_GLOBAL_LOCK_STATUS    | \
853e2f7a777SLen Brown 	ACPI_BITMASK_POWER_BUTTON_STATUS   | \
854e2f7a777SLen Brown 	ACPI_BITMASK_SLEEP_BUTTON_STATUS   | \
855e2f7a777SLen Brown 	ACPI_BITMASK_RT_CLOCK_STATUS       | \
856e2f7a777SLen Brown 	ACPI_BITMASK_WAKE_STATUS)
857e2f7a777SLen Brown 
858e2f7a777SLen Brown #define ACPI_BITMASK_TIMER_ENABLE               0x0001
859e2f7a777SLen Brown #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE         0x0020
860e2f7a777SLen Brown #define ACPI_BITMASK_POWER_BUTTON_ENABLE        0x0100
861e2f7a777SLen Brown #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE        0x0200
862e2f7a777SLen Brown #define ACPI_BITMASK_RT_CLOCK_ENABLE            0x0400
863e2f7a777SLen Brown #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE        0x4000	/* ACPI 3.0 */
864e2f7a777SLen Brown 
865e2f7a777SLen Brown #define ACPI_BITMASK_SCI_ENABLE                 0x0001
866e2f7a777SLen Brown #define ACPI_BITMASK_BUS_MASTER_RLD             0x0002
867e2f7a777SLen Brown #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE        0x0004
86882d79b86SBob Moore #define ACPI_BITMASK_SLEEP_TYPE                 0x1C00
869e2f7a777SLen Brown #define ACPI_BITMASK_SLEEP_ENABLE               0x2000
870e2f7a777SLen Brown 
871e2f7a777SLen Brown #define ACPI_BITMASK_ARB_DISABLE                0x0001
872e2f7a777SLen Brown 
873e2f7a777SLen Brown /* Raw bit position of each bit_register */
874e2f7a777SLen Brown 
875e2f7a777SLen Brown #define ACPI_BITPOSITION_TIMER_STATUS           0x00
876e2f7a777SLen Brown #define ACPI_BITPOSITION_BUS_MASTER_STATUS      0x04
877e2f7a777SLen Brown #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS     0x05
878e2f7a777SLen Brown #define ACPI_BITPOSITION_POWER_BUTTON_STATUS    0x08
879e2f7a777SLen Brown #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS    0x09
880e2f7a777SLen Brown #define ACPI_BITPOSITION_RT_CLOCK_STATUS        0x0A
881e2f7a777SLen Brown #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS     0x0E	/* ACPI 3.0 */
882e2f7a777SLen Brown #define ACPI_BITPOSITION_WAKE_STATUS            0x0F
883e2f7a777SLen Brown 
884e2f7a777SLen Brown #define ACPI_BITPOSITION_TIMER_ENABLE           0x00
885e2f7a777SLen Brown #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE     0x05
886e2f7a777SLen Brown #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE    0x08
887e2f7a777SLen Brown #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE    0x09
888e2f7a777SLen Brown #define ACPI_BITPOSITION_RT_CLOCK_ENABLE        0x0A
889e2f7a777SLen Brown #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE    0x0E	/* ACPI 3.0 */
890e2f7a777SLen Brown 
891e2f7a777SLen Brown #define ACPI_BITPOSITION_SCI_ENABLE             0x00
892e2f7a777SLen Brown #define ACPI_BITPOSITION_BUS_MASTER_RLD         0x01
893e2f7a777SLen Brown #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE    0x02
89482d79b86SBob Moore #define ACPI_BITPOSITION_SLEEP_TYPE             0x0A
895e2f7a777SLen Brown #define ACPI_BITPOSITION_SLEEP_ENABLE           0x0D
896e2f7a777SLen Brown 
897e2f7a777SLen Brown #define ACPI_BITPOSITION_ARB_DISABLE            0x00
898e2f7a777SLen Brown 
8997f071903SBob Moore /* Structs and definitions for _OSI support and I/O port validation */
9007f071903SBob Moore 
9017f071903SBob Moore #define ACPI_OSI_WIN_2000               0x01
9027f071903SBob Moore #define ACPI_OSI_WIN_XP                 0x02
9037f071903SBob Moore #define ACPI_OSI_WIN_XP_SP1             0x03
9047f071903SBob Moore #define ACPI_OSI_WINSRV_2003            0x04
9057f071903SBob Moore #define ACPI_OSI_WIN_XP_SP2             0x05
9067f071903SBob Moore #define ACPI_OSI_WINSRV_2003_SP1        0x06
9077f071903SBob Moore #define ACPI_OSI_WIN_VISTA              0x07
908eb752552SBob Moore #define ACPI_OSI_WINSRV_2008            0x08
909eb752552SBob Moore #define ACPI_OSI_WIN_VISTA_SP1          0x09
910eb752552SBob Moore #define ACPI_OSI_WIN_7                  0x0A
9117f071903SBob Moore 
9127f071903SBob Moore #define ACPI_ALWAYS_ILLEGAL             0x00
9137f071903SBob Moore 
9147f071903SBob Moore struct acpi_interface_info {
9157f071903SBob Moore 	char *name;
9167f071903SBob Moore 	u8 value;
9177f071903SBob Moore };
9187f071903SBob Moore 
9197f071903SBob Moore struct acpi_port_info {
9207f071903SBob Moore 	char *name;
9217f071903SBob Moore 	u16 start;
9227f071903SBob Moore 	u16 end;
9237f071903SBob Moore 	u8 osi_dependency;
9247f071903SBob Moore };
9257f071903SBob Moore 
926e2f7a777SLen Brown /*****************************************************************************
927e2f7a777SLen Brown  *
928e2f7a777SLen Brown  * Resource descriptors
929e2f7a777SLen Brown  *
930e2f7a777SLen Brown  ****************************************************************************/
931e2f7a777SLen Brown 
932e2f7a777SLen Brown /* resource_type values */
933e2f7a777SLen Brown 
934e2f7a777SLen Brown #define ACPI_ADDRESS_TYPE_MEMORY_RANGE          0
935e2f7a777SLen Brown #define ACPI_ADDRESS_TYPE_IO_RANGE              1
936e2f7a777SLen Brown #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE      2
937e2f7a777SLen Brown 
938e2f7a777SLen Brown /* Resource descriptor types and masks */
939e2f7a777SLen Brown 
940e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_LARGE                0x80
941e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_SMALL                0x00
942e2f7a777SLen Brown 
943e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_SMALL_MASK           0x78	/* Bits 6:3 contain the type */
944e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK    0x07	/* Bits 2:0 contain the length */
945e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_LARGE_MASK           0x7F	/* Bits 6:0 contain the type */
946e2f7a777SLen Brown 
947e2f7a777SLen Brown /*
948e2f7a777SLen Brown  * Small resource descriptor "names" as defined by the ACPI specification.
949e2f7a777SLen Brown  * Note: Bits 2:0 are used for the descriptor length
950e2f7a777SLen Brown  */
951e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_IRQ                  0x20
952e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_DMA                  0x28
953e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_START_DEPENDENT      0x30
954e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_END_DEPENDENT        0x38
955e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_IO                   0x40
956e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_FIXED_IO             0x48
957e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_RESERVED_S1          0x50
958e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_RESERVED_S2          0x58
959e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_RESERVED_S3          0x60
960e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_RESERVED_S4          0x68
961e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_VENDOR_SMALL         0x70
962e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_END_TAG              0x78
963e2f7a777SLen Brown 
964e2f7a777SLen Brown /*
965e2f7a777SLen Brown  * Large resource descriptor "names" as defined by the ACPI specification.
966e2f7a777SLen Brown  * Note: includes the Large Descriptor bit in bit[7]
967e2f7a777SLen Brown  */
968e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_MEMORY24             0x81
969e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_GENERIC_REGISTER     0x82
970e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_RESERVED_L1          0x83
971e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_VENDOR_LARGE         0x84
972e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_MEMORY32             0x85
973e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_FIXED_MEMORY32       0x86
974e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_ADDRESS32            0x87
975e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_ADDRESS16            0x88
976e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_EXTENDED_IRQ         0x89
977e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_ADDRESS64            0x8A
978e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64   0x8B
979e2f7a777SLen Brown #define ACPI_RESOURCE_NAME_LARGE_MAX            0x8B
980e2f7a777SLen Brown 
981e2f7a777SLen Brown /*****************************************************************************
982e2f7a777SLen Brown  *
983e2f7a777SLen Brown  * Miscellaneous
984e2f7a777SLen Brown  *
985e2f7a777SLen Brown  ****************************************************************************/
986e2f7a777SLen Brown 
987e2f7a777SLen Brown #define ACPI_ASCII_ZERO                 0x30
988e2f7a777SLen Brown 
989e2f7a777SLen Brown /*****************************************************************************
990e2f7a777SLen Brown  *
991e2f7a777SLen Brown  * Debugger
992e2f7a777SLen Brown  *
993e2f7a777SLen Brown  ****************************************************************************/
994e2f7a777SLen Brown 
995e2f7a777SLen Brown struct acpi_db_method_info {
996e2f7a777SLen Brown 	acpi_handle main_thread_gate;
997e2f7a777SLen Brown 	acpi_handle thread_complete_gate;
998e2f7a777SLen Brown 	u32 *threads;
999e2f7a777SLen Brown 	u32 num_threads;
1000e2f7a777SLen Brown 	u32 num_created;
1001e2f7a777SLen Brown 	u32 num_completed;
1002e2f7a777SLen Brown 
1003e2f7a777SLen Brown 	char *name;
1004e2f7a777SLen Brown 	u32 flags;
1005e2f7a777SLen Brown 	u32 num_loops;
1006e2f7a777SLen Brown 	char pathname[128];
1007e2f7a777SLen Brown 	char **args;
1008e2f7a777SLen Brown 
1009e2f7a777SLen Brown 	/*
1010e2f7a777SLen Brown 	 * Arguments to be passed to method for the command
1011e2f7a777SLen Brown 	 * Threads -
1012e2f7a777SLen Brown 	 *   the Number of threads, ID of current thread and
1013e2f7a777SLen Brown 	 *   Index of current thread inside all them created.
1014e2f7a777SLen Brown 	 */
1015e2f7a777SLen Brown 	char init_args;
1016e2f7a777SLen Brown 	char *arguments[4];
1017e2f7a777SLen Brown 	char num_threads_str[11];
1018e2f7a777SLen Brown 	char id_of_thread_str[11];
1019e2f7a777SLen Brown 	char index_of_thread_str[11];
1020e2f7a777SLen Brown };
1021e2f7a777SLen Brown 
1022e2f7a777SLen Brown struct acpi_integrity_info {
1023e2f7a777SLen Brown 	u32 nodes;
1024e2f7a777SLen Brown 	u32 objects;
1025e2f7a777SLen Brown };
1026e2f7a777SLen Brown 
1027e2f7a777SLen Brown #define ACPI_DB_REDIRECTABLE_OUTPUT     0x01
1028e2f7a777SLen Brown #define ACPI_DB_CONSOLE_OUTPUT          0x02
1029e2f7a777SLen Brown #define ACPI_DB_DUPLICATE_OUTPUT        0x03
1030e2f7a777SLen Brown 
1031e2f7a777SLen Brown /*****************************************************************************
1032e2f7a777SLen Brown  *
1033e2f7a777SLen Brown  * Debug
1034e2f7a777SLen Brown  *
1035e2f7a777SLen Brown  ****************************************************************************/
1036e2f7a777SLen Brown 
1037e2f7a777SLen Brown /* Entry for a memory allocation (debug only) */
1038e2f7a777SLen Brown 
1039e2f7a777SLen Brown #define ACPI_MEM_MALLOC                 0
1040e2f7a777SLen Brown #define ACPI_MEM_CALLOC                 1
1041e2f7a777SLen Brown #define ACPI_MAX_MODULE_NAME            16
1042e2f7a777SLen Brown 
1043e2f7a777SLen Brown #define ACPI_COMMON_DEBUG_MEM_HEADER \
1044e2f7a777SLen Brown 	struct acpi_debug_mem_block     *previous; \
1045e2f7a777SLen Brown 	struct acpi_debug_mem_block     *next; \
1046e2f7a777SLen Brown 	u32                             size; \
1047e2f7a777SLen Brown 	u32                             component; \
1048e2f7a777SLen Brown 	u32                             line; \
1049e2f7a777SLen Brown 	char                            module[ACPI_MAX_MODULE_NAME]; \
1050e2f7a777SLen Brown 	u8                              alloc_type;
1051e2f7a777SLen Brown 
1052e2f7a777SLen Brown struct acpi_debug_mem_header {
1053e2f7a777SLen Brown ACPI_COMMON_DEBUG_MEM_HEADER};
1054e2f7a777SLen Brown 
1055e2f7a777SLen Brown struct acpi_debug_mem_block {
1056e2f7a777SLen Brown 	ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space;
1057e2f7a777SLen Brown };
1058e2f7a777SLen Brown 
1059e2f7a777SLen Brown #define ACPI_MEM_LIST_GLOBAL            0
1060e2f7a777SLen Brown #define ACPI_MEM_LIST_NSNODE            1
1061e2f7a777SLen Brown #define ACPI_MEM_LIST_MAX               1
1062e2f7a777SLen Brown #define ACPI_NUM_MEM_LISTS              2
1063e2f7a777SLen Brown 
1064e2f7a777SLen Brown #endif				/* __ACLOCAL_H__ */
1065