Deleted Added
sdiff udiff text old ( 117521 ) new ( 123315 )
full compact
1/******************************************************************************
2 *
3 * Module Name: dsopcode - Dispatcher Op Region support and handling of
4 * "control" opcodes
5 * $Revision: 91 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.

--- 120 unchanged lines hidden (view full) ---

134 * FUNCTION: AcpiDsExecuteArguments
135 *
136 * PARAMETERS: Node - Parent NS node
137 * AmlLength - Length of executable AML
138 * AmlStart - Pointer to the AML
139 *
140 * RETURN: Status.
141 *
142 * DESCRIPTION: Late (deferred) execution of region or field arguments
143 *
144 ****************************************************************************/
145
146ACPI_STATUS
147AcpiDsExecuteArguments (
148 ACPI_NAMESPACE_NODE *Node,
149 ACPI_NAMESPACE_NODE *ScopeNode,
150 UINT32 AmlLength,

--- 32 unchanged lines hidden (view full) ---

183 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
184 AmlLength, NULL, NULL, 1);
185 if (ACPI_FAILURE (Status))
186 {
187 AcpiDsDeleteWalkState (WalkState);
188 return_ACPI_STATUS (Status);
189 }
190
191 /* Mark this parse as a deferred opcode */
192
193 WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP;
194 WalkState->DeferredNode = Node;
195
196 /* Pass1: Parse the entire declaration */
197
198 Status = AcpiPsParseAml (WalkState);
199 if (ACPI_FAILURE (Status))
200 {
201 AcpiPsDeleteParseTree (Op);
202 return_ACPI_STATUS (Status);
203 }
204
205 /* Get and init the Op created above */
206
207 Arg = Op->Common.Value.Arg;
208 Op->Common.Node = Node;
209 Arg->Common.Node = Node;
210 AcpiPsDeleteParseTree (Op);
211
212 /* Evaluate the deferred arguments */
213
214 Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
215 if (!Op)
216 {
217 return_ACPI_STATUS (AE_NO_MEMORY);
218 }
219
220 Op->Common.Node = ScopeNode;
221
222 /* Create and initialize a new parser state */
223
224 WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
225 if (!WalkState)
226 {
227 return_ACPI_STATUS (AE_NO_MEMORY);
228 }
229
230 /* Execute the opcode and arguments */
231
232 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
233 AmlLength, NULL, NULL, 3);
234 if (ACPI_FAILURE (Status))
235 {
236 AcpiDsDeleteWalkState (WalkState);
237 return_ACPI_STATUS (Status);
238 }
239
240 /* Mark this execution as a deferred opcode */
241
242 WalkState->DeferredNode = Node;
243 Status = AcpiPsParseAml (WalkState);
244 AcpiPsDeleteParseTree (Op);
245 return_ACPI_STATUS (Status);
246}
247
248
249/*****************************************************************************
250 *

--- 26 unchanged lines hidden (view full) ---

277 }
278
279 /* Get the AML pointer (method object) and BufferField node */
280
281 ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
282 Node = ObjDesc->BufferField.Node;
283
284 ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD, Node, NULL));
285 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
286 AcpiUtGetNodeName (Node)));
287
288 /* Execute the AML code for the TermArg arguments */
289
290 Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
291 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
292 return_ACPI_STATUS (Status);
293}
294
295
296/*****************************************************************************
297 *
298 * FUNCTION: AcpiDsGetBufferArguments
299 *
300 * PARAMETERS: ObjDesc - A valid Buffer object
301 *
302 * RETURN: Status.
303 *
304 * DESCRIPTION: Get Buffer length and initializer byte list. This implements
305 * the late evaluation of these attributes.
306 *
307 ****************************************************************************/
308

--- 18 unchanged lines hidden (view full) ---

327 Node = ObjDesc->Buffer.Node;
328 if (!Node)
329 {
330 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
331 "No pointer back to NS node in buffer %p\n", ObjDesc));
332 return_ACPI_STATUS (AE_AML_INTERNAL);
333 }
334
335 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n"));
336
337 /* Execute the AML code for the TermArg arguments */
338
339 Status = AcpiDsExecuteArguments (Node, Node,
340 ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
341 return_ACPI_STATUS (Status);
342}
343
344
345/*****************************************************************************
346 *
347 * FUNCTION: AcpiDsGetPackageArguments
348 *
349 * PARAMETERS: ObjDesc - A valid Package object
350 *
351 * RETURN: Status.
352 *
353 * DESCRIPTION: Get Package length and initializer byte list. This implements
354 * the late evaluation of these attributes.
355 *
356 ****************************************************************************/
357

--- 18 unchanged lines hidden (view full) ---

376 Node = ObjDesc->Package.Node;
377 if (!Node)
378 {
379 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
380 "No pointer back to NS node in package %p\n", ObjDesc));
381 return_ACPI_STATUS (AE_AML_INTERNAL);
382 }
383
384 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
385
386 /* Execute the AML code for the TermArg arguments */
387
388 Status = AcpiDsExecuteArguments (Node, Node,
389 ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
390 return_ACPI_STATUS (Status);
391}
392

--- 33 unchanged lines hidden (view full) ---

426 {
427 return_ACPI_STATUS (AE_NOT_EXIST);
428 }
429
430 /* Get the Region node */
431
432 Node = ObjDesc->Region.Node;
433
434 ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
435
436 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
437 AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
438
439 /* Execute the argument AML */
440
441 Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node),
442 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
443 return_ACPI_STATUS (Status);
444}
445
446
447/*****************************************************************************

--- 75 unchanged lines hidden (view full) ---

523
524 /*
525 * The last parameter to all of these opcodes (ResultDesc) started
526 * out as a NameString, and should therefore now be a NS node
527 * after resolution in AcpiExResolveOperands().
528 */
529 if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED)
530 {
531 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination not a NS Node [%s]\n",
532 AcpiPsGetOpcodeName (AmlOpcode), AcpiUtGetDescriptorName (ResultDesc)));
533
534 Status = AE_AML_OPERAND_TYPE;
535 goto Cleanup;
536 }
537
538 Offset = (UINT32) OffsetDesc->Integer.Value;
539
540 /*

--- 59 unchanged lines hidden (view full) ---

600
601 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
602 "Unknown field creation opcode %02x\n",
603 AmlOpcode));
604 Status = AE_AML_BAD_OPCODE;
605 goto Cleanup;
606 }
607
608 /* Entire field must fit within the current length of the buffer */
609
610 if ((BitOffset + BitCount) >
611 (8 * (UINT32) BufferDesc->Buffer.Length))
612 {
613 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
614 "Field [%4.4s] size %d exceeds Buffer [%4.4s] size %d (bits)\n",
615 AcpiUtGetNodeName (ResultDesc),
616 BitOffset + BitCount,
617 AcpiUtGetNodeName (BufferDesc->Buffer.Node),
618 8 * (UINT32) BufferDesc->Buffer.Length));
619 Status = AE_AML_BUFFER_LIMIT;
620 goto Cleanup;
621 }
622
623 /*
624 * Initialize areas of the field object that are common to all fields
625 * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE)
626 */

--- 216 unchanged lines hidden (view full) ---

843 */
844 OperandDesc = WalkState->Operands[WalkState->NumOperands - 2];
845
846 ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) OperandDesc->Integer.Value;
847 AcpiUtRemoveReference (OperandDesc);
848
849 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
850 ObjDesc,
851 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
852 ObjDesc->Region.Length));
853
854 /* Now the address and length are valid for this opregion */
855
856 ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
857
858 return_ACPI_STATUS (Status);
859}

--- 415 unchanged lines hidden ---