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