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