Deleted Added
full compact
aclocal.h (85756) aclocal.h (87031)
1/******************************************************************************
2 *
3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
1/******************************************************************************
2 *
3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
4 * $Revision: 138 $
4 * $Revision: 145 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
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.
21 *
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
28 *
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;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
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.
54 *
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.
66 *
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.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
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.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
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.
90 *
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.
99 *
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.
114 *
115 *****************************************************************************/
116
117#ifndef __ACLOCAL_H__
118#define __ACLOCAL_H__
119
120
121#define WAIT_FOREVER ((UINT32) -1)
122
123typedef void* ACPI_MUTEX;
124typedef UINT32 ACPI_MUTEX_HANDLE;
125
126
127#define ACPI_MEMORY_MODE 0x01
128#define ACPI_LOGICAL_ADDRESSING 0x00
129#define ACPI_PHYSICAL_ADDRESSING 0x01
130
131/* Object descriptor types */
132
133#define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */
134#define ACPI_DESC_TYPE_STATE 0x20
135#define ACPI_DESC_TYPE_STATE_UPDATE 0x21
136#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22
137#define ACPI_DESC_TYPE_STATE_CONTROL 0x23
138#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24
139#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25
140#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26
141#define ACPI_DESC_TYPE_STATE_RESULT 0x27
142#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
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.
21 *
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
28 *
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;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
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.
54 *
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.
66 *
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.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
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.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
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.
90 *
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.
99 *
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.
114 *
115 *****************************************************************************/
116
117#ifndef __ACLOCAL_H__
118#define __ACLOCAL_H__
119
120
121#define WAIT_FOREVER ((UINT32) -1)
122
123typedef void* ACPI_MUTEX;
124typedef UINT32 ACPI_MUTEX_HANDLE;
125
126
127#define ACPI_MEMORY_MODE 0x01
128#define ACPI_LOGICAL_ADDRESSING 0x00
129#define ACPI_PHYSICAL_ADDRESSING 0x01
130
131/* Object descriptor types */
132
133#define ACPI_CACHED_OBJECT 0x11 /* ORed in when object is cached */
134#define ACPI_DESC_TYPE_STATE 0x20
135#define ACPI_DESC_TYPE_STATE_UPDATE 0x21
136#define ACPI_DESC_TYPE_STATE_PACKAGE 0x22
137#define ACPI_DESC_TYPE_STATE_CONTROL 0x23
138#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x24
139#define ACPI_DESC_TYPE_STATE_PSCOPE 0x25
140#define ACPI_DESC_TYPE_STATE_WSCOPE 0x26
141#define ACPI_DESC_TYPE_STATE_RESULT 0x27
142#define ACPI_DESC_TYPE_STATE_NOTIFY 0x28
143#define ACPI_DESC_TYPE_STATE_THREAD 0x29
143#define ACPI_DESC_TYPE_WALK 0x44
144#define ACPI_DESC_TYPE_PARSER 0x66
145#define ACPI_DESC_TYPE_INTERNAL 0x88
146#define ACPI_DESC_TYPE_NAMED 0xAA
147
148
149/*****************************************************************************
150 *
151 * Mutex typedefs and structs
152 *
153 ****************************************************************************/
154
155
156/*
157 * Predefined handles for the mutex objects used within the subsystem
158 * All mutex objects are automatically created by AcpiUtMutexInitialize.
159 *
160 * The acquire/release ordering protocol is implied via this list. Mutexes
161 * with a lower value must be acquired before mutexes with a higher value.
162 *
163 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames table also!
164 */
165
166#define ACPI_MTX_EXECUTE 0
167#define ACPI_MTX_INTERPRETER 1
168#define ACPI_MTX_PARSER 2
169#define ACPI_MTX_DISPATCHER 3
170#define ACPI_MTX_TABLES 4
171#define ACPI_MTX_OP_REGIONS 5
172#define ACPI_MTX_NAMESPACE 6
173#define ACPI_MTX_EVENTS 7
174#define ACPI_MTX_HARDWARE 8
175#define ACPI_MTX_CACHES 9
176#define ACPI_MTX_MEMORY 10
177#define ACPI_MTX_DEBUG_CMD_COMPLETE 11
178#define ACPI_MTX_DEBUG_CMD_READY 12
179
180#define MAX_MTX 12
181#define NUM_MTX MAX_MTX+1
182
183
184#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
185#ifdef DEFINE_ACPI_GLOBALS
186
187/* Names for the mutexes used in the subsystem */
188
189static NATIVE_CHAR *AcpiGbl_MutexNames[] =
190{
191 "ACPI_MTX_Execute",
192 "ACPI_MTX_Interpreter",
193 "ACPI_MTX_Parser",
194 "ACPI_MTX_Dispatcher",
195 "ACPI_MTX_Tables",
196 "ACPI_MTX_OpRegions",
197 "ACPI_MTX_Namespace",
198 "ACPI_MTX_Events",
199 "ACPI_MTX_Hardware",
200 "ACPI_MTX_Caches",
201 "ACPI_MTX_Memory",
202 "ACPI_MTX_DebugCmdComplete",
203 "ACPI_MTX_DebugCmdReady",
204};
205
206#endif
207#endif
208
209
210/* Table for the global mutexes */
211
212typedef struct AcpiMutexInfo
213{
214 ACPI_MUTEX Mutex;
215 UINT32 UseCount;
216 UINT32 OwnerId;
217
218} ACPI_MUTEX_INFO;
219
220/* This owner ID means that the mutex is not in use (unlocked) */
221
222#define ACPI_MUTEX_NOT_ACQUIRED (UINT32) (-1)
223
224
225/* Lock flag parameter for various interfaces */
226
227#define ACPI_MTX_DO_NOT_LOCK 0
228#define ACPI_MTX_LOCK 1
229
230
231typedef UINT16 ACPI_OWNER_ID;
232#define OWNER_TYPE_TABLE 0x0
233#define OWNER_TYPE_METHOD 0x1
234#define FIRST_METHOD_ID 0x0000
235#define FIRST_TABLE_ID 0x8000
236
237/* TBD: [Restructure] get rid of the need for this! */
238
239#define TABLE_ID_DSDT (ACPI_OWNER_ID) 0x8000
240
241
242/* Field access granularities */
243
244#define ACPI_FIELD_BYTE_GRANULARITY 1
245#define ACPI_FIELD_WORD_GRANULARITY 2
246#define ACPI_FIELD_DWORD_GRANULARITY 4
247#define ACPI_FIELD_QWORD_GRANULARITY 8
248
249/*****************************************************************************
250 *
251 * Namespace typedefs and structs
252 *
253 ****************************************************************************/
254
255
256/* Operational modes of the AML interpreter/scanner */
257
258typedef enum
259{
260 IMODE_LOAD_PASS1 = 0x01,
261 IMODE_LOAD_PASS2 = 0x02,
262 IMODE_EXECUTE = 0x0E
263
264} OPERATING_MODE;
265
266
267/*
268 * The Node describes a named object that appears in the AML
269 * An AcpiNode is used to store Nodes.
270 *
271 * DataType is used to differentiate between internal descriptors, and MUST
272 * be the first byte in this structure.
273 */
274
275typedef struct acpi_node
276{
277 UINT8 DataType;
278 UINT8 Type; /* Type associated with this name */
279 UINT16 OwnerId;
280 UINT32 Name; /* ACPI Name, always 4 chars per ACPI spec */
281
282
283 union acpi_operand_obj *Object; /* Pointer to attached ACPI object (optional) */
284 struct acpi_node *Child; /* first child */
285 struct acpi_node *Peer; /* Next peer*/
286 UINT16 ReferenceCount; /* Current count of references and children */
287 UINT8 Flags;
288
289} ACPI_NAMESPACE_NODE;
290
291
292#define ENTRY_NOT_FOUND NULL
293
294
295/* Node flags */
296
144#define ACPI_DESC_TYPE_WALK 0x44
145#define ACPI_DESC_TYPE_PARSER 0x66
146#define ACPI_DESC_TYPE_INTERNAL 0x88
147#define ACPI_DESC_TYPE_NAMED 0xAA
148
149
150/*****************************************************************************
151 *
152 * Mutex typedefs and structs
153 *
154 ****************************************************************************/
155
156
157/*
158 * Predefined handles for the mutex objects used within the subsystem
159 * All mutex objects are automatically created by AcpiUtMutexInitialize.
160 *
161 * The acquire/release ordering protocol is implied via this list. Mutexes
162 * with a lower value must be acquired before mutexes with a higher value.
163 *
164 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames table also!
165 */
166
167#define ACPI_MTX_EXECUTE 0
168#define ACPI_MTX_INTERPRETER 1
169#define ACPI_MTX_PARSER 2
170#define ACPI_MTX_DISPATCHER 3
171#define ACPI_MTX_TABLES 4
172#define ACPI_MTX_OP_REGIONS 5
173#define ACPI_MTX_NAMESPACE 6
174#define ACPI_MTX_EVENTS 7
175#define ACPI_MTX_HARDWARE 8
176#define ACPI_MTX_CACHES 9
177#define ACPI_MTX_MEMORY 10
178#define ACPI_MTX_DEBUG_CMD_COMPLETE 11
179#define ACPI_MTX_DEBUG_CMD_READY 12
180
181#define MAX_MTX 12
182#define NUM_MTX MAX_MTX+1
183
184
185#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
186#ifdef DEFINE_ACPI_GLOBALS
187
188/* Names for the mutexes used in the subsystem */
189
190static NATIVE_CHAR *AcpiGbl_MutexNames[] =
191{
192 "ACPI_MTX_Execute",
193 "ACPI_MTX_Interpreter",
194 "ACPI_MTX_Parser",
195 "ACPI_MTX_Dispatcher",
196 "ACPI_MTX_Tables",
197 "ACPI_MTX_OpRegions",
198 "ACPI_MTX_Namespace",
199 "ACPI_MTX_Events",
200 "ACPI_MTX_Hardware",
201 "ACPI_MTX_Caches",
202 "ACPI_MTX_Memory",
203 "ACPI_MTX_DebugCmdComplete",
204 "ACPI_MTX_DebugCmdReady",
205};
206
207#endif
208#endif
209
210
211/* Table for the global mutexes */
212
213typedef struct AcpiMutexInfo
214{
215 ACPI_MUTEX Mutex;
216 UINT32 UseCount;
217 UINT32 OwnerId;
218
219} ACPI_MUTEX_INFO;
220
221/* This owner ID means that the mutex is not in use (unlocked) */
222
223#define ACPI_MUTEX_NOT_ACQUIRED (UINT32) (-1)
224
225
226/* Lock flag parameter for various interfaces */
227
228#define ACPI_MTX_DO_NOT_LOCK 0
229#define ACPI_MTX_LOCK 1
230
231
232typedef UINT16 ACPI_OWNER_ID;
233#define OWNER_TYPE_TABLE 0x0
234#define OWNER_TYPE_METHOD 0x1
235#define FIRST_METHOD_ID 0x0000
236#define FIRST_TABLE_ID 0x8000
237
238/* TBD: [Restructure] get rid of the need for this! */
239
240#define TABLE_ID_DSDT (ACPI_OWNER_ID) 0x8000
241
242
243/* Field access granularities */
244
245#define ACPI_FIELD_BYTE_GRANULARITY 1
246#define ACPI_FIELD_WORD_GRANULARITY 2
247#define ACPI_FIELD_DWORD_GRANULARITY 4
248#define ACPI_FIELD_QWORD_GRANULARITY 8
249
250/*****************************************************************************
251 *
252 * Namespace typedefs and structs
253 *
254 ****************************************************************************/
255
256
257/* Operational modes of the AML interpreter/scanner */
258
259typedef enum
260{
261 IMODE_LOAD_PASS1 = 0x01,
262 IMODE_LOAD_PASS2 = 0x02,
263 IMODE_EXECUTE = 0x0E
264
265} OPERATING_MODE;
266
267
268/*
269 * The Node describes a named object that appears in the AML
270 * An AcpiNode is used to store Nodes.
271 *
272 * DataType is used to differentiate between internal descriptors, and MUST
273 * be the first byte in this structure.
274 */
275
276typedef struct acpi_node
277{
278 UINT8 DataType;
279 UINT8 Type; /* Type associated with this name */
280 UINT16 OwnerId;
281 UINT32 Name; /* ACPI Name, always 4 chars per ACPI spec */
282
283
284 union acpi_operand_obj *Object; /* Pointer to attached ACPI object (optional) */
285 struct acpi_node *Child; /* first child */
286 struct acpi_node *Peer; /* Next peer*/
287 UINT16 ReferenceCount; /* Current count of references and children */
288 UINT8 Flags;
289
290} ACPI_NAMESPACE_NODE;
291
292
293#define ENTRY_NOT_FOUND NULL
294
295
296/* Node flags */
297
297#define ANOBJ_AML_ATTACHMENT 0x01
298#define ANOBJ_RESERVED 0x01
298#define ANOBJ_END_OF_PEER_LIST 0x02
299#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
300#define ANOBJ_METHOD_ARG 0x08
301#define ANOBJ_METHOD_LOCAL 0x10
302#define ANOBJ_METHOD_NO_RETVAL 0x20
303#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
304
305#define ANOBJ_IS_BIT_OFFSET 0x80
306
307
308/*
309 * ACPI Table Descriptor. One per ACPI table
310 */
311typedef struct AcpiTableDesc
312{
313 struct AcpiTableDesc *Prev;
314 struct AcpiTableDesc *Next;
315 struct AcpiTableDesc *InstalledDesc;
316 ACPI_TABLE_HEADER *Pointer;
317 void *BasePointer;
318 UINT8 *AmlStart;
319 UINT64 PhysicalAddress;
320 UINT32 AmlLength;
321 UINT32 Length;
322 UINT32 Count;
323 ACPI_OWNER_ID TableId;
324 UINT8 Type;
325 UINT8 Allocation;
326 BOOLEAN LoadedIntoNamespace;
327
328} ACPI_TABLE_DESC;
329
330
331typedef struct
332{
333 NATIVE_CHAR *SearchFor;
334 ACPI_HANDLE *List;
335 UINT32 *Count;
336
337} FIND_CONTEXT;
338
339
340typedef struct
341{
342 ACPI_NAMESPACE_NODE *Node;
343} NS_SEARCH_DATA;
344
345
346/*
347 * Predefined Namespace items
348 */
349typedef struct
350{
351 NATIVE_CHAR *Name;
352 ACPI_OBJECT_TYPE8 Type;
353 NATIVE_CHAR *Val;
354
355} PREDEFINED_NAMES;
356
357
358/* Object types used during package copies */
359
360
361#define ACPI_COPY_TYPE_SIMPLE 0
362#define ACPI_COPY_TYPE_PACKAGE 1
363
364/* Info structure used to convert external<->internal namestrings */
365
366typedef struct acpi_namestring_info
367{
368 NATIVE_CHAR *ExternalName;
369 NATIVE_CHAR *NextExternalChar;
370 NATIVE_CHAR *InternalName;
371 UINT32 Length;
372 UINT32 NumSegments;
373 UINT32 NumCarats;
374 BOOLEAN FullyQualified;
375
376} ACPI_NAMESTRING_INFO;
377
378
379/* Field creation info */
380
381typedef struct
382{
383 ACPI_NAMESPACE_NODE *RegionNode;
384 ACPI_NAMESPACE_NODE *FieldNode;
385 ACPI_NAMESPACE_NODE *RegisterNode;
386 ACPI_NAMESPACE_NODE *DataRegisterNode;
387 UINT32 BankValue;
388 UINT32 FieldBitPosition;
389 UINT32 FieldBitLength;
390 UINT8 FieldFlags;
299#define ANOBJ_END_OF_PEER_LIST 0x02
300#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
301#define ANOBJ_METHOD_ARG 0x08
302#define ANOBJ_METHOD_LOCAL 0x10
303#define ANOBJ_METHOD_NO_RETVAL 0x20
304#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
305
306#define ANOBJ_IS_BIT_OFFSET 0x80
307
308
309/*
310 * ACPI Table Descriptor. One per ACPI table
311 */
312typedef struct AcpiTableDesc
313{
314 struct AcpiTableDesc *Prev;
315 struct AcpiTableDesc *Next;
316 struct AcpiTableDesc *InstalledDesc;
317 ACPI_TABLE_HEADER *Pointer;
318 void *BasePointer;
319 UINT8 *AmlStart;
320 UINT64 PhysicalAddress;
321 UINT32 AmlLength;
322 UINT32 Length;
323 UINT32 Count;
324 ACPI_OWNER_ID TableId;
325 UINT8 Type;
326 UINT8 Allocation;
327 BOOLEAN LoadedIntoNamespace;
328
329} ACPI_TABLE_DESC;
330
331
332typedef struct
333{
334 NATIVE_CHAR *SearchFor;
335 ACPI_HANDLE *List;
336 UINT32 *Count;
337
338} FIND_CONTEXT;
339
340
341typedef struct
342{
343 ACPI_NAMESPACE_NODE *Node;
344} NS_SEARCH_DATA;
345
346
347/*
348 * Predefined Namespace items
349 */
350typedef struct
351{
352 NATIVE_CHAR *Name;
353 ACPI_OBJECT_TYPE8 Type;
354 NATIVE_CHAR *Val;
355
356} PREDEFINED_NAMES;
357
358
359/* Object types used during package copies */
360
361
362#define ACPI_COPY_TYPE_SIMPLE 0
363#define ACPI_COPY_TYPE_PACKAGE 1
364
365/* Info structure used to convert external<->internal namestrings */
366
367typedef struct acpi_namestring_info
368{
369 NATIVE_CHAR *ExternalName;
370 NATIVE_CHAR *NextExternalChar;
371 NATIVE_CHAR *InternalName;
372 UINT32 Length;
373 UINT32 NumSegments;
374 UINT32 NumCarats;
375 BOOLEAN FullyQualified;
376
377} ACPI_NAMESTRING_INFO;
378
379
380/* Field creation info */
381
382typedef struct
383{
384 ACPI_NAMESPACE_NODE *RegionNode;
385 ACPI_NAMESPACE_NODE *FieldNode;
386 ACPI_NAMESPACE_NODE *RegisterNode;
387 ACPI_NAMESPACE_NODE *DataRegisterNode;
388 UINT32 BankValue;
389 UINT32 FieldBitPosition;
390 UINT32 FieldBitLength;
391 UINT8 FieldFlags;
392 UINT8 Attribute;
391 UINT8 FieldType;
392
393} ACPI_CREATE_FIELD_INFO;
394
393 UINT8 FieldType;
394
395} ACPI_CREATE_FIELD_INFO;
396
395/*
396 * Field flags: Bits 00 - 03 : AccessType (AnyAcc, ByteAcc, etc.)
397 * 04 : LockRule (1 == Lock)
398 * 05 - 06 : UpdateRule
399 */
400
397
401#define FIELD_ACCESS_TYPE_MASK 0x0F
402#define FIELD_LOCK_RULE_MASK 0x10
403#define FIELD_UPDATE_RULE_MASK 0x60
404
398
405
406/*****************************************************************************
407 *
408 * Event typedefs and structs
409 *
410 ****************************************************************************/
411
412
413/* Status bits. */
414
415#define ACPI_STATUS_PMTIMER 0x0001
416#define ACPI_STATUS_BUSMASTER 0x0010
417#define ACPI_STATUS_GLOBAL 0x0020
418#define ACPI_STATUS_POWER_BUTTON 0x0100
419#define ACPI_STATUS_SLEEP_BUTTON 0x0200
420#define ACPI_STATUS_RTC_ALARM 0x0400
421
422/* Enable bits. */
423
424#define ACPI_ENABLE_PMTIMER 0x0001
425#define ACPI_ENABLE_GLOBAL 0x0020
426#define ACPI_ENABLE_POWER_BUTTON 0x0100
427#define ACPI_ENABLE_SLEEP_BUTTON 0x0200
428#define ACPI_ENABLE_RTC_ALARM 0x0400
429
430
399/*****************************************************************************
400 *
401 * Event typedefs and structs
402 *
403 ****************************************************************************/
404
405
406/* Status bits. */
407
408#define ACPI_STATUS_PMTIMER 0x0001
409#define ACPI_STATUS_BUSMASTER 0x0010
410#define ACPI_STATUS_GLOBAL 0x0020
411#define ACPI_STATUS_POWER_BUTTON 0x0100
412#define ACPI_STATUS_SLEEP_BUTTON 0x0200
413#define ACPI_STATUS_RTC_ALARM 0x0400
414
415/* Enable bits. */
416
417#define ACPI_ENABLE_PMTIMER 0x0001
418#define ACPI_ENABLE_GLOBAL 0x0020
419#define ACPI_ENABLE_POWER_BUTTON 0x0100
420#define ACPI_ENABLE_SLEEP_BUTTON 0x0200
421#define ACPI_ENABLE_RTC_ALARM 0x0400
422
423
431/*
432 * Entry in the AddressSpace (AKA Operation Region) table
433 */
434
435typedef struct
436{
437 ACPI_ADR_SPACE_HANDLER Handler;
438 void *Context;
439
440} ACPI_ADR_SPACE_INFO;
441
442
443/* Values and addresses of the GPE registers (both banks) */
444
445typedef struct
446{
447 UINT16 StatusAddr; /* Address of status reg */
448 UINT16 EnableAddr; /* Address of enable reg */
449 UINT8 Status; /* Current value of status reg */
450 UINT8 Enable; /* Current value of enable reg */
451 UINT8 WakeEnable; /* Mask of bits to keep enabled when sleeping */
452 UINT8 GpeBase; /* Base GPE number */
453
454} ACPI_GPE_REGISTERS;
455
456
457#define ACPI_GPE_LEVEL_TRIGGERED 1
458#define ACPI_GPE_EDGE_TRIGGERED 2
459
460
461/* Information about each particular GPE level */
462
463typedef struct
464{
465 UINT8 Type; /* Level or Edge */
466
467 ACPI_HANDLE MethodHandle; /* Method handle for direct (fast) execution */
468 ACPI_GPE_HANDLER Handler; /* Address of handler, if any */
469 void *Context; /* Context to be passed to handler */
470
471} ACPI_GPE_LEVEL_INFO;
472
473
474/* Information about each particular fixed event */
475
476typedef struct
477{
478 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
479 void *Context; /* Context to be passed to handler */
480
481} ACPI_FIXED_EVENT_INFO;
482
483
484/* Information used during field processing */
485
486typedef struct
487{
488 UINT8 SkipField;
489 UINT8 FieldFlag;
490 UINT32 PkgLength;
491
492} ACPI_FIELD_INFO;
493
494
495/*****************************************************************************
496 *
497 * Generic "state" object for stacks
498 *
499 ****************************************************************************/
500
501
502#define CONTROL_NORMAL 0xC0
503#define CONTROL_CONDITIONAL_EXECUTING 0xC1
504#define CONTROL_PREDICATE_EXECUTING 0xC2
505#define CONTROL_PREDICATE_FALSE 0xC3
506#define CONTROL_PREDICATE_TRUE 0xC4
507
508
509/* Forward declarations */
510struct acpi_walk_state;
424/* Values and addresses of the GPE registers (both banks) */
425
426typedef struct
427{
428 UINT16 StatusAddr; /* Address of status reg */
429 UINT16 EnableAddr; /* Address of enable reg */
430 UINT8 Status; /* Current value of status reg */
431 UINT8 Enable; /* Current value of enable reg */
432 UINT8 WakeEnable; /* Mask of bits to keep enabled when sleeping */
433 UINT8 GpeBase; /* Base GPE number */
434
435} ACPI_GPE_REGISTERS;
436
437
438#define ACPI_GPE_LEVEL_TRIGGERED 1
439#define ACPI_GPE_EDGE_TRIGGERED 2
440
441
442/* Information about each particular GPE level */
443
444typedef struct
445{
446 UINT8 Type; /* Level or Edge */
447
448 ACPI_HANDLE MethodHandle; /* Method handle for direct (fast) execution */
449 ACPI_GPE_HANDLER Handler; /* Address of handler, if any */
450 void *Context; /* Context to be passed to handler */
451
452} ACPI_GPE_LEVEL_INFO;
453
454
455/* Information about each particular fixed event */
456
457typedef struct
458{
459 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
460 void *Context; /* Context to be passed to handler */
461
462} ACPI_FIXED_EVENT_INFO;
463
464
465/* Information used during field processing */
466
467typedef struct
468{
469 UINT8 SkipField;
470 UINT8 FieldFlag;
471 UINT32 PkgLength;
472
473} ACPI_FIELD_INFO;
474
475
476/*****************************************************************************
477 *
478 * Generic "state" object for stacks
479 *
480 ****************************************************************************/
481
482
483#define CONTROL_NORMAL 0xC0
484#define CONTROL_CONDITIONAL_EXECUTING 0xC1
485#define CONTROL_PREDICATE_EXECUTING 0xC2
486#define CONTROL_PREDICATE_FALSE 0xC3
487#define CONTROL_PREDICATE_TRUE 0xC4
488
489
490/* Forward declarations */
491struct acpi_walk_state;
511struct acpi_walk_list;
512struct acpi_parse_obj;
513struct acpi_obj_mutex;
514
515
516#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
517 UINT8 DataType; /* To differentiate various internal objs */\
518 UINT8 Flags; \
519 UINT16 Value; \
520 UINT16 State; \
521 UINT16 AcpiEval; \
522 void *Next; \
523
524typedef struct acpi_common_state
525{
526 ACPI_STATE_COMMON
527} ACPI_COMMON_STATE;
528
529
530/*
531 * Update state - used to traverse complex objects such as packages
532 */
533typedef struct acpi_update_state
534{
535 ACPI_STATE_COMMON
536 union acpi_operand_obj *Object;
537
538} ACPI_UPDATE_STATE;
539
540
541/*
542 * Pkg state - used to traverse nested package structures
543 */
544typedef struct acpi_pkg_state
545{
546 ACPI_STATE_COMMON
547 union acpi_operand_obj *SourceObject;
548 union acpi_operand_obj *DestObject;
549 struct acpi_walk_state *WalkState;
550 void *ThisTargetObj;
551 UINT32 NumPackages;
552 UINT16 Index;
553
554} ACPI_PKG_STATE;
555
556
557/*
558 * Control state - one per if/else and while constructs.
559 * Allows nesting of these constructs
560 */
561typedef struct acpi_control_state
562{
563 ACPI_STATE_COMMON
564 struct acpi_parse_obj *PredicateOp;
492struct acpi_parse_obj;
493struct acpi_obj_mutex;
494
495
496#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
497 UINT8 DataType; /* To differentiate various internal objs */\
498 UINT8 Flags; \
499 UINT16 Value; \
500 UINT16 State; \
501 UINT16 AcpiEval; \
502 void *Next; \
503
504typedef struct acpi_common_state
505{
506 ACPI_STATE_COMMON
507} ACPI_COMMON_STATE;
508
509
510/*
511 * Update state - used to traverse complex objects such as packages
512 */
513typedef struct acpi_update_state
514{
515 ACPI_STATE_COMMON
516 union acpi_operand_obj *Object;
517
518} ACPI_UPDATE_STATE;
519
520
521/*
522 * Pkg state - used to traverse nested package structures
523 */
524typedef struct acpi_pkg_state
525{
526 ACPI_STATE_COMMON
527 union acpi_operand_obj *SourceObject;
528 union acpi_operand_obj *DestObject;
529 struct acpi_walk_state *WalkState;
530 void *ThisTargetObj;
531 UINT32 NumPackages;
532 UINT16 Index;
533
534} ACPI_PKG_STATE;
535
536
537/*
538 * Control state - one per if/else and while constructs.
539 * Allows nesting of these constructs
540 */
541typedef struct acpi_control_state
542{
543 ACPI_STATE_COMMON
544 struct acpi_parse_obj *PredicateOp;
565 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
545 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
566
567} ACPI_CONTROL_STATE;
568
569
570/*
571 * Scope state - current scope during namespace lookups
572 */
573typedef struct acpi_scope_state
574{
575 ACPI_STATE_COMMON
576 ACPI_NAMESPACE_NODE *Node;
577
578} ACPI_SCOPE_STATE;
579
580
581typedef struct acpi_pscope_state
582{
583 ACPI_STATE_COMMON
546
547} ACPI_CONTROL_STATE;
548
549
550/*
551 * Scope state - current scope during namespace lookups
552 */
553typedef struct acpi_scope_state
554{
555 ACPI_STATE_COMMON
556 ACPI_NAMESPACE_NODE *Node;
557
558} ACPI_SCOPE_STATE;
559
560
561typedef struct acpi_pscope_state
562{
563 ACPI_STATE_COMMON
584 struct acpi_parse_obj *Op; /* current op being parsed */
585 UINT8 *ArgEnd; /* current argument end */
586 UINT8 *PkgEnd; /* current package end */
587 UINT32 ArgList; /* next argument to parse */
588 UINT32 ArgCount; /* Number of fixed arguments */
564 struct acpi_parse_obj *Op; /* current op being parsed */
565 UINT8 *ArgEnd; /* current argument end */
566 UINT8 *PkgEnd; /* current package end */
567 UINT32 ArgList; /* next argument to parse */
568 UINT32 ArgCount; /* Number of fixed arguments */
589
590} ACPI_PSCOPE_STATE;
591
592
593/*
569
570} ACPI_PSCOPE_STATE;
571
572
573/*
574 * Thread state - one per thread across multiple walk states. Multiple walk
575 * states are created when there are nested control methods executing.
576 */
577typedef struct acpi_thread_state
578{
579 ACPI_STATE_COMMON
580 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */
581 union acpi_operand_obj *AcquiredMutexList; /* List of all currently acquired mutexes */
582 UINT32 ThreadId; /* Running thread ID */
583 UINT16 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */
584
585} ACPI_THREAD_STATE;
586
587
588/*
594 * Result values - used to accumulate the results of nested
595 * AML arguments
596 */
597typedef struct acpi_result_values
598{
599 ACPI_STATE_COMMON
600 union acpi_operand_obj *ObjDesc [OBJ_NUM_OPERANDS];
601 UINT8 NumResults;
602 UINT8 LastInsert;
603
604} ACPI_RESULT_VALUES;
605
606
607typedef
608ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
609 struct acpi_walk_state *WalkState,
610 struct acpi_parse_obj **OutOp);
611
612typedef
613ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
614 struct acpi_walk_state *WalkState);
615
616
617/*
618 * Notify info - used to pass info to the deferred notify
619 * handler/dispatcher.
620 */
621typedef struct acpi_notify_info
622{
623 ACPI_STATE_COMMON
624 ACPI_NAMESPACE_NODE *Node;
625 union acpi_operand_obj *HandlerObj;
626
627} ACPI_NOTIFY_INFO;
628
629
630/* Generic state is union of structs above */
631
632typedef union acpi_gen_state
633{
634 ACPI_COMMON_STATE Common;
635 ACPI_CONTROL_STATE Control;
636 ACPI_UPDATE_STATE Update;
637 ACPI_SCOPE_STATE Scope;
638 ACPI_PSCOPE_STATE ParseScope;
639 ACPI_PKG_STATE Pkg;
589 * Result values - used to accumulate the results of nested
590 * AML arguments
591 */
592typedef struct acpi_result_values
593{
594 ACPI_STATE_COMMON
595 union acpi_operand_obj *ObjDesc [OBJ_NUM_OPERANDS];
596 UINT8 NumResults;
597 UINT8 LastInsert;
598
599} ACPI_RESULT_VALUES;
600
601
602typedef
603ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
604 struct acpi_walk_state *WalkState,
605 struct acpi_parse_obj **OutOp);
606
607typedef
608ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
609 struct acpi_walk_state *WalkState);
610
611
612/*
613 * Notify info - used to pass info to the deferred notify
614 * handler/dispatcher.
615 */
616typedef struct acpi_notify_info
617{
618 ACPI_STATE_COMMON
619 ACPI_NAMESPACE_NODE *Node;
620 union acpi_operand_obj *HandlerObj;
621
622} ACPI_NOTIFY_INFO;
623
624
625/* Generic state is union of structs above */
626
627typedef union acpi_gen_state
628{
629 ACPI_COMMON_STATE Common;
630 ACPI_CONTROL_STATE Control;
631 ACPI_UPDATE_STATE Update;
632 ACPI_SCOPE_STATE Scope;
633 ACPI_PSCOPE_STATE ParseScope;
634 ACPI_PKG_STATE Pkg;
635 ACPI_THREAD_STATE Thread;
640 ACPI_RESULT_VALUES Results;
641 ACPI_NOTIFY_INFO Notify;
642
643} ACPI_GENERIC_STATE;
644
645
636 ACPI_RESULT_VALUES Results;
637 ACPI_NOTIFY_INFO Notify;
638
639} ACPI_GENERIC_STATE;
640
641
646
647/*****************************************************************************
648 *
649 * Interpreter typedefs and structs
650 *
651 ****************************************************************************/
652
653typedef
654ACPI_STATUS (*ACPI_EXECUTE_OP) (
655 struct acpi_walk_state *WalkState);
656
657
658/*****************************************************************************
659 *
660 * Parser typedefs and structs
661 *
662 ****************************************************************************/
663
664/*
665 * AML opcode, name, and argument layout
666 */
667typedef struct acpi_opcode_info
668{
642/*****************************************************************************
643 *
644 * Interpreter typedefs and structs
645 *
646 ****************************************************************************/
647
648typedef
649ACPI_STATUS (*ACPI_EXECUTE_OP) (
650 struct acpi_walk_state *WalkState);
651
652
653/*****************************************************************************
654 *
655 * Parser typedefs and structs
656 *
657 ****************************************************************************/
658
659/*
660 * AML opcode, name, and argument layout
661 */
662typedef struct acpi_opcode_info
663{
664#ifdef _OPCODE_NAMES
665 NATIVE_CHAR *Name; /* Opcode name (debug only) */
666#endif
669 UINT32 ParseArgs; /* Grammar/Parse time arguments */
670 UINT32 RuntimeArgs; /* Interpret time arguments */
667 UINT32 ParseArgs; /* Grammar/Parse time arguments */
668 UINT32 RuntimeArgs; /* Interpret time arguments */
671 UINT16 Flags; /* Misc flags */
669 UINT32 Flags; /* Misc flags */
670 UINT8 ObjectType; /* Corresponding internal object type */
672 UINT8 Class; /* Opcode class */
673 UINT8 Type; /* Opcode type */
674
671 UINT8 Class; /* Opcode class */
672 UINT8 Type; /* Opcode type */
673
675#ifdef _OPCODE_NAMES
676 NATIVE_CHAR *Name; /* op name (debug only) */
677#endif
678
679} ACPI_OPCODE_INFO;
680
681
682typedef union acpi_parse_val
683{
684 ACPI_INTEGER Integer; /* integer constant (Up to 64 bits) */
685 UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */
686 UINT32 Integer32; /* integer constant, 32 bits only */
687 UINT16 Integer16; /* integer constant, 16 bits only */
688 UINT8 Integer8; /* integer constant, 8 bits only */
689 UINT32 Size; /* bytelist or field size */
690 NATIVE_CHAR *String; /* NULL terminated string */
691 UINT8 *Buffer; /* buffer or string */
692 NATIVE_CHAR *Name; /* NULL terminated string */
693 struct acpi_parse_obj *Arg; /* arguments and contained ops */
694
695} ACPI_PARSE_VALUE;
696
697
698#define ACPI_PARSE_COMMON \
699 UINT8 DataType; /* To differentiate various internal objs */\
700 UINT8 Flags; /* Type of Op */\
701 UINT16 Opcode; /* AML opcode */\
702 UINT32 AmlOffset; /* offset of declaration in AML */\
703 struct acpi_parse_obj *Parent; /* parent op */\
704 struct acpi_parse_obj *Next; /* next op */\
705 DEBUG_ONLY_MEMBERS (\
706 NATIVE_CHAR OpName[16]) /* op name (debug only) */\
707 /* NON-DEBUG members below: */\
708 ACPI_NAMESPACE_NODE *Node; /* for use by interpreter */\
709 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
710
711
712/*
713 * generic operation (eg. If, While, Store)
714 */
715typedef struct acpi_parse_obj
716{
717 ACPI_PARSE_COMMON
718} ACPI_PARSE_OBJECT;
719
720
721/*
722 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
723 * and bytelists.
724 */
725typedef struct acpi_parse2_obj
726{
727 ACPI_PARSE_COMMON
728 UINT8 *Data; /* AML body or bytelist data */
729 UINT32 Length; /* AML length */
730 UINT32 Name; /* 4-byte name or zero if no name */
731
732} ACPI_PARSE2_OBJECT;
733
734
735/*
736 * Parse state - one state per parser invocation and each control
737 * method.
738 */
739typedef struct acpi_parse_state
740{
741 UINT32 AmlSize;
742 UINT8 *AmlStart; /* first AML byte */
743 UINT8 *Aml; /* next AML byte */
744 UINT8 *AmlEnd; /* (last + 1) AML byte */
745 UINT8 *PkgStart; /* current package begin */
746 UINT8 *PkgEnd; /* current package end */
747
748 struct acpi_parse_obj *StartOp; /* root of parse tree */
749 struct acpi_node *StartNode;
750 union acpi_gen_state *Scope; /* current scope */
751
752
753 struct acpi_parse_obj *StartScope;
754
755
674
675} ACPI_OPCODE_INFO;
676
677
678typedef union acpi_parse_val
679{
680 ACPI_INTEGER Integer; /* integer constant (Up to 64 bits) */
681 UINT64_STRUCT Integer64; /* Structure overlay for 2 32-bit Dwords */
682 UINT32 Integer32; /* integer constant, 32 bits only */
683 UINT16 Integer16; /* integer constant, 16 bits only */
684 UINT8 Integer8; /* integer constant, 8 bits only */
685 UINT32 Size; /* bytelist or field size */
686 NATIVE_CHAR *String; /* NULL terminated string */
687 UINT8 *Buffer; /* buffer or string */
688 NATIVE_CHAR *Name; /* NULL terminated string */
689 struct acpi_parse_obj *Arg; /* arguments and contained ops */
690
691} ACPI_PARSE_VALUE;
692
693
694#define ACPI_PARSE_COMMON \
695 UINT8 DataType; /* To differentiate various internal objs */\
696 UINT8 Flags; /* Type of Op */\
697 UINT16 Opcode; /* AML opcode */\
698 UINT32 AmlOffset; /* offset of declaration in AML */\
699 struct acpi_parse_obj *Parent; /* parent op */\
700 struct acpi_parse_obj *Next; /* next op */\
701 DEBUG_ONLY_MEMBERS (\
702 NATIVE_CHAR OpName[16]) /* op name (debug only) */\
703 /* NON-DEBUG members below: */\
704 ACPI_NAMESPACE_NODE *Node; /* for use by interpreter */\
705 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
706
707
708/*
709 * generic operation (eg. If, While, Store)
710 */
711typedef struct acpi_parse_obj
712{
713 ACPI_PARSE_COMMON
714} ACPI_PARSE_OBJECT;
715
716
717/*
718 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
719 * and bytelists.
720 */
721typedef struct acpi_parse2_obj
722{
723 ACPI_PARSE_COMMON
724 UINT8 *Data; /* AML body or bytelist data */
725 UINT32 Length; /* AML length */
726 UINT32 Name; /* 4-byte name or zero if no name */
727
728} ACPI_PARSE2_OBJECT;
729
730
731/*
732 * Parse state - one state per parser invocation and each control
733 * method.
734 */
735typedef struct acpi_parse_state
736{
737 UINT32 AmlSize;
738 UINT8 *AmlStart; /* first AML byte */
739 UINT8 *Aml; /* next AML byte */
740 UINT8 *AmlEnd; /* (last + 1) AML byte */
741 UINT8 *PkgStart; /* current package begin */
742 UINT8 *PkgEnd; /* current package end */
743
744 struct acpi_parse_obj *StartOp; /* root of parse tree */
745 struct acpi_node *StartNode;
746 union acpi_gen_state *Scope; /* current scope */
747
748
749 struct acpi_parse_obj *StartScope;
750
751
756
757
758} ACPI_PARSE_STATE;
759
760
761/*****************************************************************************
762 *
763 * Hardware and PNP
764 *
765 ****************************************************************************/
766
767
768/* PCI */
769#define PCI_ROOT_HID_STRING "PNP0A03"
770
771/*
772 * The #define's and enum below establish an abstract way of identifying what
773 * register block and register is to be accessed. Do not change any of the
774 * values as they are used in switch statements and offset calculations.
775 */
776
777#define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */
778#define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */
779#define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */
780
781#define REGISTER_BLOCK_ID(RegId) (RegId & REGISTER_BLOCK_MASK)
782#define REGISTER_BIT_ID(RegId) (RegId & BIT_IN_REGISTER_MASK)
783#define REGISTER_OFFSET(RegId) (RegId & BYTE_IN_REGISTER_MASK)
784
785/*
786 * Access Rule
787 * To access a Register Bit:
788 * -> Use Bit Name (= Register Block Id | Bit Id) defined in the enum.
789 *
790 * To access a Register:
791 * -> Use Register Id (= Register Block Id | Register Offset)
792 */
793
794
795/*
796 * Register Block Id
797 */
798#define PM1_STS 0x0100
799#define PM1_EN 0x0200
800#define PM1_CONTROL 0x0300
801#define PM1A_CONTROL 0x0400
802#define PM1B_CONTROL 0x0500
803#define PM2_CONTROL 0x0600
804#define PM_TIMER 0x0700
805#define PROCESSOR_BLOCK 0x0800
806#define GPE0_STS_BLOCK 0x0900
807#define GPE0_EN_BLOCK 0x0A00
808#define GPE1_STS_BLOCK 0x0B00
809#define GPE1_EN_BLOCK 0x0C00
810#define SMI_CMD_BLOCK 0x0D00
811
812/*
813 * Address space bitmasks for mmio or io spaces
814 */
815
816#define SMI_CMD_ADDRESS_SPACE 0x01
817#define PM1_BLK_ADDRESS_SPACE 0x02
818#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
819#define PM_TMR_BLK_ADDRESS_SPACE 0x08
820#define GPE0_BLK_ADDRESS_SPACE 0x10
821#define GPE1_BLK_ADDRESS_SPACE 0x20
822
823/*
824 * Control bit definitions
825 */
826#define TMR_STS (PM1_STS | 0x01)
827#define BM_STS (PM1_STS | 0x02)
828#define GBL_STS (PM1_STS | 0x03)
829#define PWRBTN_STS (PM1_STS | 0x04)
830#define SLPBTN_STS (PM1_STS | 0x05)
831#define RTC_STS (PM1_STS | 0x06)
832#define WAK_STS (PM1_STS | 0x07)
833
834#define TMR_EN (PM1_EN | 0x01)
835 /* no BM_EN */
836#define GBL_EN (PM1_EN | 0x03)
837#define PWRBTN_EN (PM1_EN | 0x04)
838#define SLPBTN_EN (PM1_EN | 0x05)
839#define RTC_EN (PM1_EN | 0x06)
840#define WAK_EN (PM1_EN | 0x07)
841
842#define SCI_EN (PM1_CONTROL | 0x01)
843#define BM_RLD (PM1_CONTROL | 0x02)
844#define GBL_RLS (PM1_CONTROL | 0x03)
845#define SLP_TYPE_A (PM1_CONTROL | 0x04)
846#define SLP_TYPE_B (PM1_CONTROL | 0x05)
847#define SLP_EN (PM1_CONTROL | 0x06)
848
849#define ARB_DIS (PM2_CONTROL | 0x01)
850
851#define TMR_VAL (PM_TIMER | 0x01)
852
853#define GPE0_STS (GPE0_STS_BLOCK | 0x01)
854#define GPE0_EN (GPE0_EN_BLOCK | 0x01)
855
856#define GPE1_STS (GPE1_STS_BLOCK | 0x01)
857#define GPE1_EN (GPE1_EN_BLOCK | 0x01)
858
859
860#define TMR_STS_MASK 0x0001
861#define BM_STS_MASK 0x0010
862#define GBL_STS_MASK 0x0020
863#define PWRBTN_STS_MASK 0x0100
864#define SLPBTN_STS_MASK 0x0200
865#define RTC_STS_MASK 0x0400
866#define WAK_STS_MASK 0x8000
867
868#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \
869 | PWRBTN_STS_MASK | SLPBTN_STS_MASK \
870 | RTC_STS_MASK | WAK_STS_MASK)
871
872#define TMR_EN_MASK 0x0001
873#define GBL_EN_MASK 0x0020
874#define PWRBTN_EN_MASK 0x0100
875#define SLPBTN_EN_MASK 0x0200
876#define RTC_EN_MASK 0x0400
877
878#define SCI_EN_MASK 0x0001
879#define BM_RLD_MASK 0x0002
880#define GBL_RLS_MASK 0x0004
881#define SLP_TYPE_X_MASK 0x1C00
882#define SLP_EN_MASK 0x2000
883
884#define ARB_DIS_MASK 0x0001
885#define TMR_VAL_MASK 0xFFFFFFFF
886
887#define GPE0_STS_MASK
888#define GPE0_EN_MASK
889
890#define GPE1_STS_MASK
891#define GPE1_EN_MASK
892
893
752} ACPI_PARSE_STATE;
753
754
755/*****************************************************************************
756 *
757 * Hardware and PNP
758 *
759 ****************************************************************************/
760
761
762/* PCI */
763#define PCI_ROOT_HID_STRING "PNP0A03"
764
765/*
766 * The #define's and enum below establish an abstract way of identifying what
767 * register block and register is to be accessed. Do not change any of the
768 * values as they are used in switch statements and offset calculations.
769 */
770
771#define REGISTER_BLOCK_MASK 0xFF00 /* Register Block Id */
772#define BIT_IN_REGISTER_MASK 0x00FF /* Bit Id in the Register Block Id */
773#define BYTE_IN_REGISTER_MASK 0x00FF /* Register Offset in the Register Block */
774
775#define REGISTER_BLOCK_ID(RegId) (RegId & REGISTER_BLOCK_MASK)
776#define REGISTER_BIT_ID(RegId) (RegId & BIT_IN_REGISTER_MASK)
777#define REGISTER_OFFSET(RegId) (RegId & BYTE_IN_REGISTER_MASK)
778
779/*
780 * Access Rule
781 * To access a Register Bit:
782 * -> Use Bit Name (= Register Block Id | Bit Id) defined in the enum.
783 *
784 * To access a Register:
785 * -> Use Register Id (= Register Block Id | Register Offset)
786 */
787
788
789/*
790 * Register Block Id
791 */
792#define PM1_STS 0x0100
793#define PM1_EN 0x0200
794#define PM1_CONTROL 0x0300
795#define PM1A_CONTROL 0x0400
796#define PM1B_CONTROL 0x0500
797#define PM2_CONTROL 0x0600
798#define PM_TIMER 0x0700
799#define PROCESSOR_BLOCK 0x0800
800#define GPE0_STS_BLOCK 0x0900
801#define GPE0_EN_BLOCK 0x0A00
802#define GPE1_STS_BLOCK 0x0B00
803#define GPE1_EN_BLOCK 0x0C00
804#define SMI_CMD_BLOCK 0x0D00
805
806/*
807 * Address space bitmasks for mmio or io spaces
808 */
809
810#define SMI_CMD_ADDRESS_SPACE 0x01
811#define PM1_BLK_ADDRESS_SPACE 0x02
812#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
813#define PM_TMR_BLK_ADDRESS_SPACE 0x08
814#define GPE0_BLK_ADDRESS_SPACE 0x10
815#define GPE1_BLK_ADDRESS_SPACE 0x20
816
817/*
818 * Control bit definitions
819 */
820#define TMR_STS (PM1_STS | 0x01)
821#define BM_STS (PM1_STS | 0x02)
822#define GBL_STS (PM1_STS | 0x03)
823#define PWRBTN_STS (PM1_STS | 0x04)
824#define SLPBTN_STS (PM1_STS | 0x05)
825#define RTC_STS (PM1_STS | 0x06)
826#define WAK_STS (PM1_STS | 0x07)
827
828#define TMR_EN (PM1_EN | 0x01)
829 /* no BM_EN */
830#define GBL_EN (PM1_EN | 0x03)
831#define PWRBTN_EN (PM1_EN | 0x04)
832#define SLPBTN_EN (PM1_EN | 0x05)
833#define RTC_EN (PM1_EN | 0x06)
834#define WAK_EN (PM1_EN | 0x07)
835
836#define SCI_EN (PM1_CONTROL | 0x01)
837#define BM_RLD (PM1_CONTROL | 0x02)
838#define GBL_RLS (PM1_CONTROL | 0x03)
839#define SLP_TYPE_A (PM1_CONTROL | 0x04)
840#define SLP_TYPE_B (PM1_CONTROL | 0x05)
841#define SLP_EN (PM1_CONTROL | 0x06)
842
843#define ARB_DIS (PM2_CONTROL | 0x01)
844
845#define TMR_VAL (PM_TIMER | 0x01)
846
847#define GPE0_STS (GPE0_STS_BLOCK | 0x01)
848#define GPE0_EN (GPE0_EN_BLOCK | 0x01)
849
850#define GPE1_STS (GPE1_STS_BLOCK | 0x01)
851#define GPE1_EN (GPE1_EN_BLOCK | 0x01)
852
853
854#define TMR_STS_MASK 0x0001
855#define BM_STS_MASK 0x0010
856#define GBL_STS_MASK 0x0020
857#define PWRBTN_STS_MASK 0x0100
858#define SLPBTN_STS_MASK 0x0200
859#define RTC_STS_MASK 0x0400
860#define WAK_STS_MASK 0x8000
861
862#define ALL_FIXED_STS_BITS (TMR_STS_MASK | BM_STS_MASK | GBL_STS_MASK \
863 | PWRBTN_STS_MASK | SLPBTN_STS_MASK \
864 | RTC_STS_MASK | WAK_STS_MASK)
865
866#define TMR_EN_MASK 0x0001
867#define GBL_EN_MASK 0x0020
868#define PWRBTN_EN_MASK 0x0100
869#define SLPBTN_EN_MASK 0x0200
870#define RTC_EN_MASK 0x0400
871
872#define SCI_EN_MASK 0x0001
873#define BM_RLD_MASK 0x0002
874#define GBL_RLS_MASK 0x0004
875#define SLP_TYPE_X_MASK 0x1C00
876#define SLP_EN_MASK 0x2000
877
878#define ARB_DIS_MASK 0x0001
879#define TMR_VAL_MASK 0xFFFFFFFF
880
881#define GPE0_STS_MASK
882#define GPE0_EN_MASK
883
884#define GPE1_STS_MASK
885#define GPE1_EN_MASK
886
887
894#define ACPI_READ 1
895#define ACPI_WRITE 2
896
897
898/*****************************************************************************
899 *
900 * Resource descriptors
901 *
902 ****************************************************************************/
903
904
905/* ResourceType values */
906
907#define RESOURCE_TYPE_MEMORY_RANGE 0
908#define RESOURCE_TYPE_IO_RANGE 1
909#define RESOURCE_TYPE_BUS_NUMBER_RANGE 2
910
911/* Resource descriptor types and masks */
912
913#define RESOURCE_DESC_TYPE_LARGE 0x80
914#define RESOURCE_DESC_TYPE_SMALL 0x00
915
916#define RESOURCE_DESC_TYPE_MASK 0x80
917#define RESOURCE_DESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
918
919
920/*
921 * Small resource descriptor types
922 * Note: The 3 length bits (2:0) must be zero
923 */
924#define RESOURCE_DESC_IRQ_FORMAT 0x20
925#define RESOURCE_DESC_DMA_FORMAT 0x28
926#define RESOURCE_DESC_START_DEPENDENT 0x30
927#define RESOURCE_DESC_END_DEPENDENT 0x38
928#define RESOURCE_DESC_IO_PORT 0x40
929#define RESOURCE_DESC_FIXED_IO_PORT 0x48
930#define RESOURCE_DESC_SMALL_VENDOR 0x70
931#define RESOURCE_DESC_END_TAG 0x78
932
933/*
934 * Large resource descriptor types
935 */
936
937#define RESOURCE_DESC_MEMORY_24 0x81
938#define RESOURCE_DESC_GENERAL_REGISTER 0x82
939#define RESOURCE_DESC_LARGE_VENDOR 0x84
940#define RESOURCE_DESC_MEMORY_32 0x85
941#define RESOURCE_DESC_FIXED_MEMORY_32 0x86
942#define RESOURCE_DESC_DWORD_ADDRESS_SPACE 0x87
943#define RESOURCE_DESC_WORD_ADDRESS_SPACE 0x88
944#define RESOURCE_DESC_EXTENDED_XRUPT 0x89
945#define RESOURCE_DESC_QWORD_ADDRESS_SPACE 0x8A
946
947
948/* String version of device HIDs and UIDs */
949
950#define ACPI_DEVICE_ID_LENGTH 0x09
951
952typedef struct
953{
954 char Buffer[ACPI_DEVICE_ID_LENGTH];
955
956} ACPI_DEVICE_ID;
957
958
959/*****************************************************************************
960 *
961 * Miscellaneous
962 *
963 ****************************************************************************/
964
965#define ASCII_ZERO 0x30
966
967/*****************************************************************************
968 *
969 * Debugger
970 *
971 ****************************************************************************/
972
973typedef struct dbmethodinfo
974{
975 ACPI_HANDLE ThreadGate;
976 NATIVE_CHAR *Name;
977 NATIVE_CHAR **Args;
978 UINT32 Flags;
979 UINT32 NumLoops;
980 NATIVE_CHAR Pathname[128];
981
982} DB_METHOD_INFO;
983
984
985/*****************************************************************************
986 *
987 * Debug
988 *
989 ****************************************************************************/
990
991typedef struct
992{
993 UINT32 ComponentId;
994 NATIVE_CHAR *ProcName;
995 NATIVE_CHAR *ModuleName;
996
997} ACPI_DEBUG_PRINT_INFO;
998
999
1000/* Entry for a memory allocation (debug only) */
1001
1002
1003#define MEM_MALLOC 0
1004#define MEM_CALLOC 1
1005#define MAX_MODULE_NAME 16
1006
1007#define ACPI_COMMON_DEBUG_MEM_HEADER \
1008 struct AcpiDebugMemBlock *Previous; \
1009 struct AcpiDebugMemBlock *Next; \
1010 UINT32 Size; \
1011 UINT32 Component; \
1012 UINT32 Line; \
1013 NATIVE_CHAR Module[MAX_MODULE_NAME]; \
1014 UINT8 AllocType;
1015
1016
1017typedef struct
1018{
1019 ACPI_COMMON_DEBUG_MEM_HEADER
1020
1021} ACPI_DEBUG_MEM_HEADER;
1022
1023typedef struct AcpiDebugMemBlock
1024{
1025 ACPI_COMMON_DEBUG_MEM_HEADER
1026 UINT64 UserSpace;
1027
1028} ACPI_DEBUG_MEM_BLOCK;
1029
1030
1031#define ACPI_MEM_LIST_GLOBAL 0
1032#define ACPI_MEM_LIST_NSNODE 1
1033
1034#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2
1035#define ACPI_MEM_LIST_STATE 2
1036#define ACPI_MEM_LIST_PSNODE 3
1037#define ACPI_MEM_LIST_PSNODE_EXT 4
1038#define ACPI_MEM_LIST_OPERAND 5
1039#define ACPI_MEM_LIST_WALK 6
1040#define ACPI_MEM_LIST_MAX 6
1041#define ACPI_NUM_MEM_LISTS 7
1042
1043
1044typedef struct
1045{
1046 void *ListHead;
1047 UINT16 LinkOffset;
1048 UINT16 MaxCacheDepth;
1049 UINT16 CacheDepth;
1050 UINT16 ObjectSize;
1051
1052#ifdef ACPI_DBG_TRACK_ALLOCATIONS
1053
1054 /* Statistics for debug memory tracking only */
1055
1056 UINT32 TotalAllocated;
1057 UINT32 TotalFreed;
1058 UINT32 CurrentTotalSize;
1059 UINT32 CacheRequests;
1060 UINT32 CacheHits;
1061 char *ListName;
1062#endif
1063
1064} ACPI_MEMORY_LIST;
1065
1066
1067#endif /* __ACLOCAL_H__ */
888/*****************************************************************************
889 *
890 * Resource descriptors
891 *
892 ****************************************************************************/
893
894
895/* ResourceType values */
896
897#define RESOURCE_TYPE_MEMORY_RANGE 0
898#define RESOURCE_TYPE_IO_RANGE 1
899#define RESOURCE_TYPE_BUS_NUMBER_RANGE 2
900
901/* Resource descriptor types and masks */
902
903#define RESOURCE_DESC_TYPE_LARGE 0x80
904#define RESOURCE_DESC_TYPE_SMALL 0x00
905
906#define RESOURCE_DESC_TYPE_MASK 0x80
907#define RESOURCE_DESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
908
909
910/*
911 * Small resource descriptor types
912 * Note: The 3 length bits (2:0) must be zero
913 */
914#define RESOURCE_DESC_IRQ_FORMAT 0x20
915#define RESOURCE_DESC_DMA_FORMAT 0x28
916#define RESOURCE_DESC_START_DEPENDENT 0x30
917#define RESOURCE_DESC_END_DEPENDENT 0x38
918#define RESOURCE_DESC_IO_PORT 0x40
919#define RESOURCE_DESC_FIXED_IO_PORT 0x48
920#define RESOURCE_DESC_SMALL_VENDOR 0x70
921#define RESOURCE_DESC_END_TAG 0x78
922
923/*
924 * Large resource descriptor types
925 */
926
927#define RESOURCE_DESC_MEMORY_24 0x81
928#define RESOURCE_DESC_GENERAL_REGISTER 0x82
929#define RESOURCE_DESC_LARGE_VENDOR 0x84
930#define RESOURCE_DESC_MEMORY_32 0x85
931#define RESOURCE_DESC_FIXED_MEMORY_32 0x86
932#define RESOURCE_DESC_DWORD_ADDRESS_SPACE 0x87
933#define RESOURCE_DESC_WORD_ADDRESS_SPACE 0x88
934#define RESOURCE_DESC_EXTENDED_XRUPT 0x89
935#define RESOURCE_DESC_QWORD_ADDRESS_SPACE 0x8A
936
937
938/* String version of device HIDs and UIDs */
939
940#define ACPI_DEVICE_ID_LENGTH 0x09
941
942typedef struct
943{
944 char Buffer[ACPI_DEVICE_ID_LENGTH];
945
946} ACPI_DEVICE_ID;
947
948
949/*****************************************************************************
950 *
951 * Miscellaneous
952 *
953 ****************************************************************************/
954
955#define ASCII_ZERO 0x30
956
957/*****************************************************************************
958 *
959 * Debugger
960 *
961 ****************************************************************************/
962
963typedef struct dbmethodinfo
964{
965 ACPI_HANDLE ThreadGate;
966 NATIVE_CHAR *Name;
967 NATIVE_CHAR **Args;
968 UINT32 Flags;
969 UINT32 NumLoops;
970 NATIVE_CHAR Pathname[128];
971
972} DB_METHOD_INFO;
973
974
975/*****************************************************************************
976 *
977 * Debug
978 *
979 ****************************************************************************/
980
981typedef struct
982{
983 UINT32 ComponentId;
984 NATIVE_CHAR *ProcName;
985 NATIVE_CHAR *ModuleName;
986
987} ACPI_DEBUG_PRINT_INFO;
988
989
990/* Entry for a memory allocation (debug only) */
991
992
993#define MEM_MALLOC 0
994#define MEM_CALLOC 1
995#define MAX_MODULE_NAME 16
996
997#define ACPI_COMMON_DEBUG_MEM_HEADER \
998 struct AcpiDebugMemBlock *Previous; \
999 struct AcpiDebugMemBlock *Next; \
1000 UINT32 Size; \
1001 UINT32 Component; \
1002 UINT32 Line; \
1003 NATIVE_CHAR Module[MAX_MODULE_NAME]; \
1004 UINT8 AllocType;
1005
1006
1007typedef struct
1008{
1009 ACPI_COMMON_DEBUG_MEM_HEADER
1010
1011} ACPI_DEBUG_MEM_HEADER;
1012
1013typedef struct AcpiDebugMemBlock
1014{
1015 ACPI_COMMON_DEBUG_MEM_HEADER
1016 UINT64 UserSpace;
1017
1018} ACPI_DEBUG_MEM_BLOCK;
1019
1020
1021#define ACPI_MEM_LIST_GLOBAL 0
1022#define ACPI_MEM_LIST_NSNODE 1
1023
1024#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2
1025#define ACPI_MEM_LIST_STATE 2
1026#define ACPI_MEM_LIST_PSNODE 3
1027#define ACPI_MEM_LIST_PSNODE_EXT 4
1028#define ACPI_MEM_LIST_OPERAND 5
1029#define ACPI_MEM_LIST_WALK 6
1030#define ACPI_MEM_LIST_MAX 6
1031#define ACPI_NUM_MEM_LISTS 7
1032
1033
1034typedef struct
1035{
1036 void *ListHead;
1037 UINT16 LinkOffset;
1038 UINT16 MaxCacheDepth;
1039 UINT16 CacheDepth;
1040 UINT16 ObjectSize;
1041
1042#ifdef ACPI_DBG_TRACK_ALLOCATIONS
1043
1044 /* Statistics for debug memory tracking only */
1045
1046 UINT32 TotalAllocated;
1047 UINT32 TotalFreed;
1048 UINT32 CurrentTotalSize;
1049 UINT32 CacheRequests;
1050 UINT32 CacheHits;
1051 char *ListName;
1052#endif
1053
1054} ACPI_MEMORY_LIST;
1055
1056
1057#endif /* __ACLOCAL_H__ */