xref: /minix3/minix/drivers/power/acpi/utilities/uteval.c (revision 29492bb71c7148a089a5afafa0c99409161218df)
1433d6423SLionel Sambuc /******************************************************************************
2433d6423SLionel Sambuc  *
3433d6423SLionel Sambuc  * Module Name: uteval - Object evaluation
4433d6423SLionel Sambuc  *
5433d6423SLionel Sambuc  *****************************************************************************/
6433d6423SLionel Sambuc 
7*29492bb7SDavid van Moolenbroek /*
8*29492bb7SDavid van Moolenbroek  * Copyright (C) 2000 - 2014, Intel Corp.
9433d6423SLionel Sambuc  * All rights reserved.
10433d6423SLionel Sambuc  *
11*29492bb7SDavid van Moolenbroek  * Redistribution and use in source and binary forms, with or without
12*29492bb7SDavid van Moolenbroek  * modification, are permitted provided that the following conditions
13*29492bb7SDavid van Moolenbroek  * are met:
14*29492bb7SDavid van Moolenbroek  * 1. Redistributions of source code must retain the above copyright
15*29492bb7SDavid van Moolenbroek  *    notice, this list of conditions, and the following disclaimer,
16*29492bb7SDavid van Moolenbroek  *    without modification.
17*29492bb7SDavid van Moolenbroek  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18*29492bb7SDavid van Moolenbroek  *    substantially similar to the "NO WARRANTY" disclaimer below
19*29492bb7SDavid van Moolenbroek  *    ("Disclaimer") and any redistribution must be conditioned upon
20*29492bb7SDavid van Moolenbroek  *    including a substantially similar Disclaimer requirement for further
21*29492bb7SDavid van Moolenbroek  *    binary redistribution.
22*29492bb7SDavid van Moolenbroek  * 3. Neither the names of the above-listed copyright holders nor the names
23*29492bb7SDavid van Moolenbroek  *    of any contributors may be used to endorse or promote products derived
24*29492bb7SDavid van Moolenbroek  *    from this software without specific prior written permission.
25433d6423SLionel Sambuc  *
26*29492bb7SDavid van Moolenbroek  * Alternatively, this software may be distributed under the terms of the
27*29492bb7SDavid van Moolenbroek  * GNU General Public License ("GPL") version 2 as published by the Free
28*29492bb7SDavid van Moolenbroek  * Software Foundation.
29433d6423SLionel Sambuc  *
30*29492bb7SDavid van Moolenbroek  * NO WARRANTY
31*29492bb7SDavid van Moolenbroek  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32*29492bb7SDavid van Moolenbroek  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33*29492bb7SDavid van Moolenbroek  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34*29492bb7SDavid van Moolenbroek  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35*29492bb7SDavid van Moolenbroek  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*29492bb7SDavid van Moolenbroek  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*29492bb7SDavid van Moolenbroek  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*29492bb7SDavid van Moolenbroek  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*29492bb7SDavid van Moolenbroek  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40*29492bb7SDavid van Moolenbroek  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*29492bb7SDavid van Moolenbroek  * POSSIBILITY OF SUCH DAMAGES.
42*29492bb7SDavid van Moolenbroek  */
43433d6423SLionel Sambuc 
44433d6423SLionel Sambuc #include "acpi.h"
45433d6423SLionel Sambuc #include "accommon.h"
46433d6423SLionel Sambuc #include "acnamesp.h"
47433d6423SLionel Sambuc 
48433d6423SLionel Sambuc 
49433d6423SLionel Sambuc #define _COMPONENT          ACPI_UTILITIES
50433d6423SLionel Sambuc         ACPI_MODULE_NAME    ("uteval")
51433d6423SLionel Sambuc 
52433d6423SLionel Sambuc 
53433d6423SLionel Sambuc /*******************************************************************************
54433d6423SLionel Sambuc  *
55433d6423SLionel Sambuc  * FUNCTION:    AcpiUtEvaluateObject
56433d6423SLionel Sambuc  *
57433d6423SLionel Sambuc  * PARAMETERS:  PrefixNode          - Starting node
58433d6423SLionel Sambuc  *              Path                - Path to object from starting node
59433d6423SLionel Sambuc  *              ExpectedReturnTypes - Bitmap of allowed return types
60433d6423SLionel Sambuc  *              ReturnDesc          - Where a return value is stored
61433d6423SLionel Sambuc  *
62433d6423SLionel Sambuc  * RETURN:      Status
63433d6423SLionel Sambuc  *
64433d6423SLionel Sambuc  * DESCRIPTION: Evaluates a namespace object and verifies the type of the
65433d6423SLionel Sambuc  *              return object. Common code that simplifies accessing objects
66433d6423SLionel Sambuc  *              that have required return objects of fixed types.
67433d6423SLionel Sambuc  *
68433d6423SLionel Sambuc  *              NOTE: Internal function, no parameter validation
69433d6423SLionel Sambuc  *
70433d6423SLionel Sambuc  ******************************************************************************/
71433d6423SLionel Sambuc 
72433d6423SLionel Sambuc ACPI_STATUS
AcpiUtEvaluateObject(ACPI_NAMESPACE_NODE * PrefixNode,char * Path,UINT32 ExpectedReturnBtypes,ACPI_OPERAND_OBJECT ** ReturnDesc)73433d6423SLionel Sambuc AcpiUtEvaluateObject (
74433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE     *PrefixNode,
75433d6423SLionel Sambuc     char                    *Path,
76433d6423SLionel Sambuc     UINT32                  ExpectedReturnBtypes,
77433d6423SLionel Sambuc     ACPI_OPERAND_OBJECT     **ReturnDesc)
78433d6423SLionel Sambuc {
79433d6423SLionel Sambuc     ACPI_EVALUATE_INFO      *Info;
80433d6423SLionel Sambuc     ACPI_STATUS             Status;
81433d6423SLionel Sambuc     UINT32                  ReturnBtype;
82433d6423SLionel Sambuc 
83433d6423SLionel Sambuc 
84433d6423SLionel Sambuc     ACPI_FUNCTION_TRACE (UtEvaluateObject);
85433d6423SLionel Sambuc 
86433d6423SLionel Sambuc 
87433d6423SLionel Sambuc     /* Allocate the evaluation information block */
88433d6423SLionel Sambuc 
89433d6423SLionel Sambuc     Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
90433d6423SLionel Sambuc     if (!Info)
91433d6423SLionel Sambuc     {
92433d6423SLionel Sambuc         return_ACPI_STATUS (AE_NO_MEMORY);
93433d6423SLionel Sambuc     }
94433d6423SLionel Sambuc 
95433d6423SLionel Sambuc     Info->PrefixNode = PrefixNode;
96*29492bb7SDavid van Moolenbroek     Info->RelativePathname = Path;
97433d6423SLionel Sambuc 
98433d6423SLionel Sambuc     /* Evaluate the object/method */
99433d6423SLionel Sambuc 
100433d6423SLionel Sambuc     Status = AcpiNsEvaluate (Info);
101433d6423SLionel Sambuc     if (ACPI_FAILURE (Status))
102433d6423SLionel Sambuc     {
103433d6423SLionel Sambuc         if (Status == AE_NOT_FOUND)
104433d6423SLionel Sambuc         {
105433d6423SLionel Sambuc             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n",
106433d6423SLionel Sambuc                 AcpiUtGetNodeName (PrefixNode), Path));
107433d6423SLionel Sambuc         }
108433d6423SLionel Sambuc         else
109433d6423SLionel Sambuc         {
110433d6423SLionel Sambuc             ACPI_ERROR_METHOD ("Method execution failed",
111433d6423SLionel Sambuc                 PrefixNode, Path, Status);
112433d6423SLionel Sambuc         }
113433d6423SLionel Sambuc 
114433d6423SLionel Sambuc         goto Cleanup;
115433d6423SLionel Sambuc     }
116433d6423SLionel Sambuc 
117433d6423SLionel Sambuc     /* Did we get a return object? */
118433d6423SLionel Sambuc 
119433d6423SLionel Sambuc     if (!Info->ReturnObject)
120433d6423SLionel Sambuc     {
121433d6423SLionel Sambuc         if (ExpectedReturnBtypes)
122433d6423SLionel Sambuc         {
123433d6423SLionel Sambuc             ACPI_ERROR_METHOD ("No object was returned from",
124433d6423SLionel Sambuc                 PrefixNode, Path, AE_NOT_EXIST);
125433d6423SLionel Sambuc 
126433d6423SLionel Sambuc             Status = AE_NOT_EXIST;
127433d6423SLionel Sambuc         }
128433d6423SLionel Sambuc 
129433d6423SLionel Sambuc         goto Cleanup;
130433d6423SLionel Sambuc     }
131433d6423SLionel Sambuc 
132433d6423SLionel Sambuc     /* Map the return object type to the bitmapped type */
133433d6423SLionel Sambuc 
134433d6423SLionel Sambuc     switch ((Info->ReturnObject)->Common.Type)
135433d6423SLionel Sambuc     {
136433d6423SLionel Sambuc     case ACPI_TYPE_INTEGER:
137*29492bb7SDavid van Moolenbroek 
138433d6423SLionel Sambuc         ReturnBtype = ACPI_BTYPE_INTEGER;
139433d6423SLionel Sambuc         break;
140433d6423SLionel Sambuc 
141433d6423SLionel Sambuc     case ACPI_TYPE_BUFFER:
142*29492bb7SDavid van Moolenbroek 
143433d6423SLionel Sambuc         ReturnBtype = ACPI_BTYPE_BUFFER;
144433d6423SLionel Sambuc         break;
145433d6423SLionel Sambuc 
146433d6423SLionel Sambuc     case ACPI_TYPE_STRING:
147*29492bb7SDavid van Moolenbroek 
148433d6423SLionel Sambuc         ReturnBtype = ACPI_BTYPE_STRING;
149433d6423SLionel Sambuc         break;
150433d6423SLionel Sambuc 
151433d6423SLionel Sambuc     case ACPI_TYPE_PACKAGE:
152*29492bb7SDavid van Moolenbroek 
153433d6423SLionel Sambuc         ReturnBtype = ACPI_BTYPE_PACKAGE;
154433d6423SLionel Sambuc         break;
155433d6423SLionel Sambuc 
156433d6423SLionel Sambuc     default:
157*29492bb7SDavid van Moolenbroek 
158433d6423SLionel Sambuc         ReturnBtype = 0;
159433d6423SLionel Sambuc         break;
160433d6423SLionel Sambuc     }
161433d6423SLionel Sambuc 
162433d6423SLionel Sambuc     if ((AcpiGbl_EnableInterpreterSlack) &&
163433d6423SLionel Sambuc         (!ExpectedReturnBtypes))
164433d6423SLionel Sambuc     {
165433d6423SLionel Sambuc         /*
166433d6423SLionel Sambuc          * We received a return object, but one was not expected. This can
167433d6423SLionel Sambuc          * happen frequently if the "implicit return" feature is enabled.
168433d6423SLionel Sambuc          * Just delete the return object and return AE_OK.
169433d6423SLionel Sambuc          */
170433d6423SLionel Sambuc         AcpiUtRemoveReference (Info->ReturnObject);
171433d6423SLionel Sambuc         goto Cleanup;
172433d6423SLionel Sambuc     }
173433d6423SLionel Sambuc 
174433d6423SLionel Sambuc     /* Is the return object one of the expected types? */
175433d6423SLionel Sambuc 
176433d6423SLionel Sambuc     if (!(ExpectedReturnBtypes & ReturnBtype))
177433d6423SLionel Sambuc     {
178433d6423SLionel Sambuc         ACPI_ERROR_METHOD ("Return object type is incorrect",
179433d6423SLionel Sambuc             PrefixNode, Path, AE_TYPE);
180433d6423SLionel Sambuc 
181433d6423SLionel Sambuc         ACPI_ERROR ((AE_INFO,
182433d6423SLionel Sambuc             "Type returned from %s was incorrect: %s, expected Btypes: 0x%X",
183433d6423SLionel Sambuc             Path, AcpiUtGetObjectTypeName (Info->ReturnObject),
184433d6423SLionel Sambuc             ExpectedReturnBtypes));
185433d6423SLionel Sambuc 
186433d6423SLionel Sambuc         /* On error exit, we must delete the return object */
187433d6423SLionel Sambuc 
188433d6423SLionel Sambuc         AcpiUtRemoveReference (Info->ReturnObject);
189433d6423SLionel Sambuc         Status = AE_TYPE;
190433d6423SLionel Sambuc         goto Cleanup;
191433d6423SLionel Sambuc     }
192433d6423SLionel Sambuc 
193433d6423SLionel Sambuc     /* Object type is OK, return it */
194433d6423SLionel Sambuc 
195433d6423SLionel Sambuc     *ReturnDesc = Info->ReturnObject;
196433d6423SLionel Sambuc 
197433d6423SLionel Sambuc Cleanup:
198433d6423SLionel Sambuc     ACPI_FREE (Info);
199433d6423SLionel Sambuc     return_ACPI_STATUS (Status);
200433d6423SLionel Sambuc }
201433d6423SLionel Sambuc 
202433d6423SLionel Sambuc 
203433d6423SLionel Sambuc /*******************************************************************************
204433d6423SLionel Sambuc  *
205433d6423SLionel Sambuc  * FUNCTION:    AcpiUtEvaluateNumericObject
206433d6423SLionel Sambuc  *
207433d6423SLionel Sambuc  * PARAMETERS:  ObjectName          - Object name to be evaluated
208433d6423SLionel Sambuc  *              DeviceNode          - Node for the device
209433d6423SLionel Sambuc  *              Value               - Where the value is returned
210433d6423SLionel Sambuc  *
211433d6423SLionel Sambuc  * RETURN:      Status
212433d6423SLionel Sambuc  *
213433d6423SLionel Sambuc  * DESCRIPTION: Evaluates a numeric namespace object for a selected device
214433d6423SLionel Sambuc  *              and stores result in *Value.
215433d6423SLionel Sambuc  *
216433d6423SLionel Sambuc  *              NOTE: Internal function, no parameter validation
217433d6423SLionel Sambuc  *
218433d6423SLionel Sambuc  ******************************************************************************/
219433d6423SLionel Sambuc 
220433d6423SLionel Sambuc ACPI_STATUS
AcpiUtEvaluateNumericObject(char * ObjectName,ACPI_NAMESPACE_NODE * DeviceNode,UINT64 * Value)221433d6423SLionel Sambuc AcpiUtEvaluateNumericObject (
222433d6423SLionel Sambuc     char                    *ObjectName,
223433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE     *DeviceNode,
224433d6423SLionel Sambuc     UINT64                  *Value)
225433d6423SLionel Sambuc {
226433d6423SLionel Sambuc     ACPI_OPERAND_OBJECT     *ObjDesc;
227433d6423SLionel Sambuc     ACPI_STATUS             Status;
228433d6423SLionel Sambuc 
229433d6423SLionel Sambuc 
230433d6423SLionel Sambuc     ACPI_FUNCTION_TRACE (UtEvaluateNumericObject);
231433d6423SLionel Sambuc 
232433d6423SLionel Sambuc 
233433d6423SLionel Sambuc     Status = AcpiUtEvaluateObject (DeviceNode, ObjectName,
234433d6423SLionel Sambuc                 ACPI_BTYPE_INTEGER, &ObjDesc);
235433d6423SLionel Sambuc     if (ACPI_FAILURE (Status))
236433d6423SLionel Sambuc     {
237433d6423SLionel Sambuc         return_ACPI_STATUS (Status);
238433d6423SLionel Sambuc     }
239433d6423SLionel Sambuc 
240433d6423SLionel Sambuc     /* Get the returned Integer */
241433d6423SLionel Sambuc 
242433d6423SLionel Sambuc     *Value = ObjDesc->Integer.Value;
243433d6423SLionel Sambuc 
244433d6423SLionel Sambuc     /* On exit, we must delete the return object */
245433d6423SLionel Sambuc 
246433d6423SLionel Sambuc     AcpiUtRemoveReference (ObjDesc);
247433d6423SLionel Sambuc     return_ACPI_STATUS (Status);
248433d6423SLionel Sambuc }
249433d6423SLionel Sambuc 
250433d6423SLionel Sambuc 
251433d6423SLionel Sambuc /*******************************************************************************
252433d6423SLionel Sambuc  *
253433d6423SLionel Sambuc  * FUNCTION:    AcpiUtExecute_STA
254433d6423SLionel Sambuc  *
255433d6423SLionel Sambuc  * PARAMETERS:  DeviceNode          - Node for the device
256433d6423SLionel Sambuc  *              Flags               - Where the status flags are returned
257433d6423SLionel Sambuc  *
258433d6423SLionel Sambuc  * RETURN:      Status
259433d6423SLionel Sambuc  *
260433d6423SLionel Sambuc  * DESCRIPTION: Executes _STA for selected device and stores results in
261*29492bb7SDavid van Moolenbroek  *              *Flags. If _STA does not exist, then the device is assumed
262*29492bb7SDavid van Moolenbroek  *              to be present/functional/enabled (as per the ACPI spec).
263433d6423SLionel Sambuc  *
264433d6423SLionel Sambuc  *              NOTE: Internal function, no parameter validation
265433d6423SLionel Sambuc  *
266433d6423SLionel Sambuc  ******************************************************************************/
267433d6423SLionel Sambuc 
268433d6423SLionel Sambuc ACPI_STATUS
AcpiUtExecute_STA(ACPI_NAMESPACE_NODE * DeviceNode,UINT32 * Flags)269433d6423SLionel Sambuc AcpiUtExecute_STA (
270433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE     *DeviceNode,
271433d6423SLionel Sambuc     UINT32                  *Flags)
272433d6423SLionel Sambuc {
273433d6423SLionel Sambuc     ACPI_OPERAND_OBJECT     *ObjDesc;
274433d6423SLionel Sambuc     ACPI_STATUS             Status;
275433d6423SLionel Sambuc 
276433d6423SLionel Sambuc 
277433d6423SLionel Sambuc     ACPI_FUNCTION_TRACE (UtExecute_STA);
278433d6423SLionel Sambuc 
279433d6423SLionel Sambuc 
280433d6423SLionel Sambuc     Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__STA,
281433d6423SLionel Sambuc                 ACPI_BTYPE_INTEGER, &ObjDesc);
282433d6423SLionel Sambuc     if (ACPI_FAILURE (Status))
283433d6423SLionel Sambuc     {
284433d6423SLionel Sambuc         if (AE_NOT_FOUND == Status)
285433d6423SLionel Sambuc         {
286*29492bb7SDavid van Moolenbroek             /*
287*29492bb7SDavid van Moolenbroek              * if _STA does not exist, then (as per the ACPI specification),
288*29492bb7SDavid van Moolenbroek              * the returned flags will indicate that the device is present,
289*29492bb7SDavid van Moolenbroek              * functional, and enabled.
290*29492bb7SDavid van Moolenbroek              */
291433d6423SLionel Sambuc             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
292433d6423SLionel Sambuc                 "_STA on %4.4s was not found, assuming device is present\n",
293433d6423SLionel Sambuc                 AcpiUtGetNodeName (DeviceNode)));
294433d6423SLionel Sambuc 
295433d6423SLionel Sambuc             *Flags = ACPI_UINT32_MAX;
296433d6423SLionel Sambuc             Status = AE_OK;
297433d6423SLionel Sambuc         }
298433d6423SLionel Sambuc 
299433d6423SLionel Sambuc         return_ACPI_STATUS (Status);
300433d6423SLionel Sambuc     }
301433d6423SLionel Sambuc 
302433d6423SLionel Sambuc     /* Extract the status flags */
303433d6423SLionel Sambuc 
304433d6423SLionel Sambuc     *Flags = (UINT32) ObjDesc->Integer.Value;
305433d6423SLionel Sambuc 
306433d6423SLionel Sambuc     /* On exit, we must delete the return object */
307433d6423SLionel Sambuc 
308433d6423SLionel Sambuc     AcpiUtRemoveReference (ObjDesc);
309433d6423SLionel Sambuc     return_ACPI_STATUS (Status);
310433d6423SLionel Sambuc }
311433d6423SLionel Sambuc 
312433d6423SLionel Sambuc 
313433d6423SLionel Sambuc /*******************************************************************************
314433d6423SLionel Sambuc  *
315433d6423SLionel Sambuc  * FUNCTION:    AcpiUtExecutePowerMethods
316433d6423SLionel Sambuc  *
317433d6423SLionel Sambuc  * PARAMETERS:  DeviceNode          - Node for the device
318433d6423SLionel Sambuc  *              MethodNames         - Array of power method names
319433d6423SLionel Sambuc  *              MethodCount         - Number of methods to execute
320433d6423SLionel Sambuc  *              OutValues           - Where the power method values are returned
321433d6423SLionel Sambuc  *
322433d6423SLionel Sambuc  * RETURN:      Status, OutValues
323433d6423SLionel Sambuc  *
324433d6423SLionel Sambuc  * DESCRIPTION: Executes the specified power methods for the device and returns
325433d6423SLionel Sambuc  *              the result(s).
326433d6423SLionel Sambuc  *
327433d6423SLionel Sambuc  *              NOTE: Internal function, no parameter validation
328433d6423SLionel Sambuc  *
329433d6423SLionel Sambuc  ******************************************************************************/
330433d6423SLionel Sambuc 
331433d6423SLionel Sambuc ACPI_STATUS
AcpiUtExecutePowerMethods(ACPI_NAMESPACE_NODE * DeviceNode,const char ** MethodNames,UINT8 MethodCount,UINT8 * OutValues)332433d6423SLionel Sambuc AcpiUtExecutePowerMethods (
333433d6423SLionel Sambuc     ACPI_NAMESPACE_NODE     *DeviceNode,
334433d6423SLionel Sambuc     const char              **MethodNames,
335433d6423SLionel Sambuc     UINT8                   MethodCount,
336433d6423SLionel Sambuc     UINT8                   *OutValues)
337433d6423SLionel Sambuc {
338433d6423SLionel Sambuc     ACPI_OPERAND_OBJECT     *ObjDesc;
339433d6423SLionel Sambuc     ACPI_STATUS             Status;
340433d6423SLionel Sambuc     ACPI_STATUS             FinalStatus = AE_NOT_FOUND;
341433d6423SLionel Sambuc     UINT32                  i;
342433d6423SLionel Sambuc 
343433d6423SLionel Sambuc 
344433d6423SLionel Sambuc     ACPI_FUNCTION_TRACE (UtExecutePowerMethods);
345433d6423SLionel Sambuc 
346433d6423SLionel Sambuc 
347433d6423SLionel Sambuc     for (i = 0; i < MethodCount; i++)
348433d6423SLionel Sambuc     {
349433d6423SLionel Sambuc         /*
350433d6423SLionel Sambuc          * Execute the power method (_SxD or _SxW). The only allowable
351433d6423SLionel Sambuc          * return type is an Integer.
352433d6423SLionel Sambuc          */
353433d6423SLionel Sambuc         Status = AcpiUtEvaluateObject (DeviceNode,
354433d6423SLionel Sambuc                     ACPI_CAST_PTR (char, MethodNames[i]),
355433d6423SLionel Sambuc                     ACPI_BTYPE_INTEGER, &ObjDesc);
356433d6423SLionel Sambuc         if (ACPI_SUCCESS (Status))
357433d6423SLionel Sambuc         {
358433d6423SLionel Sambuc             OutValues[i] = (UINT8) ObjDesc->Integer.Value;
359433d6423SLionel Sambuc 
360433d6423SLionel Sambuc             /* Delete the return object */
361433d6423SLionel Sambuc 
362433d6423SLionel Sambuc             AcpiUtRemoveReference (ObjDesc);
363433d6423SLionel Sambuc             FinalStatus = AE_OK;            /* At least one value is valid */
364433d6423SLionel Sambuc             continue;
365433d6423SLionel Sambuc         }
366433d6423SLionel Sambuc 
367433d6423SLionel Sambuc         OutValues[i] = ACPI_UINT8_MAX;
368433d6423SLionel Sambuc         if (Status == AE_NOT_FOUND)
369433d6423SLionel Sambuc         {
370433d6423SLionel Sambuc             continue; /* Ignore if not found */
371433d6423SLionel Sambuc         }
372433d6423SLionel Sambuc 
373433d6423SLionel Sambuc         ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Failed %s on Device %4.4s, %s\n",
374433d6423SLionel Sambuc             ACPI_CAST_PTR (char, MethodNames[i]),
375433d6423SLionel Sambuc             AcpiUtGetNodeName (DeviceNode), AcpiFormatException (Status)));
376433d6423SLionel Sambuc     }
377433d6423SLionel Sambuc 
378433d6423SLionel Sambuc     return_ACPI_STATUS (FinalStatus);
379433d6423SLionel Sambuc }
380