checkdirs() was being passed the wrong mount point, resulting in a panic
[dragonfly.git] / sys / contrib / dev / acpica-unix-20050309 / include / aclocal.h
blob1eb4794959bad0ff687656d8c8b107de221e98ff
1 /******************************************************************************
3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
4 * $Revision: 205 $
6 *****************************************************************************/
8 /******************************************************************************
10 * 1. Copyright Notice
12 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13 * All rights reserved.
15 * 2. License
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
41 * 3. Conditions
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
117 #ifndef __ACLOCAL_H__
118 #define __ACLOCAL_H__
121 #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */
123 typedef void * ACPI_MUTEX;
124 typedef UINT32 ACPI_MUTEX_HANDLE;
127 /* Total number of aml opcodes defined */
129 #define AML_NUM_OPCODES 0x7F
132 /*****************************************************************************
134 * Mutex typedefs and structs
136 ****************************************************************************/
140 * Predefined handles for the mutex objects used within the subsystem
141 * All mutex objects are automatically created by AcpiUtMutexInitialize.
143 * The acquire/release ordering protocol is implied via this list. Mutexes
144 * with a lower value must be acquired before mutexes with a higher value.
146 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames table also!
149 #define ACPI_MTX_EXECUTE 0
150 #define ACPI_MTX_INTERPRETER 1
151 #define ACPI_MTX_PARSER 2
152 #define ACPI_MTX_DISPATCHER 3
153 #define ACPI_MTX_TABLES 4
154 #define ACPI_MTX_OP_REGIONS 5
155 #define ACPI_MTX_NAMESPACE 6
156 #define ACPI_MTX_EVENTS 7
157 #define ACPI_MTX_HARDWARE 8
158 #define ACPI_MTX_CACHES 9
159 #define ACPI_MTX_MEMORY 10
160 #define ACPI_MTX_DEBUG_CMD_COMPLETE 11
161 #define ACPI_MTX_DEBUG_CMD_READY 12
163 #define MAX_MUTEX 12
164 #define NUM_MUTEX MAX_MUTEX+1
167 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
168 #ifdef DEFINE_ACPI_GLOBALS
170 /* Names for the mutexes used in the subsystem */
172 static char *AcpiGbl_MutexNames[] =
174 "ACPI_MTX_Execute",
175 "ACPI_MTX_Interpreter",
176 "ACPI_MTX_Parser",
177 "ACPI_MTX_Dispatcher",
178 "ACPI_MTX_Tables",
179 "ACPI_MTX_OpRegions",
180 "ACPI_MTX_Namespace",
181 "ACPI_MTX_Events",
182 "ACPI_MTX_Hardware",
183 "ACPI_MTX_Caches",
184 "ACPI_MTX_Memory",
185 "ACPI_MTX_DebugCmdComplete",
186 "ACPI_MTX_DebugCmdReady",
189 #endif
190 #endif
193 /* Table for the global mutexes */
195 typedef struct acpi_mutex_info
197 ACPI_MUTEX Mutex;
198 UINT32 UseCount;
199 UINT32 OwnerId;
201 } ACPI_MUTEX_INFO;
203 /* This owner ID means that the mutex is not in use (unlocked) */
205 #define ACPI_MUTEX_NOT_ACQUIRED (UINT32) (-1)
208 /* Lock flag parameter for various interfaces */
210 #define ACPI_MTX_DO_NOT_LOCK 0
211 #define ACPI_MTX_LOCK 1
214 typedef UINT16 ACPI_OWNER_ID;
215 #define ACPI_OWNER_TYPE_TABLE 0x0
216 #define ACPI_OWNER_TYPE_METHOD 0x1
217 #define ACPI_FIRST_METHOD_ID 0x0001
218 #define ACPI_FIRST_TABLE_ID 0xF000
221 /* Field access granularities */
223 #define ACPI_FIELD_BYTE_GRANULARITY 1
224 #define ACPI_FIELD_WORD_GRANULARITY 2
225 #define ACPI_FIELD_DWORD_GRANULARITY 4
226 #define ACPI_FIELD_QWORD_GRANULARITY 8
228 /*****************************************************************************
230 * Namespace typedefs and structs
232 ****************************************************************************/
235 /* Operational modes of the AML interpreter/scanner */
237 typedef enum
239 ACPI_IMODE_LOAD_PASS1 = 0x01,
240 ACPI_IMODE_LOAD_PASS2 = 0x02,
241 ACPI_IMODE_EXECUTE = 0x0E
243 } ACPI_INTERPRETER_MODE;
247 * The Node describes a named object that appears in the AML
248 * An AcpiNode is used to store Nodes.
250 * DataType is used to differentiate between internal descriptors, and MUST
251 * be the first byte in this structure.
254 typedef union acpi_name_union
256 UINT32 Integer;
257 char Ascii[4];
259 } ACPI_NAME_UNION;
261 typedef struct acpi_namespace_node
263 UINT8 Descriptor; /* Used to differentiate object descriptor types */
264 UINT8 Type; /* Type associated with this name */
265 UINT16 OwnerId;
266 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
267 union acpi_operand_object *Object; /* Pointer to attached ACPI object (optional) */
268 struct acpi_namespace_node *Child; /* First child */
269 struct acpi_namespace_node *Peer; /* Next peer*/
270 UINT16 ReferenceCount; /* Current count of references and children */
271 UINT8 Flags;
273 } ACPI_NAMESPACE_NODE;
276 #define ACPI_ENTRY_NOT_FOUND NULL
279 /* Node flags */
281 #define ANOBJ_RESERVED 0x01
282 #define ANOBJ_END_OF_PEER_LIST 0x02
283 #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
284 #define ANOBJ_METHOD_ARG 0x08
285 #define ANOBJ_METHOD_LOCAL 0x10
286 #define ANOBJ_METHOD_NO_RETVAL 0x20
287 #define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
288 #define ANOBJ_IS_BIT_OFFSET 0x80
291 * ACPI Table Descriptor. One per ACPI table
293 typedef struct acpi_table_desc
295 struct acpi_table_desc *Prev;
296 struct acpi_table_desc *Next;
297 struct acpi_table_desc *InstalledDesc;
298 ACPI_TABLE_HEADER *Pointer;
299 UINT8 *AmlStart;
300 UINT64 PhysicalAddress;
301 UINT32 AmlLength;
302 ACPI_SIZE Length;
303 ACPI_OWNER_ID TableId;
304 UINT8 Type;
305 UINT8 Allocation;
306 BOOLEAN LoadedIntoNamespace;
308 } ACPI_TABLE_DESC;
310 typedef struct acpi_table_list
312 struct acpi_table_desc *Next;
313 UINT32 Count;
315 } ACPI_TABLE_LIST;
318 typedef struct acpi_find_context
320 char *SearchFor;
321 ACPI_HANDLE *List;
322 UINT32 *Count;
324 } ACPI_FIND_CONTEXT;
327 typedef struct acpi_ns_search_data
329 ACPI_NAMESPACE_NODE *Node;
331 } ACPI_NS_SEARCH_DATA;
335 * Predefined Namespace items
337 typedef struct acpi_predefined_names
339 char *Name;
340 UINT8 Type;
341 char *Val;
343 } ACPI_PREDEFINED_NAMES;
346 /* Object types used during package copies */
349 #define ACPI_COPY_TYPE_SIMPLE 0
350 #define ACPI_COPY_TYPE_PACKAGE 1
352 /* Info structure used to convert external<->internal namestrings */
354 typedef struct acpi_namestring_info
356 char *ExternalName;
357 char *NextExternalChar;
358 char *InternalName;
359 UINT32 Length;
360 UINT32 NumSegments;
361 UINT32 NumCarats;
362 BOOLEAN FullyQualified;
364 } ACPI_NAMESTRING_INFO;
367 /* Field creation info */
369 typedef struct acpi_create_field_info
371 ACPI_NAMESPACE_NODE *RegionNode;
372 ACPI_NAMESPACE_NODE *FieldNode;
373 ACPI_NAMESPACE_NODE *RegisterNode;
374 ACPI_NAMESPACE_NODE *DataRegisterNode;
375 UINT32 BankValue;
376 UINT32 FieldBitPosition;
377 UINT32 FieldBitLength;
378 UINT8 FieldFlags;
379 UINT8 Attribute;
380 UINT8 FieldType;
382 } ACPI_CREATE_FIELD_INFO;
385 /*****************************************************************************
387 * Event typedefs and structs
389 ****************************************************************************/
391 /* Dispatch info for each GPE -- either a method or handler, cannot be both */
393 typedef struct acpi_handler_info
395 ACPI_EVENT_HANDLER Address; /* Address of handler, if any */
396 void *Context; /* Context to be passed to handler */
397 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */
399 } ACPI_HANDLER_INFO;
401 typedef union acpi_gpe_dispatch_info
403 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
404 struct acpi_handler_info *Handler;
406 } ACPI_GPE_DISPATCH_INFO;
409 * Information about a GPE, one per each GPE in an array.
410 * NOTE: Important to keep this struct as small as possible.
412 typedef struct acpi_gpe_event_info
414 union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */
415 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */
416 UINT8 Flags; /* Misc info about this GPE */
417 UINT8 RegisterBit; /* This GPE bit within the register */
419 } ACPI_GPE_EVENT_INFO;
421 /* Information about a GPE register pair, one per each status/enable pair in an array */
423 typedef struct acpi_gpe_register_info
425 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
426 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
427 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
428 UINT8 EnableForRun; /* GPEs to keep enabled when running */
429 UINT8 BaseGpeNumber; /* Base GPE number for this register */
431 } ACPI_GPE_REGISTER_INFO;
434 * Information about a GPE register block, one per each installed block --
435 * GPE0, GPE1, and one per each installed GPE Block Device.
437 typedef struct acpi_gpe_block_info
439 ACPI_NAMESPACE_NODE *Node;
440 struct acpi_gpe_block_info *Previous;
441 struct acpi_gpe_block_info *Next;
442 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
443 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
444 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
445 ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
446 UINT32 RegisterCount; /* Number of register pairs in block */
447 UINT8 BlockBaseNumber;/* Base GPE number for this block */
449 } ACPI_GPE_BLOCK_INFO;
451 /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
453 typedef struct acpi_gpe_xrupt_info
455 struct acpi_gpe_xrupt_info *Previous;
456 struct acpi_gpe_xrupt_info *Next;
457 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */
458 UINT32 InterruptLevel; /* System interrupt level */
460 } ACPI_GPE_XRUPT_INFO;
463 typedef struct acpi_gpe_walk_info
465 ACPI_NAMESPACE_NODE *GpeDevice;
466 ACPI_GPE_BLOCK_INFO *GpeBlock;
468 } ACPI_GPE_WALK_INFO;
471 typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
472 ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
473 ACPI_GPE_BLOCK_INFO *GpeBlock);
476 /* Information about each particular fixed event */
478 typedef struct acpi_fixed_event_handler
480 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
481 void *Context; /* Context to be passed to handler */
483 } ACPI_FIXED_EVENT_HANDLER;
485 typedef struct acpi_fixed_event_info
487 UINT8 StatusRegisterId;
488 UINT8 EnableRegisterId;
489 UINT16 StatusBitMask;
490 UINT16 EnableBitMask;
492 } ACPI_FIXED_EVENT_INFO;
494 /* Information used during field processing */
496 typedef struct acpi_field_info
498 UINT8 SkipField;
499 UINT8 FieldFlag;
500 UINT32 PkgLength;
502 } ACPI_FIELD_INFO;
505 /*****************************************************************************
507 * Generic "state" object for stacks
509 ****************************************************************************/
512 #define ACPI_CONTROL_NORMAL 0xC0
513 #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
514 #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
515 #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
516 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
519 /* Forward declarations */
520 struct acpi_walk_state;
521 struct acpi_obj_mutex;
522 union acpi_parse_object;
525 #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
526 UINT8 DataType; /* To differentiate various internal objs */\
527 UINT8 Flags; \
528 UINT16 Value; \
529 UINT16 State; \
530 UINT16 Reserved; \
531 void *Next; \
533 typedef struct acpi_common_state
535 ACPI_STATE_COMMON
536 } ACPI_COMMON_STATE;
540 * Update state - used to traverse complex objects such as packages
542 typedef struct acpi_update_state
544 ACPI_STATE_COMMON
545 union acpi_operand_object *Object;
547 } ACPI_UPDATE_STATE;
551 * Pkg state - used to traverse nested package structures
553 typedef struct acpi_pkg_state
555 ACPI_STATE_COMMON
556 union acpi_operand_object *SourceObject;
557 union acpi_operand_object *DestObject;
558 struct acpi_walk_state *WalkState;
559 void *ThisTargetObj;
560 UINT32 NumPackages;
561 UINT16 Index;
563 } ACPI_PKG_STATE;
567 * Control state - one per if/else and while constructs.
568 * Allows nesting of these constructs
570 typedef struct acpi_control_state
572 ACPI_STATE_COMMON
573 union acpi_parse_object *PredicateOp;
574 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
575 UINT8 *PackageEnd; /* End of if/while block */
576 UINT16 Opcode;
578 } ACPI_CONTROL_STATE;
582 * Scope state - current scope during namespace lookups
584 typedef struct acpi_scope_state
586 ACPI_STATE_COMMON
587 ACPI_NAMESPACE_NODE *Node;
589 } ACPI_SCOPE_STATE;
592 typedef struct acpi_pscope_state
594 ACPI_STATE_COMMON
595 union acpi_parse_object *Op; /* Current op being parsed */
596 UINT8 *ArgEnd; /* Current argument end */
597 UINT8 *PkgEnd; /* Current package end */
598 UINT32 ArgList; /* Next argument to parse */
599 UINT32 ArgCount; /* Number of fixed arguments */
601 } ACPI_PSCOPE_STATE;
605 * Thread state - one per thread across multiple walk states. Multiple walk
606 * states are created when there are nested control methods executing.
608 typedef struct acpi_thread_state
610 ACPI_STATE_COMMON
611 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */
612 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */
613 UINT32 ThreadId; /* Running thread ID */
614 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */
616 } ACPI_THREAD_STATE;
620 * Result values - used to accumulate the results of nested
621 * AML arguments
623 typedef struct acpi_result_values
625 ACPI_STATE_COMMON
626 union acpi_operand_object *ObjDesc [ACPI_OBJ_NUM_OPERANDS];
627 UINT8 NumResults;
628 UINT8 LastInsert;
630 } ACPI_RESULT_VALUES;
633 typedef
634 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
635 struct acpi_walk_state *WalkState,
636 union acpi_parse_object **OutOp);
638 typedef
639 ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
640 struct acpi_walk_state *WalkState);
644 * Notify info - used to pass info to the deferred notify
645 * handler/dispatcher.
647 typedef struct acpi_notify_info
649 ACPI_STATE_COMMON
650 ACPI_NAMESPACE_NODE *Node;
651 union acpi_operand_object *HandlerObj;
653 } ACPI_NOTIFY_INFO;
656 /* Generic state is union of structs above */
658 typedef union acpi_generic_state
660 ACPI_COMMON_STATE Common;
661 ACPI_CONTROL_STATE Control;
662 ACPI_UPDATE_STATE Update;
663 ACPI_SCOPE_STATE Scope;
664 ACPI_PSCOPE_STATE ParseScope;
665 ACPI_PKG_STATE Pkg;
666 ACPI_THREAD_STATE Thread;
667 ACPI_RESULT_VALUES Results;
668 ACPI_NOTIFY_INFO Notify;
670 } ACPI_GENERIC_STATE;
673 /*****************************************************************************
675 * Interpreter typedefs and structs
677 ****************************************************************************/
679 typedef
680 ACPI_STATUS (*ACPI_EXECUTE_OP) (
681 struct acpi_walk_state *WalkState);
684 /*****************************************************************************
686 * Parser typedefs and structs
688 ****************************************************************************/
691 * AML opcode, name, and argument layout
693 typedef struct acpi_opcode_info
695 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
696 char *Name; /* Opcode name (disassembler/debug only) */
697 #endif
698 UINT32 ParseArgs; /* Grammar/Parse time arguments */
699 UINT32 RuntimeArgs; /* Interpret time arguments */
700 UINT32 Flags; /* Misc flags */
701 UINT8 ObjectType; /* Corresponding internal object type */
702 UINT8 Class; /* Opcode class */
703 UINT8 Type; /* Opcode type */
705 } ACPI_OPCODE_INFO;
708 typedef union acpi_parse_value
710 ACPI_INTEGER Integer; /* Integer constant (Up to 64 bits) */
711 UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */
712 UINT32 Size; /* bytelist or field size */
713 char *String; /* NULL terminated string */
714 UINT8 *Buffer; /* buffer or string */
715 char *Name; /* NULL terminated string */
716 union acpi_parse_object *Arg; /* arguments and contained ops */
718 } ACPI_PARSE_VALUE;
721 #define ACPI_PARSE_COMMON \
722 UINT8 DataType; /* To differentiate various internal objs */\
723 UINT8 Flags; /* Type of Op */\
724 UINT16 AmlOpcode; /* AML opcode */\
725 UINT32 AmlOffset; /* Offset of declaration in AML */\
726 union acpi_parse_object *Parent; /* Parent op */\
727 union acpi_parse_object *Next; /* Next op */\
728 ACPI_DISASM_ONLY_MEMBERS (\
729 UINT8 DisasmFlags; /* Used during AML disassembly */\
730 UINT8 DisasmOpcode; /* Subtype used for disassembly */\
731 char AmlOpName[16]) /* Op name (debug only) */\
732 /* NON-DEBUG members below: */\
733 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\
734 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
737 #define ACPI_DASM_BUFFER 0x00
738 #define ACPI_DASM_RESOURCE 0x01
739 #define ACPI_DASM_STRING 0x02
740 #define ACPI_DASM_UNICODE 0x03
741 #define ACPI_DASM_EISAID 0x04
742 #define ACPI_DASM_MATCHOP 0x05
745 * generic operation (for example: If, While, Store)
747 typedef struct acpi_parse_obj_common
749 ACPI_PARSE_COMMON
750 } ACPI_PARSE_OBJ_COMMON;
754 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
755 * and bytelists.
757 typedef struct acpi_parse_obj_named
759 ACPI_PARSE_COMMON
760 UINT8 *Path;
761 UINT8 *Data; /* AML body or bytelist data */
762 UINT32 Length; /* AML length */
763 UINT32 Name; /* 4-byte name or zero if no name */
765 } ACPI_PARSE_OBJ_NAMED;
768 /* The parse node is the fundamental element of the parse tree */
770 typedef struct acpi_parse_obj_asl
772 ACPI_PARSE_COMMON
773 union acpi_parse_object *Child;
774 union acpi_parse_object *ParentMethod;
775 char *Filename;
776 char *ExternalName;
777 char *Namepath;
778 char NameSeg[4];
779 UINT32 ExtraValue;
780 UINT32 Column;
781 UINT32 LineNumber;
782 UINT32 LogicalLineNumber;
783 UINT32 LogicalByteOffset;
784 UINT32 EndLine;
785 UINT32 EndLogicalLine;
786 UINT32 AcpiBtype;
787 UINT32 AmlLength;
788 UINT32 AmlSubtreeLength;
789 UINT32 FinalAmlLength;
790 UINT32 FinalAmlOffset;
791 UINT32 CompileFlags;
792 UINT16 ParseOpcode;
793 UINT8 AmlOpcodeLength;
794 UINT8 AmlPkgLenBytes;
795 UINT8 Extra;
796 char ParseOpName[12];
798 } ACPI_PARSE_OBJ_ASL;
801 typedef union acpi_parse_object
803 ACPI_PARSE_OBJ_COMMON Common;
804 ACPI_PARSE_OBJ_NAMED Named;
805 ACPI_PARSE_OBJ_ASL Asl;
807 } ACPI_PARSE_OBJECT;
811 * Parse state - one state per parser invocation and each control
812 * method.
814 typedef struct acpi_parse_state
816 UINT32 AmlSize;
817 UINT8 *AmlStart; /* First AML byte */
818 UINT8 *Aml; /* Next AML byte */
819 UINT8 *AmlEnd; /* (last + 1) AML byte */
820 UINT8 *PkgStart; /* Current package begin */
821 UINT8 *PkgEnd; /* Current package end */
822 union acpi_parse_object *StartOp; /* Root of parse tree */
823 struct acpi_namespace_node *StartNode;
824 union acpi_generic_state *Scope; /* Current scope */
825 union acpi_parse_object *StartScope;
827 } ACPI_PARSE_STATE;
830 /* Parse object flags */
832 #define ACPI_PARSEOP_GENERIC 0x01
833 #define ACPI_PARSEOP_NAMED 0x02
834 #define ACPI_PARSEOP_DEFERRED 0x04
835 #define ACPI_PARSEOP_BYTELIST 0x08
836 #define ACPI_PARSEOP_IN_CACHE 0x80
838 /* Parse object DisasmFlags */
840 #define ACPI_PARSEOP_IGNORE 0x01
841 #define ACPI_PARSEOP_PARAMLIST 0x02
842 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
843 #define ACPI_PARSEOP_SPECIAL 0x10
846 /*****************************************************************************
848 * Hardware (ACPI registers) and PNP
850 ****************************************************************************/
852 #define PCI_ROOT_HID_STRING "PNP0A03"
854 typedef struct acpi_bit_register_info
856 UINT8 ParentRegister;
857 UINT8 BitPosition;
858 UINT16 AccessBitMask;
860 } ACPI_BIT_REGISTER_INFO;
864 * Register IDs
865 * These are the full ACPI registers
867 #define ACPI_REGISTER_PM1_STATUS 0x01
868 #define ACPI_REGISTER_PM1_ENABLE 0x02
869 #define ACPI_REGISTER_PM1_CONTROL 0x03
870 #define ACPI_REGISTER_PM1A_CONTROL 0x04
871 #define ACPI_REGISTER_PM1B_CONTROL 0x05
872 #define ACPI_REGISTER_PM2_CONTROL 0x06
873 #define ACPI_REGISTER_PM_TIMER 0x07
874 #define ACPI_REGISTER_PROCESSOR_BLOCK 0x08
875 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09
878 /* Masks used to access the BitRegisters */
880 #define ACPI_BITMASK_TIMER_STATUS 0x0001
881 #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
882 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
883 #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
884 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
885 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
886 #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
887 #define ACPI_BITMASK_WAKE_STATUS 0x8000
889 #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \
890 ACPI_BITMASK_BUS_MASTER_STATUS | \
891 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
892 ACPI_BITMASK_POWER_BUTTON_STATUS | \
893 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
894 ACPI_BITMASK_RT_CLOCK_STATUS | \
895 ACPI_BITMASK_WAKE_STATUS)
897 #define ACPI_BITMASK_TIMER_ENABLE 0x0001
898 #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
899 #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
900 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
901 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
902 #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
904 #define ACPI_BITMASK_SCI_ENABLE 0x0001
905 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
906 #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
907 #define ACPI_BITMASK_SLEEP_TYPE_X 0x1C00
908 #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
910 #define ACPI_BITMASK_ARB_DISABLE 0x0001
913 /* Raw bit position of each BitRegister */
915 #define ACPI_BITPOSITION_TIMER_STATUS 0x00
916 #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
917 #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
918 #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
919 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
920 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
921 #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
922 #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
924 #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
925 #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
926 #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
927 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
928 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
929 #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
931 #define ACPI_BITPOSITION_SCI_ENABLE 0x00
932 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
933 #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
934 #define ACPI_BITPOSITION_SLEEP_TYPE_X 0x0A
935 #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
937 #define ACPI_BITPOSITION_ARB_DISABLE 0x00
940 /*****************************************************************************
942 * Resource descriptors
944 ****************************************************************************/
947 /* ResourceType values */
949 #define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
950 #define ACPI_RESOURCE_TYPE_IO_RANGE 1
951 #define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2
953 /* Resource descriptor types and masks */
955 #define ACPI_RDESC_TYPE_LARGE 0x80
956 #define ACPI_RDESC_TYPE_SMALL 0x00
958 #define ACPI_RDESC_TYPE_MASK 0x80
959 #define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
963 * Small resource descriptor types
964 * Note: The 3 length bits (2:0) must be zero
966 #define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20
967 #define ACPI_RDESC_TYPE_DMA_FORMAT 0x28
968 #define ACPI_RDESC_TYPE_START_DEPENDENT 0x30
969 #define ACPI_RDESC_TYPE_END_DEPENDENT 0x38
970 #define ACPI_RDESC_TYPE_IO_PORT 0x40
971 #define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48
972 #define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70
973 #define ACPI_RDESC_TYPE_END_TAG 0x78
976 * Large resource descriptor types
978 #define ACPI_RDESC_TYPE_MEMORY_24 0x81
979 #define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82
980 #define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84
981 #define ACPI_RDESC_TYPE_MEMORY_32 0x85
982 #define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86
983 #define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87
984 #define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88
985 #define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89
986 #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A
987 #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B
990 /*****************************************************************************
992 * Miscellaneous
994 ****************************************************************************/
996 #define ACPI_ASCII_ZERO 0x30
999 /*****************************************************************************
1001 * Debugger
1003 ****************************************************************************/
1005 typedef struct acpi_db_method_info
1007 ACPI_HANDLE ThreadGate;
1008 char *Name;
1009 char **Args;
1010 UINT32 Flags;
1011 UINT32 NumLoops;
1012 char Pathname[128];
1014 } ACPI_DB_METHOD_INFO;
1016 typedef struct acpi_integrity_info
1018 UINT32 Nodes;
1019 UINT32 Objects;
1021 } ACPI_INTEGRITY_INFO;
1024 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1025 #define ACPI_DB_CONSOLE_OUTPUT 0x02
1026 #define ACPI_DB_DUPLICATE_OUTPUT 0x03
1029 /*****************************************************************************
1031 * Debug
1033 ****************************************************************************/
1035 typedef struct acpi_debug_print_info
1037 UINT32 ComponentId;
1038 char *ProcName;
1039 char *ModuleName;
1041 } ACPI_DEBUG_PRINT_INFO;
1044 /* Entry for a memory allocation (debug only) */
1046 #define ACPI_MEM_MALLOC 0
1047 #define ACPI_MEM_CALLOC 1
1048 #define ACPI_MAX_MODULE_NAME 16
1050 #define ACPI_COMMON_DEBUG_MEM_HEADER \
1051 struct acpi_debug_mem_block *Previous; \
1052 struct acpi_debug_mem_block *Next; \
1053 UINT32 Size; \
1054 UINT32 Component; \
1055 UINT32 Line; \
1056 char Module[ACPI_MAX_MODULE_NAME]; \
1057 UINT8 AllocType;
1059 typedef struct acpi_debug_mem_header
1061 ACPI_COMMON_DEBUG_MEM_HEADER
1063 } ACPI_DEBUG_MEM_HEADER;
1065 typedef struct acpi_debug_mem_block
1067 ACPI_COMMON_DEBUG_MEM_HEADER
1068 UINT64 UserSpace;
1070 } ACPI_DEBUG_MEM_BLOCK;
1073 #define ACPI_MEM_LIST_GLOBAL 0
1074 #define ACPI_MEM_LIST_NSNODE 1
1076 #define ACPI_MEM_LIST_FIRST_CACHE_LIST 2
1077 #define ACPI_MEM_LIST_STATE 2
1078 #define ACPI_MEM_LIST_PSNODE 3
1079 #define ACPI_MEM_LIST_PSNODE_EXT 4
1080 #define ACPI_MEM_LIST_OPERAND 5
1081 #define ACPI_MEM_LIST_WALK 6
1082 #define ACPI_MEM_LIST_MAX 6
1083 #define ACPI_NUM_MEM_LISTS 7
1086 typedef struct acpi_memory_list
1088 void *ListHead;
1089 UINT16 LinkOffset;
1090 UINT16 MaxCacheDepth;
1091 UINT16 CacheDepth;
1092 UINT16 ObjectSize;
1094 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1096 /* Statistics for debug memory tracking only */
1098 UINT32 TotalAllocated;
1099 UINT32 TotalFreed;
1100 UINT32 CurrentTotalSize;
1101 UINT32 CacheRequests;
1102 UINT32 CacheHits;
1103 char *ListName;
1104 #endif
1106 } ACPI_MEMORY_LIST;
1109 #endif /* __ACLOCAL_H__ */