aclocal.h revision 1.3.4.2 1 1.3.4.2 rmind /******************************************************************************
2 1.3.4.2 rmind *
3 1.3.4.2 rmind * Name: aclocal.h - Internal data types used across the ACPI subsystem
4 1.3.4.2 rmind *
5 1.3.4.2 rmind *****************************************************************************/
6 1.3.4.2 rmind
7 1.3.4.2 rmind /*
8 1.3.4.2 rmind * Copyright (C) 2000 - 2011, Intel Corp.
9 1.3.4.2 rmind * All rights reserved.
10 1.3.4.2 rmind *
11 1.3.4.2 rmind * Redistribution and use in source and binary forms, with or without
12 1.3.4.2 rmind * modification, are permitted provided that the following conditions
13 1.3.4.2 rmind * are met:
14 1.3.4.2 rmind * 1. Redistributions of source code must retain the above copyright
15 1.3.4.2 rmind * notice, this list of conditions, and the following disclaimer,
16 1.3.4.2 rmind * without modification.
17 1.3.4.2 rmind * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.3.4.2 rmind * substantially similar to the "NO WARRANTY" disclaimer below
19 1.3.4.2 rmind * ("Disclaimer") and any redistribution must be conditioned upon
20 1.3.4.2 rmind * including a substantially similar Disclaimer requirement for further
21 1.3.4.2 rmind * binary redistribution.
22 1.3.4.2 rmind * 3. Neither the names of the above-listed copyright holders nor the names
23 1.3.4.2 rmind * of any contributors may be used to endorse or promote products derived
24 1.3.4.2 rmind * from this software without specific prior written permission.
25 1.3.4.2 rmind *
26 1.3.4.2 rmind * Alternatively, this software may be distributed under the terms of the
27 1.3.4.2 rmind * GNU General Public License ("GPL") version 2 as published by the Free
28 1.3.4.2 rmind * Software Foundation.
29 1.3.4.2 rmind *
30 1.3.4.2 rmind * NO WARRANTY
31 1.3.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.3.4.2 rmind * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.3.4.2 rmind * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.3.4.2 rmind * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.3.4.2 rmind * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.3.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.3.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.3.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.3.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.3.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.3.4.2 rmind * POSSIBILITY OF SUCH DAMAGES.
42 1.3.4.2 rmind */
43 1.3.4.2 rmind
44 1.3.4.2 rmind #ifndef __ACLOCAL_H__
45 1.3.4.2 rmind #define __ACLOCAL_H__
46 1.3.4.2 rmind
47 1.3.4.2 rmind
48 1.3.4.2 rmind /* acpisrc:StructDefs -- for acpisrc conversion */
49 1.3.4.2 rmind
50 1.3.4.2 rmind #define ACPI_SERIALIZED 0xFF
51 1.3.4.2 rmind
52 1.3.4.2 rmind typedef UINT32 ACPI_MUTEX_HANDLE;
53 1.3.4.2 rmind #define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1)
54 1.3.4.2 rmind
55 1.3.4.2 rmind /* Total number of aml opcodes defined */
56 1.3.4.2 rmind
57 1.3.4.2 rmind #define AML_NUM_OPCODES 0x7F
58 1.3.4.2 rmind
59 1.3.4.2 rmind
60 1.3.4.2 rmind /* Forward declarations */
61 1.3.4.2 rmind
62 1.3.4.2 rmind struct acpi_walk_state;
63 1.3.4.2 rmind struct acpi_obj_mutex;
64 1.3.4.2 rmind union acpi_parse_object;
65 1.3.4.2 rmind
66 1.3.4.2 rmind
67 1.3.4.2 rmind /*****************************************************************************
68 1.3.4.2 rmind *
69 1.3.4.2 rmind * Mutex typedefs and structs
70 1.3.4.2 rmind *
71 1.3.4.2 rmind ****************************************************************************/
72 1.3.4.2 rmind
73 1.3.4.2 rmind
74 1.3.4.2 rmind /*
75 1.3.4.2 rmind * Predefined handles for the mutex objects used within the subsystem
76 1.3.4.2 rmind * All mutex objects are automatically created by AcpiUtMutexInitialize.
77 1.3.4.2 rmind *
78 1.3.4.2 rmind * The acquire/release ordering protocol is implied via this list. Mutexes
79 1.3.4.2 rmind * with a lower value must be acquired before mutexes with a higher value.
80 1.3.4.2 rmind *
81 1.3.4.2 rmind * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
82 1.3.4.2 rmind * table below also!
83 1.3.4.2 rmind */
84 1.3.4.2 rmind #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
85 1.3.4.2 rmind #define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
86 1.3.4.2 rmind #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
87 1.3.4.2 rmind #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
88 1.3.4.2 rmind #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
89 1.3.4.2 rmind #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
90 1.3.4.2 rmind #define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */
91 1.3.4.2 rmind #define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */
92 1.3.4.2 rmind
93 1.3.4.2 rmind #define ACPI_MAX_MUTEX 7
94 1.3.4.2 rmind #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
95 1.3.4.2 rmind
96 1.3.4.2 rmind /* Lock structure for reader/writer interfaces */
97 1.3.4.2 rmind
98 1.3.4.2 rmind typedef struct acpi_rw_lock
99 1.3.4.2 rmind {
100 1.3.4.2 rmind ACPI_MUTEX WriterMutex;
101 1.3.4.2 rmind ACPI_MUTEX ReaderMutex;
102 1.3.4.2 rmind UINT32 NumReaders;
103 1.3.4.2 rmind
104 1.3.4.2 rmind } ACPI_RW_LOCK;
105 1.3.4.2 rmind
106 1.3.4.2 rmind
107 1.3.4.2 rmind /*
108 1.3.4.2 rmind * Predefined handles for spinlocks used within the subsystem.
109 1.3.4.2 rmind * These spinlocks are created by AcpiUtMutexInitialize
110 1.3.4.2 rmind */
111 1.3.4.2 rmind #define ACPI_LOCK_GPES 0
112 1.3.4.2 rmind #define ACPI_LOCK_HARDWARE 1
113 1.3.4.2 rmind
114 1.3.4.2 rmind #define ACPI_MAX_LOCK 1
115 1.3.4.2 rmind #define ACPI_NUM_LOCK ACPI_MAX_LOCK+1
116 1.3.4.2 rmind
117 1.3.4.2 rmind
118 1.3.4.2 rmind /* This Thread ID means that the mutex is not in use (unlocked) */
119 1.3.4.2 rmind
120 1.3.4.2 rmind #define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1
121 1.3.4.2 rmind
122 1.3.4.2 rmind /* Table for the global mutexes */
123 1.3.4.2 rmind
124 1.3.4.2 rmind typedef struct acpi_mutex_info
125 1.3.4.2 rmind {
126 1.3.4.2 rmind ACPI_MUTEX Mutex;
127 1.3.4.2 rmind UINT32 UseCount;
128 1.3.4.2 rmind ACPI_THREAD_ID ThreadId;
129 1.3.4.2 rmind
130 1.3.4.2 rmind } ACPI_MUTEX_INFO;
131 1.3.4.2 rmind
132 1.3.4.2 rmind
133 1.3.4.2 rmind /* Lock flag parameter for various interfaces */
134 1.3.4.2 rmind
135 1.3.4.2 rmind #define ACPI_MTX_DO_NOT_LOCK 0
136 1.3.4.2 rmind #define ACPI_MTX_LOCK 1
137 1.3.4.2 rmind
138 1.3.4.2 rmind
139 1.3.4.2 rmind /* Field access granularities */
140 1.3.4.2 rmind
141 1.3.4.2 rmind #define ACPI_FIELD_BYTE_GRANULARITY 1
142 1.3.4.2 rmind #define ACPI_FIELD_WORD_GRANULARITY 2
143 1.3.4.2 rmind #define ACPI_FIELD_DWORD_GRANULARITY 4
144 1.3.4.2 rmind #define ACPI_FIELD_QWORD_GRANULARITY 8
145 1.3.4.2 rmind
146 1.3.4.2 rmind
147 1.3.4.2 rmind #define ACPI_ENTRY_NOT_FOUND NULL
148 1.3.4.2 rmind
149 1.3.4.2 rmind
150 1.3.4.2 rmind /*****************************************************************************
151 1.3.4.2 rmind *
152 1.3.4.2 rmind * Namespace typedefs and structs
153 1.3.4.2 rmind *
154 1.3.4.2 rmind ****************************************************************************/
155 1.3.4.2 rmind
156 1.3.4.2 rmind /* Operational modes of the AML interpreter/scanner */
157 1.3.4.2 rmind
158 1.3.4.2 rmind typedef enum
159 1.3.4.2 rmind {
160 1.3.4.2 rmind ACPI_IMODE_LOAD_PASS1 = 0x01,
161 1.3.4.2 rmind ACPI_IMODE_LOAD_PASS2 = 0x02,
162 1.3.4.2 rmind ACPI_IMODE_EXECUTE = 0x03
163 1.3.4.2 rmind
164 1.3.4.2 rmind } ACPI_INTERPRETER_MODE;
165 1.3.4.2 rmind
166 1.3.4.2 rmind
167 1.3.4.2 rmind /*
168 1.3.4.2 rmind * The Namespace Node describes a named object that appears in the AML.
169 1.3.4.2 rmind * DescriptorType is used to differentiate between internal descriptors.
170 1.3.4.2 rmind *
171 1.3.4.2 rmind * The node is optimized for both 32-bit and 64-bit platforms:
172 1.3.4.2 rmind * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
173 1.3.4.2 rmind *
174 1.3.4.2 rmind * Note: The DescriptorType and Type fields must appear in the identical
175 1.3.4.2 rmind * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
176 1.3.4.2 rmind * structures.
177 1.3.4.2 rmind */
178 1.3.4.2 rmind typedef struct acpi_namespace_node
179 1.3.4.2 rmind {
180 1.3.4.2 rmind union acpi_operand_object *Object; /* Interpreter object */
181 1.3.4.2 rmind UINT8 DescriptorType; /* Differentiate object descriptor types */
182 1.3.4.2 rmind UINT8 Type; /* ACPI Type associated with this name */
183 1.3.4.2 rmind UINT8 Flags; /* Miscellaneous flags */
184 1.3.4.2 rmind ACPI_OWNER_ID OwnerId; /* Node creator */
185 1.3.4.2 rmind ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
186 1.3.4.2 rmind struct acpi_namespace_node *Parent; /* Parent node */
187 1.3.4.2 rmind struct acpi_namespace_node *Child; /* First child */
188 1.3.4.2 rmind struct acpi_namespace_node *Peer; /* First peer */
189 1.3.4.2 rmind
190 1.3.4.2 rmind /*
191 1.3.4.2 rmind * The following fields are used by the ASL compiler and disassembler only
192 1.3.4.2 rmind */
193 1.3.4.2 rmind #ifdef ACPI_LARGE_NAMESPACE_NODE
194 1.3.4.2 rmind union acpi_parse_object *Op;
195 1.3.4.2 rmind UINT32 Value;
196 1.3.4.2 rmind UINT32 Length;
197 1.3.4.2 rmind #endif
198 1.3.4.2 rmind
199 1.3.4.2 rmind } ACPI_NAMESPACE_NODE;
200 1.3.4.2 rmind
201 1.3.4.2 rmind
202 1.3.4.2 rmind /* Namespace Node flags */
203 1.3.4.2 rmind
204 1.3.4.2 rmind #define ANOBJ_RESERVED 0x01 /* Available for use */
205 1.3.4.2 rmind #define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
206 1.3.4.2 rmind #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
207 1.3.4.2 rmind #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
208 1.3.4.2 rmind #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
209 1.3.4.2 rmind #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
210 1.3.4.2 rmind #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */
211 1.3.4.2 rmind
212 1.3.4.2 rmind #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
213 1.3.4.2 rmind #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
214 1.3.4.2 rmind #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
215 1.3.4.2 rmind #define ANOBJ_IS_BIT_OFFSET 0x40 /* iASL only: Reference is a bit offset */
216 1.3.4.2 rmind #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
217 1.3.4.2 rmind
218 1.3.4.2 rmind
219 1.3.4.2 rmind /* Internal ACPI table management - master table list */
220 1.3.4.2 rmind
221 1.3.4.2 rmind typedef struct acpi_table_list
222 1.3.4.2 rmind {
223 1.3.4.2 rmind ACPI_TABLE_DESC *Tables; /* Table descriptor array */
224 1.3.4.2 rmind UINT32 CurrentTableCount; /* Tables currently in the array */
225 1.3.4.2 rmind UINT32 MaxTableCount; /* Max tables array will hold */
226 1.3.4.2 rmind UINT8 Flags;
227 1.3.4.2 rmind
228 1.3.4.2 rmind } ACPI_TABLE_LIST;
229 1.3.4.2 rmind
230 1.3.4.2 rmind /* Flags for above */
231 1.3.4.2 rmind
232 1.3.4.2 rmind #define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
233 1.3.4.2 rmind #define ACPI_ROOT_ORIGIN_ALLOCATED (1)
234 1.3.4.2 rmind #define ACPI_ROOT_ALLOW_RESIZE (2)
235 1.3.4.2 rmind
236 1.3.4.2 rmind
237 1.3.4.2 rmind /* Predefined (fixed) table indexes */
238 1.3.4.2 rmind
239 1.3.4.2 rmind #define ACPI_TABLE_INDEX_DSDT (0)
240 1.3.4.2 rmind #define ACPI_TABLE_INDEX_FACS (1)
241 1.3.4.2 rmind
242 1.3.4.2 rmind
243 1.3.4.2 rmind typedef struct acpi_find_context
244 1.3.4.2 rmind {
245 1.3.4.2 rmind char *SearchFor;
246 1.3.4.2 rmind ACPI_HANDLE *List;
247 1.3.4.2 rmind UINT32 *Count;
248 1.3.4.2 rmind
249 1.3.4.2 rmind } ACPI_FIND_CONTEXT;
250 1.3.4.2 rmind
251 1.3.4.2 rmind
252 1.3.4.2 rmind typedef struct acpi_ns_search_data
253 1.3.4.2 rmind {
254 1.3.4.2 rmind ACPI_NAMESPACE_NODE *Node;
255 1.3.4.2 rmind
256 1.3.4.2 rmind } ACPI_NS_SEARCH_DATA;
257 1.3.4.2 rmind
258 1.3.4.2 rmind
259 1.3.4.2 rmind /* Object types used during package copies */
260 1.3.4.2 rmind
261 1.3.4.2 rmind #define ACPI_COPY_TYPE_SIMPLE 0
262 1.3.4.2 rmind #define ACPI_COPY_TYPE_PACKAGE 1
263 1.3.4.2 rmind
264 1.3.4.2 rmind
265 1.3.4.2 rmind /* Info structure used to convert external<->internal namestrings */
266 1.3.4.2 rmind
267 1.3.4.2 rmind typedef struct acpi_namestring_info
268 1.3.4.2 rmind {
269 1.3.4.2 rmind const char *ExternalName;
270 1.3.4.2 rmind const char *NextExternalChar;
271 1.3.4.2 rmind char *InternalName;
272 1.3.4.2 rmind UINT32 Length;
273 1.3.4.2 rmind UINT32 NumSegments;
274 1.3.4.2 rmind UINT32 NumCarats;
275 1.3.4.2 rmind BOOLEAN FullyQualified;
276 1.3.4.2 rmind
277 1.3.4.2 rmind } ACPI_NAMESTRING_INFO;
278 1.3.4.2 rmind
279 1.3.4.2 rmind
280 1.3.4.2 rmind /* Field creation info */
281 1.3.4.2 rmind
282 1.3.4.2 rmind typedef struct acpi_create_field_info
283 1.3.4.2 rmind {
284 1.3.4.2 rmind ACPI_NAMESPACE_NODE *RegionNode;
285 1.3.4.2 rmind ACPI_NAMESPACE_NODE *FieldNode;
286 1.3.4.2 rmind ACPI_NAMESPACE_NODE *RegisterNode;
287 1.3.4.2 rmind ACPI_NAMESPACE_NODE *DataRegisterNode;
288 1.3.4.2 rmind UINT32 BankValue;
289 1.3.4.2 rmind UINT32 FieldBitPosition;
290 1.3.4.2 rmind UINT32 FieldBitLength;
291 1.3.4.2 rmind UINT8 FieldFlags;
292 1.3.4.2 rmind UINT8 Attribute;
293 1.3.4.2 rmind UINT8 FieldType;
294 1.3.4.2 rmind
295 1.3.4.2 rmind } ACPI_CREATE_FIELD_INFO;
296 1.3.4.2 rmind
297 1.3.4.2 rmind
298 1.3.4.2 rmind typedef
299 1.3.4.2 rmind ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
300 1.3.4.2 rmind struct acpi_walk_state *WalkState);
301 1.3.4.2 rmind
302 1.3.4.2 rmind
303 1.3.4.2 rmind /*
304 1.3.4.2 rmind * Bitmapped ACPI types. Used internally only
305 1.3.4.2 rmind */
306 1.3.4.2 rmind #define ACPI_BTYPE_ANY 0x00000000
307 1.3.4.2 rmind #define ACPI_BTYPE_INTEGER 0x00000001
308 1.3.4.2 rmind #define ACPI_BTYPE_STRING 0x00000002
309 1.3.4.2 rmind #define ACPI_BTYPE_BUFFER 0x00000004
310 1.3.4.2 rmind #define ACPI_BTYPE_PACKAGE 0x00000008
311 1.3.4.2 rmind #define ACPI_BTYPE_FIELD_UNIT 0x00000010
312 1.3.4.2 rmind #define ACPI_BTYPE_DEVICE 0x00000020
313 1.3.4.2 rmind #define ACPI_BTYPE_EVENT 0x00000040
314 1.3.4.2 rmind #define ACPI_BTYPE_METHOD 0x00000080
315 1.3.4.2 rmind #define ACPI_BTYPE_MUTEX 0x00000100
316 1.3.4.2 rmind #define ACPI_BTYPE_REGION 0x00000200
317 1.3.4.2 rmind #define ACPI_BTYPE_POWER 0x00000400
318 1.3.4.2 rmind #define ACPI_BTYPE_PROCESSOR 0x00000800
319 1.3.4.2 rmind #define ACPI_BTYPE_THERMAL 0x00001000
320 1.3.4.2 rmind #define ACPI_BTYPE_BUFFER_FIELD 0x00002000
321 1.3.4.2 rmind #define ACPI_BTYPE_DDB_HANDLE 0x00004000
322 1.3.4.2 rmind #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
323 1.3.4.2 rmind #define ACPI_BTYPE_REFERENCE 0x00010000
324 1.3.4.2 rmind #define ACPI_BTYPE_RESOURCE 0x00020000
325 1.3.4.2 rmind
326 1.3.4.2 rmind #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
327 1.3.4.2 rmind
328 1.3.4.2 rmind #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
329 1.3.4.2 rmind #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
330 1.3.4.2 rmind #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
331 1.3.4.2 rmind #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
332 1.3.4.2 rmind #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
333 1.3.4.2 rmind
334 1.3.4.2 rmind
335 1.3.4.2 rmind /*
336 1.3.4.2 rmind * Information structure for ACPI predefined names.
337 1.3.4.2 rmind * Each entry in the table contains the following items:
338 1.3.4.2 rmind *
339 1.3.4.2 rmind * Name - The ACPI reserved name
340 1.3.4.2 rmind * ParamCount - Number of arguments to the method
341 1.3.4.2 rmind * ExpectedReturnBtypes - Allowed type(s) for the return value
342 1.3.4.2 rmind */
343 1.3.4.2 rmind typedef struct acpi_name_info
344 1.3.4.2 rmind {
345 1.3.4.2 rmind char Name[ACPI_NAME_SIZE];
346 1.3.4.2 rmind UINT8 ParamCount;
347 1.3.4.2 rmind UINT8 ExpectedBtypes;
348 1.3.4.2 rmind
349 1.3.4.2 rmind } ACPI_NAME_INFO;
350 1.3.4.2 rmind
351 1.3.4.2 rmind /*
352 1.3.4.2 rmind * Secondary information structures for ACPI predefined objects that return
353 1.3.4.2 rmind * package objects. This structure appears as the next entry in the table
354 1.3.4.2 rmind * after the NAME_INFO structure above.
355 1.3.4.2 rmind *
356 1.3.4.2 rmind * The reason for this is to minimize the size of the predefined name table.
357 1.3.4.2 rmind */
358 1.3.4.2 rmind
359 1.3.4.2 rmind /*
360 1.3.4.2 rmind * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
361 1.3.4.2 rmind * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
362 1.3.4.2 rmind */
363 1.3.4.2 rmind typedef struct acpi_package_info
364 1.3.4.2 rmind {
365 1.3.4.2 rmind UINT8 Type;
366 1.3.4.2 rmind UINT8 ObjectType1;
367 1.3.4.2 rmind UINT8 Count1;
368 1.3.4.2 rmind UINT8 ObjectType2;
369 1.3.4.2 rmind UINT8 Count2;
370 1.3.4.2 rmind UINT8 Reserved;
371 1.3.4.2 rmind
372 1.3.4.2 rmind } ACPI_PACKAGE_INFO;
373 1.3.4.2 rmind
374 1.3.4.2 rmind /* Used for ACPI_PTYPE2_FIXED */
375 1.3.4.2 rmind
376 1.3.4.2 rmind typedef struct acpi_package_info2
377 1.3.4.2 rmind {
378 1.3.4.2 rmind UINT8 Type;
379 1.3.4.2 rmind UINT8 Count;
380 1.3.4.2 rmind UINT8 ObjectType[4];
381 1.3.4.2 rmind
382 1.3.4.2 rmind } ACPI_PACKAGE_INFO2;
383 1.3.4.2 rmind
384 1.3.4.2 rmind /* Used for ACPI_PTYPE1_OPTION */
385 1.3.4.2 rmind
386 1.3.4.2 rmind typedef struct acpi_package_info3
387 1.3.4.2 rmind {
388 1.3.4.2 rmind UINT8 Type;
389 1.3.4.2 rmind UINT8 Count;
390 1.3.4.2 rmind UINT8 ObjectType[2];
391 1.3.4.2 rmind UINT8 TailObjectType;
392 1.3.4.2 rmind UINT8 Reserved;
393 1.3.4.2 rmind
394 1.3.4.2 rmind } ACPI_PACKAGE_INFO3;
395 1.3.4.2 rmind
396 1.3.4.2 rmind typedef union acpi_predefined_info
397 1.3.4.2 rmind {
398 1.3.4.2 rmind ACPI_NAME_INFO Info;
399 1.3.4.2 rmind ACPI_PACKAGE_INFO RetInfo;
400 1.3.4.2 rmind ACPI_PACKAGE_INFO2 RetInfo2;
401 1.3.4.2 rmind ACPI_PACKAGE_INFO3 RetInfo3;
402 1.3.4.2 rmind
403 1.3.4.2 rmind } ACPI_PREDEFINED_INFO;
404 1.3.4.2 rmind
405 1.3.4.2 rmind
406 1.3.4.2 rmind /* Data block used during object validation */
407 1.3.4.2 rmind
408 1.3.4.2 rmind typedef struct acpi_predefined_data
409 1.3.4.2 rmind {
410 1.3.4.2 rmind char *Pathname;
411 1.3.4.2 rmind const ACPI_PREDEFINED_INFO *Predefined;
412 1.3.4.2 rmind union acpi_operand_object *ParentPackage;
413 1.3.4.2 rmind UINT32 Flags;
414 1.3.4.2 rmind UINT8 NodeFlags;
415 1.3.4.2 rmind
416 1.3.4.2 rmind } ACPI_PREDEFINED_DATA;
417 1.3.4.2 rmind
418 1.3.4.2 rmind /* Defines for Flags field above */
419 1.3.4.2 rmind
420 1.3.4.2 rmind #define ACPI_OBJECT_REPAIRED 1
421 1.3.4.2 rmind
422 1.3.4.2 rmind
423 1.3.4.2 rmind /*
424 1.3.4.2 rmind * Bitmapped return value types
425 1.3.4.2 rmind * Note: the actual data types must be contiguous, a loop in nspredef.c
426 1.3.4.2 rmind * depends on this.
427 1.3.4.2 rmind */
428 1.3.4.2 rmind #define ACPI_RTYPE_ANY 0x00
429 1.3.4.2 rmind #define ACPI_RTYPE_NONE 0x01
430 1.3.4.2 rmind #define ACPI_RTYPE_INTEGER 0x02
431 1.3.4.2 rmind #define ACPI_RTYPE_STRING 0x04
432 1.3.4.2 rmind #define ACPI_RTYPE_BUFFER 0x08
433 1.3.4.2 rmind #define ACPI_RTYPE_PACKAGE 0x10
434 1.3.4.2 rmind #define ACPI_RTYPE_REFERENCE 0x20
435 1.3.4.2 rmind #define ACPI_RTYPE_ALL 0x3F
436 1.3.4.2 rmind
437 1.3.4.2 rmind #define ACPI_NUM_RTYPES 5 /* Number of actual object types */
438 1.3.4.2 rmind
439 1.3.4.2 rmind
440 1.3.4.2 rmind /*****************************************************************************
441 1.3.4.2 rmind *
442 1.3.4.2 rmind * Event typedefs and structs
443 1.3.4.2 rmind *
444 1.3.4.2 rmind ****************************************************************************/
445 1.3.4.2 rmind
446 1.3.4.2 rmind /* Dispatch info for each GPE -- either a method or handler, cannot be both */
447 1.3.4.2 rmind
448 1.3.4.2 rmind typedef struct acpi_gpe_handler_info
449 1.3.4.2 rmind {
450 1.3.4.2 rmind ACPI_GPE_HANDLER Address; /* Address of handler, if any */
451 1.3.4.2 rmind void *Context; /* Context to be passed to handler */
452 1.3.4.2 rmind ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */
453 1.3.4.2 rmind UINT8 OriginalFlags; /* Original (pre-handler) GPE info */
454 1.3.4.2 rmind BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */
455 1.3.4.2 rmind
456 1.3.4.2 rmind } ACPI_GPE_HANDLER_INFO;
457 1.3.4.2 rmind
458 1.3.4.2 rmind /*
459 1.3.4.2 rmind * GPE dispatch info. At any time, the GPE can have at most one type
460 1.3.4.2 rmind * of dispatch - Method, Handler, or Implicit Notify.
461 1.3.4.2 rmind */
462 1.3.4.2 rmind typedef union acpi_gpe_dispatch_info
463 1.3.4.2 rmind {
464 1.3.4.2 rmind ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
465 1.3.4.2 rmind struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */
466 1.3.4.2 rmind ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */
467 1.3.4.2 rmind
468 1.3.4.2 rmind } ACPI_GPE_DISPATCH_INFO;
469 1.3.4.2 rmind
470 1.3.4.2 rmind /*
471 1.3.4.2 rmind * Information about a GPE, one per each GPE in an array.
472 1.3.4.2 rmind * NOTE: Important to keep this struct as small as possible.
473 1.3.4.2 rmind */
474 1.3.4.2 rmind typedef struct acpi_gpe_event_info
475 1.3.4.2 rmind {
476 1.3.4.2 rmind union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */
477 1.3.4.2 rmind struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */
478 1.3.4.2 rmind UINT8 Flags; /* Misc info about this GPE */
479 1.3.4.2 rmind UINT8 GpeNumber; /* This GPE */
480 1.3.4.2 rmind UINT8 RuntimeCount; /* References to a run GPE */
481 1.3.4.2 rmind
482 1.3.4.2 rmind } ACPI_GPE_EVENT_INFO;
483 1.3.4.2 rmind
484 1.3.4.2 rmind /* Information about a GPE register pair, one per each status/enable pair in an array */
485 1.3.4.2 rmind
486 1.3.4.2 rmind typedef struct acpi_gpe_register_info
487 1.3.4.2 rmind {
488 1.3.4.2 rmind ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
489 1.3.4.2 rmind ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
490 1.3.4.2 rmind UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
491 1.3.4.2 rmind UINT8 EnableForRun; /* GPEs to keep enabled when running */
492 1.3.4.2 rmind UINT8 BaseGpeNumber; /* Base GPE number for this register */
493 1.3.4.2 rmind
494 1.3.4.2 rmind } ACPI_GPE_REGISTER_INFO;
495 1.3.4.2 rmind
496 1.3.4.2 rmind /*
497 1.3.4.2 rmind * Information about a GPE register block, one per each installed block --
498 1.3.4.2 rmind * GPE0, GPE1, and one per each installed GPE Block Device.
499 1.3.4.2 rmind */
500 1.3.4.2 rmind typedef struct acpi_gpe_block_info
501 1.3.4.2 rmind {
502 1.3.4.2 rmind ACPI_NAMESPACE_NODE *Node;
503 1.3.4.2 rmind struct acpi_gpe_block_info *Previous;
504 1.3.4.2 rmind struct acpi_gpe_block_info *Next;
505 1.3.4.2 rmind struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
506 1.3.4.2 rmind ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
507 1.3.4.2 rmind ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
508 1.3.4.2 rmind ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
509 1.3.4.2 rmind UINT32 RegisterCount; /* Number of register pairs in block */
510 1.3.4.2 rmind UINT16 GpeCount; /* Number of individual GPEs in block */
511 1.3.4.2 rmind UINT8 BlockBaseNumber;/* Base GPE number for this block */
512 1.3.4.2 rmind BOOLEAN Initialized; /* TRUE if this block is initialized */
513 1.3.4.2 rmind
514 1.3.4.2 rmind } ACPI_GPE_BLOCK_INFO;
515 1.3.4.2 rmind
516 1.3.4.2 rmind /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
517 1.3.4.2 rmind
518 1.3.4.2 rmind typedef struct acpi_gpe_xrupt_info
519 1.3.4.2 rmind {
520 1.3.4.2 rmind struct acpi_gpe_xrupt_info *Previous;
521 1.3.4.2 rmind struct acpi_gpe_xrupt_info *Next;
522 1.3.4.2 rmind ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */
523 1.3.4.2 rmind UINT32 InterruptNumber; /* System interrupt number */
524 1.3.4.2 rmind
525 1.3.4.2 rmind } ACPI_GPE_XRUPT_INFO;
526 1.3.4.2 rmind
527 1.3.4.2 rmind typedef struct acpi_gpe_walk_info
528 1.3.4.2 rmind {
529 1.3.4.2 rmind ACPI_NAMESPACE_NODE *GpeDevice;
530 1.3.4.2 rmind ACPI_GPE_BLOCK_INFO *GpeBlock;
531 1.3.4.2 rmind UINT16 Count;
532 1.3.4.2 rmind ACPI_OWNER_ID OwnerId;
533 1.3.4.2 rmind BOOLEAN ExecuteByOwnerId;
534 1.3.4.2 rmind
535 1.3.4.2 rmind } ACPI_GPE_WALK_INFO;
536 1.3.4.2 rmind
537 1.3.4.2 rmind typedef struct acpi_gpe_device_info
538 1.3.4.2 rmind {
539 1.3.4.2 rmind UINT32 Index;
540 1.3.4.2 rmind UINT32 NextBlockBaseIndex;
541 1.3.4.2 rmind ACPI_STATUS Status;
542 1.3.4.2 rmind ACPI_NAMESPACE_NODE *GpeDevice;
543 1.3.4.2 rmind
544 1.3.4.2 rmind } ACPI_GPE_DEVICE_INFO;
545 1.3.4.2 rmind
546 1.3.4.2 rmind typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
547 1.3.4.2 rmind ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
548 1.3.4.2 rmind ACPI_GPE_BLOCK_INFO *GpeBlock,
549 1.3.4.2 rmind void *Context);
550 1.3.4.2 rmind
551 1.3.4.2 rmind
552 1.3.4.2 rmind /* Information about each particular fixed event */
553 1.3.4.2 rmind
554 1.3.4.2 rmind typedef struct acpi_fixed_event_handler
555 1.3.4.2 rmind {
556 1.3.4.2 rmind ACPI_EVENT_HANDLER Handler; /* Address of handler. */
557 1.3.4.2 rmind void *Context; /* Context to be passed to handler */
558 1.3.4.2 rmind
559 1.3.4.2 rmind } ACPI_FIXED_EVENT_HANDLER;
560 1.3.4.2 rmind
561 1.3.4.2 rmind typedef struct acpi_fixed_event_info
562 1.3.4.2 rmind {
563 1.3.4.2 rmind UINT8 StatusRegisterId;
564 1.3.4.2 rmind UINT8 EnableRegisterId;
565 1.3.4.2 rmind UINT16 StatusBitMask;
566 1.3.4.2 rmind UINT16 EnableBitMask;
567 1.3.4.2 rmind
568 1.3.4.2 rmind } ACPI_FIXED_EVENT_INFO;
569 1.3.4.2 rmind
570 1.3.4.2 rmind /* Information used during field processing */
571 1.3.4.2 rmind
572 1.3.4.2 rmind typedef struct acpi_field_info
573 1.3.4.2 rmind {
574 1.3.4.2 rmind UINT8 SkipField;
575 1.3.4.2 rmind UINT8 FieldFlag;
576 1.3.4.2 rmind UINT32 PkgLength;
577 1.3.4.2 rmind
578 1.3.4.2 rmind } ACPI_FIELD_INFO;
579 1.3.4.2 rmind
580 1.3.4.2 rmind
581 1.3.4.2 rmind /*****************************************************************************
582 1.3.4.2 rmind *
583 1.3.4.2 rmind * Generic "state" object for stacks
584 1.3.4.2 rmind *
585 1.3.4.2 rmind ****************************************************************************/
586 1.3.4.2 rmind
587 1.3.4.2 rmind #define ACPI_CONTROL_NORMAL 0xC0
588 1.3.4.2 rmind #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
589 1.3.4.2 rmind #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
590 1.3.4.2 rmind #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
591 1.3.4.2 rmind #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
592 1.3.4.2 rmind
593 1.3.4.2 rmind
594 1.3.4.2 rmind #define ACPI_STATE_COMMON \
595 1.3.4.2 rmind void *Next; \
596 1.3.4.2 rmind UINT8 DescriptorType; /* To differentiate various internal objs */\
597 1.3.4.2 rmind UINT8 Flags; \
598 1.3.4.2 rmind UINT16 Value; \
599 1.3.4.2 rmind UINT16 State;
600 1.3.4.2 rmind
601 1.3.4.2 rmind /* There are 2 bytes available here until the next natural alignment boundary */
602 1.3.4.2 rmind
603 1.3.4.2 rmind typedef struct acpi_common_state
604 1.3.4.2 rmind {
605 1.3.4.2 rmind ACPI_STATE_COMMON
606 1.3.4.2 rmind } ACPI_COMMON_STATE;
607 1.3.4.2 rmind
608 1.3.4.2 rmind
609 1.3.4.2 rmind /*
610 1.3.4.2 rmind * Update state - used to traverse complex objects such as packages
611 1.3.4.2 rmind */
612 1.3.4.2 rmind typedef struct acpi_update_state
613 1.3.4.2 rmind {
614 1.3.4.2 rmind ACPI_STATE_COMMON
615 1.3.4.2 rmind union acpi_operand_object *Object;
616 1.3.4.2 rmind
617 1.3.4.2 rmind } ACPI_UPDATE_STATE;
618 1.3.4.2 rmind
619 1.3.4.2 rmind
620 1.3.4.2 rmind /*
621 1.3.4.2 rmind * Pkg state - used to traverse nested package structures
622 1.3.4.2 rmind */
623 1.3.4.2 rmind typedef struct acpi_pkg_state
624 1.3.4.2 rmind {
625 1.3.4.2 rmind ACPI_STATE_COMMON
626 1.3.4.2 rmind UINT16 Index;
627 1.3.4.2 rmind union acpi_operand_object *SourceObject;
628 1.3.4.2 rmind union acpi_operand_object *DestObject;
629 1.3.4.2 rmind struct acpi_walk_state *WalkState;
630 1.3.4.2 rmind void *ThisTargetObj;
631 1.3.4.2 rmind UINT32 NumPackages;
632 1.3.4.2 rmind
633 1.3.4.2 rmind } ACPI_PKG_STATE;
634 1.3.4.2 rmind
635 1.3.4.2 rmind
636 1.3.4.2 rmind /*
637 1.3.4.2 rmind * Control state - one per if/else and while constructs.
638 1.3.4.2 rmind * Allows nesting of these constructs
639 1.3.4.2 rmind */
640 1.3.4.2 rmind typedef struct acpi_control_state
641 1.3.4.2 rmind {
642 1.3.4.2 rmind ACPI_STATE_COMMON
643 1.3.4.2 rmind UINT16 Opcode;
644 1.3.4.2 rmind union acpi_parse_object *PredicateOp;
645 1.3.4.2 rmind UINT8 *AmlPredicateStart; /* Start of if/while predicate */
646 1.3.4.2 rmind UINT8 *PackageEnd; /* End of if/while block */
647 1.3.4.2 rmind UINT32 LoopCount; /* While() loop counter */
648 1.3.4.2 rmind
649 1.3.4.2 rmind } ACPI_CONTROL_STATE;
650 1.3.4.2 rmind
651 1.3.4.2 rmind
652 1.3.4.2 rmind /*
653 1.3.4.2 rmind * Scope state - current scope during namespace lookups
654 1.3.4.2 rmind */
655 1.3.4.2 rmind typedef struct acpi_scope_state
656 1.3.4.2 rmind {
657 1.3.4.2 rmind ACPI_STATE_COMMON
658 1.3.4.2 rmind ACPI_NAMESPACE_NODE *Node;
659 1.3.4.2 rmind
660 1.3.4.2 rmind } ACPI_SCOPE_STATE;
661 1.3.4.2 rmind
662 1.3.4.2 rmind
663 1.3.4.2 rmind typedef struct acpi_pscope_state
664 1.3.4.2 rmind {
665 1.3.4.2 rmind ACPI_STATE_COMMON
666 1.3.4.2 rmind UINT32 ArgCount; /* Number of fixed arguments */
667 1.3.4.2 rmind union acpi_parse_object *Op; /* Current op being parsed */
668 1.3.4.2 rmind UINT8 *ArgEnd; /* Current argument end */
669 1.3.4.2 rmind UINT8 *PkgEnd; /* Current package end */
670 1.3.4.2 rmind UINT32 ArgList; /* Next argument to parse */
671 1.3.4.2 rmind
672 1.3.4.2 rmind } ACPI_PSCOPE_STATE;
673 1.3.4.2 rmind
674 1.3.4.2 rmind
675 1.3.4.2 rmind /*
676 1.3.4.2 rmind * Thread state - one per thread across multiple walk states. Multiple walk
677 1.3.4.2 rmind * states are created when there are nested control methods executing.
678 1.3.4.2 rmind */
679 1.3.4.2 rmind typedef struct acpi_thread_state
680 1.3.4.2 rmind {
681 1.3.4.2 rmind ACPI_STATE_COMMON
682 1.3.4.2 rmind UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */
683 1.3.4.2 rmind struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */
684 1.3.4.2 rmind union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */
685 1.3.4.2 rmind ACPI_THREAD_ID ThreadId; /* Running thread ID */
686 1.3.4.2 rmind
687 1.3.4.2 rmind } ACPI_THREAD_STATE;
688 1.3.4.2 rmind
689 1.3.4.2 rmind
690 1.3.4.2 rmind /*
691 1.3.4.2 rmind * Result values - used to accumulate the results of nested
692 1.3.4.2 rmind * AML arguments
693 1.3.4.2 rmind */
694 1.3.4.2 rmind typedef struct acpi_result_values
695 1.3.4.2 rmind {
696 1.3.4.2 rmind ACPI_STATE_COMMON
697 1.3.4.2 rmind union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM];
698 1.3.4.2 rmind
699 1.3.4.2 rmind } ACPI_RESULT_VALUES;
700 1.3.4.2 rmind
701 1.3.4.2 rmind
702 1.3.4.2 rmind typedef
703 1.3.4.2 rmind ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
704 1.3.4.2 rmind struct acpi_walk_state *WalkState,
705 1.3.4.2 rmind union acpi_parse_object **OutOp);
706 1.3.4.2 rmind
707 1.3.4.2 rmind typedef
708 1.3.4.2 rmind ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
709 1.3.4.2 rmind struct acpi_walk_state *WalkState);
710 1.3.4.2 rmind
711 1.3.4.2 rmind
712 1.3.4.2 rmind /*
713 1.3.4.2 rmind * Notify info - used to pass info to the deferred notify
714 1.3.4.2 rmind * handler/dispatcher.
715 1.3.4.2 rmind */
716 1.3.4.2 rmind typedef struct acpi_notify_info
717 1.3.4.2 rmind {
718 1.3.4.2 rmind ACPI_STATE_COMMON
719 1.3.4.2 rmind ACPI_NAMESPACE_NODE *Node;
720 1.3.4.2 rmind union acpi_operand_object *HandlerObj;
721 1.3.4.2 rmind
722 1.3.4.2 rmind } ACPI_NOTIFY_INFO;
723 1.3.4.2 rmind
724 1.3.4.2 rmind
725 1.3.4.2 rmind /* Generic state is union of structs above */
726 1.3.4.2 rmind
727 1.3.4.2 rmind typedef union acpi_generic_state
728 1.3.4.2 rmind {
729 1.3.4.2 rmind ACPI_COMMON_STATE Common;
730 1.3.4.2 rmind ACPI_CONTROL_STATE Control;
731 1.3.4.2 rmind ACPI_UPDATE_STATE Update;
732 1.3.4.2 rmind ACPI_SCOPE_STATE Scope;
733 1.3.4.2 rmind ACPI_PSCOPE_STATE ParseScope;
734 1.3.4.2 rmind ACPI_PKG_STATE Pkg;
735 1.3.4.2 rmind ACPI_THREAD_STATE Thread;
736 1.3.4.2 rmind ACPI_RESULT_VALUES Results;
737 1.3.4.2 rmind ACPI_NOTIFY_INFO Notify;
738 1.3.4.2 rmind
739 1.3.4.2 rmind } ACPI_GENERIC_STATE;
740 1.3.4.2 rmind
741 1.3.4.2 rmind
742 1.3.4.2 rmind /*****************************************************************************
743 1.3.4.2 rmind *
744 1.3.4.2 rmind * Interpreter typedefs and structs
745 1.3.4.2 rmind *
746 1.3.4.2 rmind ****************************************************************************/
747 1.3.4.2 rmind
748 1.3.4.2 rmind typedef
749 1.3.4.2 rmind ACPI_STATUS (*ACPI_EXECUTE_OP) (
750 1.3.4.2 rmind struct acpi_walk_state *WalkState);
751 1.3.4.2 rmind
752 1.3.4.2 rmind
753 1.3.4.2 rmind /*****************************************************************************
754 1.3.4.2 rmind *
755 1.3.4.2 rmind * Parser typedefs and structs
756 1.3.4.2 rmind *
757 1.3.4.2 rmind ****************************************************************************/
758 1.3.4.2 rmind
759 1.3.4.2 rmind /*
760 1.3.4.2 rmind * AML opcode, name, and argument layout
761 1.3.4.2 rmind */
762 1.3.4.2 rmind typedef struct acpi_opcode_info
763 1.3.4.2 rmind {
764 1.3.4.2 rmind #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
765 1.3.4.2 rmind const char *Name; /* Opcode name (disassembler/debug only) */
766 1.3.4.2 rmind #endif
767 1.3.4.2 rmind UINT32 ParseArgs; /* Grammar/Parse time arguments */
768 1.3.4.2 rmind UINT32 RuntimeArgs; /* Interpret time arguments */
769 1.3.4.2 rmind UINT16 Flags; /* Misc flags */
770 1.3.4.2 rmind UINT8 ObjectType; /* Corresponding internal object type */
771 1.3.4.2 rmind UINT8 Class; /* Opcode class */
772 1.3.4.2 rmind UINT8 Type; /* Opcode type */
773 1.3.4.2 rmind
774 1.3.4.2 rmind } ACPI_OPCODE_INFO;
775 1.3.4.2 rmind
776 1.3.4.2 rmind typedef union acpi_parse_value
777 1.3.4.2 rmind {
778 1.3.4.2 rmind UINT64 Integer; /* Integer constant (Up to 64 bits) */
779 1.3.4.2 rmind UINT32 Size; /* bytelist or field size */
780 1.3.4.2 rmind char *String; /* NULL terminated string */
781 1.3.4.2 rmind UINT8 *Buffer; /* buffer or string */
782 1.3.4.2 rmind char *Name; /* NULL terminated string */
783 1.3.4.2 rmind union acpi_parse_object *Arg; /* arguments and contained ops */
784 1.3.4.2 rmind
785 1.3.4.2 rmind } ACPI_PARSE_VALUE;
786 1.3.4.2 rmind
787 1.3.4.2 rmind
788 1.3.4.2 rmind #ifdef ACPI_DISASSEMBLER
789 1.3.4.2 rmind #define ACPI_DISASM_ONLY_MEMBERS(a) a;
790 1.3.4.2 rmind #else
791 1.3.4.2 rmind #define ACPI_DISASM_ONLY_MEMBERS(a)
792 1.3.4.2 rmind #endif
793 1.3.4.2 rmind
794 1.3.4.2 rmind #define ACPI_PARSE_COMMON \
795 1.3.4.2 rmind union acpi_parse_object *Parent; /* Parent op */\
796 1.3.4.2 rmind UINT8 DescriptorType; /* To differentiate various internal objs */\
797 1.3.4.2 rmind UINT8 Flags; /* Type of Op */\
798 1.3.4.2 rmind UINT16 AmlOpcode; /* AML opcode */\
799 1.3.4.2 rmind UINT32 AmlOffset; /* Offset of declaration in AML */\
800 1.3.4.2 rmind union acpi_parse_object *Next; /* Next op */\
801 1.3.4.2 rmind ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\
802 1.3.4.2 rmind ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
803 1.3.4.2 rmind UINT8 ArgListLength; /* Number of elements in the arg list */\
804 1.3.4.2 rmind ACPI_DISASM_ONLY_MEMBERS (\
805 1.3.4.2 rmind UINT8 DisasmFlags; /* Used during AML disassembly */\
806 1.3.4.2 rmind UINT8 DisasmOpcode; /* Subtype used for disassembly */\
807 1.3.4.2 rmind char AmlOpName[16]) /* Op name (debug only) */
808 1.3.4.2 rmind
809 1.3.4.2 rmind
810 1.3.4.2 rmind #define ACPI_DASM_BUFFER 0x00
811 1.3.4.2 rmind #define ACPI_DASM_RESOURCE 0x01
812 1.3.4.2 rmind #define ACPI_DASM_STRING 0x02
813 1.3.4.2 rmind #define ACPI_DASM_UNICODE 0x03
814 1.3.4.2 rmind #define ACPI_DASM_EISAID 0x04
815 1.3.4.2 rmind #define ACPI_DASM_MATCHOP 0x05
816 1.3.4.2 rmind #define ACPI_DASM_LNOT_PREFIX 0x06
817 1.3.4.2 rmind #define ACPI_DASM_LNOT_SUFFIX 0x07
818 1.3.4.2 rmind #define ACPI_DASM_IGNORE 0x08
819 1.3.4.2 rmind
820 1.3.4.2 rmind /*
821 1.3.4.2 rmind * Generic operation (for example: If, While, Store)
822 1.3.4.2 rmind */
823 1.3.4.2 rmind typedef struct acpi_parse_obj_common
824 1.3.4.2 rmind {
825 1.3.4.2 rmind ACPI_PARSE_COMMON
826 1.3.4.2 rmind } ACPI_PARSE_OBJ_COMMON;
827 1.3.4.2 rmind
828 1.3.4.2 rmind
829 1.3.4.2 rmind /*
830 1.3.4.2 rmind * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
831 1.3.4.2 rmind * and bytelists.
832 1.3.4.2 rmind */
833 1.3.4.2 rmind typedef struct acpi_parse_obj_named
834 1.3.4.2 rmind {
835 1.3.4.2 rmind ACPI_PARSE_COMMON
836 1.3.4.2 rmind UINT8 *Path;
837 1.3.4.2 rmind UINT8 *Data; /* AML body or bytelist data */
838 1.3.4.2 rmind UINT32 Length; /* AML length */
839 1.3.4.2 rmind UINT32 Name; /* 4-byte name or zero if no name */
840 1.3.4.2 rmind
841 1.3.4.2 rmind } ACPI_PARSE_OBJ_NAMED;
842 1.3.4.2 rmind
843 1.3.4.2 rmind
844 1.3.4.2 rmind /* This version is used by the iASL compiler only */
845 1.3.4.2 rmind
846 1.3.4.2 rmind #define ACPI_MAX_PARSEOP_NAME 20
847 1.3.4.2 rmind
848 1.3.4.2 rmind typedef struct acpi_parse_obj_asl
849 1.3.4.2 rmind {
850 1.3.4.2 rmind ACPI_PARSE_COMMON
851 1.3.4.2 rmind union acpi_parse_object *Child;
852 1.3.4.2 rmind union acpi_parse_object *ParentMethod;
853 1.3.4.2 rmind char *Filename;
854 1.3.4.2 rmind char *ExternalName;
855 1.3.4.2 rmind char *Namepath;
856 1.3.4.2 rmind char NameSeg[4];
857 1.3.4.2 rmind UINT32 ExtraValue;
858 1.3.4.2 rmind UINT32 Column;
859 1.3.4.2 rmind UINT32 LineNumber;
860 1.3.4.2 rmind UINT32 LogicalLineNumber;
861 1.3.4.2 rmind UINT32 LogicalByteOffset;
862 1.3.4.2 rmind UINT32 EndLine;
863 1.3.4.2 rmind UINT32 EndLogicalLine;
864 1.3.4.2 rmind UINT32 AcpiBtype;
865 1.3.4.2 rmind UINT32 AmlLength;
866 1.3.4.2 rmind UINT32 AmlSubtreeLength;
867 1.3.4.2 rmind UINT32 FinalAmlLength;
868 1.3.4.2 rmind UINT32 FinalAmlOffset;
869 1.3.4.2 rmind UINT32 CompileFlags;
870 1.3.4.2 rmind UINT16 ParseOpcode;
871 1.3.4.2 rmind UINT8 AmlOpcodeLength;
872 1.3.4.2 rmind UINT8 AmlPkgLenBytes;
873 1.3.4.2 rmind UINT8 Extra;
874 1.3.4.2 rmind char ParseOpName[ACPI_MAX_PARSEOP_NAME];
875 1.3.4.2 rmind
876 1.3.4.2 rmind } ACPI_PARSE_OBJ_ASL;
877 1.3.4.2 rmind
878 1.3.4.2 rmind typedef union acpi_parse_object
879 1.3.4.2 rmind {
880 1.3.4.2 rmind ACPI_PARSE_OBJ_COMMON Common;
881 1.3.4.2 rmind ACPI_PARSE_OBJ_NAMED Named;
882 1.3.4.2 rmind ACPI_PARSE_OBJ_ASL Asl;
883 1.3.4.2 rmind
884 1.3.4.2 rmind } ACPI_PARSE_OBJECT;
885 1.3.4.2 rmind
886 1.3.4.2 rmind
887 1.3.4.2 rmind /*
888 1.3.4.2 rmind * Parse state - one state per parser invocation and each control
889 1.3.4.2 rmind * method.
890 1.3.4.2 rmind */
891 1.3.4.2 rmind typedef struct acpi_parse_state
892 1.3.4.2 rmind {
893 1.3.4.2 rmind UINT8 *AmlStart; /* First AML byte */
894 1.3.4.2 rmind UINT8 *Aml; /* Next AML byte */
895 1.3.4.2 rmind UINT8 *AmlEnd; /* (last + 1) AML byte */
896 1.3.4.2 rmind UINT8 *PkgStart; /* Current package begin */
897 1.3.4.2 rmind UINT8 *PkgEnd; /* Current package end */
898 1.3.4.2 rmind union acpi_parse_object *StartOp; /* Root of parse tree */
899 1.3.4.2 rmind struct acpi_namespace_node *StartNode;
900 1.3.4.2 rmind union acpi_generic_state *Scope; /* Current scope */
901 1.3.4.2 rmind union acpi_parse_object *StartScope;
902 1.3.4.2 rmind UINT32 AmlSize;
903 1.3.4.2 rmind
904 1.3.4.2 rmind } ACPI_PARSE_STATE;
905 1.3.4.2 rmind
906 1.3.4.2 rmind
907 1.3.4.2 rmind /* Parse object flags */
908 1.3.4.2 rmind
909 1.3.4.2 rmind #define ACPI_PARSEOP_GENERIC 0x01
910 1.3.4.2 rmind #define ACPI_PARSEOP_NAMED 0x02
911 1.3.4.2 rmind #define ACPI_PARSEOP_DEFERRED 0x04
912 1.3.4.2 rmind #define ACPI_PARSEOP_BYTELIST 0x08
913 1.3.4.2 rmind #define ACPI_PARSEOP_IN_STACK 0x10
914 1.3.4.2 rmind #define ACPI_PARSEOP_TARGET 0x20
915 1.3.4.2 rmind #define ACPI_PARSEOP_IN_CACHE 0x80
916 1.3.4.2 rmind
917 1.3.4.2 rmind /* Parse object DisasmFlags */
918 1.3.4.2 rmind
919 1.3.4.2 rmind #define ACPI_PARSEOP_IGNORE 0x01
920 1.3.4.2 rmind #define ACPI_PARSEOP_PARAMLIST 0x02
921 1.3.4.2 rmind #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
922 1.3.4.2 rmind #define ACPI_PARSEOP_SPECIAL 0x10
923 1.3.4.2 rmind
924 1.3.4.2 rmind
925 1.3.4.2 rmind /*****************************************************************************
926 1.3.4.2 rmind *
927 1.3.4.2 rmind * Hardware (ACPI registers) and PNP
928 1.3.4.2 rmind *
929 1.3.4.2 rmind ****************************************************************************/
930 1.3.4.2 rmind
931 1.3.4.2 rmind typedef struct acpi_bit_register_info
932 1.3.4.2 rmind {
933 1.3.4.2 rmind UINT8 ParentRegister;
934 1.3.4.2 rmind UINT8 BitPosition;
935 1.3.4.2 rmind UINT16 AccessBitMask;
936 1.3.4.2 rmind
937 1.3.4.2 rmind } ACPI_BIT_REGISTER_INFO;
938 1.3.4.2 rmind
939 1.3.4.2 rmind
940 1.3.4.2 rmind /*
941 1.3.4.2 rmind * Some ACPI registers have bits that must be ignored -- meaning that they
942 1.3.4.2 rmind * must be preserved.
943 1.3.4.2 rmind */
944 1.3.4.2 rmind #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */
945 1.3.4.2 rmind
946 1.3.4.2 rmind /* Write-only bits must be zeroed by software */
947 1.3.4.2 rmind
948 1.3.4.2 rmind #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */
949 1.3.4.2 rmind
950 1.3.4.2 rmind /* For control registers, both ignored and reserved bits must be preserved */
951 1.3.4.2 rmind
952 1.3.4.2 rmind /*
953 1.3.4.2 rmind * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
954 1.3.4.2 rmind * ACPI specification to be a "preserved" bit - "OSPM always preserves this
955 1.3.4.2 rmind * bit position", section 4.7.3.2.1. However, on some machines the OS must
956 1.3.4.2 rmind * write a one to this bit after resume for the machine to work properly.
957 1.3.4.2 rmind * To enable this, we no longer attempt to preserve this bit. No machines
958 1.3.4.2 rmind * are known to fail if the bit is not preserved. (May 2009)
959 1.3.4.2 rmind */
960 1.3.4.2 rmind #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */
961 1.3.4.2 rmind #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
962 1.3.4.2 rmind #define ACPI_PM1_CONTROL_PRESERVED_BITS \
963 1.3.4.2 rmind (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
964 1.3.4.2 rmind
965 1.3.4.2 rmind #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */
966 1.3.4.2 rmind
967 1.3.4.2 rmind /*
968 1.3.4.2 rmind * Register IDs
969 1.3.4.2 rmind * These are the full ACPI registers
970 1.3.4.2 rmind */
971 1.3.4.2 rmind #define ACPI_REGISTER_PM1_STATUS 0x01
972 1.3.4.2 rmind #define ACPI_REGISTER_PM1_ENABLE 0x02
973 1.3.4.2 rmind #define ACPI_REGISTER_PM1_CONTROL 0x03
974 1.3.4.2 rmind #define ACPI_REGISTER_PM2_CONTROL 0x04
975 1.3.4.2 rmind #define ACPI_REGISTER_PM_TIMER 0x05
976 1.3.4.2 rmind #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06
977 1.3.4.2 rmind #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07
978 1.3.4.2 rmind
979 1.3.4.2 rmind
980 1.3.4.2 rmind /* Masks used to access the BitRegisters */
981 1.3.4.2 rmind
982 1.3.4.2 rmind #define ACPI_BITMASK_TIMER_STATUS 0x0001
983 1.3.4.2 rmind #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
984 1.3.4.2 rmind #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
985 1.3.4.2 rmind #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
986 1.3.4.2 rmind #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
987 1.3.4.2 rmind #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
988 1.3.4.2 rmind #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
989 1.3.4.2 rmind #define ACPI_BITMASK_WAKE_STATUS 0x8000
990 1.3.4.2 rmind
991 1.3.4.2 rmind #define ACPI_BITMASK_ALL_FIXED_STATUS (\
992 1.3.4.2 rmind ACPI_BITMASK_TIMER_STATUS | \
993 1.3.4.2 rmind ACPI_BITMASK_BUS_MASTER_STATUS | \
994 1.3.4.2 rmind ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
995 1.3.4.2 rmind ACPI_BITMASK_POWER_BUTTON_STATUS | \
996 1.3.4.2 rmind ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
997 1.3.4.2 rmind ACPI_BITMASK_RT_CLOCK_STATUS | \
998 1.3.4.2 rmind ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
999 1.3.4.2 rmind ACPI_BITMASK_WAKE_STATUS)
1000 1.3.4.2 rmind
1001 1.3.4.2 rmind #define ACPI_BITMASK_TIMER_ENABLE 0x0001
1002 1.3.4.2 rmind #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
1003 1.3.4.2 rmind #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
1004 1.3.4.2 rmind #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
1005 1.3.4.2 rmind #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
1006 1.3.4.2 rmind #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
1007 1.3.4.2 rmind
1008 1.3.4.2 rmind #define ACPI_BITMASK_SCI_ENABLE 0x0001
1009 1.3.4.2 rmind #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
1010 1.3.4.2 rmind #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
1011 1.3.4.2 rmind #define ACPI_BITMASK_SLEEP_TYPE 0x1C00
1012 1.3.4.2 rmind #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
1013 1.3.4.2 rmind
1014 1.3.4.2 rmind #define ACPI_BITMASK_ARB_DISABLE 0x0001
1015 1.3.4.2 rmind
1016 1.3.4.2 rmind
1017 1.3.4.2 rmind /* Raw bit position of each BitRegister */
1018 1.3.4.2 rmind
1019 1.3.4.2 rmind #define ACPI_BITPOSITION_TIMER_STATUS 0x00
1020 1.3.4.2 rmind #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
1021 1.3.4.2 rmind #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
1022 1.3.4.2 rmind #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
1023 1.3.4.2 rmind #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
1024 1.3.4.2 rmind #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
1025 1.3.4.2 rmind #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
1026 1.3.4.2 rmind #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
1027 1.3.4.2 rmind
1028 1.3.4.2 rmind #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
1029 1.3.4.2 rmind #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
1030 1.3.4.2 rmind #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
1031 1.3.4.2 rmind #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
1032 1.3.4.2 rmind #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
1033 1.3.4.2 rmind #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
1034 1.3.4.2 rmind
1035 1.3.4.2 rmind #define ACPI_BITPOSITION_SCI_ENABLE 0x00
1036 1.3.4.2 rmind #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
1037 1.3.4.2 rmind #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
1038 1.3.4.2 rmind #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A
1039 1.3.4.2 rmind #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
1040 1.3.4.2 rmind
1041 1.3.4.2 rmind #define ACPI_BITPOSITION_ARB_DISABLE 0x00
1042 1.3.4.2 rmind
1043 1.3.4.2 rmind
1044 1.3.4.2 rmind /* Structs and definitions for _OSI support and I/O port validation */
1045 1.3.4.2 rmind
1046 1.3.4.2 rmind #define ACPI_OSI_WIN_2000 0x01
1047 1.3.4.2 rmind #define ACPI_OSI_WIN_XP 0x02
1048 1.3.4.2 rmind #define ACPI_OSI_WIN_XP_SP1 0x03
1049 1.3.4.2 rmind #define ACPI_OSI_WINSRV_2003 0x04
1050 1.3.4.2 rmind #define ACPI_OSI_WIN_XP_SP2 0x05
1051 1.3.4.2 rmind #define ACPI_OSI_WINSRV_2003_SP1 0x06
1052 1.3.4.2 rmind #define ACPI_OSI_WIN_VISTA 0x07
1053 1.3.4.2 rmind #define ACPI_OSI_WINSRV_2008 0x08
1054 1.3.4.2 rmind #define ACPI_OSI_WIN_VISTA_SP1 0x09
1055 1.3.4.2 rmind #define ACPI_OSI_WIN_VISTA_SP2 0x0A
1056 1.3.4.2 rmind #define ACPI_OSI_WIN_7 0x0B
1057 1.3.4.2 rmind
1058 1.3.4.2 rmind #define ACPI_ALWAYS_ILLEGAL 0x00
1059 1.3.4.2 rmind
1060 1.3.4.2 rmind typedef struct acpi_interface_info
1061 1.3.4.2 rmind {
1062 1.3.4.2 rmind char *Name;
1063 1.3.4.2 rmind struct acpi_interface_info *Next;
1064 1.3.4.2 rmind UINT8 Flags;
1065 1.3.4.2 rmind UINT8 Value;
1066 1.3.4.2 rmind
1067 1.3.4.2 rmind } ACPI_INTERFACE_INFO;
1068 1.3.4.2 rmind
1069 1.3.4.2 rmind #define ACPI_OSI_INVALID 0x01
1070 1.3.4.2 rmind #define ACPI_OSI_DYNAMIC 0x02
1071 1.3.4.2 rmind
1072 1.3.4.2 rmind typedef struct acpi_port_info
1073 1.3.4.2 rmind {
1074 1.3.4.2 rmind const char *Name;
1075 1.3.4.2 rmind UINT16 Start;
1076 1.3.4.2 rmind UINT16 End;
1077 1.3.4.2 rmind UINT8 OsiDependency;
1078 1.3.4.2 rmind
1079 1.3.4.2 rmind } ACPI_PORT_INFO;
1080 1.3.4.2 rmind
1081 1.3.4.2 rmind
1082 1.3.4.2 rmind /*****************************************************************************
1083 1.3.4.2 rmind *
1084 1.3.4.2 rmind * Resource descriptors
1085 1.3.4.2 rmind *
1086 1.3.4.2 rmind ****************************************************************************/
1087 1.3.4.2 rmind
1088 1.3.4.2 rmind /* ResourceType values */
1089 1.3.4.2 rmind
1090 1.3.4.2 rmind #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
1091 1.3.4.2 rmind #define ACPI_ADDRESS_TYPE_IO_RANGE 1
1092 1.3.4.2 rmind #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
1093 1.3.4.2 rmind
1094 1.3.4.2 rmind /* Resource descriptor types and masks */
1095 1.3.4.2 rmind
1096 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_LARGE 0x80
1097 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_SMALL 0x00
1098 1.3.4.2 rmind
1099 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
1100 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
1101 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
1102 1.3.4.2 rmind
1103 1.3.4.2 rmind
1104 1.3.4.2 rmind /*
1105 1.3.4.2 rmind * Small resource descriptor "names" as defined by the ACPI specification.
1106 1.3.4.2 rmind * Note: Bits 2:0 are used for the descriptor length
1107 1.3.4.2 rmind */
1108 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_IRQ 0x20
1109 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_DMA 0x28
1110 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
1111 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
1112 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_IO 0x40
1113 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_FIXED_IO 0x48
1114 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
1115 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
1116 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
1117 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
1118 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
1119 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_END_TAG 0x78
1120 1.3.4.2 rmind
1121 1.3.4.2 rmind /*
1122 1.3.4.2 rmind * Large resource descriptor "names" as defined by the ACPI specification.
1123 1.3.4.2 rmind * Note: includes the Large Descriptor bit in bit[7]
1124 1.3.4.2 rmind */
1125 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_MEMORY24 0x81
1126 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
1127 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
1128 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
1129 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_MEMORY32 0x85
1130 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
1131 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_ADDRESS32 0x87
1132 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_ADDRESS16 0x88
1133 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
1134 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
1135 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
1136 1.3.4.2 rmind #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
1137 1.3.4.2 rmind
1138 1.3.4.2 rmind
1139 1.3.4.2 rmind /*****************************************************************************
1140 1.3.4.2 rmind *
1141 1.3.4.2 rmind * Miscellaneous
1142 1.3.4.2 rmind *
1143 1.3.4.2 rmind ****************************************************************************/
1144 1.3.4.2 rmind
1145 1.3.4.2 rmind #define ACPI_ASCII_ZERO 0x30
1146 1.3.4.2 rmind
1147 1.3.4.2 rmind
1148 1.3.4.2 rmind /*****************************************************************************
1149 1.3.4.2 rmind *
1150 1.3.4.2 rmind * Disassembler
1151 1.3.4.2 rmind *
1152 1.3.4.2 rmind ****************************************************************************/
1153 1.3.4.2 rmind
1154 1.3.4.2 rmind typedef struct acpi_external_list
1155 1.3.4.2 rmind {
1156 1.3.4.2 rmind char *Path;
1157 1.3.4.2 rmind char *InternalPath;
1158 1.3.4.2 rmind struct acpi_external_list *Next;
1159 1.3.4.2 rmind UINT32 Value;
1160 1.3.4.2 rmind UINT16 Length;
1161 1.3.4.2 rmind UINT8 Type;
1162 1.3.4.2 rmind UINT8 Flags;
1163 1.3.4.2 rmind
1164 1.3.4.2 rmind } ACPI_EXTERNAL_LIST;
1165 1.3.4.2 rmind
1166 1.3.4.2 rmind /* Values for Flags field above */
1167 1.3.4.2 rmind
1168 1.3.4.2 rmind #define ACPI_IPATH_ALLOCATED 0x01
1169 1.3.4.2 rmind
1170 1.3.4.2 rmind
1171 1.3.4.2 rmind typedef struct acpi_external_file
1172 1.3.4.2 rmind {
1173 1.3.4.2 rmind char *Path;
1174 1.3.4.2 rmind struct acpi_external_file *Next;
1175 1.3.4.2 rmind
1176 1.3.4.2 rmind } ACPI_EXTERNAL_FILE;
1177 1.3.4.2 rmind
1178 1.3.4.2 rmind
1179 1.3.4.2 rmind /*****************************************************************************
1180 1.3.4.2 rmind *
1181 1.3.4.2 rmind * Debugger
1182 1.3.4.2 rmind *
1183 1.3.4.2 rmind ****************************************************************************/
1184 1.3.4.2 rmind
1185 1.3.4.2 rmind typedef struct acpi_db_method_info
1186 1.3.4.2 rmind {
1187 1.3.4.2 rmind ACPI_HANDLE MainThreadGate;
1188 1.3.4.2 rmind ACPI_HANDLE ThreadCompleteGate;
1189 1.3.4.2 rmind ACPI_HANDLE InfoGate;
1190 1.3.4.2 rmind ACPI_THREAD_ID *Threads;
1191 1.3.4.2 rmind UINT32 NumThreads;
1192 1.3.4.2 rmind UINT32 NumCreated;
1193 1.3.4.2 rmind UINT32 NumCompleted;
1194 1.3.4.2 rmind
1195 1.3.4.2 rmind char *Name;
1196 1.3.4.2 rmind UINT32 Flags;
1197 1.3.4.2 rmind UINT32 NumLoops;
1198 1.3.4.2 rmind char Pathname[128];
1199 1.3.4.2 rmind char **Args;
1200 1.3.4.2 rmind
1201 1.3.4.2 rmind /*
1202 1.3.4.2 rmind * Arguments to be passed to method for the command
1203 1.3.4.2 rmind * Threads -
1204 1.3.4.2 rmind * the Number of threads, ID of current thread and
1205 1.3.4.2 rmind * Index of current thread inside all them created.
1206 1.3.4.2 rmind */
1207 1.3.4.2 rmind char InitArgs;
1208 1.3.4.2 rmind char *Arguments[4];
1209 1.3.4.2 rmind char NumThreadsStr[11];
1210 1.3.4.2 rmind char IdOfThreadStr[11];
1211 1.3.4.2 rmind char IndexOfThreadStr[11];
1212 1.3.4.2 rmind
1213 1.3.4.2 rmind } ACPI_DB_METHOD_INFO;
1214 1.3.4.2 rmind
1215 1.3.4.2 rmind typedef struct acpi_integrity_info
1216 1.3.4.2 rmind {
1217 1.3.4.2 rmind UINT32 Nodes;
1218 1.3.4.2 rmind UINT32 Objects;
1219 1.3.4.2 rmind
1220 1.3.4.2 rmind } ACPI_INTEGRITY_INFO;
1221 1.3.4.2 rmind
1222 1.3.4.2 rmind
1223 1.3.4.2 rmind #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1224 1.3.4.2 rmind #define ACPI_DB_CONSOLE_OUTPUT 0x02
1225 1.3.4.2 rmind #define ACPI_DB_DUPLICATE_OUTPUT 0x03
1226 1.3.4.2 rmind
1227 1.3.4.2 rmind
1228 1.3.4.2 rmind /*****************************************************************************
1229 1.3.4.2 rmind *
1230 1.3.4.2 rmind * Debug
1231 1.3.4.2 rmind *
1232 1.3.4.2 rmind ****************************************************************************/
1233 1.3.4.2 rmind
1234 1.3.4.2 rmind /* Entry for a memory allocation (debug only) */
1235 1.3.4.2 rmind
1236 1.3.4.2 rmind #define ACPI_MEM_MALLOC 0
1237 1.3.4.2 rmind #define ACPI_MEM_CALLOC 1
1238 1.3.4.2 rmind #define ACPI_MAX_MODULE_NAME 16
1239 1.3.4.2 rmind
1240 1.3.4.2 rmind #define ACPI_COMMON_DEBUG_MEM_HEADER \
1241 1.3.4.2 rmind struct acpi_debug_mem_block *Previous; \
1242 1.3.4.2 rmind struct acpi_debug_mem_block *Next; \
1243 1.3.4.2 rmind UINT32 Size; \
1244 1.3.4.2 rmind UINT32 Component; \
1245 1.3.4.2 rmind UINT32 Line; \
1246 1.3.4.2 rmind char Module[ACPI_MAX_MODULE_NAME]; \
1247 1.3.4.2 rmind UINT8 AllocType;
1248 1.3.4.2 rmind
1249 1.3.4.2 rmind typedef struct acpi_debug_mem_header
1250 1.3.4.2 rmind {
1251 1.3.4.2 rmind ACPI_COMMON_DEBUG_MEM_HEADER
1252 1.3.4.2 rmind
1253 1.3.4.2 rmind } ACPI_DEBUG_MEM_HEADER;
1254 1.3.4.2 rmind
1255 1.3.4.2 rmind typedef struct acpi_debug_mem_block
1256 1.3.4.2 rmind {
1257 1.3.4.2 rmind ACPI_COMMON_DEBUG_MEM_HEADER
1258 1.3.4.2 rmind UINT64 UserSpace;
1259 1.3.4.2 rmind
1260 1.3.4.2 rmind } ACPI_DEBUG_MEM_BLOCK;
1261 1.3.4.2 rmind
1262 1.3.4.2 rmind
1263 1.3.4.2 rmind #define ACPI_MEM_LIST_GLOBAL 0
1264 1.3.4.2 rmind #define ACPI_MEM_LIST_NSNODE 1
1265 1.3.4.2 rmind #define ACPI_MEM_LIST_MAX 1
1266 1.3.4.2 rmind #define ACPI_NUM_MEM_LISTS 2
1267 1.3.4.2 rmind
1268 1.3.4.2 rmind
1269 1.3.4.2 rmind #endif /* __ACLOCAL_H__ */
1270