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