Print this page
update to acpica-unix2-20131218
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/io/acpica/executer/exresnte.c
+++ new/usr/src/common/acpica/components/executer/exresnte.c
1 -
2 1 /******************************************************************************
3 2 *
4 3 * Module Name: exresnte - AML Interpreter object resolution
5 4 *
6 5 *****************************************************************************/
7 6
8 7 /*
9 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2013, Intel Corp.
10 9 * All rights reserved.
11 10 *
12 11 * Redistribution and use in source and binary forms, with or without
13 12 * modification, are permitted provided that the following conditions
14 13 * are met:
15 14 * 1. Redistributions of source code must retain the above copyright
16 15 * notice, this list of conditions, and the following disclaimer,
17 16 * without modification.
18 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 18 * substantially similar to the "NO WARRANTY" disclaimer below
20 19 * ("Disclaimer") and any redistribution must be conditioned upon
21 20 * including a substantially similar Disclaimer requirement for further
22 21 * binary redistribution.
23 22 * 3. Neither the names of the above-listed copyright holders nor the names
24 23 * of any contributors may be used to endorse or promote products derived
25 24 * from this software without specific prior written permission.
26 25 *
27 26 * Alternatively, this software may be distributed under the terms of the
28 27 * GNU General Public License ("GPL") version 2 as published by the Free
29 28 * Software Foundation.
30 29 *
31 30 * NO WARRANTY
32 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 41 * POSSIBILITY OF SUCH DAMAGES.
43 42 */
44 43
45 44 #define __EXRESNTE_C__
46 45
47 46 #include "acpi.h"
48 47 #include "accommon.h"
49 48 #include "acdispat.h"
50 49 #include "acinterp.h"
51 50 #include "acnamesp.h"
52 51
53 52
54 53 #define _COMPONENT ACPI_EXECUTER
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
55 54 ACPI_MODULE_NAME ("exresnte")
56 55
57 56
58 57 /*******************************************************************************
59 58 *
60 59 * FUNCTION: AcpiExResolveNodeToValue
61 60 *
62 61 * PARAMETERS: ObjectPtr - Pointer to a location that contains
63 62 * a pointer to a NS node, and will receive a
64 63 * pointer to the resolved object.
65 - * WalkState - Current state. Valid only if executing AML
66 - * code. NULL if simply resolving an object
64 + * WalkState - Current state. Valid only if executing AML
65 + * code. NULL if simply resolving an object
67 66 *
68 67 * RETURN: Status
69 68 *
70 69 * DESCRIPTION: Resolve a Namespace node to a valued object
71 70 *
72 71 * Note: for some of the data types, the pointer attached to the Node
73 72 * can be either a pointer to an actual internal object or a pointer into the
74 - * AML stream itself. These types are currently:
73 + * AML stream itself. These types are currently:
75 74 *
76 75 * ACPI_TYPE_INTEGER
77 76 * ACPI_TYPE_STRING
78 77 * ACPI_TYPE_BUFFER
79 78 * ACPI_TYPE_MUTEX
80 79 * ACPI_TYPE_PACKAGE
81 80 *
82 81 ******************************************************************************/
83 82
84 83 ACPI_STATUS
85 84 AcpiExResolveNodeToValue (
86 85 ACPI_NAMESPACE_NODE **ObjectPtr,
87 86 ACPI_WALK_STATE *WalkState)
88 87
89 88 {
90 89 ACPI_STATUS Status = AE_OK;
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
91 90 ACPI_OPERAND_OBJECT *SourceDesc;
92 91 ACPI_OPERAND_OBJECT *ObjDesc = NULL;
93 92 ACPI_NAMESPACE_NODE *Node;
94 93 ACPI_OBJECT_TYPE EntryType;
95 94
96 95
97 96 ACPI_FUNCTION_TRACE (ExResolveNodeToValue);
98 97
99 98
100 99 /*
101 - * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
100 + * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
102 101 * object that is attached to the Node.
103 102 */
104 103 Node = *ObjectPtr;
105 104 SourceDesc = AcpiNsGetAttachedObject (Node);
106 105 EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
107 106
108 107 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n",
109 108 Node, SourceDesc, AcpiUtGetTypeName (EntryType)));
110 109
111 110 if ((EntryType == ACPI_TYPE_LOCAL_ALIAS) ||
112 111 (EntryType == ACPI_TYPE_LOCAL_METHOD_ALIAS))
113 112 {
114 113 /* There is always exactly one level of indirection */
115 114
116 115 Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object);
117 116 SourceDesc = AcpiNsGetAttachedObject (Node);
118 117 EntryType = AcpiNsGetType ((ACPI_HANDLE) Node);
119 118 *ObjectPtr = Node;
120 119 }
121 120
122 121 /*
123 122 * Several object types require no further processing:
124 123 * 1) Device/Thermal objects don't have a "real" subobject, return the Node
125 124 * 2) Method locals and arguments have a pseudo-Node
126 125 * 3) 10/2007: Added method type to assist with Package construction.
127 126 */
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
128 127 if ((EntryType == ACPI_TYPE_DEVICE) ||
129 128 (EntryType == ACPI_TYPE_THERMAL) ||
130 129 (EntryType == ACPI_TYPE_METHOD) ||
131 130 (Node->Flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL)))
132 131 {
133 132 return_ACPI_STATUS (AE_OK);
134 133 }
135 134
136 135 if (!SourceDesc)
137 136 {
138 - ACPI_ERROR ((AE_INFO, "No object attached to node %p",
139 - Node));
137 + ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
138 + Node->Name.Ascii, Node));
140 139 return_ACPI_STATUS (AE_AML_NO_OPERAND);
141 140 }
142 141
143 142 /*
144 143 * Action is based on the type of the Node, which indicates the type
145 144 * of the attached object or pointer
146 145 */
147 146 switch (EntryType)
148 147 {
149 148 case ACPI_TYPE_PACKAGE:
150 149
151 150 if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE)
152 151 {
153 152 ACPI_ERROR ((AE_INFO, "Object not a Package, type %s",
154 153 AcpiUtGetObjectTypeName (SourceDesc)));
155 154 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
156 155 }
157 156
↓ open down ↓ |
8 lines elided |
↑ open up ↑ |
158 157 Status = AcpiDsGetPackageArguments (SourceDesc);
159 158 if (ACPI_SUCCESS (Status))
160 159 {
161 160 /* Return an additional reference to the object */
162 161
163 162 ObjDesc = SourceDesc;
164 163 AcpiUtAddReference (ObjDesc);
165 164 }
166 165 break;
167 166
168 -
169 167 case ACPI_TYPE_BUFFER:
170 168
171 169 if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
172 170 {
173 171 ACPI_ERROR ((AE_INFO, "Object not a Buffer, type %s",
174 172 AcpiUtGetObjectTypeName (SourceDesc)));
175 173 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
176 174 }
177 175
178 176 Status = AcpiDsGetBufferArguments (SourceDesc);
179 177 if (ACPI_SUCCESS (Status))
180 178 {
181 179 /* Return an additional reference to the object */
182 180
183 181 ObjDesc = SourceDesc;
184 182 AcpiUtAddReference (ObjDesc);
185 183 }
186 184 break;
187 185
188 -
189 186 case ACPI_TYPE_STRING:
190 187
191 188 if (SourceDesc->Common.Type != ACPI_TYPE_STRING)
192 189 {
193 190 ACPI_ERROR ((AE_INFO, "Object not a String, type %s",
194 191 AcpiUtGetObjectTypeName (SourceDesc)));
195 192 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
196 193 }
197 194
198 195 /* Return an additional reference to the object */
199 196
200 197 ObjDesc = SourceDesc;
201 198 AcpiUtAddReference (ObjDesc);
202 199 break;
203 200
204 -
205 201 case ACPI_TYPE_INTEGER:
206 202
207 203 if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
208 204 {
209 205 ACPI_ERROR ((AE_INFO, "Object not a Integer, type %s",
210 206 AcpiUtGetObjectTypeName (SourceDesc)));
211 207 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
212 208 }
213 209
214 210 /* Return an additional reference to the object */
215 211
216 212 ObjDesc = SourceDesc;
217 213 AcpiUtAddReference (ObjDesc);
218 214 break;
219 215
220 -
221 216 case ACPI_TYPE_BUFFER_FIELD:
222 217 case ACPI_TYPE_LOCAL_REGION_FIELD:
223 218 case ACPI_TYPE_LOCAL_BANK_FIELD:
224 219 case ACPI_TYPE_LOCAL_INDEX_FIELD:
225 220
226 221 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
227 222 "FieldRead Node=%p SourceDesc=%p Type=%X\n",
228 223 Node, SourceDesc, EntryType));
229 224
230 225 Status = AcpiExReadDataFromField (WalkState, SourceDesc, &ObjDesc);
231 226 break;
232 227
233 228 /* For these objects, just return the object attached to the Node */
234 229
235 230 case ACPI_TYPE_MUTEX:
236 231 case ACPI_TYPE_POWER:
237 232 case ACPI_TYPE_PROCESSOR:
238 233 case ACPI_TYPE_EVENT:
239 234 case ACPI_TYPE_REGION:
240 235
241 236 /* Return an additional reference to the object */
242 237
243 238 ObjDesc = SourceDesc;
244 239 AcpiUtAddReference (ObjDesc);
245 240 break;
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
246 241
247 242 /* TYPE_ANY is untyped, and thus there is no object associated with it */
248 243
249 244 case ACPI_TYPE_ANY:
250 245
251 246 ACPI_ERROR ((AE_INFO,
252 247 "Untyped entry %p, no attached object!", Node));
253 248
254 249 return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
255 250
256 -
257 251 case ACPI_TYPE_LOCAL_REFERENCE:
258 252
259 253 switch (SourceDesc->Reference.Class)
260 254 {
261 255 case ACPI_REFCLASS_TABLE: /* This is a DdbHandle */
262 256 case ACPI_REFCLASS_REFOF:
263 257 case ACPI_REFCLASS_INDEX:
264 258
265 259 /* Return an additional reference to the object */
266 260
267 261 ObjDesc = SourceDesc;
268 262 AcpiUtAddReference (ObjDesc);
269 263 break;
270 264
271 265 default:
266 +
272 267 /* No named references are allowed here */
273 268
274 269 ACPI_ERROR ((AE_INFO,
275 270 "Unsupported Reference type 0x%X",
276 271 SourceDesc->Reference.Class));
277 272
278 273 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
279 274 }
280 275 break;
281 276
282 -
283 277 default:
284 278
285 279 /* Default case is for unknown types */
286 280
287 281 ACPI_ERROR ((AE_INFO,
288 282 "Node %p - Unknown object type 0x%X",
289 283 Node, EntryType));
290 284
291 285 return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
292 286
293 287 } /* switch (EntryType) */
294 288
295 289
296 290 /* Return the object descriptor */
297 291
298 292 *ObjectPtr = (void *) ObjDesc;
299 293 return_ACPI_STATUS (Status);
300 294 }
301 -
302 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX