1 /******************************************************************************
3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
6 *****************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13 * All rights reserved.
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
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
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
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
73 * 3.4. Intel retains all right, title, and interest in and to the Original
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
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
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 *****************************************************************************/
116 /* $DragonFly: src/sys/contrib/dev/acpica/Attic/aclocal.h,v 1.1 2003/09/24 03:32:15 drhodus Exp $ */
118 #ifndef __ACLOCAL_H__
119 #define __ACLOCAL_H__
122 #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */
124 typedef void * ACPI_MUTEX;
125 typedef UINT32 ACPI_MUTEX_HANDLE;
128 /* Total number of aml opcodes defined */
130 #define AML_NUM_OPCODES 0x7E
133 /*****************************************************************************
135 * Mutex typedefs and structs
137 ****************************************************************************/
141 * Predefined handles for the mutex objects used within the subsystem
142 * All mutex objects are automatically created by AcpiUtMutexInitialize.
144 * The acquire/release ordering protocol is implied via this list. Mutexes
145 * with a lower value must be acquired before mutexes with a higher value.
147 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames table also!
150 #define ACPI_MTX_EXECUTE 0
151 #define ACPI_MTX_INTERPRETER 1
152 #define ACPI_MTX_PARSER 2
153 #define ACPI_MTX_DISPATCHER 3
154 #define ACPI_MTX_TABLES 4
155 #define ACPI_MTX_OP_REGIONS 5
156 #define ACPI_MTX_NAMESPACE 6
157 #define ACPI_MTX_EVENTS 7
158 #define ACPI_MTX_HARDWARE 8
159 #define ACPI_MTX_CACHES 9
160 #define ACPI_MTX_MEMORY 10
161 #define ACPI_MTX_DEBUG_CMD_COMPLETE 11
162 #define ACPI_MTX_DEBUG_CMD_READY 12
165 #define NUM_MTX MAX_MTX+1
168 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
169 #ifdef DEFINE_ACPI_GLOBALS
171 /* Names for the mutexes used in the subsystem */
173 static char *AcpiGbl_MutexNames[] =
176 "ACPI_MTX_Interpreter",
178 "ACPI_MTX_Dispatcher",
180 "ACPI_MTX_OpRegions",
181 "ACPI_MTX_Namespace",
186 "ACPI_MTX_DebugCmdComplete",
187 "ACPI_MTX_DebugCmdReady",
194 /* Table for the global mutexes */
196 typedef struct acpi_mutex_info
204 /* This owner ID means that the mutex is not in use (unlocked) */
206 #define ACPI_MUTEX_NOT_ACQUIRED (UINT32) (-1)
209 /* Lock flag parameter for various interfaces */
211 #define ACPI_MTX_DO_NOT_LOCK 0
212 #define ACPI_MTX_LOCK 1
215 typedef UINT16 ACPI_OWNER_ID;
216 #define ACPI_OWNER_TYPE_TABLE 0x0
217 #define ACPI_OWNER_TYPE_METHOD 0x1
218 #define ACPI_FIRST_METHOD_ID 0x0000
219 #define ACPI_FIRST_TABLE_ID 0x8000
221 /* TBD: [Restructure] get rid of the need for this! */
223 #define TABLE_ID_DSDT (ACPI_OWNER_ID) 0x8000
226 /* Field access granularities */
228 #define ACPI_FIELD_BYTE_GRANULARITY 1
229 #define ACPI_FIELD_WORD_GRANULARITY 2
230 #define ACPI_FIELD_DWORD_GRANULARITY 4
231 #define ACPI_FIELD_QWORD_GRANULARITY 8
233 /*****************************************************************************
235 * Namespace typedefs and structs
237 ****************************************************************************/
240 /* Operational modes of the AML interpreter/scanner */
244 ACPI_IMODE_LOAD_PASS1 = 0x01,
245 ACPI_IMODE_LOAD_PASS2 = 0x02,
246 ACPI_IMODE_EXECUTE = 0x0E
248 } ACPI_INTERPRETER_MODE;
252 * The Node describes a named object that appears in the AML
253 * An AcpiNode is used to store Nodes.
255 * DataType is used to differentiate between internal descriptors, and MUST
256 * be the first byte in this structure.
259 typedef union acpi_name_union
266 typedef struct acpi_namespace_node
268 UINT8 Descriptor; /* Used to differentiate object descriptor types */
269 UINT8 Type; /* Type associated with this name */
271 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
274 union acpi_operand_object *Object; /* Pointer to attached ACPI object (optional) */
275 struct acpi_namespace_node *Child; /* first child */
276 struct acpi_namespace_node *Peer; /* Next peer*/
277 UINT16 ReferenceCount; /* Current count of references and children */
280 } ACPI_NAMESPACE_NODE;
283 #define ACPI_ENTRY_NOT_FOUND NULL
288 #define ANOBJ_RESERVED 0x01
289 #define ANOBJ_END_OF_PEER_LIST 0x02
290 #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
291 #define ANOBJ_METHOD_ARG 0x08
292 #define ANOBJ_METHOD_LOCAL 0x10
293 #define ANOBJ_METHOD_NO_RETVAL 0x20
294 #define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
296 #define ANOBJ_IS_BIT_OFFSET 0x80
300 * ACPI Table Descriptor. One per ACPI table
302 typedef struct acpi_table_desc
304 struct acpi_table_desc *Prev;
305 struct acpi_table_desc *Next;
306 struct acpi_table_desc *InstalledDesc;
307 ACPI_TABLE_HEADER *Pointer;
309 UINT64 PhysicalAddress;
313 ACPI_OWNER_ID TableId;
316 BOOLEAN LoadedIntoNamespace;
321 typedef struct acpi_find_context
330 typedef struct acpi_ns_search_data
332 ACPI_NAMESPACE_NODE *Node;
334 } ACPI_NS_SEARCH_DATA;
338 * Predefined Namespace items
340 typedef struct acpi_predefined_names
346 } ACPI_PREDEFINED_NAMES;
349 /* Object types used during package copies */
352 #define ACPI_COPY_TYPE_SIMPLE 0
353 #define ACPI_COPY_TYPE_PACKAGE 1
355 /* Info structure used to convert external<->internal namestrings */
357 typedef struct acpi_namestring_info
360 char *NextExternalChar;
365 BOOLEAN FullyQualified;
367 } ACPI_NAMESTRING_INFO;
370 /* Field creation info */
372 typedef struct acpi_create_field_info
374 ACPI_NAMESPACE_NODE *RegionNode;
375 ACPI_NAMESPACE_NODE *FieldNode;
376 ACPI_NAMESPACE_NODE *RegisterNode;
377 ACPI_NAMESPACE_NODE *DataRegisterNode;
379 UINT32 FieldBitPosition;
380 UINT32 FieldBitLength;
385 } ACPI_CREATE_FIELD_INFO;
388 /*****************************************************************************
390 * Event typedefs and structs
392 ****************************************************************************/
394 /* Information about each particular GPE level */
396 typedef struct acpi_gpe_event_info
398 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
399 ACPI_GPE_HANDLER Handler; /* Address of handler, if any */
400 void *Context; /* Context to be passed to handler */
401 struct acpi_gpe_register_info *RegisterInfo;
402 UINT8 Type; /* Level or Edge */
405 } ACPI_GPE_EVENT_INFO;
407 /* Information about a particular GPE register pair */
409 typedef struct acpi_gpe_register_info
411 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
412 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
413 UINT8 Status; /* Current value of status reg */
414 UINT8 Enable; /* Current value of enable reg */
415 UINT8 WakeEnable; /* Mask of bits to keep enabled when sleeping */
416 UINT8 BaseGpeNumber; /* Base GPE number for this register */
418 } ACPI_GPE_REGISTER_INFO;
421 #define ACPI_GPE_LEVEL_TRIGGERED 1
422 #define ACPI_GPE_EDGE_TRIGGERED 2
425 /* Information about each GPE register block */
427 typedef struct acpi_gpe_block_info
429 struct acpi_gpe_block_info *Previous;
430 struct acpi_gpe_block_info *Next;
431 struct acpi_gpe_block_info *NextOnInterrupt;
432 ACPI_GPE_REGISTER_INFO *RegisterInfo;
433 ACPI_GPE_EVENT_INFO *EventInfo;
434 ACPI_GENERIC_ADDRESS BlockAddress;
435 UINT32 RegisterCount;
436 UINT8 BlockBaseNumber;
438 } ACPI_GPE_BLOCK_INFO;
441 /* Information about each particular fixed event */
443 typedef struct acpi_fixed_event_handler
445 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
446 void *Context; /* Context to be passed to handler */
448 } ACPI_FIXED_EVENT_HANDLER;
451 typedef struct acpi_fixed_event_info
453 UINT8 StatusRegisterId;
454 UINT8 EnableRegisterId;
455 UINT16 StatusBitMask;
456 UINT16 EnableBitMask;
458 } ACPI_FIXED_EVENT_INFO;
460 /* Information used during field processing */
462 typedef struct acpi_field_info
471 /*****************************************************************************
473 * Generic "state" object for stacks
475 ****************************************************************************/
478 #define ACPI_CONTROL_NORMAL 0xC0
479 #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
480 #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
481 #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
482 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
485 /* Forward declarations */
486 struct acpi_walk_state;
487 struct acpi_obj_mutex;
488 union acpi_parse_object;
491 #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
492 UINT8 DataType; /* To differentiate various internal objs */\
499 typedef struct acpi_common_state
506 * Update state - used to traverse complex objects such as packages
508 typedef struct acpi_update_state
511 union acpi_operand_object *Object;
517 * Pkg state - used to traverse nested package structures
519 typedef struct acpi_pkg_state
522 union acpi_operand_object *SourceObject;
523 union acpi_operand_object *DestObject;
524 struct acpi_walk_state *WalkState;
533 * Control state - one per if/else and while constructs.
534 * Allows nesting of these constructs
536 typedef struct acpi_control_state
539 union acpi_parse_object *PredicateOp;
540 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
541 UINT8 *PackageEnd; /* End of if/while block */
544 } ACPI_CONTROL_STATE;
548 * Scope state - current scope during namespace lookups
550 typedef struct acpi_scope_state
553 ACPI_NAMESPACE_NODE *Node;
558 typedef struct acpi_pscope_state
561 union acpi_parse_object *Op; /* current op being parsed */
562 UINT8 *ArgEnd; /* current argument end */
563 UINT8 *PkgEnd; /* current package end */
564 UINT32 ArgList; /* next argument to parse */
565 UINT32 ArgCount; /* Number of fixed arguments */
571 * Thread state - one per thread across multiple walk states. Multiple walk
572 * states are created when there are nested control methods executing.
574 typedef struct acpi_thread_state
577 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */
578 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */
579 UINT32 ThreadId; /* Running thread ID */
580 UINT16 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */
586 * Result values - used to accumulate the results of nested
589 typedef struct acpi_result_values
592 union acpi_operand_object *ObjDesc [ACPI_OBJ_NUM_OPERANDS];
596 } ACPI_RESULT_VALUES;
600 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
601 struct acpi_walk_state *WalkState,
602 union acpi_parse_object **OutOp);
605 ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
606 struct acpi_walk_state *WalkState);
610 * Notify info - used to pass info to the deferred notify
611 * handler/dispatcher.
613 typedef struct acpi_notify_info
616 ACPI_NAMESPACE_NODE *Node;
617 union acpi_operand_object *HandlerObj;
622 /* Generic state is union of structs above */
624 typedef union acpi_generic_state
626 ACPI_COMMON_STATE Common;
627 ACPI_CONTROL_STATE Control;
628 ACPI_UPDATE_STATE Update;
629 ACPI_SCOPE_STATE Scope;
630 ACPI_PSCOPE_STATE ParseScope;
632 ACPI_THREAD_STATE Thread;
633 ACPI_RESULT_VALUES Results;
634 ACPI_NOTIFY_INFO Notify;
636 } ACPI_GENERIC_STATE;
639 /*****************************************************************************
641 * Interpreter typedefs and structs
643 ****************************************************************************/
646 ACPI_STATUS (*ACPI_EXECUTE_OP) (
647 struct acpi_walk_state *WalkState);
650 /*****************************************************************************
652 * Parser typedefs and structs
654 ****************************************************************************/
657 * AML opcode, name, and argument layout
659 typedef struct acpi_opcode_info
661 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
662 char *Name; /* Opcode name (disassembler/debug only) */
664 UINT32 ParseArgs; /* Grammar/Parse time arguments */
665 UINT32 RuntimeArgs; /* Interpret time arguments */
666 UINT32 Flags; /* Misc flags */
667 UINT8 ObjectType; /* Corresponding internal object type */
668 UINT8 Class; /* Opcode class */
669 UINT8 Type; /* Opcode type */
674 typedef union acpi_parse_value
676 ACPI_INTEGER Integer; /* integer constant (Up to 64 bits) */
677 UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */
678 UINT32 Integer32; /* integer constant, 32 bits only */
679 UINT16 Integer16; /* integer constant, 16 bits only */
680 UINT8 Integer8; /* integer constant, 8 bits only */
681 UINT32 Size; /* bytelist or field size */
682 char *String; /* NULL terminated string */
683 UINT8 *Buffer; /* buffer or string */
684 char *Name; /* NULL terminated string */
685 union acpi_parse_object *Arg; /* arguments and contained ops */
690 #define ACPI_PARSE_COMMON \
691 UINT8 DataType; /* To differentiate various internal objs */\
692 UINT8 Flags; /* Type of Op */\
693 UINT16 AmlOpcode; /* AML opcode */\
694 UINT32 AmlOffset; /* offset of declaration in AML */\
695 union acpi_parse_object *Parent; /* parent op */\
696 union acpi_parse_object *Next; /* next op */\
697 ACPI_DISASM_ONLY_MEMBERS (\
698 UINT8 DisasmFlags; /* Used during AML disassembly */\
699 UINT8 DisasmOpcode; /* Subtype used for disassembly */\
700 char AmlOpName[16]) /* op name (debug only) */\
701 /* NON-DEBUG members below: */\
702 ACPI_NAMESPACE_NODE *Node; /* for use by interpreter */\
703 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
706 #define ACPI_DASM_BUFFER 0x00
707 #define ACPI_DASM_RESOURCE 0x01
708 #define ACPI_DASM_STRING 0x02
709 #define ACPI_DASM_UNICODE 0x03
710 #define ACPI_DASM_EISAID 0x04
711 #define ACPI_DASM_MATCHOP 0x05
714 * generic operation (for example: If, While, Store)
716 typedef struct acpi_parse_obj_common
719 } ACPI_PARSE_OBJ_COMMON;
723 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
726 typedef struct acpi_parse_obj_named
730 UINT8 *Data; /* AML body or bytelist data */
731 UINT32 Length; /* AML length */
732 UINT32 Name; /* 4-byte name or zero if no name */
734 } ACPI_PARSE_OBJ_NAMED;
737 /* The parse node is the fundamental element of the parse tree */
739 typedef struct acpi_parse_obj_asl
742 union acpi_parse_object *Child;
743 union acpi_parse_object *ParentMethod;
751 UINT32 LogicalLineNumber;
752 UINT32 LogicalByteOffset;
754 UINT32 EndLogicalLine;
757 UINT32 AmlSubtreeLength;
758 UINT32 FinalAmlLength;
759 UINT32 FinalAmlOffset;
762 UINT8 AmlOpcodeLength;
763 UINT8 AmlPkgLenBytes;
765 char ParseOpName[12];
767 } ACPI_PARSE_OBJ_ASL;
770 typedef union acpi_parse_object
772 ACPI_PARSE_OBJ_COMMON Common;
773 ACPI_PARSE_OBJ_NAMED Named;
774 ACPI_PARSE_OBJ_ASL Asl;
780 * Parse state - one state per parser invocation and each control
783 typedef struct acpi_parse_state
786 UINT8 *AmlStart; /* first AML byte */
787 UINT8 *Aml; /* next AML byte */
788 UINT8 *AmlEnd; /* (last + 1) AML byte */
789 UINT8 *PkgStart; /* current package begin */
790 UINT8 *PkgEnd; /* current package end */
791 union acpi_parse_object *StartOp; /* root of parse tree */
792 struct acpi_namespace_node *StartNode;
793 union acpi_generic_state *Scope; /* current scope */
794 union acpi_parse_object *StartScope;
799 /* Parse object flags */
801 #define ACPI_PARSEOP_GENERIC 0x01
802 #define ACPI_PARSEOP_NAMED 0x02
803 #define ACPI_PARSEOP_DEFERRED 0x04
804 #define ACPI_PARSEOP_BYTELIST 0x08
805 #define ACPI_PARSEOP_IN_CACHE 0x80
807 /* Parse object DisasmFlags */
809 #define ACPI_PARSEOP_IGNORE 0x01
810 #define ACPI_PARSEOP_PARAMLIST 0x02
811 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
812 #define ACPI_PARSEOP_SPECIAL 0x10
815 /*****************************************************************************
817 * Hardware (ACPI registers) and PNP
819 ****************************************************************************/
821 #define PCI_ROOT_HID_STRING "PNP0A03"
823 typedef struct acpi_bit_register_info
825 UINT8 ParentRegister;
827 UINT16 AccessBitMask;
829 } ACPI_BIT_REGISTER_INFO;
834 * These are the full ACPI registers
836 #define ACPI_REGISTER_PM1_STATUS 0x01
837 #define ACPI_REGISTER_PM1_ENABLE 0x02
838 #define ACPI_REGISTER_PM1_CONTROL 0x03
839 #define ACPI_REGISTER_PM1A_CONTROL 0x04
840 #define ACPI_REGISTER_PM1B_CONTROL 0x05
841 #define ACPI_REGISTER_PM2_CONTROL 0x06
842 #define ACPI_REGISTER_PM_TIMER 0x07
843 #define ACPI_REGISTER_PROCESSOR_BLOCK 0x08
844 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09
847 /* Masks used to access the BitRegisters */
849 #define ACPI_BITMASK_TIMER_STATUS 0x0001
850 #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
851 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
852 #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
853 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
854 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
855 #define ACPI_BITMASK_WAKE_STATUS 0x8000
857 #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \
858 ACPI_BITMASK_BUS_MASTER_STATUS | \
859 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
860 ACPI_BITMASK_POWER_BUTTON_STATUS | \
861 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
862 ACPI_BITMASK_RT_CLOCK_STATUS | \
863 ACPI_BITMASK_WAKE_STATUS)
865 #define ACPI_BITMASK_TIMER_ENABLE 0x0001
866 #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
867 #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
868 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
869 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
871 #define ACPI_BITMASK_SCI_ENABLE 0x0001
872 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
873 #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
874 #define ACPI_BITMASK_SLEEP_TYPE_X 0x1C00
875 #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
877 #define ACPI_BITMASK_ARB_DISABLE 0x0001
880 /* Raw bit position of each BitRegister */
882 #define ACPI_BITPOSITION_TIMER_STATUS 0x00
883 #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
884 #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
885 #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
886 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
887 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
888 #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
890 #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
891 #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
892 #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
893 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
894 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
896 #define ACPI_BITPOSITION_SCI_ENABLE 0x00
897 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
898 #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
899 #define ACPI_BITPOSITION_SLEEP_TYPE_X 0x0A
900 #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
902 #define ACPI_BITPOSITION_ARB_DISABLE 0x00
905 /*****************************************************************************
907 * Resource descriptors
909 ****************************************************************************/
912 /* ResourceType values */
914 #define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
915 #define ACPI_RESOURCE_TYPE_IO_RANGE 1
916 #define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2
918 /* Resource descriptor types and masks */
920 #define ACPI_RDESC_TYPE_LARGE 0x80
921 #define ACPI_RDESC_TYPE_SMALL 0x00
923 #define ACPI_RDESC_TYPE_MASK 0x80
924 #define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
928 * Small resource descriptor types
929 * Note: The 3 length bits (2:0) must be zero
931 #define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20
932 #define ACPI_RDESC_TYPE_DMA_FORMAT 0x28
933 #define ACPI_RDESC_TYPE_START_DEPENDENT 0x30
934 #define ACPI_RDESC_TYPE_END_DEPENDENT 0x38
935 #define ACPI_RDESC_TYPE_IO_PORT 0x40
936 #define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48
937 #define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70
938 #define ACPI_RDESC_TYPE_END_TAG 0x78
941 * Large resource descriptor types
944 #define ACPI_RDESC_TYPE_MEMORY_24 0x81
945 #define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82
946 #define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84
947 #define ACPI_RDESC_TYPE_MEMORY_32 0x85
948 #define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86
949 #define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87
950 #define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88
951 #define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89
952 #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A
955 /* String version of device HIDs and UIDs */
957 #define ACPI_DEVICE_ID_LENGTH 0x09
959 typedef struct acpi_device_id
961 char Buffer[ACPI_DEVICE_ID_LENGTH];
966 /*****************************************************************************
970 ****************************************************************************/
972 #define ACPI_ASCII_ZERO 0x30
975 /*****************************************************************************
979 ****************************************************************************/
981 typedef struct acpi_db_method_info
983 ACPI_HANDLE ThreadGate;
990 } ACPI_DB_METHOD_INFO;
992 typedef struct acpi_integrity_info
997 } ACPI_INTEGRITY_INFO;
1000 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1001 #define ACPI_DB_CONSOLE_OUTPUT 0x02
1002 #define ACPI_DB_DUPLICATE_OUTPUT 0x03
1005 /*****************************************************************************
1009 ****************************************************************************/
1011 typedef struct acpi_debug_print_info
1017 } ACPI_DEBUG_PRINT_INFO;
1020 /* Entry for a memory allocation (debug only) */
1022 #define ACPI_MEM_MALLOC 0
1023 #define ACPI_MEM_CALLOC 1
1024 #define ACPI_MAX_MODULE_NAME 16
1026 #define ACPI_COMMON_DEBUG_MEM_HEADER \
1027 struct acpi_debug_mem_block *Previous; \
1028 struct acpi_debug_mem_block *Next; \
1032 char Module[ACPI_MAX_MODULE_NAME]; \
1035 typedef struct acpi_debug_mem_header
1037 ACPI_COMMON_DEBUG_MEM_HEADER
1039 } ACPI_DEBUG_MEM_HEADER;
1041 typedef struct acpi_debug_mem_block
1043 ACPI_COMMON_DEBUG_MEM_HEADER
1046 } ACPI_DEBUG_MEM_BLOCK;
1049 #define ACPI_MEM_LIST_GLOBAL 0
1050 #define ACPI_MEM_LIST_NSNODE 1
1052 #define ACPI_MEM_LIST_FIRST_CACHE_LIST 2
1053 #define ACPI_MEM_LIST_STATE 2
1054 #define ACPI_MEM_LIST_PSNODE 3
1055 #define ACPI_MEM_LIST_PSNODE_EXT 4
1056 #define ACPI_MEM_LIST_OPERAND 5
1057 #define ACPI_MEM_LIST_WALK 6
1058 #define ACPI_MEM_LIST_MAX 6
1059 #define ACPI_NUM_MEM_LISTS 7
1062 typedef struct acpi_memory_list
1066 UINT16 MaxCacheDepth;
1070 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1072 /* Statistics for debug memory tracking only */
1074 UINT32 TotalAllocated;
1076 UINT32 CurrentTotalSize;
1077 UINT32 CacheRequests;
1085 #endif /* __ACLOCAL_H__ */