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, 2000, 2001, 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 *****************************************************************************/
117 #ifndef __ACLOCAL_H__
118 #define __ACLOCAL_H__
121 #define WAIT_FOREVER ((UINT32) -1)
123 typedef void* ACPI_MUTEX;
124 typedef UINT32 ACPI_MUTEX_HANDLE;
128 #define ACPI_MEMORY_MODE 0x01
129 #define ACPI_LOGICAL_ADDRESSING 0x00
130 #define ACPI_PHYSICAL_ADDRESSING 0x01
132 /* Object descriptor types */
134 #define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */
135 #define ACPI_DESC_TYPE_STATE 0x22
136 #define ACPI_DESC_TYPE_WALK 0x44
137 #define ACPI_DESC_TYPE_PARSER 0x66
138 #define ACPI_DESC_TYPE_INTERNAL 0x88
139 #define ACPI_DESC_TYPE_NAMED 0xAA
142 /*****************************************************************************
144 * Mutex typedefs and structs
146 ****************************************************************************/
150 * Predefined handles for the mutex objects used within the subsystem
151 * All mutex objects are automatically created by AcpiUtMutexInitialize.
153 * The acquire/release ordering protocol is implied via this list. Mutexes
154 * with a lower value must be acquired before mutexes with a higher value.
156 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames table also!
159 #define ACPI_MTX_EXECUTE 0
160 #define ACPI_MTX_INTERPRETER 1
161 #define ACPI_MTX_PARSER 2
162 #define ACPI_MTX_DISPATCHER 3
163 #define ACPI_MTX_TABLES 4
164 #define ACPI_MTX_OP_REGIONS 5
165 #define ACPI_MTX_NAMESPACE 6
166 #define ACPI_MTX_EVENTS 7
167 #define ACPI_MTX_HARDWARE 8
168 #define ACPI_MTX_CACHES 9
169 #define ACPI_MTX_MEMORY 10
170 #define ACPI_MTX_DEBUG_CMD_COMPLETE 11
171 #define ACPI_MTX_DEBUG_CMD_READY 12
174 #define NUM_MTX MAX_MTX+1
177 #if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
178 #ifdef DEFINE_ACPI_GLOBALS
180 /* Names for the mutexes used in the subsystem */
182 static NATIVE_CHAR *AcpiGbl_MutexNames[] =
185 "ACPI_MTX_Interpreter",
187 "ACPI_MTX_Dispatcher",
189 "ACPI_MTX_OpRegions",
190 "ACPI_MTX_Namespace",
195 "ACPI_MTX_DebugCmdComplete",
196 "ACPI_MTX_DebugCmdReady",
203 /* Table for the global mutexes */
205 typedef struct AcpiMutexInfo
213 /* This owner ID means that the mutex is not in use (unlocked) */
215 #define ACPI_MUTEX_NOT_ACQUIRED (UINT32) (-1)
218 /* Lock flag parameter for various interfaces */
220 #define ACPI_MTX_DO_NOT_LOCK 0
221 #define ACPI_MTX_LOCK 1
224 typedef UINT16 ACPI_OWNER_ID;
225 #define OWNER_TYPE_TABLE 0x0
226 #define OWNER_TYPE_METHOD 0x1
227 #define FIRST_METHOD_ID 0x0000
228 #define FIRST_TABLE_ID 0x8000
230 /* TBD: [Restructure] get rid of the need for this! */
232 #define TABLE_ID_DSDT (ACPI_OWNER_ID) 0x8000
235 /* Field access granularities */
237 #define ACPI_FIELD_BYTE_GRANULARITY 1
238 #define ACPI_FIELD_WORD_GRANULARITY 2
239 #define ACPI_FIELD_DWORD_GRANULARITY 4
240 #define ACPI_FIELD_QWORD_GRANULARITY 8
242 /*****************************************************************************
244 * Namespace typedefs and structs
246 ****************************************************************************/
249 /* Operational modes of the AML interpreter/scanner */
253 IMODE_LOAD_PASS1 = 0x01,
254 IMODE_LOAD_PASS2 = 0x02,
261 * The Node describes a named object that appears in the AML
262 * An AcpiNode is used to store Nodes.
264 * DataType is used to differentiate between internal descriptors, and MUST
265 * be the first byte in this structure.
268 typedef struct acpi_node
271 UINT8 Type; /* Type associated with this name */
273 UINT32 Name; /* ACPI Name, always 4 chars per ACPI spec */
276 void *Object; /* Pointer to attached ACPI object (optional) */
277 struct acpi_node *Child; /* first child */
278 struct acpi_node *Peer; /* Next peer*/
279 UINT16 ReferenceCount; /* Current count of references and children */
282 } ACPI_NAMESPACE_NODE;
285 #define ENTRY_NOT_FOUND NULL
290 #define ANOBJ_AML_ATTACHMENT 0x01
291 #define ANOBJ_END_OF_PEER_LIST 0x02
292 #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
293 #define ANOBJ_METHOD_ARG 0x08
294 #define ANOBJ_METHOD_LOCAL 0x10
295 #define ANOBJ_METHOD_NO_RETVAL 0x20
296 #define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
298 #define ANOBJ_IS_BIT_OFFSET 0x80
302 * ACPI Table Descriptor. One per ACPI table
304 typedef struct AcpiTableDesc
306 struct AcpiTableDesc *Prev;
307 struct AcpiTableDesc *Next;
308 struct AcpiTableDesc *InstalledDesc;
309 ACPI_TABLE_HEADER *Pointer;
312 UINT64 PhysicalAddress;
316 ACPI_OWNER_ID TableId;
319 BOOLEAN LoadedIntoNamespace;
326 NATIVE_CHAR *SearchFor;
335 ACPI_NAMESPACE_NODE *Node;
340 * Predefined Namespace items
345 ACPI_OBJECT_TYPE8 Type;
351 /* Object types used during package copies */
354 #define ACPI_COPY_TYPE_SIMPLE 0
355 #define ACPI_COPY_TYPE_PACKAGE 1
357 /* Info structure used to convert external<->internal namestrings */
359 typedef struct acpi_namestring_info
361 NATIVE_CHAR *ExternalName;
362 NATIVE_CHAR *NextExternalChar;
363 NATIVE_CHAR *InternalName;
367 BOOLEAN FullyQualified;
369 } ACPI_NAMESTRING_INFO;
372 /*****************************************************************************
374 * Event typedefs and structs
376 ****************************************************************************/
381 #define ACPI_STATUS_PMTIMER 0x0001
382 #define ACPI_STATUS_BUSMASTER 0x0010
383 #define ACPI_STATUS_GLOBAL 0x0020
384 #define ACPI_STATUS_POWER_BUTTON 0x0100
385 #define ACPI_STATUS_SLEEP_BUTTON 0x0200
386 #define ACPI_STATUS_RTC_ALARM 0x0400
390 #define ACPI_ENABLE_PMTIMER 0x0001
391 #define ACPI_ENABLE_GLOBAL 0x0020
392 #define ACPI_ENABLE_POWER_BUTTON 0x0100
393 #define ACPI_ENABLE_SLEEP_BUTTON 0x0200
394 #define ACPI_ENABLE_RTC_ALARM 0x0400
398 * Entry in the AddressSpace (AKA Operation Region) table
403 ACPI_ADR_SPACE_HANDLER Handler;
406 } ACPI_ADR_SPACE_INFO;
409 /* Values and addresses of the GPE registers (both banks) */
413 UINT8 Status; /* Current value of status reg */
414 UINT8 Enable; /* Current value of enable reg */
415 UINT16 StatusAddr; /* Address of status reg */
416 UINT16 EnableAddr; /* Address of enable reg */
417 UINT8 GpeBase; /* Base GPE number */
419 } ACPI_GPE_REGISTERS;
422 #define ACPI_GPE_LEVEL_TRIGGERED 1
423 #define ACPI_GPE_EDGE_TRIGGERED 2
426 /* Information about each particular GPE level */
430 UINT8 Type; /* Level or Edge */
432 ACPI_HANDLE MethodHandle; /* Method handle for direct (fast) execution */
433 ACPI_GPE_HANDLER Handler; /* Address of handler, if any */
434 void *Context; /* Context to be passed to handler */
436 } ACPI_GPE_LEVEL_INFO;
439 /* Information about each particular fixed event */
443 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
444 void *Context; /* Context to be passed to handler */
446 } ACPI_FIXED_EVENT_INFO;
449 /* Information used during field processing */
460 /*****************************************************************************
462 * Generic "state" object for stacks
464 ****************************************************************************/
467 #define CONTROL_NORMAL 0xC0
468 #define CONTROL_CONDITIONAL_EXECUTING 0xC1
469 #define CONTROL_PREDICATE_EXECUTING 0xC2
470 #define CONTROL_PREDICATE_FALSE 0xC3
471 #define CONTROL_PREDICATE_TRUE 0xC4
474 /* Forward declarations */
475 struct acpi_walk_state;
476 struct acpi_walk_list;
477 struct acpi_parse_obj;
478 struct acpi_obj_mutex;
481 #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
482 UINT8 DataType; /* To differentiate various internal objs */\
489 typedef struct acpi_common_state
496 * Update state - used to traverse complex objects such as packages
498 typedef struct acpi_update_state
501 union acpi_operand_obj *Object;
507 * Pkg state - used to traverse nested package structures
509 typedef struct acpi_pkg_state
512 union acpi_operand_obj *SourceObject;
513 union acpi_operand_obj *DestObject;
514 struct acpi_walk_state *WalkState;
523 * Control state - one per if/else and while constructs.
524 * Allows nesting of these constructs
526 typedef struct acpi_control_state
529 struct acpi_parse_obj *PredicateOp;
530 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
532 } ACPI_CONTROL_STATE;
536 * Scope state - current scope during namespace lookups
538 typedef struct acpi_scope_state
541 ACPI_NAMESPACE_NODE *Node;
546 typedef struct acpi_pscope_state
549 struct acpi_parse_obj *Op; /* current op being parsed */
550 UINT8 *ArgEnd; /* current argument end */
551 UINT8 *PkgEnd; /* current package end */
552 UINT32 ArgList; /* next argument to parse */
553 UINT32 ArgCount; /* Number of fixed arguments */
559 * Result values - used to accumulate the results of nested
562 typedef struct acpi_result_values
565 union acpi_operand_obj *ObjDesc [OBJ_NUM_OPERANDS];
569 } ACPI_RESULT_VALUES;
573 * Notify info - used to pass info to the deferred notify
574 * handler/dispatcher.
576 typedef struct acpi_notify_info
579 ACPI_NAMESPACE_NODE *Node;
580 union acpi_operand_obj *HandlerObj;
585 /* Generic state is union of structs above */
587 typedef union acpi_gen_state
589 ACPI_COMMON_STATE Common;
590 ACPI_CONTROL_STATE Control;
591 ACPI_UPDATE_STATE Update;
592 ACPI_SCOPE_STATE Scope;
593 ACPI_PSCOPE_STATE ParseScope;
595 ACPI_RESULT_VALUES Results;
596 ACPI_NOTIFY_INFO Notify;
598 } ACPI_GENERIC_STATE;
602 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
604 struct acpi_parse_obj *Op,
605 struct acpi_walk_state *WalkState,
606 struct acpi_parse_obj **OutOp);
609 ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
610 struct acpi_walk_state *WalkState,
611 struct acpi_parse_obj *Op);
614 /*****************************************************************************
616 * Parser typedefs and structs
618 ****************************************************************************/
620 #define ACPI_OP_CLASS_MASK 0x1F
621 #define ACPI_OP_ARGS_MASK 0x20
622 #define ACPI_OP_TYPE_MASK 0xC0
624 #define ACPI_OP_TYPE_OPCODE 0x00
625 #define ACPI_OP_TYPE_ASCII 0x40
626 #define ACPI_OP_TYPE_PREFIX 0x80
627 #define ACPI_OP_TYPE_UNKNOWN 0xC0
629 #define ACPI_GET_OP_CLASS(a) ((a)->Flags & ACPI_OP_CLASS_MASK)
630 #define ACPI_GET_OP_ARGS(a) ((a)->Flags & ACPI_OP_ARGS_MASK)
631 #define ACPI_GET_OP_TYPE(a) ((a)->Flags & ACPI_OP_TYPE_MASK)
635 * AML opcode, name, and argument layout
637 typedef struct acpi_opcode_info
639 UINT8 Flags; /* Opcode type, HasArgs flag */
640 UINT32 ParseArgs; /* Grammar/Parse time arguments */
641 UINT32 RuntimeArgs; /* Interpret time arguments */
644 NATIVE_CHAR *Name; /* op name (debug only) */
650 typedef union acpi_parse_val
652 ACPI_INTEGER Integer; /* integer constant (Up to 64 bits) */
653 UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */
654 UINT32 Integer32; /* integer constant, 32 bits only */
655 UINT16 Integer16; /* integer constant, 16 bits only */
656 UINT8 Integer8; /* integer constant, 8 bits only */
657 UINT32 Size; /* bytelist or field size */
658 NATIVE_CHAR *String; /* NULL terminated string */
659 UINT8 *Buffer; /* buffer or string */
660 NATIVE_CHAR *Name; /* NULL terminated string */
661 struct acpi_parse_obj *Arg; /* arguments and contained ops */
666 #define ACPI_PARSE_COMMON \
667 UINT8 DataType; /* To differentiate various internal objs */\
668 UINT8 Flags; /* Type of Op */\
669 UINT16 Opcode; /* AML opcode */\
670 UINT32 AmlOffset; /* offset of declaration in AML */\
671 struct acpi_parse_obj *Parent; /* parent op */\
672 struct acpi_parse_obj *Next; /* next op */\
673 DEBUG_ONLY_MEMBERS (\
674 NATIVE_CHAR OpName[16]) /* op name (debug only) */\
675 /* NON-DEBUG members below: */\
676 ACPI_NAMESPACE_NODE *Node; /* for use by interpreter */\
677 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
681 * generic operation (eg. If, While, Store)
683 typedef struct acpi_parse_obj
690 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
693 typedef struct acpi_parse2_obj
696 UINT8 *Data; /* AML body or bytelist data */
697 UINT32 Length; /* AML length */
698 UINT32 Name; /* 4-byte name or zero if no name */
700 } ACPI_PARSE2_OBJECT;
704 * Parse state - one state per parser invocation and each control
708 typedef struct acpi_parse_state
710 UINT8 *AmlStart; /* first AML byte */
711 UINT8 *Aml; /* next AML byte */
712 UINT8 *AmlEnd; /* (last + 1) AML byte */
713 UINT8 *PkgStart; /* current package begin */
714 UINT8 *PkgEnd; /* current package end */
715 ACPI_PARSE_OBJECT *StartOp; /* root of parse tree */
716 struct acpi_node *StartNode;
717 ACPI_GENERIC_STATE *Scope; /* current scope */
718 struct acpi_parse_state *Next;
723 /*****************************************************************************
727 ****************************************************************************/
731 #define PCI_ROOT_HID_STRING "PNP0A03"
734 * The #define's and enum below establish an abstract way of identifying what
735 * register block and register is to be accessed. Do not change any of the
736 * values as they are used in switch statements and offset calculations.
739 #define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */
740 #define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */
741 #define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */
743 #define REGISTER_BLOCK_ID(RegId) (RegId & REGISTER_BLOCK_MASK)
744 #define REGISTER_BIT_ID(RegId) (RegId & BIT_IN_REGISTER_MASK)
745 #define REGISTER_OFFSET(RegId) (RegId & BYTE_IN_REGISTER_MASK)
749 * To access a Register Bit:
750 * -> Use Bit Name (= Register Block Id | Bit Id) defined in the enum.
752 * To access a Register:
753 * -> Use Register Id (= Register Block Id | Register Offset)
760 #define PM1_STS 0x0100
761 #define PM1_EN 0x0200
762 #define PM1_CONTROL 0x0300
763 #define PM1A_CONTROL 0x0400
764 #define PM1B_CONTROL 0x0500
765 #define PM2_CONTROL 0x0600
766 #define PM_TIMER 0x0700
767 #define PROCESSOR_BLOCK 0x0800
768 #define GPE0_STS_BLOCK 0x0900
769 #define GPE0_EN_BLOCK 0x0A00
770 #define GPE1_STS_BLOCK 0x0B00
771 #define GPE1_EN_BLOCK 0x0C00
772 #define SMI_CMD_BLOCK 0x0D00
775 * Address space bitmasks for mmio or io spaces
778 #define SMI_CMD_ADDRESS_SPACE 0x01
779 #define PM1_BLK_ADDRESS_SPACE 0x02
780 #define PM2_CNT_BLK_ADDRESS_SPACE 0x04
781 #define PM_TMR_BLK_ADDRESS_SPACE 0x08
782 #define GPE0_BLK_ADDRESS_SPACE 0x10
783 #define GPE1_BLK_ADDRESS_SPACE 0x20
786 * Control bit definitions
788 #define TMR_STS (PM1_STS | 0x01)
789 #define BM_STS (PM1_STS | 0x02)
790 #define GBL_STS (PM1_STS | 0x03)
791 #define PWRBTN_STS (PM1_STS | 0x04)
792 #define SLPBTN_STS (PM1_STS | 0x05)
793 #define RTC_STS (PM1_STS | 0x06)
794 #define WAK_STS (PM1_STS | 0x07)
796 #define TMR_EN (PM1_EN | 0x01)
798 #define GBL_EN (PM1_EN | 0x03)
799 #define PWRBTN_EN (PM1_EN | 0x04)
800 #define SLPBTN_EN (PM1_EN | 0x05)
801 #define RTC_EN (PM1_EN | 0x06)
802 #define WAK_EN (PM1_EN | 0x07)
804 #define SCI_EN (PM1_CONTROL | 0x01)
805 #define BM_RLD (PM1_CONTROL | 0x02)
806 #define GBL_RLS (PM1_CONTROL | 0x03)
807 #define SLP_TYPE_A (PM1_CONTROL | 0x04)
808 #define SLP_TYPE_B (PM1_CONTROL | 0x05)
809 #define SLP_EN (PM1_CONTROL | 0x06)
811 #define ARB_DIS (PM2_CONTROL | 0x01)
813 #define TMR_VAL (PM_TIMER | 0x01)
815 #define GPE0_STS (GPE0_STS_BLOCK | 0x01)
816 #define GPE0_EN (GPE0_EN_BLOCK | 0x01)
818 #define GPE1_STS (GPE1_STS_BLOCK | 0x01)
819 #define GPE1_EN (GPE1_EN_BLOCK | 0x01)
822 #define TMR_STS_MASK 0x0001
823 #define BM_STS_MASK 0x0010
824 #define GBL_STS_MASK 0x0020
825 #define PWRBTN_STS_MASK 0x0100
826 #define SLPBTN_STS_MASK 0x0200
827 #define RTC_STS_MASK 0x0400
828 #define WAK_STS_MASK 0x8000
830 #define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \
831 | PWRBTN_STS_MASK | SLPBTN_STS_MASK \
832 | RTC_STS_MASK | WAK_STS_MASK)
834 #define TMR_EN_MASK 0x0001
835 #define GBL_EN_MASK 0x0020
836 #define PWRBTN_EN_MASK 0x0100
837 #define SLPBTN_EN_MASK 0x0200
838 #define RTC_EN_MASK 0x0400
840 #define SCI_EN_MASK 0x0001
841 #define BM_RLD_MASK 0x0002
842 #define GBL_RLS_MASK 0x0004
843 #define SLP_TYPE_X_MASK 0x1C00
844 #define SLP_EN_MASK 0x2000
846 #define ARB_DIS_MASK 0x0001
847 #define TMR_VAL_MASK 0xFFFFFFFF
849 #define GPE0_STS_MASK
852 #define GPE1_STS_MASK
860 /*****************************************************************************
862 * Resource descriptors
864 ****************************************************************************/
867 /* ResourceType values */
869 #define RESOURCE_TYPE_MEMORY_RANGE 0
870 #define RESOURCE_TYPE_IO_RANGE 1
871 #define RESOURCE_TYPE_BUS_NUMBER_RANGE 2
873 /* Resource descriptor types and masks */
875 #define RESOURCE_DESC_TYPE_LARGE 0x80
876 #define RESOURCE_DESC_TYPE_SMALL 0x00
878 #define RESOURCE_DESC_TYPE_MASK 0x80
879 #define RESOURCE_DESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
883 * Small resource descriptor types
884 * Note: The 3 length bits (2:0) must be zero
886 #define RESOURCE_DESC_IRQ_FORMAT 0x20
887 #define RESOURCE_DESC_DMA_FORMAT 0x28
888 #define RESOURCE_DESC_START_DEPENDENT 0x30
889 #define RESOURCE_DESC_END_DEPENDENT 0x38
890 #define RESOURCE_DESC_IO_PORT 0x40
891 #define RESOURCE_DESC_FIXED_IO_PORT 0x48
892 #define RESOURCE_DESC_SMALL_VENDOR 0x70
893 #define RESOURCE_DESC_END_TAG 0x78
896 * Large resource descriptor types
899 #define RESOURCE_DESC_MEMORY_24 0x81
900 #define RESOURCE_DESC_GENERAL_REGISTER 0x82
901 #define RESOURCE_DESC_LARGE_VENDOR 0x84
902 #define RESOURCE_DESC_MEMORY_32 0x85
903 #define RESOURCE_DESC_FIXED_MEMORY_32 0x86
904 #define RESOURCE_DESC_DWORD_ADDRESS_SPACE 0x87
905 #define RESOURCE_DESC_WORD_ADDRESS_SPACE 0x88
906 #define RESOURCE_DESC_EXTENDED_XRUPT 0x89
907 #define RESOURCE_DESC_QWORD_ADDRESS_SPACE 0x8A
910 /* String version of device HIDs and UIDs */
912 #define ACPI_DEVICE_ID_LENGTH 0x09
916 char Buffer[ACPI_DEVICE_ID_LENGTH];
922 /*****************************************************************************
926 ****************************************************************************/
928 #define ASCII_ZERO 0x30
930 /*****************************************************************************
934 ****************************************************************************/
936 typedef struct dbmethodinfo
938 ACPI_HANDLE ThreadGate;
943 NATIVE_CHAR Pathname[128];
949 /*****************************************************************************
953 ****************************************************************************/
956 /* Entry for a memory allocation (debug only) */
961 #define MAX_MODULE_NAME 16
963 #define ACPI_COMMON_DEBUG_MEM_HEADER \
964 struct AcpiDebugMemBlock *Previous; \
965 struct AcpiDebugMemBlock *Next; \
969 NATIVE_CHAR Module[MAX_MODULE_NAME]; \
975 ACPI_COMMON_DEBUG_MEM_HEADER
977 } ACPI_DEBUG_MEM_HEADER;
979 typedef struct AcpiDebugMemBlock
981 ACPI_COMMON_DEBUG_MEM_HEADER
984 } ACPI_DEBUG_MEM_BLOCK;
988 #define ACPI_MEM_LIST_GLOBAL 0
989 #define ACPI_MEM_LIST_NSNODE 1
991 #define ACPI_MEM_LIST_FIRST_CACHE_LIST 2
992 #define ACPI_MEM_LIST_STATE 2
993 #define ACPI_MEM_LIST_PSNODE 3
994 #define ACPI_MEM_LIST_PSNODE_EXT 4
995 #define ACPI_MEM_LIST_OPERAND 5
996 #define ACPI_MEM_LIST_WALK 6
997 #define ACPI_MEM_LIST_MAX 6
998 #define ACPI_NUM_MEM_LISTS 7
1005 UINT16 MaxCacheDepth;
1009 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1011 /* Statistics for debug memory tracking only */
1013 UINT32 TotalAllocated;
1015 UINT32 CurrentTotalSize;
1016 UINT32 CacheRequests;
1025 #endif /* __ACLOCAL_H__ */