dspkginit.c revision 1.1 1 1.1 christos /******************************************************************************
2 1.1 christos *
3 1.1 christos * Module Name: dspkginit - Completion of deferred package initialization
4 1.1 christos *
5 1.1 christos *****************************************************************************/
6 1.1 christos
7 1.1 christos /*
8 1.1 christos * Copyright (C) 2000 - 2017, Intel Corp.
9 1.1 christos * All rights reserved.
10 1.1 christos *
11 1.1 christos * Redistribution and use in source and binary forms, with or without
12 1.1 christos * modification, are permitted provided that the following conditions
13 1.1 christos * are met:
14 1.1 christos * 1. Redistributions of source code must retain the above copyright
15 1.1 christos * notice, this list of conditions, and the following disclaimer,
16 1.1 christos * without modification.
17 1.1 christos * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1 christos * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1 christos * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1 christos * including a substantially similar Disclaimer requirement for further
21 1.1 christos * binary redistribution.
22 1.1 christos * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1 christos * of any contributors may be used to endorse or promote products derived
24 1.1 christos * from this software without specific prior written permission.
25 1.1 christos *
26 1.1 christos * Alternatively, this software may be distributed under the terms of the
27 1.1 christos * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1 christos * Software Foundation.
29 1.1 christos *
30 1.1 christos * NO WARRANTY
31 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1 christos * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1 christos * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1 christos * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1 christos * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1 christos * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1 christos * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1 christos * POSSIBILITY OF SUCH DAMAGES.
42 1.1 christos */
43 1.1 christos
44 1.1 christos #include "acpi.h"
45 1.1 christos #include "accommon.h"
46 1.1 christos #include "acnamesp.h"
47 1.1 christos #include "amlcode.h"
48 1.1 christos #include "acdispat.h"
49 1.1 christos #include "acinterp.h"
50 1.1 christos
51 1.1 christos
52 1.1 christos #define _COMPONENT ACPI_NAMESPACE
53 1.1 christos ACPI_MODULE_NAME ("dspkginit")
54 1.1 christos
55 1.1 christos
56 1.1 christos /* Local prototypes */
57 1.1 christos
58 1.1 christos static void
59 1.1 christos AcpiDsResolvePackageElement (
60 1.1 christos ACPI_OPERAND_OBJECT **Element);
61 1.1 christos
62 1.1 christos
63 1.1 christos /*******************************************************************************
64 1.1 christos *
65 1.1 christos * FUNCTION: AcpiDsBuildInternalPackageObj
66 1.1 christos *
67 1.1 christos * PARAMETERS: WalkState - Current walk state
68 1.1 christos * Op - Parser object to be translated
69 1.1 christos * ElementCount - Number of elements in the package - this is
70 1.1 christos * the NumElements argument to Package()
71 1.1 christos * ObjDescPtr - Where the ACPI internal object is returned
72 1.1 christos *
73 1.1 christos * RETURN: Status
74 1.1 christos *
75 1.1 christos * DESCRIPTION: Translate a parser Op package object to the equivalent
76 1.1 christos * namespace object
77 1.1 christos *
78 1.1 christos * NOTE: The number of elements in the package will be always be the NumElements
79 1.1 christos * count, regardless of the number of elements in the package list. If
80 1.1 christos * NumElements is smaller, only that many package list elements are used.
81 1.1 christos * if NumElements is larger, the Package object is padded out with
82 1.1 christos * objects of type Uninitialized (as per ACPI spec.)
83 1.1 christos *
84 1.1 christos * Even though the ASL compilers do not allow NumElements to be smaller
85 1.1 christos * than the Package list length (for the fixed length package opcode), some
86 1.1 christos * BIOS code modifies the AML on the fly to adjust the NumElements, and
87 1.1 christos * this code compensates for that. This also provides compatibility with
88 1.1 christos * other AML interpreters.
89 1.1 christos *
90 1.1 christos ******************************************************************************/
91 1.1 christos
92 1.1 christos ACPI_STATUS
93 1.1 christos AcpiDsBuildInternalPackageObj (
94 1.1 christos ACPI_WALK_STATE *WalkState,
95 1.1 christos ACPI_PARSE_OBJECT *Op,
96 1.1 christos UINT32 ElementCount,
97 1.1 christos ACPI_OPERAND_OBJECT **ObjDescPtr)
98 1.1 christos {
99 1.1 christos ACPI_PARSE_OBJECT *Arg;
100 1.1 christos ACPI_PARSE_OBJECT *Parent;
101 1.1 christos ACPI_OPERAND_OBJECT *ObjDesc = NULL;
102 1.1 christos ACPI_STATUS Status = AE_OK;
103 1.1 christos UINT16 ReferenceCount;
104 1.1 christos UINT32 Index;
105 1.1 christos UINT32 i;
106 1.1 christos
107 1.1 christos
108 1.1 christos ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
109 1.1 christos
110 1.1 christos
111 1.1 christos /* Find the parent of a possibly nested package */
112 1.1 christos
113 1.1 christos Parent = Op->Common.Parent;
114 1.1 christos while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
115 1.1 christos (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
116 1.1 christos {
117 1.1 christos Parent = Parent->Common.Parent;
118 1.1 christos }
119 1.1 christos
120 1.1 christos /*
121 1.1 christos * If we are evaluating a Named package object of the form:
122 1.1 christos * Name (xxxx, Package)
123 1.1 christos * the package object already exists, otherwise it must be created.
124 1.1 christos */
125 1.1 christos ObjDesc = *ObjDescPtr;
126 1.1 christos if (!ObjDesc)
127 1.1 christos {
128 1.1 christos ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
129 1.1 christos *ObjDescPtr = ObjDesc;
130 1.1 christos if (!ObjDesc)
131 1.1 christos {
132 1.1 christos return_ACPI_STATUS (AE_NO_MEMORY);
133 1.1 christos }
134 1.1 christos
135 1.1 christos ObjDesc->Package.Node = Parent->Common.Node;
136 1.1 christos }
137 1.1 christos
138 1.1 christos if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID) /* Just in case */
139 1.1 christos {
140 1.1 christos return_ACPI_STATUS (AE_OK);
141 1.1 christos }
142 1.1 christos
143 1.1 christos /*
144 1.1 christos * Allocate the element array (array of pointers to the individual
145 1.1 christos * objects) based on the NumElements parameter. Add an extra pointer slot
146 1.1 christos * so that the list is always null terminated.
147 1.1 christos */
148 1.1 christos ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
149 1.1 christos ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
150 1.1 christos
151 1.1 christos if (!ObjDesc->Package.Elements)
152 1.1 christos {
153 1.1 christos AcpiUtDeleteObjectDesc (ObjDesc);
154 1.1 christos return_ACPI_STATUS (AE_NO_MEMORY);
155 1.1 christos }
156 1.1 christos
157 1.1 christos ObjDesc->Package.Count = ElementCount;
158 1.1 christos Arg = Op->Common.Value.Arg;
159 1.1 christos Arg = Arg->Common.Next;
160 1.1 christos
161 1.1 christos if (Arg)
162 1.1 christos {
163 1.1 christos ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
164 1.1 christos }
165 1.1 christos
166 1.1 christos /*
167 1.1 christos * Initialize the elements of the package, up to the NumElements count.
168 1.1 christos * Package is automatically padded with uninitialized (NULL) elements
169 1.1 christos * if NumElements is greater than the package list length. Likewise,
170 1.1 christos * Package is truncated if NumElements is less than the list length.
171 1.1 christos */
172 1.1 christos for (i = 0; Arg && (i < ElementCount); i++)
173 1.1 christos {
174 1.1 christos if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
175 1.1 christos {
176 1.1 christos if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
177 1.1 christos {
178 1.1 christos /*
179 1.1 christos * A method reference "looks" to the parser to be a method
180 1.1 christos * invocation, so we special case it here
181 1.1 christos */
182 1.1 christos Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
183 1.1 christos Status = AcpiDsBuildInternalObject (
184 1.1 christos WalkState, Arg, &ObjDesc->Package.Elements[i]);
185 1.1 christos }
186 1.1 christos else
187 1.1 christos {
188 1.1 christos /* This package element is already built, just get it */
189 1.1 christos
190 1.1 christos ObjDesc->Package.Elements[i] =
191 1.1 christos ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
192 1.1 christos }
193 1.1 christos }
194 1.1 christos else
195 1.1 christos {
196 1.1 christos Status = AcpiDsBuildInternalObject (
197 1.1 christos WalkState, Arg, &ObjDesc->Package.Elements[i]);
198 1.1 christos if (Status == AE_NOT_FOUND)
199 1.1 christos {
200 1.1 christos ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
201 1.1 christos }
202 1.1 christos
203 1.1 christos /*
204 1.1 christos * Initialize this package element. This function handles the
205 1.1 christos * resolution of named references within the package.
206 1.1 christos */
207 1.1 christos AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
208 1.1 christos NULL, &ObjDesc->Package.Elements[i]);
209 1.1 christos }
210 1.1 christos
211 1.1 christos if (*ObjDescPtr)
212 1.1 christos {
213 1.1 christos /* Existing package, get existing reference count */
214 1.1 christos
215 1.1 christos ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
216 1.1 christos if (ReferenceCount > 1)
217 1.1 christos {
218 1.1 christos /* Make new element ref count match original ref count */
219 1.1 christos /* TBD: Probably need an AcpiUtAddReferences function */
220 1.1 christos
221 1.1 christos for (Index = 0; Index < ((UINT32) ReferenceCount - 1); Index++)
222 1.1 christos {
223 1.1 christos AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
224 1.1 christos }
225 1.1 christos }
226 1.1 christos }
227 1.1 christos
228 1.1 christos Arg = Arg->Common.Next;
229 1.1 christos }
230 1.1 christos
231 1.1 christos /* Check for match between NumElements and actual length of PackageList */
232 1.1 christos
233 1.1 christos if (Arg)
234 1.1 christos {
235 1.1 christos /*
236 1.1 christos * NumElements was exhausted, but there are remaining elements in
237 1.1 christos * the PackageList. Truncate the package to NumElements.
238 1.1 christos *
239 1.1 christos * Note: technically, this is an error, from ACPI spec: "It is an
240 1.1 christos * error for NumElements to be less than the number of elements in
241 1.1 christos * the PackageList". However, we just print a message and no
242 1.1 christos * exception is returned. This provides compatibility with other
243 1.1 christos * ACPI implementations. Some firmware implementations will alter
244 1.1 christos * the NumElements on the fly, possibly creating this type of
245 1.1 christos * ill-formed package object.
246 1.1 christos */
247 1.1 christos while (Arg)
248 1.1 christos {
249 1.1 christos /*
250 1.1 christos * We must delete any package elements that were created earlier
251 1.1 christos * and are not going to be used because of the package truncation.
252 1.1 christos */
253 1.1 christos if (Arg->Common.Node)
254 1.1 christos {
255 1.1 christos AcpiUtRemoveReference (
256 1.1 christos ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
257 1.1 christos Arg->Common.Node = NULL;
258 1.1 christos }
259 1.1 christos
260 1.1 christos /* Find out how many elements there really are */
261 1.1 christos
262 1.1 christos i++;
263 1.1 christos Arg = Arg->Common.Next;
264 1.1 christos }
265 1.1 christos
266 1.1 christos ACPI_INFO ((
267 1.1 christos "Actual Package length (%u) is larger than "
268 1.1 christos "NumElements field (%u), truncated",
269 1.1 christos i, ElementCount));
270 1.1 christos }
271 1.1 christos else if (i < ElementCount)
272 1.1 christos {
273 1.1 christos /*
274 1.1 christos * Arg list (elements) was exhausted, but we did not reach
275 1.1 christos * NumElements count.
276 1.1 christos *
277 1.1 christos * Note: this is not an error, the package is padded out
278 1.1 christos * with NULLs.
279 1.1 christos */
280 1.1 christos ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
281 1.1 christos "Package List length (%u) smaller than NumElements "
282 1.1 christos "count (%u), padded with null elements\n",
283 1.1 christos i, ElementCount));
284 1.1 christos }
285 1.1 christos
286 1.1 christos ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
287 1.1 christos Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
288 1.1 christos return_ACPI_STATUS (Status);
289 1.1 christos }
290 1.1 christos
291 1.1 christos
292 1.1 christos /*******************************************************************************
293 1.1 christos *
294 1.1 christos * FUNCTION: AcpiDsInitPackageElement
295 1.1 christos *
296 1.1 christos * PARAMETERS: ACPI_PKG_CALLBACK
297 1.1 christos *
298 1.1 christos * RETURN: Status
299 1.1 christos *
300 1.1 christos * DESCRIPTION: Resolve a named reference element within a package object
301 1.1 christos *
302 1.1 christos ******************************************************************************/
303 1.1 christos
304 1.1 christos ACPI_STATUS
305 1.1 christos AcpiDsInitPackageElement (
306 1.1 christos UINT8 ObjectType,
307 1.1 christos ACPI_OPERAND_OBJECT *SourceObject,
308 1.1 christos ACPI_GENERIC_STATE *State,
309 1.1 christos void *Context)
310 1.1 christos {
311 1.1 christos ACPI_OPERAND_OBJECT **ElementPtr;
312 1.1 christos
313 1.1 christos
314 1.1 christos if (!SourceObject)
315 1.1 christos {
316 1.1 christos return (AE_OK);
317 1.1 christos }
318 1.1 christos
319 1.1 christos /*
320 1.1 christos * The following code is a bit of a hack to workaround a (current)
321 1.1 christos * limitation of the ACPI_PKG_CALLBACK interface. We need a pointer
322 1.1 christos * to the location within the element array because a new object
323 1.1 christos * may be created and stored there.
324 1.1 christos */
325 1.1 christos if (Context)
326 1.1 christos {
327 1.1 christos /* A direct call was made to this function */
328 1.1 christos
329 1.1 christos ElementPtr = (ACPI_OPERAND_OBJECT **) Context;
330 1.1 christos }
331 1.1 christos else
332 1.1 christos {
333 1.1 christos /* Call came from AcpiUtWalkPackageTree */
334 1.1 christos
335 1.1 christos ElementPtr = State->Pkg.ThisTargetObj;
336 1.1 christos }
337 1.1 christos
338 1.1 christos /* We are only interested in reference objects/elements */
339 1.1 christos
340 1.1 christos if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
341 1.1 christos {
342 1.1 christos /* Attempt to resolve the (named) reference to a namespace node */
343 1.1 christos
344 1.1 christos AcpiDsResolvePackageElement (ElementPtr);
345 1.1 christos }
346 1.1 christos else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE)
347 1.1 christos {
348 1.1 christos SourceObject->Package.Flags |= AOPOBJ_DATA_VALID;
349 1.1 christos }
350 1.1 christos
351 1.1 christos return (AE_OK);
352 1.1 christos }
353 1.1 christos
354 1.1 christos
355 1.1 christos /*******************************************************************************
356 1.1 christos *
357 1.1 christos * FUNCTION: AcpiDsResolvePackageElement
358 1.1 christos *
359 1.1 christos * PARAMETERS: ElementPtr - Pointer to a reference object
360 1.1 christos *
361 1.1 christos * RETURN: Possible new element is stored to the indirect ElementPtr
362 1.1 christos *
363 1.1 christos * DESCRIPTION: Resolve a package element that is a reference to a named
364 1.1 christos * object.
365 1.1 christos *
366 1.1 christos ******************************************************************************/
367 1.1 christos
368 1.1 christos static void
369 1.1 christos AcpiDsResolvePackageElement (
370 1.1 christos ACPI_OPERAND_OBJECT **ElementPtr)
371 1.1 christos {
372 1.1 christos ACPI_STATUS Status;
373 1.1 christos ACPI_GENERIC_STATE ScopeInfo;
374 1.1 christos ACPI_OPERAND_OBJECT *Element = *ElementPtr;
375 1.1 christos ACPI_NAMESPACE_NODE *ResolvedNode;
376 1.1 christos char *ExternalPath = NULL;
377 1.1 christos ACPI_OBJECT_TYPE Type;
378 1.1 christos
379 1.1 christos
380 1.1 christos ACPI_FUNCTION_TRACE (DsResolvePackageElement);
381 1.1 christos
382 1.1 christos
383 1.1 christos /* Check if reference element is already resolved */
384 1.1 christos
385 1.1 christos if (Element->Reference.Resolved)
386 1.1 christos {
387 1.1 christos return_VOID;
388 1.1 christos }
389 1.1 christos
390 1.1 christos /* Element must be a reference object of correct type */
391 1.1 christos
392 1.1 christos ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
393 1.1 christos
394 1.1 christos Status = AcpiNsLookup (&ScopeInfo,
395 1.1 christos (char *) Element->Reference.Aml, /* Pointer to AML path */
396 1.1 christos ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
397 1.1 christos ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
398 1.1 christos NULL, &ResolvedNode);
399 1.1 christos if (ACPI_FAILURE (Status))
400 1.1 christos {
401 1.1 christos Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
402 1.1 christos (char *) Element->Reference.Aml,
403 1.1 christos NULL, &ExternalPath);
404 1.1 christos
405 1.1 christos ACPI_EXCEPTION ((AE_INFO, Status,
406 1.1 christos "Could not find/resolve named package element: %s", ExternalPath));
407 1.1 christos
408 1.1 christos ACPI_FREE (ExternalPath);
409 1.1 christos *ElementPtr = NULL;
410 1.1 christos return_VOID;
411 1.1 christos }
412 1.1 christos else if (ResolvedNode->Type == ACPI_TYPE_ANY)
413 1.1 christos {
414 1.1 christos /* Named reference not resolved, return a NULL package element */
415 1.1 christos
416 1.1 christos ACPI_ERROR ((AE_INFO,
417 1.1 christos "Could not resolve named package element [%4.4s] in [%4.4s]",
418 1.1 christos ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii));
419 1.1 christos *ElementPtr = NULL;
420 1.1 christos return_VOID;
421 1.1 christos }
422 1.1 christos #if 0
423 1.1 christos else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
424 1.1 christos {
425 1.1 christos /*
426 1.1 christos * A temporary node found here indicates that the reference is
427 1.1 christos * to a node that was created within this method. We are not
428 1.1 christos * going to allow it (especially if the package is returned
429 1.1 christos * from the method) -- the temporary node will be deleted out
430 1.1 christos * from under the method. (05/2017).
431 1.1 christos */
432 1.1 christos ACPI_ERROR ((AE_INFO,
433 1.1 christos "Package element refers to a temporary name [%4.4s], "
434 1.1 christos "inserting a NULL element",
435 1.1 christos ResolvedNode->Name.Ascii));
436 1.1 christos *ElementPtr = NULL;
437 1.1 christos return_VOID;
438 1.1 christos }
439 1.1 christos #endif
440 1.1 christos
441 1.1 christos /*
442 1.1 christos * Special handling for Alias objects. We need ResolvedNode to point
443 1.1 christos * to the Alias target. This effectively "resolves" the alias.
444 1.1 christos */
445 1.1 christos if (ResolvedNode->Type == ACPI_TYPE_LOCAL_ALIAS)
446 1.1 christos {
447 1.1 christos ResolvedNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
448 1.1 christos ResolvedNode->Object);
449 1.1 christos }
450 1.1 christos
451 1.1 christos /* Update the reference object */
452 1.1 christos
453 1.1 christos Element->Reference.Resolved = TRUE;
454 1.1 christos Element->Reference.Node = ResolvedNode;
455 1.1 christos Type = Element->Reference.Node->Type;
456 1.1 christos
457 1.1 christos /*
458 1.1 christos * Attempt to resolve the node to a value before we insert it into
459 1.1 christos * the package. If this is a reference to a common data type,
460 1.1 christos * resolve it immediately. According to the ACPI spec, package
461 1.1 christos * elements can only be "data objects" or method references.
462 1.1 christos * Attempt to resolve to an Integer, Buffer, String or Package.
463 1.1 christos * If cannot, return the named reference (for things like Devices,
464 1.1 christos * Methods, etc.) Buffer Fields and Fields will resolve to simple
465 1.1 christos * objects (int/buf/str/pkg).
466 1.1 christos *
467 1.1 christos * NOTE: References to things like Devices, Methods, Mutexes, etc.
468 1.1 christos * will remain as named references. This behavior is not described
469 1.1 christos * in the ACPI spec, but it appears to be an oversight.
470 1.1 christos */
471 1.1 christos Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL);
472 1.1 christos if (ACPI_FAILURE (Status))
473 1.1 christos {
474 1.1 christos return_VOID;
475 1.1 christos }
476 1.1 christos
477 1.1 christos #if 0
478 1.1 christos /* TBD - alias support */
479 1.1 christos /*
480 1.1 christos * Special handling for Alias objects. We need to setup the type
481 1.1 christos * and the Op->Common.Node to point to the Alias target. Note,
482 1.1 christos * Alias has at most one level of indirection internally.
483 1.1 christos */
484 1.1 christos Type = Op->Common.Node->Type;
485 1.1 christos if (Type == ACPI_TYPE_LOCAL_ALIAS)
486 1.1 christos {
487 1.1 christos Type = ObjDesc->Common.Type;
488 1.1 christos Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
489 1.1 christos Op->Common.Node->Object);
490 1.1 christos }
491 1.1 christos #endif
492 1.1 christos
493 1.1 christos switch (Type)
494 1.1 christos {
495 1.1 christos /*
496 1.1 christos * These object types are a result of named references, so we will
497 1.1 christos * leave them as reference objects. In other words, these types
498 1.1 christos * have no intrinsic "value".
499 1.1 christos */
500 1.1 christos case ACPI_TYPE_DEVICE:
501 1.1 christos case ACPI_TYPE_THERMAL:
502 1.1 christos
503 1.1 christos /* TBD: This may not be necesssary */
504 1.1 christos
505 1.1 christos AcpiUtAddReference (ResolvedNode->Object);
506 1.1 christos break;
507 1.1 christos
508 1.1 christos case ACPI_TYPE_MUTEX:
509 1.1 christos case ACPI_TYPE_METHOD:
510 1.1 christos case ACPI_TYPE_POWER:
511 1.1 christos case ACPI_TYPE_PROCESSOR:
512 1.1 christos case ACPI_TYPE_EVENT:
513 1.1 christos case ACPI_TYPE_REGION:
514 1.1 christos
515 1.1 christos break;
516 1.1 christos
517 1.1 christos default:
518 1.1 christos /*
519 1.1 christos * For all other types - the node was resolved to an actual
520 1.1 christos * operand object with a value, return the object
521 1.1 christos */
522 1.1 christos *ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode;
523 1.1 christos break;
524 1.1 christos }
525 1.1 christos
526 1.1 christos return_VOID;
527 1.1 christos }
528