Rev 1498 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
1 | /****************************************************************************** |
1 | /****************************************************************************** |
2 | * |
2 | * |
3 | * Module Name: exresolv - AML Interpreter object resolution |
3 | * Module Name: exresolv - AML Interpreter object resolution |
4 | * |
4 | * |
5 | *****************************************************************************/ |
5 | *****************************************************************************/ |
6 | 6 | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
17 | * rights. You may have additional license terms from the party that provided |
17 | * rights. You may have additional license terms from the party that provided |
18 | * you this software, covering your right to use that party's intellectual |
18 | * you this software, covering your right to use that party's intellectual |
19 | * property rights. |
19 | * property rights. |
20 | * |
20 | * |
21 | * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
21 | * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a |
22 | * copy of the source code appearing in this file ("Covered Code") an |
22 | * copy of the source code appearing in this file ("Covered Code") an |
23 | * irrevocable, perpetual, worldwide license under Intel's copyrights in the |
23 | * irrevocable, perpetual, worldwide license under Intel's copyrights in the |
24 | * base code distributed originally by Intel ("Original Intel Code") to copy, |
24 | * base code distributed originally by Intel ("Original Intel Code") to copy, |
25 | * make derivatives, distribute, use and display any portion of the Covered |
25 | * make derivatives, distribute, use and display any portion of the Covered |
26 | * Code in any form, with the right to sublicense such rights; and |
26 | * Code in any form, with the right to sublicense such rights; and |
27 | * |
27 | * |
28 | * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
28 | * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent |
29 | * license (with the right to sublicense), under only those claims of Intel |
29 | * license (with the right to sublicense), under only those claims of Intel |
30 | * patents that are infringed by the Original Intel Code, to make, use, sell, |
30 | * patents that are infringed by the Original Intel Code, to make, use, sell, |
31 | * offer to sell, and import the Covered Code and derivative works thereof |
31 | * offer to sell, and import the Covered Code and derivative works thereof |
32 | * solely to the minimum extent necessary to exercise the above copyright |
32 | * solely to the minimum extent necessary to exercise the above copyright |
33 | * license, and in no event shall the patent license extend to any additions |
33 | * license, and in no event shall the patent license extend to any additions |
34 | * to or modifications of the Original Intel Code. No other license or right |
34 | * to or modifications of the Original Intel Code. No other license or right |
35 | * is granted directly or by implication, estoppel or otherwise; |
35 | * is granted directly or by implication, estoppel or otherwise; |
36 | * |
36 | * |
37 | * The above copyright and patent license is granted only if the following |
37 | * The above copyright and patent license is granted only if the following |
38 | * conditions are met: |
38 | * conditions are met: |
39 | * |
39 | * |
40 | * 3. Conditions |
40 | * 3. Conditions |
41 | * |
41 | * |
42 | * 3.1. Redistribution of Source with Rights to Further Distribute Source. |
42 | * 3.1. Redistribution of Source with Rights to Further Distribute Source. |
43 | * Redistribution of source code of any substantial portion of the Covered |
43 | * Redistribution of source code of any substantial portion of the Covered |
44 | * Code or modification with rights to further distribute source must include |
44 | * Code or modification with rights to further distribute source must include |
45 | * the above Copyright Notice, the above License, this list of Conditions, |
45 | * the above Copyright Notice, the above License, this list of Conditions, |
46 | * and the following Disclaimer and Export Compliance provision. In addition, |
46 | * and the following Disclaimer and Export Compliance provision. In addition, |
47 | * Licensee must cause all Covered Code to which Licensee contributes to |
47 | * Licensee must cause all Covered Code to which Licensee contributes to |
48 | * contain a file documenting the changes Licensee made to create that Covered |
48 | * contain a file documenting the changes Licensee made to create that Covered |
49 | * Code and the date of any change. Licensee must include in that file the |
49 | * Code and the date of any change. Licensee must include in that file the |
50 | * documentation of any changes made by any predecessor Licensee. Licensee |
50 | * documentation of any changes made by any predecessor Licensee. Licensee |
51 | * must include a prominent statement that the modification is derived, |
51 | * must include a prominent statement that the modification is derived, |
52 | * directly or indirectly, from Original Intel Code. |
52 | * directly or indirectly, from Original Intel Code. |
53 | * |
53 | * |
54 | * 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
54 | * 3.2. Redistribution of Source with no Rights to Further Distribute Source. |
55 | * Redistribution of source code of any substantial portion of the Covered |
55 | * Redistribution of source code of any substantial portion of the Covered |
56 | * Code or modification without rights to further distribute source must |
56 | * Code or modification without rights to further distribute source must |
57 | * include the following Disclaimer and Export Compliance provision in the |
57 | * include the following Disclaimer and Export Compliance provision in the |
58 | * documentation and/or other materials provided with distribution. In |
58 | * documentation and/or other materials provided with distribution. In |
59 | * addition, Licensee may not authorize further sublicense of source of any |
59 | * addition, Licensee may not authorize further sublicense of source of any |
60 | * portion of the Covered Code, and must include terms to the effect that the |
60 | * portion of the Covered Code, and must include terms to the effect that the |
61 | * license from Licensee to its licensee is limited to the intellectual |
61 | * license from Licensee to its licensee is limited to the intellectual |
62 | * property embodied in the software Licensee provides to its licensee, and |
62 | * property embodied in the software Licensee provides to its licensee, and |
63 | * not to intellectual property embodied in modifications its licensee may |
63 | * not to intellectual property embodied in modifications its licensee may |
64 | * make. |
64 | * make. |
65 | * |
65 | * |
66 | * 3.3. Redistribution of Executable. Redistribution in executable form of any |
66 | * 3.3. Redistribution of Executable. Redistribution in executable form of any |
67 | * substantial portion of the Covered Code or modification must reproduce the |
67 | * substantial portion of the Covered Code or modification must reproduce the |
68 | * above Copyright Notice, and the following Disclaimer and Export Compliance |
68 | * above Copyright Notice, and the following Disclaimer and Export Compliance |
69 | * provision in the documentation and/or other materials provided with the |
69 | * provision in the documentation and/or other materials provided with the |
70 | * distribution. |
70 | * distribution. |
71 | * |
71 | * |
72 | * 3.4. Intel retains all right, title, and interest in and to the Original |
72 | * 3.4. Intel retains all right, title, and interest in and to the Original |
73 | * Intel Code. |
73 | * Intel Code. |
74 | * |
74 | * |
75 | * 3.5. Neither the name Intel nor any other trademark owned or controlled by |
75 | * 3.5. Neither the name Intel nor any other trademark owned or controlled by |
76 | * Intel shall be used in advertising or otherwise to promote the sale, use or |
76 | * Intel shall be used in advertising or otherwise to promote the sale, use or |
77 | * other dealings in products derived from or relating to the Covered Code |
77 | * other dealings in products derived from or relating to the Covered Code |
78 | * without prior written authorization from Intel. |
78 | * without prior written authorization from Intel. |
79 | * |
79 | * |
80 | * 4. Disclaimer and Export Compliance |
80 | * 4. Disclaimer and Export Compliance |
81 | * |
81 | * |
82 | * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
82 | * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED |
83 | * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
83 | * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE |
84 | * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
84 | * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, |
85 | * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
85 | * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY |
86 | * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
86 | * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY |
87 | * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
87 | * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A |
88 | * PARTICULAR PURPOSE. |
88 | * PARTICULAR PURPOSE. |
89 | * |
89 | * |
90 | * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
90 | * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES |
91 | * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
91 | * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR |
92 | * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
92 | * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, |
93 | * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
93 | * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY |
94 | * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
94 | * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL |
95 | * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
95 | * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS |
96 | * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
96 | * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY |
97 | * LIMITED REMEDY. |
97 | * LIMITED REMEDY. |
98 | * |
98 | * |
99 | * 4.3. Licensee shall not export, either directly or indirectly, any of this |
99 | * 4.3. Licensee shall not export, either directly or indirectly, any of this |
100 | * software or system incorporating such software without first obtaining any |
100 | * software or system incorporating such software without first obtaining any |
101 | * required license or other approval from the U. S. Department of Commerce or |
101 | * required license or other approval from the U. S. Department of Commerce or |
102 | * any other agency or department of the United States Government. In the |
102 | * any other agency or department of the United States Government. In the |
103 | * event Licensee exports any such software from the United States or |
103 | * event Licensee exports any such software from the United States or |
104 | * re-exports any such software from a foreign destination, Licensee shall |
104 | * re-exports any such software from a foreign destination, Licensee shall |
105 | * ensure that the distribution and export/re-export of the software is in |
105 | * ensure that the distribution and export/re-export of the software is in |
106 | * compliance with all laws, regulations, orders, or other restrictions of the |
106 | * compliance with all laws, regulations, orders, or other restrictions of the |
107 | * U.S. Export Administration Regulations. Licensee agrees that neither it nor |
107 | * U.S. Export Administration Regulations. Licensee agrees that neither it nor |
108 | * any of its subsidiaries will export/re-export any technical data, process, |
108 | * any of its subsidiaries will export/re-export any technical data, process, |
109 | * software, or service, directly or indirectly, to any country for which the |
109 | * software, or service, directly or indirectly, to any country for which the |
110 | * United States government or any agency thereof requires an export license, |
110 | * United States government or any agency thereof requires an export license, |
111 | * other governmental approval, or letter of assurance, without first obtaining |
111 | * other governmental approval, or letter of assurance, without first obtaining |
112 | * such license, approval or letter. |
112 | * such license, approval or letter. |
113 | * |
113 | * |
114 | *****************************************************************************/ |
114 | *****************************************************************************/ |
115 | 115 | ||
116 | #define __EXRESOLV_C__ |
116 | #define __EXRESOLV_C__ |
117 | 117 | ||
118 | #include "acpi.h" |
118 | #include "acpi.h" |
119 | #include "accommon.h" |
119 | #include "accommon.h" |
120 | #include "amlcode.h" |
120 | #include "amlcode.h" |
121 | #include "acdispat.h" |
121 | #include "acdispat.h" |
122 | #include "acinterp.h" |
122 | #include "acinterp.h" |
123 | #include "acnamesp.h" |
123 | #include "acnamesp.h" |
124 | 124 | ||
125 | 125 | ||
126 | #define _COMPONENT ACPI_EXECUTER |
126 | #define _COMPONENT ACPI_EXECUTER |
127 | ACPI_MODULE_NAME ("exresolv") |
127 | ACPI_MODULE_NAME ("exresolv") |
128 | 128 | ||
129 | /* Local prototypes */ |
129 | /* Local prototypes */ |
130 | 130 | ||
131 | static ACPI_STATUS |
131 | static ACPI_STATUS |
132 | AcpiExResolveObjectToValue ( |
132 | AcpiExResolveObjectToValue ( |
133 | ACPI_OPERAND_OBJECT **StackPtr, |
133 | ACPI_OPERAND_OBJECT **StackPtr, |
134 | ACPI_WALK_STATE *WalkState); |
134 | ACPI_WALK_STATE *WalkState); |
135 | 135 | ||
136 | 136 | ||
137 | /******************************************************************************* |
137 | /******************************************************************************* |
138 | * |
138 | * |
139 | * FUNCTION: AcpiExResolveToValue |
139 | * FUNCTION: AcpiExResolveToValue |
140 | * |
140 | * |
141 | * PARAMETERS: **StackPtr - Points to entry on ObjStack, which can |
141 | * PARAMETERS: **StackPtr - Points to entry on ObjStack, which can |
142 | * be either an (ACPI_OPERAND_OBJECT *) |
142 | * be either an (ACPI_OPERAND_OBJECT *) |
143 | * or an ACPI_HANDLE. |
143 | * or an ACPI_HANDLE. |
144 | * WalkState - Current method state |
144 | * WalkState - Current method state |
145 | * |
145 | * |
146 | * RETURN: Status |
146 | * RETURN: Status |
147 | * |
147 | * |
148 | * DESCRIPTION: Convert Reference objects to values |
148 | * DESCRIPTION: Convert Reference objects to values |
149 | * |
149 | * |
150 | ******************************************************************************/ |
150 | ******************************************************************************/ |
151 | 151 | ||
152 | ACPI_STATUS |
152 | ACPI_STATUS |
153 | AcpiExResolveToValue ( |
153 | AcpiExResolveToValue ( |
154 | ACPI_OPERAND_OBJECT **StackPtr, |
154 | ACPI_OPERAND_OBJECT **StackPtr, |
155 | ACPI_WALK_STATE *WalkState) |
155 | ACPI_WALK_STATE *WalkState) |
156 | { |
156 | { |
157 | ACPI_STATUS Status; |
157 | ACPI_STATUS Status; |
158 | 158 | ||
159 | 159 | ||
160 | ACPI_FUNCTION_TRACE_PTR (ExResolveToValue, StackPtr); |
160 | ACPI_FUNCTION_TRACE_PTR (ExResolveToValue, StackPtr); |
161 | 161 | ||
162 | 162 | ||
163 | if (!StackPtr || !*StackPtr) |
163 | if (!StackPtr || !*StackPtr) |
164 | { |
164 | { |
165 | ACPI_ERROR ((AE_INFO, "Internal - null pointer")); |
165 | ACPI_ERROR ((AE_INFO, "Internal - null pointer")); |
166 | return_ACPI_STATUS (AE_AML_NO_OPERAND); |
166 | return_ACPI_STATUS (AE_AML_NO_OPERAND); |
167 | } |
167 | } |
168 | 168 | ||
169 | /* |
169 | /* |
170 | * The entity pointed to by the StackPtr can be either |
170 | * The entity pointed to by the StackPtr can be either |
171 | * 1) A valid ACPI_OPERAND_OBJECT, or |
171 | * 1) A valid ACPI_OPERAND_OBJECT, or |
172 | * 2) A ACPI_NAMESPACE_NODE (NamedObj) |
172 | * 2) A ACPI_NAMESPACE_NODE (NamedObj) |
173 | */ |
173 | */ |
174 | if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_OPERAND) |
174 | if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_OPERAND) |
175 | { |
175 | { |
176 | Status = AcpiExResolveObjectToValue (StackPtr, WalkState); |
176 | Status = AcpiExResolveObjectToValue (StackPtr, WalkState); |
177 | if (ACPI_FAILURE (Status)) |
177 | if (ACPI_FAILURE (Status)) |
178 | { |
178 | { |
179 | return_ACPI_STATUS (Status); |
179 | return_ACPI_STATUS (Status); |
180 | } |
180 | } |
181 | 181 | ||
182 | if (!*StackPtr) |
182 | if (!*StackPtr) |
183 | { |
183 | { |
184 | ACPI_ERROR ((AE_INFO, "Internal - null pointer")); |
184 | ACPI_ERROR ((AE_INFO, "Internal - null pointer")); |
185 | return_ACPI_STATUS (AE_AML_NO_OPERAND); |
185 | return_ACPI_STATUS (AE_AML_NO_OPERAND); |
186 | } |
186 | } |
187 | } |
187 | } |
188 | 188 | ||
189 | /* |
189 | /* |
190 | * Object on the stack may have changed if AcpiExResolveObjectToValue() |
190 | * Object on the stack may have changed if AcpiExResolveObjectToValue() |
191 | * was called (i.e., we can't use an _else_ here.) |
191 | * was called (i.e., we can't use an _else_ here.) |
192 | */ |
192 | */ |
193 | if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_NAMED) |
193 | if (ACPI_GET_DESCRIPTOR_TYPE (*StackPtr) == ACPI_DESC_TYPE_NAMED) |
194 | { |
194 | { |
195 | Status = AcpiExResolveNodeToValue ( |
195 | Status = AcpiExResolveNodeToValue ( |
196 | ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr), |
196 | ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, StackPtr), |
197 | WalkState); |
197 | WalkState); |
198 | if (ACPI_FAILURE (Status)) |
198 | if (ACPI_FAILURE (Status)) |
199 | { |
199 | { |
200 | return_ACPI_STATUS (Status); |
200 | return_ACPI_STATUS (Status); |
201 | } |
201 | } |
202 | } |
202 | } |
203 | 203 | ||
204 | ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Resolved object %p\n", *StackPtr)); |
204 | ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Resolved object %p\n", *StackPtr)); |
205 | return_ACPI_STATUS (AE_OK); |
205 | return_ACPI_STATUS (AE_OK); |
206 | } |
206 | } |
207 | 207 | ||
208 | 208 | ||
209 | /******************************************************************************* |
209 | /******************************************************************************* |
210 | * |
210 | * |
211 | * FUNCTION: AcpiExResolveObjectToValue |
211 | * FUNCTION: AcpiExResolveObjectToValue |
212 | * |
212 | * |
213 | * PARAMETERS: StackPtr - Pointer to an internal object |
213 | * PARAMETERS: StackPtr - Pointer to an internal object |
214 | * WalkState - Current method state |
214 | * WalkState - Current method state |
215 | * |
215 | * |
216 | * RETURN: Status |
216 | * RETURN: Status |
217 | * |
217 | * |
218 | * DESCRIPTION: Retrieve the value from an internal object. The Reference type |
218 | * DESCRIPTION: Retrieve the value from an internal object. The Reference type |
219 | * uses the associated AML opcode to determine the value. |
219 | * uses the associated AML opcode to determine the value. |
220 | * |
220 | * |
221 | ******************************************************************************/ |
221 | ******************************************************************************/ |
222 | 222 | ||
223 | static ACPI_STATUS |
223 | static ACPI_STATUS |
224 | AcpiExResolveObjectToValue ( |
224 | AcpiExResolveObjectToValue ( |
225 | ACPI_OPERAND_OBJECT **StackPtr, |
225 | ACPI_OPERAND_OBJECT **StackPtr, |
226 | ACPI_WALK_STATE *WalkState) |
226 | ACPI_WALK_STATE *WalkState) |
227 | { |
227 | { |
228 | ACPI_STATUS Status = AE_OK; |
228 | ACPI_STATUS Status = AE_OK; |
229 | ACPI_OPERAND_OBJECT *StackDesc; |
229 | ACPI_OPERAND_OBJECT *StackDesc; |
230 | ACPI_OPERAND_OBJECT *ObjDesc = NULL; |
230 | ACPI_OPERAND_OBJECT *ObjDesc = NULL; |
231 | UINT8 RefType; |
231 | UINT8 RefType; |
232 | 232 | ||
233 | 233 | ||
234 | ACPI_FUNCTION_TRACE (ExResolveObjectToValue); |
234 | ACPI_FUNCTION_TRACE (ExResolveObjectToValue); |
235 | 235 | ||
236 | 236 | ||
237 | StackDesc = *StackPtr; |
237 | StackDesc = *StackPtr; |
238 | 238 | ||
239 | /* This is an ACPI_OPERAND_OBJECT */ |
239 | /* This is an ACPI_OPERAND_OBJECT */ |
240 | 240 | ||
241 | switch (StackDesc->Common.Type) |
241 | switch (StackDesc->Common.Type) |
242 | { |
242 | { |
243 | case ACPI_TYPE_LOCAL_REFERENCE: |
243 | case ACPI_TYPE_LOCAL_REFERENCE: |
244 | 244 | ||
245 | RefType = StackDesc->Reference.Class; |
245 | RefType = StackDesc->Reference.Class; |
246 | 246 | ||
247 | switch (RefType) |
247 | switch (RefType) |
248 | { |
248 | { |
249 | case ACPI_REFCLASS_LOCAL: |
249 | case ACPI_REFCLASS_LOCAL: |
250 | case ACPI_REFCLASS_ARG: |
250 | case ACPI_REFCLASS_ARG: |
251 | 251 | ||
252 | /* |
252 | /* |
253 | * Get the local from the method's state info |
253 | * Get the local from the method's state info |
254 | * Note: this increments the local's object reference count |
254 | * Note: this increments the local's object reference count |
255 | */ |
255 | */ |
256 | Status = AcpiDsMethodDataGetValue (RefType, |
256 | Status = AcpiDsMethodDataGetValue (RefType, |
257 | StackDesc->Reference.Value, WalkState, &ObjDesc); |
257 | StackDesc->Reference.Value, WalkState, &ObjDesc); |
258 | if (ACPI_FAILURE (Status)) |
258 | if (ACPI_FAILURE (Status)) |
259 | { |
259 | { |
260 | return_ACPI_STATUS (Status); |
260 | return_ACPI_STATUS (Status); |
261 | } |
261 | } |
262 | 262 | ||
263 | ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %X] ValueObj is %p\n", |
263 | ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %X] ValueObj is %p\n", |
264 | StackDesc->Reference.Value, ObjDesc)); |
264 | StackDesc->Reference.Value, ObjDesc)); |
265 | 265 | ||
266 | /* |
266 | /* |
267 | * Now we can delete the original Reference Object and |
267 | * Now we can delete the original Reference Object and |
268 | * replace it with the resolved value |
268 | * replace it with the resolved value |
269 | */ |
269 | */ |
270 | AcpiUtRemoveReference (StackDesc); |
270 | AcpiUtRemoveReference (StackDesc); |
271 | *StackPtr = ObjDesc; |
271 | *StackPtr = ObjDesc; |
272 | break; |
272 | break; |
273 | 273 | ||
274 | 274 | ||
275 | case ACPI_REFCLASS_INDEX: |
275 | case ACPI_REFCLASS_INDEX: |
276 | 276 | ||
277 | switch (StackDesc->Reference.TargetType) |
277 | switch (StackDesc->Reference.TargetType) |
278 | { |
278 | { |
279 | case ACPI_TYPE_BUFFER_FIELD: |
279 | case ACPI_TYPE_BUFFER_FIELD: |
280 | 280 | ||
281 | /* Just return - do not dereference */ |
281 | /* Just return - do not dereference */ |
282 | break; |
282 | break; |
283 | 283 | ||
284 | 284 | ||
285 | case ACPI_TYPE_PACKAGE: |
285 | case ACPI_TYPE_PACKAGE: |
286 | 286 | ||
287 | /* If method call or CopyObject - do not dereference */ |
287 | /* If method call or CopyObject - do not dereference */ |
288 | 288 | ||
289 | if ((WalkState->Opcode == AML_INT_METHODCALL_OP) || |
289 | if ((WalkState->Opcode == AML_INT_METHODCALL_OP) || |
290 | (WalkState->Opcode == AML_COPY_OP)) |
290 | (WalkState->Opcode == AML_COPY_OP)) |
291 | { |
291 | { |
292 | break; |
292 | break; |
293 | } |
293 | } |
294 | 294 | ||
295 | /* Otherwise, dereference the PackageIndex to a package element */ |
295 | /* Otherwise, dereference the PackageIndex to a package element */ |
296 | 296 | ||
297 | ObjDesc = *StackDesc->Reference.Where; |
297 | ObjDesc = *StackDesc->Reference.Where; |
298 | if (ObjDesc) |
298 | if (ObjDesc) |
299 | { |
299 | { |
300 | /* |
300 | /* |
301 | * Valid object descriptor, copy pointer to return value |
301 | * Valid object descriptor, copy pointer to return value |
302 | * (i.e., dereference the package index) |
302 | * (i.e., dereference the package index) |
303 | * Delete the ref object, increment the returned object |
303 | * Delete the ref object, increment the returned object |
304 | */ |
304 | */ |
305 | AcpiUtRemoveReference (StackDesc); |
305 | AcpiUtRemoveReference (StackDesc); |
306 | AcpiUtAddReference (ObjDesc); |
306 | AcpiUtAddReference (ObjDesc); |
307 | *StackPtr = ObjDesc; |
307 | *StackPtr = ObjDesc; |
308 | } |
308 | } |
309 | else |
309 | else |
310 | { |
310 | { |
311 | /* |
311 | /* |
312 | * A NULL object descriptor means an uninitialized element of |
312 | * A NULL object descriptor means an uninitialized element of |
313 | * the package, can't dereference it |
313 | * the package, can't dereference it |
314 | */ |
314 | */ |
315 | ACPI_ERROR ((AE_INFO, |
315 | ACPI_ERROR ((AE_INFO, |
316 | "Attempt to dereference an Index to NULL package element Idx=%p", |
316 | "Attempt to dereference an Index to NULL package element Idx=%p", |
317 | StackDesc)); |
317 | StackDesc)); |
318 | Status = AE_AML_UNINITIALIZED_ELEMENT; |
318 | Status = AE_AML_UNINITIALIZED_ELEMENT; |
319 | } |
319 | } |
320 | break; |
320 | break; |
321 | 321 | ||
322 | 322 | ||
323 | default: |
323 | default: |
324 | 324 | ||
325 | /* Invalid reference object */ |
325 | /* Invalid reference object */ |
326 | 326 | ||
327 | ACPI_ERROR ((AE_INFO, |
327 | ACPI_ERROR ((AE_INFO, |
328 | "Unknown TargetType 0x%X in Index/Reference object %p", |
328 | "Unknown TargetType 0x%X in Index/Reference object %p", |
329 | StackDesc->Reference.TargetType, StackDesc)); |
329 | StackDesc->Reference.TargetType, StackDesc)); |
330 | Status = AE_AML_INTERNAL; |
330 | Status = AE_AML_INTERNAL; |
331 | break; |
331 | break; |
332 | } |
332 | } |
333 | break; |
333 | break; |
334 | 334 | ||
335 | 335 | ||
336 | case ACPI_REFCLASS_REFOF: |
336 | case ACPI_REFCLASS_REFOF: |
337 | case ACPI_REFCLASS_DEBUG: |
337 | case ACPI_REFCLASS_DEBUG: |
338 | case ACPI_REFCLASS_TABLE: |
338 | case ACPI_REFCLASS_TABLE: |
339 | 339 | ||
340 | /* Just leave the object as-is, do not dereference */ |
340 | /* Just leave the object as-is, do not dereference */ |
341 | 341 | ||
342 | break; |
342 | break; |
343 | 343 | ||
344 | case ACPI_REFCLASS_NAME: /* Reference to a named object */ |
344 | case ACPI_REFCLASS_NAME: /* Reference to a named object */ |
345 | 345 | ||
346 | /* Dereference the name */ |
346 | /* Dereference the name */ |
347 | 347 | ||
348 | if ((StackDesc->Reference.Node->Type == ACPI_TYPE_DEVICE) || |
348 | if ((StackDesc->Reference.Node->Type == ACPI_TYPE_DEVICE) || |
349 | (StackDesc->Reference.Node->Type == ACPI_TYPE_THERMAL)) |
349 | (StackDesc->Reference.Node->Type == ACPI_TYPE_THERMAL)) |
350 | { |
350 | { |
351 | /* These node types do not have 'real' subobjects */ |
351 | /* These node types do not have 'real' subobjects */ |
352 | 352 | ||
353 | *StackPtr = (void *) StackDesc->Reference.Node; |
353 | *StackPtr = (void *) StackDesc->Reference.Node; |
354 | } |
354 | } |
355 | else |
355 | else |
356 | { |
356 | { |
357 | /* Get the object pointed to by the namespace node */ |
357 | /* Get the object pointed to by the namespace node */ |
358 | 358 | ||
359 | *StackPtr = (StackDesc->Reference.Node)->Object; |
359 | *StackPtr = (StackDesc->Reference.Node)->Object; |
360 | AcpiUtAddReference (*StackPtr); |
360 | AcpiUtAddReference (*StackPtr); |
361 | } |
361 | } |
362 | 362 | ||
363 | AcpiUtRemoveReference (StackDesc); |
363 | AcpiUtRemoveReference (StackDesc); |
364 | break; |
364 | break; |
365 | 365 | ||
366 | default: |
366 | default: |
367 | 367 | ||
368 | ACPI_ERROR ((AE_INFO, |
368 | ACPI_ERROR ((AE_INFO, |
369 | "Unknown Reference type 0x%X in %p", RefType, StackDesc)); |
369 | "Unknown Reference type 0x%X in %p", RefType, StackDesc)); |
370 | Status = AE_AML_INTERNAL; |
370 | Status = AE_AML_INTERNAL; |
371 | break; |
371 | break; |
372 | } |
372 | } |
373 | break; |
373 | break; |
374 | 374 | ||
375 | 375 | ||
376 | case ACPI_TYPE_BUFFER: |
376 | case ACPI_TYPE_BUFFER: |
377 | 377 | ||
378 | Status = AcpiDsGetBufferArguments (StackDesc); |
378 | Status = AcpiDsGetBufferArguments (StackDesc); |
379 | break; |
379 | break; |
380 | 380 | ||
381 | 381 | ||
382 | case ACPI_TYPE_PACKAGE: |
382 | case ACPI_TYPE_PACKAGE: |
383 | 383 | ||
384 | Status = AcpiDsGetPackageArguments (StackDesc); |
384 | Status = AcpiDsGetPackageArguments (StackDesc); |
385 | break; |
385 | break; |
386 | 386 | ||
387 | 387 | ||
388 | case ACPI_TYPE_BUFFER_FIELD: |
388 | case ACPI_TYPE_BUFFER_FIELD: |
389 | case ACPI_TYPE_LOCAL_REGION_FIELD: |
389 | case ACPI_TYPE_LOCAL_REGION_FIELD: |
390 | case ACPI_TYPE_LOCAL_BANK_FIELD: |
390 | case ACPI_TYPE_LOCAL_BANK_FIELD: |
391 | case ACPI_TYPE_LOCAL_INDEX_FIELD: |
391 | case ACPI_TYPE_LOCAL_INDEX_FIELD: |
392 | 392 | ||
393 | ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead SourceDesc=%p Type=%X\n", |
393 | ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead SourceDesc=%p Type=%X\n", |
394 | StackDesc, StackDesc->Common.Type)); |
394 | StackDesc, StackDesc->Common.Type)); |
395 | 395 | ||
396 | Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc); |
396 | Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc); |
397 | 397 | ||
398 | /* Remove a reference to the original operand, then override */ |
398 | /* Remove a reference to the original operand, then override */ |
399 | 399 | ||
400 | AcpiUtRemoveReference (*StackPtr); |
400 | AcpiUtRemoveReference (*StackPtr); |
401 | *StackPtr = (void *) ObjDesc; |
401 | *StackPtr = (void *) ObjDesc; |
402 | break; |
402 | break; |
403 | 403 | ||
404 | default: |
404 | default: |
405 | break; |
405 | break; |
406 | } |
406 | } |
407 | 407 | ||
408 | return_ACPI_STATUS (Status); |
408 | return_ACPI_STATUS (Status); |
409 | } |
409 | } |
410 | 410 | ||
411 | 411 | ||
412 | /******************************************************************************* |
412 | /******************************************************************************* |
413 | * |
413 | * |
414 | * FUNCTION: AcpiExResolveMultiple |
414 | * FUNCTION: AcpiExResolveMultiple |
415 | * |
415 | * |
416 | * PARAMETERS: WalkState - Current state (contains AML opcode) |
416 | * PARAMETERS: WalkState - Current state (contains AML opcode) |
417 | * Operand - Starting point for resolution |
417 | * Operand - Starting point for resolution |
418 | * ReturnType - Where the object type is returned |
418 | * ReturnType - Where the object type is returned |
419 | * ReturnDesc - Where the resolved object is returned |
419 | * ReturnDesc - Where the resolved object is returned |
420 | * |
420 | * |
421 | * RETURN: Status |
421 | * RETURN: Status |
422 | * |
422 | * |
423 | * DESCRIPTION: Return the base object and type. Traverse a reference list if |
423 | * DESCRIPTION: Return the base object and type. Traverse a reference list if |
424 | * necessary to get to the base object. |
424 | * necessary to get to the base object. |
425 | * |
425 | * |
426 | ******************************************************************************/ |
426 | ******************************************************************************/ |
427 | 427 | ||
428 | ACPI_STATUS |
428 | ACPI_STATUS |
429 | AcpiExResolveMultiple ( |
429 | AcpiExResolveMultiple ( |
430 | ACPI_WALK_STATE *WalkState, |
430 | ACPI_WALK_STATE *WalkState, |
431 | ACPI_OPERAND_OBJECT *Operand, |
431 | ACPI_OPERAND_OBJECT *Operand, |
432 | ACPI_OBJECT_TYPE *ReturnType, |
432 | ACPI_OBJECT_TYPE *ReturnType, |
433 | ACPI_OPERAND_OBJECT **ReturnDesc) |
433 | ACPI_OPERAND_OBJECT **ReturnDesc) |
434 | { |
434 | { |
435 | ACPI_OPERAND_OBJECT *ObjDesc = (void *) Operand; |
435 | ACPI_OPERAND_OBJECT *ObjDesc = (void *) Operand; |
436 | ACPI_NAMESPACE_NODE *Node; |
436 | ACPI_NAMESPACE_NODE *Node; |
437 | ACPI_OBJECT_TYPE Type; |
437 | ACPI_OBJECT_TYPE Type; |
438 | ACPI_STATUS Status; |
438 | ACPI_STATUS Status; |
439 | 439 | ||
440 | 440 | ||
441 | ACPI_FUNCTION_TRACE (AcpiExResolveMultiple); |
441 | ACPI_FUNCTION_TRACE (AcpiExResolveMultiple); |
442 | 442 | ||
443 | 443 | ||
444 | /* Operand can be either a namespace node or an operand descriptor */ |
444 | /* Operand can be either a namespace node or an operand descriptor */ |
445 | 445 | ||
446 | switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) |
446 | switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) |
447 | { |
447 | { |
448 | case ACPI_DESC_TYPE_OPERAND: |
448 | case ACPI_DESC_TYPE_OPERAND: |
449 | Type = ObjDesc->Common.Type; |
449 | Type = ObjDesc->Common.Type; |
450 | break; |
450 | break; |
451 | 451 | ||
452 | case ACPI_DESC_TYPE_NAMED: |
452 | case ACPI_DESC_TYPE_NAMED: |
453 | Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; |
453 | Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; |
454 | ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); |
454 | ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); |
455 | 455 | ||
456 | /* If we had an Alias node, use the attached object for type info */ |
456 | /* If we had an Alias node, use the attached object for type info */ |
457 | 457 | ||
458 | if (Type == ACPI_TYPE_LOCAL_ALIAS) |
458 | if (Type == ACPI_TYPE_LOCAL_ALIAS) |
459 | { |
459 | { |
460 | Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; |
460 | Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; |
461 | ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); |
461 | ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); |
462 | } |
462 | } |
463 | break; |
463 | break; |
464 | 464 | ||
465 | default: |
465 | default: |
466 | return_ACPI_STATUS (AE_AML_OPERAND_TYPE); |
466 | return_ACPI_STATUS (AE_AML_OPERAND_TYPE); |
467 | } |
467 | } |
468 | 468 | ||
469 | /* If type is anything other than a reference, we are done */ |
469 | /* If type is anything other than a reference, we are done */ |
470 | 470 | ||
471 | if (Type != ACPI_TYPE_LOCAL_REFERENCE) |
471 | if (Type != ACPI_TYPE_LOCAL_REFERENCE) |
472 | { |
472 | { |
473 | goto Exit; |
473 | goto Exit; |
474 | } |
474 | } |
475 | 475 | ||
476 | /* |
476 | /* |
477 | * For reference objects created via the RefOf, Index, or Load/LoadTable |
477 | * For reference objects created via the RefOf, Index, or Load/LoadTable |
478 | * operators, we need to get to the base object (as per the ACPI |
478 | * operators, we need to get to the base object (as per the ACPI |
479 | * specification of the ObjectType and SizeOf operators). This means |
479 | * specification of the ObjectType and SizeOf operators). This means |
480 | * traversing the list of possibly many nested references. |
480 | * traversing the list of possibly many nested references. |
481 | */ |
481 | */ |
482 | while (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) |
482 | while (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) |
483 | { |
483 | { |
484 | switch (ObjDesc->Reference.Class) |
484 | switch (ObjDesc->Reference.Class) |
485 | { |
485 | { |
486 | case ACPI_REFCLASS_REFOF: |
486 | case ACPI_REFCLASS_REFOF: |
487 | case ACPI_REFCLASS_NAME: |
487 | case ACPI_REFCLASS_NAME: |
488 | 488 | ||
489 | /* Dereference the reference pointer */ |
489 | /* Dereference the reference pointer */ |
490 | 490 | ||
491 | if (ObjDesc->Reference.Class == ACPI_REFCLASS_REFOF) |
491 | if (ObjDesc->Reference.Class == ACPI_REFCLASS_REFOF) |
492 | { |
492 | { |
493 | Node = ObjDesc->Reference.Object; |
493 | Node = ObjDesc->Reference.Object; |
494 | } |
494 | } |
495 | else /* AML_INT_NAMEPATH_OP */ |
495 | else /* AML_INT_NAMEPATH_OP */ |
496 | { |
496 | { |
497 | Node = ObjDesc->Reference.Node; |
497 | Node = ObjDesc->Reference.Node; |
498 | } |
498 | } |
499 | 499 | ||
500 | /* All "References" point to a NS node */ |
500 | /* All "References" point to a NS node */ |
501 | 501 | ||
502 | if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) |
502 | if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) |
503 | { |
503 | { |
504 | ACPI_ERROR ((AE_INFO, |
504 | ACPI_ERROR ((AE_INFO, |
505 | "Not a namespace node %p [%s]", |
505 | "Not a namespace node %p [%s]", |
506 | Node, AcpiUtGetDescriptorName (Node))); |
506 | Node, AcpiUtGetDescriptorName (Node))); |
507 | return_ACPI_STATUS (AE_AML_INTERNAL); |
507 | return_ACPI_STATUS (AE_AML_INTERNAL); |
508 | } |
508 | } |
509 | 509 | ||
510 | /* Get the attached object */ |
510 | /* Get the attached object */ |
511 | 511 | ||
512 | ObjDesc = AcpiNsGetAttachedObject (Node); |
512 | ObjDesc = AcpiNsGetAttachedObject (Node); |
513 | if (!ObjDesc) |
513 | if (!ObjDesc) |
514 | { |
514 | { |
515 | /* No object, use the NS node type */ |
515 | /* No object, use the NS node type */ |
516 | 516 | ||
517 | Type = AcpiNsGetType (Node); |
517 | Type = AcpiNsGetType (Node); |
518 | goto Exit; |
518 | goto Exit; |
519 | } |
519 | } |
520 | 520 | ||
521 | /* Check for circular references */ |
521 | /* Check for circular references */ |
522 | 522 | ||
523 | if (ObjDesc == Operand) |
523 | if (ObjDesc == Operand) |
524 | { |
524 | { |
525 | return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE); |
525 | return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE); |
526 | } |
526 | } |
527 | break; |
527 | break; |
528 | 528 | ||
529 | 529 | ||
530 | case ACPI_REFCLASS_INDEX: |
530 | case ACPI_REFCLASS_INDEX: |
531 | 531 | ||
532 | /* Get the type of this reference (index into another object) */ |
532 | /* Get the type of this reference (index into another object) */ |
533 | 533 | ||
534 | Type = ObjDesc->Reference.TargetType; |
534 | Type = ObjDesc->Reference.TargetType; |
535 | if (Type != ACPI_TYPE_PACKAGE) |
535 | if (Type != ACPI_TYPE_PACKAGE) |
536 | { |
536 | { |
537 | goto Exit; |
537 | goto Exit; |
538 | } |
538 | } |
539 | 539 | ||
540 | /* |
540 | /* |
541 | * The main object is a package, we want to get the type |
541 | * The main object is a package, we want to get the type |
542 | * of the individual package element that is referenced by |
542 | * of the individual package element that is referenced by |
543 | * the index. |
543 | * the index. |
544 | * |
544 | * |
545 | * This could of course in turn be another reference object. |
545 | * This could of course in turn be another reference object. |
546 | */ |
546 | */ |
547 | ObjDesc = *(ObjDesc->Reference.Where); |
547 | ObjDesc = *(ObjDesc->Reference.Where); |
548 | if (!ObjDesc) |
548 | if (!ObjDesc) |
549 | { |
549 | { |
550 | /* NULL package elements are allowed */ |
550 | /* NULL package elements are allowed */ |
551 | 551 | ||
552 | Type = 0; /* Uninitialized */ |
552 | Type = 0; /* Uninitialized */ |
553 | goto Exit; |
553 | goto Exit; |
554 | } |
554 | } |
555 | break; |
555 | break; |
556 | 556 | ||
557 | 557 | ||
558 | case ACPI_REFCLASS_TABLE: |
558 | case ACPI_REFCLASS_TABLE: |
559 | 559 | ||
560 | Type = ACPI_TYPE_DDB_HANDLE; |
560 | Type = ACPI_TYPE_DDB_HANDLE; |
561 | goto Exit; |
561 | goto Exit; |
562 | 562 | ||
563 | 563 | ||
564 | case ACPI_REFCLASS_LOCAL: |
564 | case ACPI_REFCLASS_LOCAL: |
565 | case ACPI_REFCLASS_ARG: |
565 | case ACPI_REFCLASS_ARG: |
566 | 566 | ||
567 | if (ReturnDesc) |
567 | if (ReturnDesc) |
568 | { |
568 | { |
569 | Status = AcpiDsMethodDataGetValue (ObjDesc->Reference.Class, |
569 | Status = AcpiDsMethodDataGetValue (ObjDesc->Reference.Class, |
570 | ObjDesc->Reference.Value, WalkState, &ObjDesc); |
570 | ObjDesc->Reference.Value, WalkState, &ObjDesc); |
571 | if (ACPI_FAILURE (Status)) |
571 | if (ACPI_FAILURE (Status)) |
572 | { |
572 | { |
573 | return_ACPI_STATUS (Status); |
573 | return_ACPI_STATUS (Status); |
574 | } |
574 | } |
575 | AcpiUtRemoveReference (ObjDesc); |
575 | AcpiUtRemoveReference (ObjDesc); |
576 | } |
576 | } |
577 | else |
577 | else |
578 | { |
578 | { |
579 | Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Class, |
579 | Status = AcpiDsMethodDataGetNode (ObjDesc->Reference.Class, |
580 | ObjDesc->Reference.Value, WalkState, &Node); |
580 | ObjDesc->Reference.Value, WalkState, &Node); |
581 | if (ACPI_FAILURE (Status)) |
581 | if (ACPI_FAILURE (Status)) |
582 | { |
582 | { |
583 | return_ACPI_STATUS (Status); |
583 | return_ACPI_STATUS (Status); |
584 | } |
584 | } |
585 | 585 | ||
586 | ObjDesc = AcpiNsGetAttachedObject (Node); |
586 | ObjDesc = AcpiNsGetAttachedObject (Node); |
587 | if (!ObjDesc) |
587 | if (!ObjDesc) |
588 | { |
588 | { |
589 | Type = ACPI_TYPE_ANY; |
589 | Type = ACPI_TYPE_ANY; |
590 | goto Exit; |
590 | goto Exit; |
591 | } |
591 | } |
592 | } |
592 | } |
593 | break; |
593 | break; |
594 | 594 | ||
595 | 595 | ||
596 | case ACPI_REFCLASS_DEBUG: |
596 | case ACPI_REFCLASS_DEBUG: |
597 | 597 | ||
598 | /* The Debug Object is of type "DebugObject" */ |
598 | /* The Debug Object is of type "DebugObject" */ |
599 | 599 | ||
600 | Type = ACPI_TYPE_DEBUG_OBJECT; |
600 | Type = ACPI_TYPE_DEBUG_OBJECT; |
601 | goto Exit; |
601 | goto Exit; |
602 | 602 | ||
603 | 603 | ||
604 | default: |
604 | default: |
605 | 605 | ||
606 | ACPI_ERROR ((AE_INFO, |
606 | ACPI_ERROR ((AE_INFO, |
607 | "Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class)); |
607 | "Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class)); |
608 | return_ACPI_STATUS (AE_AML_INTERNAL); |
608 | return_ACPI_STATUS (AE_AML_INTERNAL); |
609 | } |
609 | } |
610 | } |
610 | } |
611 | 611 | ||
612 | /* |
612 | /* |
613 | * Now we are guaranteed to have an object that has not been created |
613 | * Now we are guaranteed to have an object that has not been created |
614 | * via the RefOf or Index operators. |
614 | * via the RefOf or Index operators. |
615 | */ |
615 | */ |
616 | Type = ObjDesc->Common.Type; |
616 | Type = ObjDesc->Common.Type; |
617 | 617 | ||
618 | 618 | ||
619 | Exit: |
619 | Exit: |
620 | /* Convert internal types to external types */ |
620 | /* Convert internal types to external types */ |
621 | 621 | ||
622 | switch (Type) |
622 | switch (Type) |
623 | { |
623 | { |
624 | case ACPI_TYPE_LOCAL_REGION_FIELD: |
624 | case ACPI_TYPE_LOCAL_REGION_FIELD: |
625 | case ACPI_TYPE_LOCAL_BANK_FIELD: |
625 | case ACPI_TYPE_LOCAL_BANK_FIELD: |
626 | case ACPI_TYPE_LOCAL_INDEX_FIELD: |
626 | case ACPI_TYPE_LOCAL_INDEX_FIELD: |
627 | 627 | ||
628 | Type = ACPI_TYPE_FIELD_UNIT; |
628 | Type = ACPI_TYPE_FIELD_UNIT; |
629 | break; |
629 | break; |
630 | 630 | ||
631 | case ACPI_TYPE_LOCAL_SCOPE: |
631 | case ACPI_TYPE_LOCAL_SCOPE: |
632 | 632 | ||
633 | /* Per ACPI Specification, Scope is untyped */ |
633 | /* Per ACPI Specification, Scope is untyped */ |
634 | 634 | ||
635 | Type = ACPI_TYPE_ANY; |
635 | Type = ACPI_TYPE_ANY; |
636 | break; |
636 | break; |
637 | 637 | ||
638 | default: |
638 | default: |
639 | /* No change to Type required */ |
639 | /* No change to Type required */ |
640 | break; |
640 | break; |
641 | } |
641 | } |
642 | 642 | ||
643 | *ReturnType = Type; |
643 | *ReturnType = Type; |
644 | if (ReturnDesc) |
644 | if (ReturnDesc) |
645 | { |
645 | { |
646 | *ReturnDesc = ObjDesc; |
646 | *ReturnDesc = ObjDesc; |
647 | } |
647 | } |
648 | return_ACPI_STATUS (AE_OK); |
648 | return_ACPI_STATUS (AE_OK); |
649 | } |
649 | } |