dsopcode.c revision 1.3.2.2 1 1.3.2.2 bouyer /******************************************************************************
2 1.3.2.2 bouyer *
3 1.3.2.2 bouyer * Module Name: dsopcode - Dispatcher suport for regions and fields
4 1.3.2.2 bouyer *
5 1.3.2.2 bouyer *****************************************************************************/
6 1.3.2.2 bouyer
7 1.3.2.2 bouyer /*
8 1.3.2.2 bouyer * Copyright (C) 2000 - 2011, Intel Corp.
9 1.3.2.2 bouyer * All rights reserved.
10 1.3.2.2 bouyer *
11 1.3.2.2 bouyer * Redistribution and use in source and binary forms, with or without
12 1.3.2.2 bouyer * modification, are permitted provided that the following conditions
13 1.3.2.2 bouyer * are met:
14 1.3.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
15 1.3.2.2 bouyer * notice, this list of conditions, and the following disclaimer,
16 1.3.2.2 bouyer * without modification.
17 1.3.2.2 bouyer * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.3.2.2 bouyer * substantially similar to the "NO WARRANTY" disclaimer below
19 1.3.2.2 bouyer * ("Disclaimer") and any redistribution must be conditioned upon
20 1.3.2.2 bouyer * including a substantially similar Disclaimer requirement for further
21 1.3.2.2 bouyer * binary redistribution.
22 1.3.2.2 bouyer * 3. Neither the names of the above-listed copyright holders nor the names
23 1.3.2.2 bouyer * of any contributors may be used to endorse or promote products derived
24 1.3.2.2 bouyer * from this software without specific prior written permission.
25 1.3.2.2 bouyer *
26 1.3.2.2 bouyer * Alternatively, this software may be distributed under the terms of the
27 1.3.2.2 bouyer * GNU General Public License ("GPL") version 2 as published by the Free
28 1.3.2.2 bouyer * Software Foundation.
29 1.3.2.2 bouyer *
30 1.3.2.2 bouyer * NO WARRANTY
31 1.3.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.3.2.2 bouyer * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.3.2.2 bouyer * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.3.2.2 bouyer * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.3.2.2 bouyer * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.3.2.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.3.2.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.3.2.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.3.2.2 bouyer * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.3.2.2 bouyer * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.3.2.2 bouyer * POSSIBILITY OF SUCH DAMAGES.
42 1.3.2.2 bouyer */
43 1.3.2.2 bouyer
44 1.3.2.2 bouyer #define __DSOPCODE_C__
45 1.3.2.2 bouyer
46 1.3.2.2 bouyer #include "acpi.h"
47 1.3.2.2 bouyer #include "accommon.h"
48 1.3.2.2 bouyer #include "acparser.h"
49 1.3.2.2 bouyer #include "amlcode.h"
50 1.3.2.2 bouyer #include "acdispat.h"
51 1.3.2.2 bouyer #include "acinterp.h"
52 1.3.2.2 bouyer #include "acnamesp.h"
53 1.3.2.2 bouyer #include "acevents.h"
54 1.3.2.2 bouyer #include "actables.h"
55 1.3.2.2 bouyer
56 1.3.2.2 bouyer #define _COMPONENT ACPI_DISPATCHER
57 1.3.2.2 bouyer ACPI_MODULE_NAME ("dsopcode")
58 1.3.2.2 bouyer
59 1.3.2.2 bouyer /* Local prototypes */
60 1.3.2.2 bouyer
61 1.3.2.2 bouyer static ACPI_STATUS
62 1.3.2.2 bouyer AcpiDsInitBufferField (
63 1.3.2.2 bouyer UINT16 AmlOpcode,
64 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc,
65 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *BufferDesc,
66 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *OffsetDesc,
67 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *LengthDesc,
68 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ResultDesc);
69 1.3.2.2 bouyer
70 1.3.2.2 bouyer
71 1.3.2.2 bouyer /*******************************************************************************
72 1.3.2.2 bouyer *
73 1.3.2.2 bouyer * FUNCTION: AcpiDsInitializeRegion
74 1.3.2.2 bouyer *
75 1.3.2.2 bouyer * PARAMETERS: ObjHandle - Region namespace node
76 1.3.2.2 bouyer *
77 1.3.2.2 bouyer * RETURN: Status
78 1.3.2.2 bouyer *
79 1.3.2.2 bouyer * DESCRIPTION: Front end to EvInitializeRegion
80 1.3.2.2 bouyer *
81 1.3.2.2 bouyer ******************************************************************************/
82 1.3.2.2 bouyer
83 1.3.2.2 bouyer ACPI_STATUS
84 1.3.2.2 bouyer AcpiDsInitializeRegion (
85 1.3.2.2 bouyer ACPI_HANDLE ObjHandle)
86 1.3.2.2 bouyer {
87 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc;
88 1.3.2.2 bouyer ACPI_STATUS Status;
89 1.3.2.2 bouyer
90 1.3.2.2 bouyer
91 1.3.2.2 bouyer ObjDesc = AcpiNsGetAttachedObject (ObjHandle);
92 1.3.2.2 bouyer
93 1.3.2.2 bouyer /* Namespace is NOT locked */
94 1.3.2.2 bouyer
95 1.3.2.2 bouyer Status = AcpiEvInitializeRegion (ObjDesc, FALSE);
96 1.3.2.2 bouyer return (Status);
97 1.3.2.2 bouyer }
98 1.3.2.2 bouyer
99 1.3.2.2 bouyer
100 1.3.2.2 bouyer /*******************************************************************************
101 1.3.2.2 bouyer *
102 1.3.2.2 bouyer * FUNCTION: AcpiDsInitBufferField
103 1.3.2.2 bouyer *
104 1.3.2.2 bouyer * PARAMETERS: AmlOpcode - CreateXxxField
105 1.3.2.2 bouyer * ObjDesc - BufferField object
106 1.3.2.2 bouyer * BufferDesc - Host Buffer
107 1.3.2.2 bouyer * OffsetDesc - Offset into buffer
108 1.3.2.2 bouyer * LengthDesc - Length of field (CREATE_FIELD_OP only)
109 1.3.2.2 bouyer * ResultDesc - Where to store the result
110 1.3.2.2 bouyer *
111 1.3.2.2 bouyer * RETURN: Status
112 1.3.2.2 bouyer *
113 1.3.2.2 bouyer * DESCRIPTION: Perform actual initialization of a buffer field
114 1.3.2.2 bouyer *
115 1.3.2.2 bouyer ******************************************************************************/
116 1.3.2.2 bouyer
117 1.3.2.2 bouyer static ACPI_STATUS
118 1.3.2.2 bouyer AcpiDsInitBufferField (
119 1.3.2.2 bouyer UINT16 AmlOpcode,
120 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc,
121 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *BufferDesc,
122 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *OffsetDesc,
123 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *LengthDesc,
124 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ResultDesc)
125 1.3.2.2 bouyer {
126 1.3.2.2 bouyer UINT32 Offset;
127 1.3.2.2 bouyer UINT32 BitOffset;
128 1.3.2.2 bouyer UINT32 BitCount;
129 1.3.2.2 bouyer UINT8 FieldFlags;
130 1.3.2.2 bouyer ACPI_STATUS Status;
131 1.3.2.2 bouyer
132 1.3.2.2 bouyer
133 1.3.2.2 bouyer ACPI_FUNCTION_TRACE_PTR (DsInitBufferField, ObjDesc);
134 1.3.2.2 bouyer
135 1.3.2.2 bouyer
136 1.3.2.2 bouyer /* Host object must be a Buffer */
137 1.3.2.2 bouyer
138 1.3.2.2 bouyer if (BufferDesc->Common.Type != ACPI_TYPE_BUFFER)
139 1.3.2.2 bouyer {
140 1.3.2.2 bouyer ACPI_ERROR ((AE_INFO,
141 1.3.2.2 bouyer "Target of Create Field is not a Buffer object - %s",
142 1.3.2.2 bouyer AcpiUtGetObjectTypeName (BufferDesc)));
143 1.3.2.2 bouyer
144 1.3.2.2 bouyer Status = AE_AML_OPERAND_TYPE;
145 1.3.2.2 bouyer goto Cleanup;
146 1.3.2.2 bouyer }
147 1.3.2.2 bouyer
148 1.3.2.2 bouyer /*
149 1.3.2.2 bouyer * The last parameter to all of these opcodes (ResultDesc) started
150 1.3.2.2 bouyer * out as a NameString, and should therefore now be a NS node
151 1.3.2.2 bouyer * after resolution in AcpiExResolveOperands().
152 1.3.2.2 bouyer */
153 1.3.2.2 bouyer if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED)
154 1.3.2.2 bouyer {
155 1.3.2.2 bouyer ACPI_ERROR ((AE_INFO,
156 1.3.2.2 bouyer "(%s) destination not a NS Node [%s]",
157 1.3.2.2 bouyer AcpiPsGetOpcodeName (AmlOpcode),
158 1.3.2.2 bouyer AcpiUtGetDescriptorName (ResultDesc)));
159 1.3.2.2 bouyer
160 1.3.2.2 bouyer Status = AE_AML_OPERAND_TYPE;
161 1.3.2.2 bouyer goto Cleanup;
162 1.3.2.2 bouyer }
163 1.3.2.2 bouyer
164 1.3.2.2 bouyer Offset = (UINT32) OffsetDesc->Integer.Value;
165 1.3.2.2 bouyer
166 1.3.2.2 bouyer /*
167 1.3.2.2 bouyer * Setup the Bit offsets and counts, according to the opcode
168 1.3.2.2 bouyer */
169 1.3.2.2 bouyer switch (AmlOpcode)
170 1.3.2.2 bouyer {
171 1.3.2.2 bouyer case AML_CREATE_FIELD_OP:
172 1.3.2.2 bouyer
173 1.3.2.2 bouyer /* Offset is in bits, count is in bits */
174 1.3.2.2 bouyer
175 1.3.2.2 bouyer FieldFlags = AML_FIELD_ACCESS_BYTE;
176 1.3.2.2 bouyer BitOffset = Offset;
177 1.3.2.2 bouyer BitCount = (UINT32) LengthDesc->Integer.Value;
178 1.3.2.2 bouyer
179 1.3.2.2 bouyer /* Must have a valid (>0) bit count */
180 1.3.2.2 bouyer
181 1.3.2.2 bouyer if (BitCount == 0)
182 1.3.2.2 bouyer {
183 1.3.2.2 bouyer ACPI_ERROR ((AE_INFO,
184 1.3.2.2 bouyer "Attempt to CreateField of length zero"));
185 1.3.2.2 bouyer Status = AE_AML_OPERAND_VALUE;
186 1.3.2.2 bouyer goto Cleanup;
187 1.3.2.2 bouyer }
188 1.3.2.2 bouyer break;
189 1.3.2.2 bouyer
190 1.3.2.2 bouyer case AML_CREATE_BIT_FIELD_OP:
191 1.3.2.2 bouyer
192 1.3.2.2 bouyer /* Offset is in bits, Field is one bit */
193 1.3.2.2 bouyer
194 1.3.2.2 bouyer BitOffset = Offset;
195 1.3.2.2 bouyer BitCount = 1;
196 1.3.2.2 bouyer FieldFlags = AML_FIELD_ACCESS_BYTE;
197 1.3.2.2 bouyer break;
198 1.3.2.2 bouyer
199 1.3.2.2 bouyer case AML_CREATE_BYTE_FIELD_OP:
200 1.3.2.2 bouyer
201 1.3.2.2 bouyer /* Offset is in bytes, field is one byte */
202 1.3.2.2 bouyer
203 1.3.2.2 bouyer BitOffset = 8 * Offset;
204 1.3.2.2 bouyer BitCount = 8;
205 1.3.2.2 bouyer FieldFlags = AML_FIELD_ACCESS_BYTE;
206 1.3.2.2 bouyer break;
207 1.3.2.2 bouyer
208 1.3.2.2 bouyer case AML_CREATE_WORD_FIELD_OP:
209 1.3.2.2 bouyer
210 1.3.2.2 bouyer /* Offset is in bytes, field is one word */
211 1.3.2.2 bouyer
212 1.3.2.2 bouyer BitOffset = 8 * Offset;
213 1.3.2.2 bouyer BitCount = 16;
214 1.3.2.2 bouyer FieldFlags = AML_FIELD_ACCESS_WORD;
215 1.3.2.2 bouyer break;
216 1.3.2.2 bouyer
217 1.3.2.2 bouyer case AML_CREATE_DWORD_FIELD_OP:
218 1.3.2.2 bouyer
219 1.3.2.2 bouyer /* Offset is in bytes, field is one dword */
220 1.3.2.2 bouyer
221 1.3.2.2 bouyer BitOffset = 8 * Offset;
222 1.3.2.2 bouyer BitCount = 32;
223 1.3.2.2 bouyer FieldFlags = AML_FIELD_ACCESS_DWORD;
224 1.3.2.2 bouyer break;
225 1.3.2.2 bouyer
226 1.3.2.2 bouyer case AML_CREATE_QWORD_FIELD_OP:
227 1.3.2.2 bouyer
228 1.3.2.2 bouyer /* Offset is in bytes, field is one qword */
229 1.3.2.2 bouyer
230 1.3.2.2 bouyer BitOffset = 8 * Offset;
231 1.3.2.2 bouyer BitCount = 64;
232 1.3.2.2 bouyer FieldFlags = AML_FIELD_ACCESS_QWORD;
233 1.3.2.2 bouyer break;
234 1.3.2.2 bouyer
235 1.3.2.2 bouyer default:
236 1.3.2.2 bouyer
237 1.3.2.2 bouyer ACPI_ERROR ((AE_INFO,
238 1.3.2.2 bouyer "Unknown field creation opcode 0x%02X",
239 1.3.2.2 bouyer AmlOpcode));
240 1.3.2.2 bouyer Status = AE_AML_BAD_OPCODE;
241 1.3.2.2 bouyer goto Cleanup;
242 1.3.2.2 bouyer }
243 1.3.2.2 bouyer
244 1.3.2.2 bouyer /* Entire field must fit within the current length of the buffer */
245 1.3.2.2 bouyer
246 1.3.2.2 bouyer if ((BitOffset + BitCount) >
247 1.3.2.2 bouyer (8 * (UINT32) BufferDesc->Buffer.Length))
248 1.3.2.2 bouyer {
249 1.3.2.2 bouyer ACPI_ERROR ((AE_INFO,
250 1.3.2.2 bouyer "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)",
251 1.3.2.2 bouyer AcpiUtGetNodeName (ResultDesc),
252 1.3.2.2 bouyer BitOffset + BitCount,
253 1.3.2.2 bouyer AcpiUtGetNodeName (BufferDesc->Buffer.Node),
254 1.3.2.2 bouyer 8 * (UINT32) BufferDesc->Buffer.Length));
255 1.3.2.2 bouyer Status = AE_AML_BUFFER_LIMIT;
256 1.3.2.2 bouyer goto Cleanup;
257 1.3.2.2 bouyer }
258 1.3.2.2 bouyer
259 1.3.2.2 bouyer /*
260 1.3.2.2 bouyer * Initialize areas of the field object that are common to all fields
261 1.3.2.2 bouyer * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
262 1.3.2.2 bouyer * UPDATE_RULE = 0 (UPDATE_PRESERVE)
263 1.3.2.2 bouyer */
264 1.3.2.2 bouyer Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
265 1.3.2.2 bouyer BitOffset, BitCount);
266 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
267 1.3.2.2 bouyer {
268 1.3.2.2 bouyer goto Cleanup;
269 1.3.2.2 bouyer }
270 1.3.2.2 bouyer
271 1.3.2.2 bouyer ObjDesc->BufferField.BufferObj = BufferDesc;
272 1.3.2.2 bouyer
273 1.3.2.2 bouyer /* Reference count for BufferDesc inherits ObjDesc count */
274 1.3.2.2 bouyer
275 1.3.2.2 bouyer BufferDesc->Common.ReferenceCount = (UINT16)
276 1.3.2.2 bouyer (BufferDesc->Common.ReferenceCount + ObjDesc->Common.ReferenceCount);
277 1.3.2.2 bouyer
278 1.3.2.2 bouyer
279 1.3.2.2 bouyer Cleanup:
280 1.3.2.2 bouyer
281 1.3.2.2 bouyer /* Always delete the operands */
282 1.3.2.2 bouyer
283 1.3.2.2 bouyer AcpiUtRemoveReference (OffsetDesc);
284 1.3.2.2 bouyer AcpiUtRemoveReference (BufferDesc);
285 1.3.2.2 bouyer
286 1.3.2.2 bouyer if (AmlOpcode == AML_CREATE_FIELD_OP)
287 1.3.2.2 bouyer {
288 1.3.2.2 bouyer AcpiUtRemoveReference (LengthDesc);
289 1.3.2.2 bouyer }
290 1.3.2.2 bouyer
291 1.3.2.2 bouyer /* On failure, delete the result descriptor */
292 1.3.2.2 bouyer
293 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
294 1.3.2.2 bouyer {
295 1.3.2.2 bouyer AcpiUtRemoveReference (ResultDesc); /* Result descriptor */
296 1.3.2.2 bouyer }
297 1.3.2.2 bouyer else
298 1.3.2.2 bouyer {
299 1.3.2.2 bouyer /* Now the address and length are valid for this BufferField */
300 1.3.2.2 bouyer
301 1.3.2.2 bouyer ObjDesc->BufferField.Flags |= AOPOBJ_DATA_VALID;
302 1.3.2.2 bouyer }
303 1.3.2.2 bouyer
304 1.3.2.2 bouyer return_ACPI_STATUS (Status);
305 1.3.2.2 bouyer }
306 1.3.2.2 bouyer
307 1.3.2.2 bouyer
308 1.3.2.2 bouyer /*******************************************************************************
309 1.3.2.2 bouyer *
310 1.3.2.2 bouyer * FUNCTION: AcpiDsEvalBufferFieldOperands
311 1.3.2.2 bouyer *
312 1.3.2.2 bouyer * PARAMETERS: WalkState - Current walk
313 1.3.2.2 bouyer * Op - A valid BufferField Op object
314 1.3.2.2 bouyer *
315 1.3.2.2 bouyer * RETURN: Status
316 1.3.2.2 bouyer *
317 1.3.2.2 bouyer * DESCRIPTION: Get BufferField Buffer and Index
318 1.3.2.2 bouyer * Called from AcpiDsExecEndOp during BufferField parse tree walk
319 1.3.2.2 bouyer *
320 1.3.2.2 bouyer ******************************************************************************/
321 1.3.2.2 bouyer
322 1.3.2.2 bouyer ACPI_STATUS
323 1.3.2.2 bouyer AcpiDsEvalBufferFieldOperands (
324 1.3.2.2 bouyer ACPI_WALK_STATE *WalkState,
325 1.3.2.2 bouyer ACPI_PARSE_OBJECT *Op)
326 1.3.2.2 bouyer {
327 1.3.2.2 bouyer ACPI_STATUS Status;
328 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc;
329 1.3.2.2 bouyer ACPI_NAMESPACE_NODE *Node;
330 1.3.2.2 bouyer ACPI_PARSE_OBJECT *NextOp;
331 1.3.2.2 bouyer
332 1.3.2.2 bouyer
333 1.3.2.2 bouyer ACPI_FUNCTION_TRACE_PTR (DsEvalBufferFieldOperands, Op);
334 1.3.2.2 bouyer
335 1.3.2.2 bouyer
336 1.3.2.2 bouyer /*
337 1.3.2.2 bouyer * This is where we evaluate the address and length fields of the
338 1.3.2.2 bouyer * CreateXxxField declaration
339 1.3.2.2 bouyer */
340 1.3.2.2 bouyer Node = Op->Common.Node;
341 1.3.2.2 bouyer
342 1.3.2.2 bouyer /* NextOp points to the op that holds the Buffer */
343 1.3.2.2 bouyer
344 1.3.2.2 bouyer NextOp = Op->Common.Value.Arg;
345 1.3.2.2 bouyer
346 1.3.2.2 bouyer /* Evaluate/create the address and length operands */
347 1.3.2.2 bouyer
348 1.3.2.2 bouyer Status = AcpiDsCreateOperands (WalkState, NextOp);
349 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
350 1.3.2.2 bouyer {
351 1.3.2.2 bouyer return_ACPI_STATUS (Status);
352 1.3.2.2 bouyer }
353 1.3.2.2 bouyer
354 1.3.2.2 bouyer ObjDesc = AcpiNsGetAttachedObject (Node);
355 1.3.2.2 bouyer if (!ObjDesc)
356 1.3.2.2 bouyer {
357 1.3.2.2 bouyer return_ACPI_STATUS (AE_NOT_EXIST);
358 1.3.2.2 bouyer }
359 1.3.2.2 bouyer
360 1.3.2.2 bouyer /* Resolve the operands */
361 1.3.2.2 bouyer
362 1.3.2.2 bouyer Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
363 1.3.2.2 bouyer ACPI_WALK_OPERANDS, WalkState);
364 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
365 1.3.2.2 bouyer {
366 1.3.2.2 bouyer ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
367 1.3.2.2 bouyer AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status));
368 1.3.2.2 bouyer
369 1.3.2.2 bouyer return_ACPI_STATUS (Status);
370 1.3.2.2 bouyer }
371 1.3.2.2 bouyer
372 1.3.2.2 bouyer /* Initialize the Buffer Field */
373 1.3.2.2 bouyer
374 1.3.2.2 bouyer if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
375 1.3.2.2 bouyer {
376 1.3.2.2 bouyer /* NOTE: Slightly different operands for this opcode */
377 1.3.2.2 bouyer
378 1.3.2.2 bouyer Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
379 1.3.2.2 bouyer WalkState->Operands[0], WalkState->Operands[1],
380 1.3.2.2 bouyer WalkState->Operands[2], WalkState->Operands[3]);
381 1.3.2.2 bouyer }
382 1.3.2.2 bouyer else
383 1.3.2.2 bouyer {
384 1.3.2.2 bouyer /* All other, CreateXxxField opcodes */
385 1.3.2.2 bouyer
386 1.3.2.2 bouyer Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc,
387 1.3.2.2 bouyer WalkState->Operands[0], WalkState->Operands[1],
388 1.3.2.2 bouyer NULL, WalkState->Operands[2]);
389 1.3.2.2 bouyer }
390 1.3.2.2 bouyer
391 1.3.2.2 bouyer return_ACPI_STATUS (Status);
392 1.3.2.2 bouyer }
393 1.3.2.2 bouyer
394 1.3.2.2 bouyer
395 1.3.2.2 bouyer /*******************************************************************************
396 1.3.2.2 bouyer *
397 1.3.2.2 bouyer * FUNCTION: AcpiDsEvalRegionOperands
398 1.3.2.2 bouyer *
399 1.3.2.2 bouyer * PARAMETERS: WalkState - Current walk
400 1.3.2.2 bouyer * Op - A valid region Op object
401 1.3.2.2 bouyer *
402 1.3.2.2 bouyer * RETURN: Status
403 1.3.2.2 bouyer *
404 1.3.2.2 bouyer * DESCRIPTION: Get region address and length
405 1.3.2.2 bouyer * Called from AcpiDsExecEndOp during OpRegion parse tree walk
406 1.3.2.2 bouyer *
407 1.3.2.2 bouyer ******************************************************************************/
408 1.3.2.2 bouyer
409 1.3.2.2 bouyer ACPI_STATUS
410 1.3.2.2 bouyer AcpiDsEvalRegionOperands (
411 1.3.2.2 bouyer ACPI_WALK_STATE *WalkState,
412 1.3.2.2 bouyer ACPI_PARSE_OBJECT *Op)
413 1.3.2.2 bouyer {
414 1.3.2.2 bouyer ACPI_STATUS Status;
415 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc;
416 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *OperandDesc;
417 1.3.2.2 bouyer ACPI_NAMESPACE_NODE *Node;
418 1.3.2.2 bouyer ACPI_PARSE_OBJECT *NextOp;
419 1.3.2.2 bouyer
420 1.3.2.2 bouyer
421 1.3.2.2 bouyer ACPI_FUNCTION_TRACE_PTR (DsEvalRegionOperands, Op);
422 1.3.2.2 bouyer
423 1.3.2.2 bouyer
424 1.3.2.2 bouyer /*
425 1.3.2.2 bouyer * This is where we evaluate the address and length fields of the
426 1.3.2.2 bouyer * OpRegion declaration
427 1.3.2.2 bouyer */
428 1.3.2.2 bouyer Node = Op->Common.Node;
429 1.3.2.2 bouyer
430 1.3.2.2 bouyer /* NextOp points to the op that holds the SpaceID */
431 1.3.2.2 bouyer
432 1.3.2.2 bouyer NextOp = Op->Common.Value.Arg;
433 1.3.2.2 bouyer
434 1.3.2.2 bouyer /* NextOp points to address op */
435 1.3.2.2 bouyer
436 1.3.2.2 bouyer NextOp = NextOp->Common.Next;
437 1.3.2.2 bouyer
438 1.3.2.2 bouyer /* Evaluate/create the address and length operands */
439 1.3.2.2 bouyer
440 1.3.2.2 bouyer Status = AcpiDsCreateOperands (WalkState, NextOp);
441 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
442 1.3.2.2 bouyer {
443 1.3.2.2 bouyer return_ACPI_STATUS (Status);
444 1.3.2.2 bouyer }
445 1.3.2.2 bouyer
446 1.3.2.2 bouyer /* Resolve the length and address operands to numbers */
447 1.3.2.2 bouyer
448 1.3.2.2 bouyer Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
449 1.3.2.2 bouyer ACPI_WALK_OPERANDS, WalkState);
450 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
451 1.3.2.2 bouyer {
452 1.3.2.2 bouyer return_ACPI_STATUS (Status);
453 1.3.2.2 bouyer }
454 1.3.2.2 bouyer
455 1.3.2.2 bouyer ObjDesc = AcpiNsGetAttachedObject (Node);
456 1.3.2.2 bouyer if (!ObjDesc)
457 1.3.2.2 bouyer {
458 1.3.2.2 bouyer return_ACPI_STATUS (AE_NOT_EXIST);
459 1.3.2.2 bouyer }
460 1.3.2.2 bouyer
461 1.3.2.2 bouyer /*
462 1.3.2.2 bouyer * Get the length operand and save it
463 1.3.2.2 bouyer * (at Top of stack)
464 1.3.2.2 bouyer */
465 1.3.2.2 bouyer OperandDesc = WalkState->Operands[WalkState->NumOperands - 1];
466 1.3.2.2 bouyer
467 1.3.2.2 bouyer ObjDesc->Region.Length = (UINT32) OperandDesc->Integer.Value;
468 1.3.2.2 bouyer AcpiUtRemoveReference (OperandDesc);
469 1.3.2.2 bouyer
470 1.3.2.2 bouyer /*
471 1.3.2.2 bouyer * Get the address and save it
472 1.3.2.2 bouyer * (at top of stack - 1)
473 1.3.2.2 bouyer */
474 1.3.2.2 bouyer OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
475 1.3.2.2 bouyer
476 1.3.2.2 bouyer ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS)
477 1.3.2.2 bouyer OperandDesc->Integer.Value;
478 1.3.2.2 bouyer AcpiUtRemoveReference (OperandDesc);
479 1.3.2.2 bouyer
480 1.3.2.2 bouyer ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
481 1.3.2.2 bouyer ObjDesc,
482 1.3.2.2 bouyer ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
483 1.3.2.2 bouyer ObjDesc->Region.Length));
484 1.3.2.2 bouyer
485 1.3.2.2 bouyer /* Now the address and length are valid for this opregion */
486 1.3.2.2 bouyer
487 1.3.2.2 bouyer ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
488 1.3.2.2 bouyer
489 1.3.2.2 bouyer return_ACPI_STATUS (Status);
490 1.3.2.2 bouyer }
491 1.3.2.2 bouyer
492 1.3.2.2 bouyer
493 1.3.2.2 bouyer /*******************************************************************************
494 1.3.2.2 bouyer *
495 1.3.2.2 bouyer * FUNCTION: AcpiDsEvalTableRegionOperands
496 1.3.2.2 bouyer *
497 1.3.2.2 bouyer * PARAMETERS: WalkState - Current walk
498 1.3.2.2 bouyer * Op - A valid region Op object
499 1.3.2.2 bouyer *
500 1.3.2.2 bouyer * RETURN: Status
501 1.3.2.2 bouyer *
502 1.3.2.2 bouyer * DESCRIPTION: Get region address and length.
503 1.3.2.2 bouyer * Called from AcpiDsExecEndOp during DataTableRegion parse
504 1.3.2.2 bouyer * tree walk.
505 1.3.2.2 bouyer *
506 1.3.2.2 bouyer ******************************************************************************/
507 1.3.2.2 bouyer
508 1.3.2.2 bouyer ACPI_STATUS
509 1.3.2.2 bouyer AcpiDsEvalTableRegionOperands (
510 1.3.2.2 bouyer ACPI_WALK_STATE *WalkState,
511 1.3.2.2 bouyer ACPI_PARSE_OBJECT *Op)
512 1.3.2.2 bouyer {
513 1.3.2.2 bouyer ACPI_STATUS Status;
514 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc;
515 1.3.2.2 bouyer ACPI_OPERAND_OBJECT **Operand;
516 1.3.2.2 bouyer ACPI_NAMESPACE_NODE *Node;
517 1.3.2.2 bouyer ACPI_PARSE_OBJECT *NextOp;
518 1.3.2.2 bouyer UINT32 TableIndex;
519 1.3.2.2 bouyer ACPI_TABLE_HEADER *Table;
520 1.3.2.2 bouyer
521 1.3.2.2 bouyer
522 1.3.2.2 bouyer ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);
523 1.3.2.2 bouyer
524 1.3.2.2 bouyer
525 1.3.2.2 bouyer /*
526 1.3.2.2 bouyer * This is where we evaluate the SignatureString and OemIDString
527 1.3.2.2 bouyer * and OemTableIDString of the DataTableRegion declaration
528 1.3.2.2 bouyer */
529 1.3.2.2 bouyer Node = Op->Common.Node;
530 1.3.2.2 bouyer
531 1.3.2.2 bouyer /* NextOp points to SignatureString op */
532 1.3.2.2 bouyer
533 1.3.2.2 bouyer NextOp = Op->Common.Value.Arg;
534 1.3.2.2 bouyer
535 1.3.2.2 bouyer /*
536 1.3.2.2 bouyer * Evaluate/create the SignatureString and OemIDString
537 1.3.2.2 bouyer * and OemTableIDString operands
538 1.3.2.2 bouyer */
539 1.3.2.2 bouyer Status = AcpiDsCreateOperands (WalkState, NextOp);
540 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
541 1.3.2.2 bouyer {
542 1.3.2.2 bouyer return_ACPI_STATUS (Status);
543 1.3.2.2 bouyer }
544 1.3.2.2 bouyer
545 1.3.2.2 bouyer /*
546 1.3.2.2 bouyer * Resolve the SignatureString and OemIDString
547 1.3.2.2 bouyer * and OemTableIDString operands
548 1.3.2.2 bouyer */
549 1.3.2.2 bouyer Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
550 1.3.2.2 bouyer ACPI_WALK_OPERANDS, WalkState);
551 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
552 1.3.2.2 bouyer {
553 1.3.2.2 bouyer return_ACPI_STATUS (Status);
554 1.3.2.2 bouyer }
555 1.3.2.2 bouyer
556 1.3.2.2 bouyer Operand = &WalkState->Operands[0];
557 1.3.2.2 bouyer
558 1.3.2.2 bouyer /* Find the ACPI table */
559 1.3.2.2 bouyer
560 1.3.2.2 bouyer Status = AcpiTbFindTable (Operand[0]->String.Pointer,
561 1.3.2.2 bouyer Operand[1]->String.Pointer, Operand[2]->String.Pointer,
562 1.3.2.2 bouyer &TableIndex);
563 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
564 1.3.2.2 bouyer {
565 1.3.2.2 bouyer return_ACPI_STATUS (Status);
566 1.3.2.2 bouyer }
567 1.3.2.2 bouyer
568 1.3.2.2 bouyer AcpiUtRemoveReference (Operand[0]);
569 1.3.2.2 bouyer AcpiUtRemoveReference (Operand[1]);
570 1.3.2.2 bouyer AcpiUtRemoveReference (Operand[2]);
571 1.3.2.2 bouyer
572 1.3.2.2 bouyer Status = AcpiGetTableByIndex (TableIndex, &Table);
573 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
574 1.3.2.2 bouyer {
575 1.3.2.2 bouyer return_ACPI_STATUS (Status);
576 1.3.2.2 bouyer }
577 1.3.2.2 bouyer
578 1.3.2.2 bouyer ObjDesc = AcpiNsGetAttachedObject (Node);
579 1.3.2.2 bouyer if (!ObjDesc)
580 1.3.2.2 bouyer {
581 1.3.2.2 bouyer return_ACPI_STATUS (AE_NOT_EXIST);
582 1.3.2.2 bouyer }
583 1.3.2.2 bouyer
584 1.3.2.2 bouyer ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) ACPI_TO_INTEGER (Table);
585 1.3.2.2 bouyer ObjDesc->Region.Length = Table->Length;
586 1.3.2.2 bouyer
587 1.3.2.2 bouyer ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
588 1.3.2.2 bouyer ObjDesc,
589 1.3.2.2 bouyer ACPI_FORMAT_NATIVE_UINT (ObjDesc->Region.Address),
590 1.3.2.2 bouyer ObjDesc->Region.Length));
591 1.3.2.2 bouyer
592 1.3.2.2 bouyer /* Now the address and length are valid for this opregion */
593 1.3.2.2 bouyer
594 1.3.2.2 bouyer ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
595 1.3.2.2 bouyer
596 1.3.2.2 bouyer return_ACPI_STATUS (Status);
597 1.3.2.2 bouyer }
598 1.3.2.2 bouyer
599 1.3.2.2 bouyer
600 1.3.2.2 bouyer /*******************************************************************************
601 1.3.2.2 bouyer *
602 1.3.2.2 bouyer * FUNCTION: AcpiDsEvalDataObjectOperands
603 1.3.2.2 bouyer *
604 1.3.2.2 bouyer * PARAMETERS: WalkState - Current walk
605 1.3.2.2 bouyer * Op - A valid DataObject Op object
606 1.3.2.2 bouyer * ObjDesc - DataObject
607 1.3.2.2 bouyer *
608 1.3.2.2 bouyer * RETURN: Status
609 1.3.2.2 bouyer *
610 1.3.2.2 bouyer * DESCRIPTION: Get the operands and complete the following data object types:
611 1.3.2.2 bouyer * Buffer, Package.
612 1.3.2.2 bouyer *
613 1.3.2.2 bouyer ******************************************************************************/
614 1.3.2.2 bouyer
615 1.3.2.2 bouyer ACPI_STATUS
616 1.3.2.2 bouyer AcpiDsEvalDataObjectOperands (
617 1.3.2.2 bouyer ACPI_WALK_STATE *WalkState,
618 1.3.2.2 bouyer ACPI_PARSE_OBJECT *Op,
619 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc)
620 1.3.2.2 bouyer {
621 1.3.2.2 bouyer ACPI_STATUS Status;
622 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ArgDesc;
623 1.3.2.2 bouyer UINT32 Length;
624 1.3.2.2 bouyer
625 1.3.2.2 bouyer
626 1.3.2.2 bouyer ACPI_FUNCTION_TRACE (DsEvalDataObjectOperands);
627 1.3.2.2 bouyer
628 1.3.2.2 bouyer
629 1.3.2.2 bouyer /* The first operand (for all of these data objects) is the length */
630 1.3.2.2 bouyer
631 1.3.2.2 bouyer /*
632 1.3.2.2 bouyer * Set proper index into operand stack for AcpiDsObjStackPush
633 1.3.2.2 bouyer * invoked inside AcpiDsCreateOperand.
634 1.3.2.2 bouyer */
635 1.3.2.2 bouyer WalkState->OperandIndex = WalkState->NumOperands;
636 1.3.2.2 bouyer
637 1.3.2.2 bouyer Status = AcpiDsCreateOperand (WalkState, Op->Common.Value.Arg, 1);
638 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
639 1.3.2.2 bouyer {
640 1.3.2.2 bouyer return_ACPI_STATUS (Status);
641 1.3.2.2 bouyer }
642 1.3.2.2 bouyer
643 1.3.2.2 bouyer Status = AcpiExResolveOperands (WalkState->Opcode,
644 1.3.2.2 bouyer &(WalkState->Operands [WalkState->NumOperands -1]),
645 1.3.2.2 bouyer WalkState);
646 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
647 1.3.2.2 bouyer {
648 1.3.2.2 bouyer return_ACPI_STATUS (Status);
649 1.3.2.2 bouyer }
650 1.3.2.2 bouyer
651 1.3.2.2 bouyer /* Extract length operand */
652 1.3.2.2 bouyer
653 1.3.2.2 bouyer ArgDesc = WalkState->Operands [WalkState->NumOperands - 1];
654 1.3.2.2 bouyer Length = (UINT32) ArgDesc->Integer.Value;
655 1.3.2.2 bouyer
656 1.3.2.2 bouyer /* Cleanup for length operand */
657 1.3.2.2 bouyer
658 1.3.2.2 bouyer Status = AcpiDsObjStackPop (1, WalkState);
659 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
660 1.3.2.2 bouyer {
661 1.3.2.2 bouyer return_ACPI_STATUS (Status);
662 1.3.2.2 bouyer }
663 1.3.2.2 bouyer
664 1.3.2.2 bouyer AcpiUtRemoveReference (ArgDesc);
665 1.3.2.2 bouyer
666 1.3.2.2 bouyer /*
667 1.3.2.2 bouyer * Create the actual data object
668 1.3.2.2 bouyer */
669 1.3.2.2 bouyer switch (Op->Common.AmlOpcode)
670 1.3.2.2 bouyer {
671 1.3.2.2 bouyer case AML_BUFFER_OP:
672 1.3.2.2 bouyer
673 1.3.2.2 bouyer Status = AcpiDsBuildInternalBufferObj (WalkState, Op, Length, &ObjDesc);
674 1.3.2.2 bouyer break;
675 1.3.2.2 bouyer
676 1.3.2.2 bouyer case AML_PACKAGE_OP:
677 1.3.2.2 bouyer case AML_VAR_PACKAGE_OP:
678 1.3.2.2 bouyer
679 1.3.2.2 bouyer Status = AcpiDsBuildInternalPackageObj (WalkState, Op, Length, &ObjDesc);
680 1.3.2.2 bouyer break;
681 1.3.2.2 bouyer
682 1.3.2.2 bouyer default:
683 1.3.2.2 bouyer return_ACPI_STATUS (AE_AML_BAD_OPCODE);
684 1.3.2.2 bouyer }
685 1.3.2.2 bouyer
686 1.3.2.2 bouyer if (ACPI_SUCCESS (Status))
687 1.3.2.2 bouyer {
688 1.3.2.2 bouyer /*
689 1.3.2.2 bouyer * Return the object in the WalkState, unless the parent is a package -
690 1.3.2.2 bouyer * in this case, the return object will be stored in the parse tree
691 1.3.2.2 bouyer * for the package.
692 1.3.2.2 bouyer */
693 1.3.2.2 bouyer if ((!Op->Common.Parent) ||
694 1.3.2.2 bouyer ((Op->Common.Parent->Common.AmlOpcode != AML_PACKAGE_OP) &&
695 1.3.2.2 bouyer (Op->Common.Parent->Common.AmlOpcode != AML_VAR_PACKAGE_OP) &&
696 1.3.2.2 bouyer (Op->Common.Parent->Common.AmlOpcode != AML_NAME_OP)))
697 1.3.2.2 bouyer {
698 1.3.2.2 bouyer WalkState->ResultObj = ObjDesc;
699 1.3.2.2 bouyer }
700 1.3.2.2 bouyer }
701 1.3.2.2 bouyer
702 1.3.2.2 bouyer return_ACPI_STATUS (Status);
703 1.3.2.2 bouyer }
704 1.3.2.2 bouyer
705 1.3.2.2 bouyer
706 1.3.2.2 bouyer /*******************************************************************************
707 1.3.2.2 bouyer *
708 1.3.2.2 bouyer * FUNCTION: AcpiDsEvalBankFieldOperands
709 1.3.2.2 bouyer *
710 1.3.2.2 bouyer * PARAMETERS: WalkState - Current walk
711 1.3.2.2 bouyer * Op - A valid BankField Op object
712 1.3.2.2 bouyer *
713 1.3.2.2 bouyer * RETURN: Status
714 1.3.2.2 bouyer *
715 1.3.2.2 bouyer * DESCRIPTION: Get BankField BankValue
716 1.3.2.2 bouyer * Called from AcpiDsExecEndOp during BankField parse tree walk
717 1.3.2.2 bouyer *
718 1.3.2.2 bouyer ******************************************************************************/
719 1.3.2.2 bouyer
720 1.3.2.2 bouyer ACPI_STATUS
721 1.3.2.2 bouyer AcpiDsEvalBankFieldOperands (
722 1.3.2.2 bouyer ACPI_WALK_STATE *WalkState,
723 1.3.2.2 bouyer ACPI_PARSE_OBJECT *Op)
724 1.3.2.2 bouyer {
725 1.3.2.2 bouyer ACPI_STATUS Status;
726 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *ObjDesc;
727 1.3.2.2 bouyer ACPI_OPERAND_OBJECT *OperandDesc;
728 1.3.2.2 bouyer ACPI_NAMESPACE_NODE *Node;
729 1.3.2.2 bouyer ACPI_PARSE_OBJECT *NextOp;
730 1.3.2.2 bouyer ACPI_PARSE_OBJECT *Arg;
731 1.3.2.2 bouyer
732 1.3.2.2 bouyer
733 1.3.2.2 bouyer ACPI_FUNCTION_TRACE_PTR (DsEvalBankFieldOperands, Op);
734 1.3.2.2 bouyer
735 1.3.2.2 bouyer
736 1.3.2.2 bouyer /*
737 1.3.2.2 bouyer * This is where we evaluate the BankValue field of the
738 1.3.2.2 bouyer * BankField declaration
739 1.3.2.2 bouyer */
740 1.3.2.2 bouyer
741 1.3.2.2 bouyer /* NextOp points to the op that holds the Region */
742 1.3.2.2 bouyer
743 1.3.2.2 bouyer NextOp = Op->Common.Value.Arg;
744 1.3.2.2 bouyer
745 1.3.2.2 bouyer /* NextOp points to the op that holds the Bank Register */
746 1.3.2.2 bouyer
747 1.3.2.2 bouyer NextOp = NextOp->Common.Next;
748 1.3.2.2 bouyer
749 1.3.2.2 bouyer /* NextOp points to the op that holds the Bank Value */
750 1.3.2.2 bouyer
751 1.3.2.2 bouyer NextOp = NextOp->Common.Next;
752 1.3.2.2 bouyer
753 1.3.2.2 bouyer /*
754 1.3.2.2 bouyer * Set proper index into operand stack for AcpiDsObjStackPush
755 1.3.2.2 bouyer * invoked inside AcpiDsCreateOperand.
756 1.3.2.2 bouyer *
757 1.3.2.2 bouyer * We use WalkState->Operands[0] to store the evaluated BankValue
758 1.3.2.2 bouyer */
759 1.3.2.2 bouyer WalkState->OperandIndex = 0;
760 1.3.2.2 bouyer
761 1.3.2.2 bouyer Status = AcpiDsCreateOperand (WalkState, NextOp, 0);
762 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
763 1.3.2.2 bouyer {
764 1.3.2.2 bouyer return_ACPI_STATUS (Status);
765 1.3.2.2 bouyer }
766 1.3.2.2 bouyer
767 1.3.2.2 bouyer Status = AcpiExResolveToValue (&WalkState->Operands[0], WalkState);
768 1.3.2.2 bouyer if (ACPI_FAILURE (Status))
769 1.3.2.2 bouyer {
770 1.3.2.2 bouyer return_ACPI_STATUS (Status);
771 1.3.2.2 bouyer }
772 1.3.2.2 bouyer
773 1.3.2.2 bouyer ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS,
774 1.3.2.2 bouyer AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1);
775 1.3.2.2 bouyer /*
776 1.3.2.2 bouyer * Get the BankValue operand and save it
777 1.3.2.2 bouyer * (at Top of stack)
778 1.3.2.2 bouyer */
779 1.3.2.2 bouyer OperandDesc = WalkState->Operands[0];
780 1.3.2.2 bouyer
781 1.3.2.2 bouyer /* Arg points to the start Bank Field */
782 1.3.2.2 bouyer
783 1.3.2.2 bouyer Arg = AcpiPsGetArg (Op, 4);
784 1.3.2.2 bouyer while (Arg)
785 1.3.2.2 bouyer {
786 1.3.2.2 bouyer /* Ignore OFFSET and ACCESSAS terms here */
787 1.3.2.2 bouyer
788 1.3.2.2 bouyer if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
789 1.3.2.2 bouyer {
790 1.3.2.2 bouyer Node = Arg->Common.Node;
791 1.3.2.2 bouyer
792 1.3.2.2 bouyer ObjDesc = AcpiNsGetAttachedObject (Node);
793 1.3.2.2 bouyer if (!ObjDesc)
794 1.3.2.2 bouyer {
795 1.3.2.2 bouyer return_ACPI_STATUS (AE_NOT_EXIST);
796 1.3.2.2 bouyer }
797 1.3.2.2 bouyer
798 1.3.2.2 bouyer ObjDesc->BankField.Value = (UINT32) OperandDesc->Integer.Value;
799 1.3.2.2 bouyer }
800 1.3.2.2 bouyer
801 1.3.2.2 bouyer /* Move to next field in the list */
802 1.3.2.2 bouyer
803 1.3.2.2 bouyer Arg = Arg->Common.Next;
804 1.3.2.2 bouyer }
805 1.3.2.2 bouyer
806 1.3.2.2 bouyer AcpiUtRemoveReference (OperandDesc);
807 1.3.2.2 bouyer return_ACPI_STATUS (Status);
808 1.3.2.2 bouyer }
809 1.3.2.2 bouyer
810