dsopcode.c (117521) | dsopcode.c (123315) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: dsopcode - Dispatcher Op Region support and handling of 4 * "control" opcodes | 1/****************************************************************************** 2 * 3 * Module Name: dsopcode - Dispatcher Op Region support and handling of 4 * "control" opcodes |
5 * $Revision: 87 $ | 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 * | 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 execution of region or field arguments | 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 | 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 |
|
191 WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP; | 193 WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP; |
194 WalkState->DeferredNode = Node; |
|
192 193 /* Pass1: Parse the entire declaration */ 194 195 Status = AcpiPsParseAml (WalkState); 196 if (ACPI_FAILURE (Status)) 197 { 198 AcpiPsDeleteParseTree (Op); 199 return_ACPI_STATUS (Status); 200 } 201 202 /* Get and init the Op created above */ 203 204 Arg = Op->Common.Value.Arg; 205 Op->Common.Node = Node; 206 Arg->Common.Node = Node; 207 AcpiPsDeleteParseTree (Op); 208 | 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 |
209 /* Evaluate the address and length arguments for the Buffer Field */ | 212 /* Evaluate the deferred arguments */ |
210 211 Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP); 212 if (!Op) 213 { 214 return_ACPI_STATUS (AE_NO_MEMORY); 215 } 216 217 Op->Common.Node = ScopeNode; 218 219 /* Create and initialize a new parser state */ 220 221 WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL); 222 if (!WalkState) 223 { 224 return_ACPI_STATUS (AE_NO_MEMORY); 225 } 226 | 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 |
|
227 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart, 228 AmlLength, NULL, NULL, 3); 229 if (ACPI_FAILURE (Status)) 230 { 231 AcpiDsDeleteWalkState (WalkState); 232 return_ACPI_STATUS (Status); 233 } 234 | 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; |
|
235 Status = AcpiPsParseAml (WalkState); 236 AcpiPsDeleteParseTree (Op); 237 return_ACPI_STATUS (Status); 238} 239 240 241/***************************************************************************** 242 * --- 26 unchanged lines hidden (view full) --- 269 } 270 271 /* Get the AML pointer (method object) and BufferField node */ 272 273 ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc); 274 Node = ObjDesc->BufferField.Node; 275 276 ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD, Node, NULL)); | 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)); |
277 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField JIT Init\n", 278 Node->Name.Ascii)); | 285 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n", 286 AcpiUtGetNodeName (Node))); |
279 280 /* Execute the AML code for the TermArg arguments */ 281 282 Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node), 283 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart); 284 return_ACPI_STATUS (Status); 285} 286 287 288/***************************************************************************** 289 * 290 * FUNCTION: AcpiDsGetBufferArguments 291 * | 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 * |
292 * PARAMETERS: ObjDesc - A valid Bufferobject | 300 * PARAMETERS: ObjDesc - A valid Buffer object |
293 * 294 * RETURN: Status. 295 * 296 * DESCRIPTION: Get Buffer length and initializer byte list. This implements 297 * the late evaluation of these attributes. 298 * 299 ****************************************************************************/ 300 --- 18 unchanged lines hidden (view full) --- 319 Node = ObjDesc->Buffer.Node; 320 if (!Node) 321 { 322 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 323 "No pointer back to NS node in buffer %p\n", ObjDesc)); 324 return_ACPI_STATUS (AE_AML_INTERNAL); 325 } 326 | 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 |
327 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer JIT Init\n")); | 335 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n")); |
328 329 /* Execute the AML code for the TermArg arguments */ 330 331 Status = AcpiDsExecuteArguments (Node, Node, 332 ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart); 333 return_ACPI_STATUS (Status); 334} 335 336 337/***************************************************************************** 338 * 339 * FUNCTION: AcpiDsGetPackageArguments 340 * | 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 * |
341 * PARAMETERS: ObjDesc - A valid Packageobject | 349 * PARAMETERS: ObjDesc - A valid Package object |
342 * 343 * RETURN: Status. 344 * 345 * DESCRIPTION: Get Package length and initializer byte list. This implements 346 * the late evaluation of these attributes. 347 * 348 ****************************************************************************/ 349 --- 18 unchanged lines hidden (view full) --- 368 Node = ObjDesc->Package.Node; 369 if (!Node) 370 { 371 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 372 "No pointer back to NS node in package %p\n", ObjDesc)); 373 return_ACPI_STATUS (AE_AML_INTERNAL); 374 } 375 | 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 |
376 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package JIT Init\n")); | 384 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n")); |
377 378 /* Execute the AML code for the TermArg arguments */ 379 380 Status = AcpiDsExecuteArguments (Node, Node, 381 ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart); 382 return_ACPI_STATUS (Status); 383} 384 --- 33 unchanged lines hidden (view full) --- 418 { 419 return_ACPI_STATUS (AE_NOT_EXIST); 420 } 421 422 /* Get the Region node */ 423 424 Node = ObjDesc->Region.Node; 425 | 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 |
426 ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL)); | 434 ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL)); |
427 | 435 |
428 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Init at AML %p\n", 429 Node->Name.Ascii, ExtraDesc->Extra.AmlStart)); | 436 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n", 437 AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart)); |
430 | 438 |
439 /* Execute the argument AML */ |
|
431 432 Status = AcpiDsExecuteArguments (Node, AcpiNsGetParentNode (Node), 433 ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart); 434 return_ACPI_STATUS (Status); 435} 436 437 438/***************************************************************************** --- 75 unchanged lines hidden (view full) --- 514 515 /* 516 * The last parameter to all of these opcodes (ResultDesc) started 517 * out as a NameString, and should therefore now be a NS node 518 * after resolution in AcpiExResolveOperands(). 519 */ 520 if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED) 521 { | 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 { |
522 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n", 523 AcpiPsGetOpcodeName (AmlOpcode))); | 531 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination not a NS Node [%s]\n", 532 AcpiPsGetOpcodeName (AmlOpcode), AcpiUtGetDescriptorName (ResultDesc))); |
524 525 Status = AE_AML_OPERAND_TYPE; 526 goto Cleanup; 527 } 528 529 Offset = (UINT32) OffsetDesc->Integer.Value; 530 531 /* --- 59 unchanged lines hidden (view full) --- 591 592 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 593 "Unknown field creation opcode %02x\n", 594 AmlOpcode)); 595 Status = AE_AML_BAD_OPCODE; 596 goto Cleanup; 597 } 598 | 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 |
599 | |
600 /* Entire field must fit within the current length of the buffer */ 601 602 if ((BitOffset + BitCount) > 603 (8 * (UINT32) BufferDesc->Buffer.Length)) 604 { 605 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, | 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, |
606 "Field size %d exceeds Buffer size %d (bits)\n", 607 BitOffset + BitCount, 8 * (UINT32) BufferDesc->Buffer.Length)); | 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)); |
608 Status = AE_AML_BUFFER_LIMIT; 609 goto Cleanup; 610 } 611 612 /* 613 * Initialize areas of the field object that are common to all fields 614 * For FieldFlags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE) 615 */ --- 216 unchanged lines hidden (view full) --- 832 */ 833 OperandDesc = WalkState->Operands[WalkState->NumOperands - 2]; 834 835 ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) OperandDesc->Integer.Value; 836 AcpiUtRemoveReference (OperandDesc); 837 838 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n", 839 ObjDesc, | 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, |
840 ACPI_HIDWORD (ObjDesc->Region.Address), ACPI_LODWORD (ObjDesc->Region.Address), | 851 ACPI_FORMAT_UINT64 (ObjDesc->Region.Address), |
841 ObjDesc->Region.Length)); 842 843 /* Now the address and length are valid for this opregion */ 844 845 ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID; 846 847 return_ACPI_STATUS (Status); 848} --- 415 unchanged lines hidden --- | 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 --- |