acstruct.h revision 1.1.1.2.4.2 1 1.1.1.2.4.2 rmind /******************************************************************************
2 1.1.1.2.4.2 rmind *
3 1.1.1.2.4.2 rmind * Name: acstruct.h - Internal structs
4 1.1.1.2.4.2 rmind *
5 1.1.1.2.4.2 rmind *****************************************************************************/
6 1.1.1.2.4.2 rmind
7 1.1.1.2.4.2 rmind /*
8 1.1.1.2.4.2 rmind * Copyright (C) 2000 - 2011, Intel Corp.
9 1.1.1.2.4.2 rmind * All rights reserved.
10 1.1.1.2.4.2 rmind *
11 1.1.1.2.4.2 rmind * Redistribution and use in source and binary forms, with or without
12 1.1.1.2.4.2 rmind * modification, are permitted provided that the following conditions
13 1.1.1.2.4.2 rmind * are met:
14 1.1.1.2.4.2 rmind * 1. Redistributions of source code must retain the above copyright
15 1.1.1.2.4.2 rmind * notice, this list of conditions, and the following disclaimer,
16 1.1.1.2.4.2 rmind * without modification.
17 1.1.1.2.4.2 rmind * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1.1.2.4.2 rmind * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1.1.2.4.2 rmind * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1.1.2.4.2 rmind * including a substantially similar Disclaimer requirement for further
21 1.1.1.2.4.2 rmind * binary redistribution.
22 1.1.1.2.4.2 rmind * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1.1.2.4.2 rmind * of any contributors may be used to endorse or promote products derived
24 1.1.1.2.4.2 rmind * from this software without specific prior written permission.
25 1.1.1.2.4.2 rmind *
26 1.1.1.2.4.2 rmind * Alternatively, this software may be distributed under the terms of the
27 1.1.1.2.4.2 rmind * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1.1.2.4.2 rmind * Software Foundation.
29 1.1.1.2.4.2 rmind *
30 1.1.1.2.4.2 rmind * NO WARRANTY
31 1.1.1.2.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1.1.2.4.2 rmind * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1.1.2.4.2 rmind * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1.1.2.4.2 rmind * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1.1.2.4.2 rmind * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1.1.2.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1.1.2.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1.1.2.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1.1.2.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1.1.2.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1.1.2.4.2 rmind * POSSIBILITY OF SUCH DAMAGES.
42 1.1.1.2.4.2 rmind */
43 1.1.1.2.4.2 rmind
44 1.1.1.2.4.2 rmind #ifndef __ACSTRUCT_H__
45 1.1.1.2.4.2 rmind #define __ACSTRUCT_H__
46 1.1.1.2.4.2 rmind
47 1.1.1.2.4.2 rmind /* acpisrc:StructDefs -- for acpisrc conversion */
48 1.1.1.2.4.2 rmind
49 1.1.1.2.4.2 rmind /*****************************************************************************
50 1.1.1.2.4.2 rmind *
51 1.1.1.2.4.2 rmind * Tree walking typedefs and structs
52 1.1.1.2.4.2 rmind *
53 1.1.1.2.4.2 rmind ****************************************************************************/
54 1.1.1.2.4.2 rmind
55 1.1.1.2.4.2 rmind
56 1.1.1.2.4.2 rmind /*
57 1.1.1.2.4.2 rmind * Walk state - current state of a parse tree walk. Used for both a leisurely
58 1.1.1.2.4.2 rmind * stroll through the tree (for whatever reason), and for control method
59 1.1.1.2.4.2 rmind * execution.
60 1.1.1.2.4.2 rmind */
61 1.1.1.2.4.2 rmind #define ACPI_NEXT_OP_DOWNWARD 1
62 1.1.1.2.4.2 rmind #define ACPI_NEXT_OP_UPWARD 2
63 1.1.1.2.4.2 rmind
64 1.1.1.2.4.2 rmind /*
65 1.1.1.2.4.2 rmind * Groups of definitions for WalkType used for different implementations of
66 1.1.1.2.4.2 rmind * walkers (never simultaneously) - flags for interpreter:
67 1.1.1.2.4.2 rmind */
68 1.1.1.2.4.2 rmind #define ACPI_WALK_NON_METHOD 0
69 1.1.1.2.4.2 rmind #define ACPI_WALK_METHOD 0x01
70 1.1.1.2.4.2 rmind #define ACPI_WALK_METHOD_RESTART 0x02
71 1.1.1.2.4.2 rmind
72 1.1.1.2.4.2 rmind /* Flags for iASL compiler only */
73 1.1.1.2.4.2 rmind
74 1.1.1.2.4.2 rmind #define ACPI_WALK_CONST_REQUIRED 0x10
75 1.1.1.2.4.2 rmind #define ACPI_WALK_CONST_OPTIONAL 0x20
76 1.1.1.2.4.2 rmind
77 1.1.1.2.4.2 rmind
78 1.1.1.2.4.2 rmind typedef struct acpi_walk_state
79 1.1.1.2.4.2 rmind {
80 1.1.1.2.4.2 rmind struct acpi_walk_state *Next; /* Next WalkState in list */
81 1.1.1.2.4.2 rmind UINT8 DescriptorType; /* To differentiate various internal objs */
82 1.1.1.2.4.2 rmind UINT8 WalkType;
83 1.1.1.2.4.2 rmind UINT16 Opcode; /* Current AML opcode */
84 1.1.1.2.4.2 rmind UINT8 NextOpInfo; /* Info about NextOp */
85 1.1.1.2.4.2 rmind UINT8 NumOperands; /* Stack pointer for Operands[] array */
86 1.1.1.2.4.2 rmind UINT8 OperandIndex; /* Index into operand stack, to be used by AcpiDsObjStackPush */
87 1.1.1.2.4.2 rmind ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */
88 1.1.1.2.4.2 rmind BOOLEAN LastPredicate; /* Result of last predicate */
89 1.1.1.2.4.2 rmind UINT8 CurrentResult;
90 1.1.1.2.4.2 rmind UINT8 ReturnUsed;
91 1.1.1.2.4.2 rmind UINT8 ScopeDepth;
92 1.1.1.2.4.2 rmind UINT8 PassNumber; /* Parse pass during table load */
93 1.1.1.2.4.2 rmind UINT8 ResultSize; /* Total elements for the result stack */
94 1.1.1.2.4.2 rmind UINT8 ResultCount; /* Current number of occupied elements of result stack */
95 1.1.1.2.4.2 rmind UINT32 AmlOffset;
96 1.1.1.2.4.2 rmind UINT32 ArgTypes;
97 1.1.1.2.4.2 rmind UINT32 MethodBreakpoint; /* For single stepping */
98 1.1.1.2.4.2 rmind UINT32 UserBreakpoint; /* User AML breakpoint */
99 1.1.1.2.4.2 rmind UINT32 ParseFlags;
100 1.1.1.2.4.2 rmind
101 1.1.1.2.4.2 rmind ACPI_PARSE_STATE ParserState; /* Current state of parser */
102 1.1.1.2.4.2 rmind UINT32 PrevArgTypes;
103 1.1.1.2.4.2 rmind UINT32 ArgCount; /* push for fixed or var args */
104 1.1.1.2.4.2 rmind
105 1.1.1.2.4.2 rmind struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
106 1.1.1.2.4.2 rmind struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
107 1.1.1.2.4.2 rmind union acpi_operand_object *Operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
108 1.1.1.2.4.2 rmind union acpi_operand_object **Params;
109 1.1.1.2.4.2 rmind
110 1.1.1.2.4.2 rmind UINT8 *AmlLastWhile;
111 1.1.1.2.4.2 rmind union acpi_operand_object **CallerReturnDesc;
112 1.1.1.2.4.2 rmind ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */
113 1.1.1.2.4.2 rmind struct acpi_namespace_node *DeferredNode; /* Used when executing deferred opcodes */
114 1.1.1.2.4.2 rmind union acpi_operand_object *ImplicitReturnObj;
115 1.1.1.2.4.2 rmind struct acpi_namespace_node *MethodCallNode; /* Called method Node*/
116 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */
117 1.1.1.2.4.2 rmind union acpi_operand_object *MethodDesc; /* Method descriptor if running a method */
118 1.1.1.2.4.2 rmind struct acpi_namespace_node *MethodNode; /* Method node if running a method. */
119 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Op; /* Current parser op */
120 1.1.1.2.4.2 rmind const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */
121 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */
122 1.1.1.2.4.2 rmind union acpi_operand_object *ResultObj;
123 1.1.1.2.4.2 rmind ACPI_GENERIC_STATE *Results; /* Stack of accumulated results */
124 1.1.1.2.4.2 rmind union acpi_operand_object *ReturnDesc; /* Return object, if any */
125 1.1.1.2.4.2 rmind ACPI_GENERIC_STATE *ScopeInfo; /* Stack of nested scopes */
126 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */
127 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *NextOp; /* next op to be processed */
128 1.1.1.2.4.2 rmind ACPI_THREAD_STATE *Thread;
129 1.1.1.2.4.2 rmind ACPI_PARSE_DOWNWARDS DescendingCallback;
130 1.1.1.2.4.2 rmind ACPI_PARSE_UPWARDS AscendingCallback;
131 1.1.1.2.4.2 rmind
132 1.1.1.2.4.2 rmind } ACPI_WALK_STATE;
133 1.1.1.2.4.2 rmind
134 1.1.1.2.4.2 rmind
135 1.1.1.2.4.2 rmind /* Info used by AcpiNsInitializeObjects and AcpiDsInitializeObjects */
136 1.1.1.2.4.2 rmind
137 1.1.1.2.4.2 rmind typedef struct acpi_init_walk_info
138 1.1.1.2.4.2 rmind {
139 1.1.1.2.4.2 rmind UINT32 TableIndex;
140 1.1.1.2.4.2 rmind UINT32 ObjectCount;
141 1.1.1.2.4.2 rmind UINT32 MethodCount;
142 1.1.1.2.4.2 rmind UINT32 DeviceCount;
143 1.1.1.2.4.2 rmind UINT32 OpRegionCount;
144 1.1.1.2.4.2 rmind UINT32 FieldCount;
145 1.1.1.2.4.2 rmind UINT32 BufferCount;
146 1.1.1.2.4.2 rmind UINT32 PackageCount;
147 1.1.1.2.4.2 rmind UINT32 OpRegionInit;
148 1.1.1.2.4.2 rmind UINT32 FieldInit;
149 1.1.1.2.4.2 rmind UINT32 BufferInit;
150 1.1.1.2.4.2 rmind UINT32 PackageInit;
151 1.1.1.2.4.2 rmind ACPI_OWNER_ID OwnerId;
152 1.1.1.2.4.2 rmind
153 1.1.1.2.4.2 rmind } ACPI_INIT_WALK_INFO;
154 1.1.1.2.4.2 rmind
155 1.1.1.2.4.2 rmind
156 1.1.1.2.4.2 rmind typedef struct acpi_get_devices_info
157 1.1.1.2.4.2 rmind {
158 1.1.1.2.4.2 rmind ACPI_WALK_CALLBACK UserFunction;
159 1.1.1.2.4.2 rmind void *Context;
160 1.1.1.2.4.2 rmind char *Hid;
161 1.1.1.2.4.2 rmind
162 1.1.1.2.4.2 rmind } ACPI_GET_DEVICES_INFO;
163 1.1.1.2.4.2 rmind
164 1.1.1.2.4.2 rmind
165 1.1.1.2.4.2 rmind typedef union acpi_aml_operands
166 1.1.1.2.4.2 rmind {
167 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *Operands[7];
168 1.1.1.2.4.2 rmind
169 1.1.1.2.4.2 rmind struct
170 1.1.1.2.4.2 rmind {
171 1.1.1.2.4.2 rmind ACPI_OBJECT_INTEGER *Type;
172 1.1.1.2.4.2 rmind ACPI_OBJECT_INTEGER *Code;
173 1.1.1.2.4.2 rmind ACPI_OBJECT_INTEGER *Argument;
174 1.1.1.2.4.2 rmind
175 1.1.1.2.4.2 rmind } Fatal;
176 1.1.1.2.4.2 rmind
177 1.1.1.2.4.2 rmind struct
178 1.1.1.2.4.2 rmind {
179 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *Source;
180 1.1.1.2.4.2 rmind ACPI_OBJECT_INTEGER *Index;
181 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *Target;
182 1.1.1.2.4.2 rmind
183 1.1.1.2.4.2 rmind } Index;
184 1.1.1.2.4.2 rmind
185 1.1.1.2.4.2 rmind struct
186 1.1.1.2.4.2 rmind {
187 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *Source;
188 1.1.1.2.4.2 rmind ACPI_OBJECT_INTEGER *Index;
189 1.1.1.2.4.2 rmind ACPI_OBJECT_INTEGER *Length;
190 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *Target;
191 1.1.1.2.4.2 rmind
192 1.1.1.2.4.2 rmind } Mid;
193 1.1.1.2.4.2 rmind
194 1.1.1.2.4.2 rmind } ACPI_AML_OPERANDS;
195 1.1.1.2.4.2 rmind
196 1.1.1.2.4.2 rmind
197 1.1.1.2.4.2 rmind /*
198 1.1.1.2.4.2 rmind * Structure used to pass object evaluation parameters.
199 1.1.1.2.4.2 rmind * Purpose is to reduce CPU stack use.
200 1.1.1.2.4.2 rmind */
201 1.1.1.2.4.2 rmind typedef struct acpi_evaluate_info
202 1.1.1.2.4.2 rmind {
203 1.1.1.2.4.2 rmind ACPI_NAMESPACE_NODE *PrefixNode;
204 1.1.1.2.4.2 rmind char *Pathname;
205 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *ObjDesc;
206 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT **Parameters;
207 1.1.1.2.4.2 rmind ACPI_NAMESPACE_NODE *ResolvedNode;
208 1.1.1.2.4.2 rmind ACPI_OPERAND_OBJECT *ReturnObject;
209 1.1.1.2.4.2 rmind UINT8 ParamCount;
210 1.1.1.2.4.2 rmind UINT8 PassNumber;
211 1.1.1.2.4.2 rmind UINT8 ReturnObjectType;
212 1.1.1.2.4.2 rmind UINT8 Flags;
213 1.1.1.2.4.2 rmind
214 1.1.1.2.4.2 rmind } ACPI_EVALUATE_INFO;
215 1.1.1.2.4.2 rmind
216 1.1.1.2.4.2 rmind /* Values for Flags above */
217 1.1.1.2.4.2 rmind
218 1.1.1.2.4.2 rmind #define ACPI_IGNORE_RETURN_VALUE 1
219 1.1.1.2.4.2 rmind
220 1.1.1.2.4.2 rmind
221 1.1.1.2.4.2 rmind /* Info used by AcpiNsInitializeDevices */
222 1.1.1.2.4.2 rmind
223 1.1.1.2.4.2 rmind typedef struct acpi_device_walk_info
224 1.1.1.2.4.2 rmind {
225 1.1.1.2.4.2 rmind ACPI_TABLE_DESC *TableDesc;
226 1.1.1.2.4.2 rmind ACPI_EVALUATE_INFO *EvaluateInfo;
227 1.1.1.2.4.2 rmind UINT32 DeviceCount;
228 1.1.1.2.4.2 rmind UINT32 Num_STA;
229 1.1.1.2.4.2 rmind UINT32 Num_INI;
230 1.1.1.2.4.2 rmind
231 1.1.1.2.4.2 rmind } ACPI_DEVICE_WALK_INFO;
232 1.1.1.2.4.2 rmind
233 1.1.1.2.4.2 rmind
234 1.1.1.2.4.2 rmind /* TBD: [Restructure] Merge with struct above */
235 1.1.1.2.4.2 rmind
236 1.1.1.2.4.2 rmind typedef struct acpi_walk_info
237 1.1.1.2.4.2 rmind {
238 1.1.1.2.4.2 rmind UINT32 DebugLevel;
239 1.1.1.2.4.2 rmind UINT32 Count;
240 1.1.1.2.4.2 rmind ACPI_OWNER_ID OwnerId;
241 1.1.1.2.4.2 rmind UINT8 DisplayType;
242 1.1.1.2.4.2 rmind
243 1.1.1.2.4.2 rmind } ACPI_WALK_INFO;
244 1.1.1.2.4.2 rmind
245 1.1.1.2.4.2 rmind /* Display Types */
246 1.1.1.2.4.2 rmind
247 1.1.1.2.4.2 rmind #define ACPI_DISPLAY_SUMMARY (UINT8) 0
248 1.1.1.2.4.2 rmind #define ACPI_DISPLAY_OBJECTS (UINT8) 1
249 1.1.1.2.4.2 rmind #define ACPI_DISPLAY_MASK (UINT8) 1
250 1.1.1.2.4.2 rmind
251 1.1.1.2.4.2 rmind #define ACPI_DISPLAY_SHORT (UINT8) 2
252 1.1.1.2.4.2 rmind
253 1.1.1.2.4.2 rmind
254 1.1.1.2.4.2 rmind #endif
255