psparse.c (126372) | psparse.c (127175) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: psparse - Parser top level AML parse routines | 1/****************************************************************************** 2 * 3 * Module Name: psparse - Parser top level AML parse routines |
4 * $Revision: 143 $ | 4 * $Revision: 144 $ |
5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. --- 504 unchanged lines hidden (view full) --- 517 518ACPI_STATUS 519AcpiPsParseLoop ( 520 ACPI_WALK_STATE *WalkState) 521{ 522 ACPI_STATUS Status = AE_OK; 523 ACPI_PARSE_OBJECT *Op = NULL; /* current op */ 524 ACPI_PARSE_OBJECT *Arg = NULL; | 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. --- 504 unchanged lines hidden (view full) --- 517 518ACPI_STATUS 519AcpiPsParseLoop ( 520 ACPI_WALK_STATE *WalkState) 521{ 522 ACPI_STATUS Status = AE_OK; 523 ACPI_PARSE_OBJECT *Op = NULL; /* current op */ 524 ACPI_PARSE_OBJECT *Arg = NULL; |
525 ACPI_PARSE_OBJECT PreOp; | 525 ACPI_PARSE_OBJECT *PreOp = NULL; |
526 ACPI_PARSE_STATE *ParserState; 527 UINT8 *AmlOpStart = NULL; 528 529 530 ACPI_FUNCTION_TRACE_PTR ("PsParseLoop", WalkState); 531 532 if (WalkState->DescendingCallback == NULL) 533 { --- 115 unchanged lines hidden (view full) --- 649 WalkState->ArgTypes = WalkState->OpInfo->ParseArgs; 650 break; 651 } 652 653 /* Create Op structure and append to parent's argument list */ 654 655 if (WalkState->OpInfo->Flags & AML_NAMED) 656 { | 526 ACPI_PARSE_STATE *ParserState; 527 UINT8 *AmlOpStart = NULL; 528 529 530 ACPI_FUNCTION_TRACE_PTR ("PsParseLoop", WalkState); 531 532 if (WalkState->DescendingCallback == NULL) 533 { --- 115 unchanged lines hidden (view full) --- 649 WalkState->ArgTypes = WalkState->OpInfo->ParseArgs; 650 break; 651 } 652 653 /* Create Op structure and append to parent's argument list */ 654 655 if (WalkState->OpInfo->Flags & AML_NAMED) 656 { |
657 PreOp.Common.Value.Arg = NULL; 658 PreOp.Common.AmlOpcode = WalkState->Opcode; | 657 /* Allocate a new PreOp if necessary */ |
659 | 658 |
659 if (!PreOp) 660 { 661 PreOp = AcpiPsAllocOp (WalkState->Opcode); 662 if (!PreOp) 663 { 664 return_ACPI_STATUS (AE_NO_MEMORY); 665 } 666 } 667 668 PreOp->Common.Value.Arg = NULL; 669 PreOp->Common.AmlOpcode = WalkState->Opcode; 670 |
|
660 /* 661 * Get and append arguments until we find the node that contains 662 * the name (the type ARGP_NAME). 663 */ 664 while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && 665 (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME)) 666 { 667 Status = AcpiPsGetNextArg (WalkState, ParserState, 668 GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg); 669 if (ACPI_FAILURE (Status)) 670 { 671 goto CloseThisOp; 672 } 673 | 671 /* 672 * Get and append arguments until we find the node that contains 673 * the name (the type ARGP_NAME). 674 */ 675 while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && 676 (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME)) 677 { 678 Status = AcpiPsGetNextArg (WalkState, ParserState, 679 GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg); 680 if (ACPI_FAILURE (Status)) 681 { 682 goto CloseThisOp; 683 } 684 |
674 AcpiPsAppendArg (&PreOp, Arg); | 685 AcpiPsAppendArg (PreOp, Arg); |
675 INCREMENT_ARG_LIST (WalkState->ArgTypes); 676 } 677 678 /* Make sure that we found a NAME and didn't run out of arguments */ 679 680 if (!GET_CURRENT_ARG_TYPE (WalkState->ArgTypes)) 681 { 682 return_ACPI_STATUS (AE_AML_NO_OPERAND); --- 29 unchanged lines hidden (view full) --- 712 goto CloseThisOp; 713 } 714 715 if (ACPI_FAILURE (Status)) 716 { 717 goto CloseThisOp; 718 } 719 | 686 INCREMENT_ARG_LIST (WalkState->ArgTypes); 687 } 688 689 /* Make sure that we found a NAME and didn't run out of arguments */ 690 691 if (!GET_CURRENT_ARG_TYPE (WalkState->ArgTypes)) 692 { 693 return_ACPI_STATUS (AE_AML_NO_OPERAND); --- 29 unchanged lines hidden (view full) --- 723 goto CloseThisOp; 724 } 725 726 if (ACPI_FAILURE (Status)) 727 { 728 goto CloseThisOp; 729 } 730 |
720 AcpiPsAppendArg (Op, PreOp.Common.Value.Arg); | 731 AcpiPsAppendArg (Op, PreOp->Common.Value.Arg); |
721 AcpiGbl_Depth++; 722 723 if (Op->Common.AmlOpcode == AML_REGION_OP) 724 { 725 /* 726 * Defer final parsing of an OperationRegion body, 727 * because we don't have enough info in the first pass 728 * to parse it correctly (i.e., there may be method --- 259 unchanged lines hidden (view full) --- 988 * Finished one argument of the containing scope 989 */ 990 ParserState->Scope->ParseScope.ArgCount--; 991 992 /* Close this Op (will result in parse subtree deletion) */ 993 994 AcpiPsCompleteThisOp (WalkState, Op); 995 Op = NULL; | 732 AcpiGbl_Depth++; 733 734 if (Op->Common.AmlOpcode == AML_REGION_OP) 735 { 736 /* 737 * Defer final parsing of an OperationRegion body, 738 * because we don't have enough info in the first pass 739 * to parse it correctly (i.e., there may be method --- 259 unchanged lines hidden (view full) --- 999 * Finished one argument of the containing scope 1000 */ 1001 ParserState->Scope->ParseScope.ArgCount--; 1002 1003 /* Close this Op (will result in parse subtree deletion) */ 1004 1005 AcpiPsCompleteThisOp (WalkState, Op); 1006 Op = NULL; |
1007 if (PreOp) 1008 { 1009 AcpiPsFreeOp (PreOp); 1010 PreOp = NULL; 1011 } |
|
996 997 switch (Status) 998 { 999 case AE_OK: 1000 break; 1001 1002 1003 case AE_CTRL_TRANSFER: --- 272 unchanged lines hidden (view full) --- 1276 else if (Status == AE_CTRL_TERMINATE) 1277 { 1278 Status = AE_OK; 1279 } 1280 else if (Status != AE_OK) 1281 { 1282 ACPI_REPORT_METHOD_ERROR ("Method execution failed", 1283 WalkState->MethodNode, NULL, Status); | 1012 1013 switch (Status) 1014 { 1015 case AE_OK: 1016 break; 1017 1018 1019 case AE_CTRL_TRANSFER: --- 272 unchanged lines hidden (view full) --- 1292 else if (Status == AE_CTRL_TERMINATE) 1293 { 1294 Status = AE_OK; 1295 } 1296 else if (Status != AE_OK) 1297 { 1298 ACPI_REPORT_METHOD_ERROR ("Method execution failed", 1299 WalkState->MethodNode, NULL, Status); |
1300 1301 /* Check for possible multi-thread reentrancy problem */ 1302 1303 if ((Status == AE_ALREADY_EXISTS) && 1304 (!WalkState->MethodDesc->Method.Semaphore)) 1305 { 1306 /* 1307 * This method is marked NotSerialized, but it tried to create a named 1308 * object, causing the second thread entrance to fail. We will workaround 1309 * this by marking the method permanently as Serialized. 1310 */ 1311 WalkState->MethodDesc->Method.MethodFlags |= AML_METHOD_SERIALIZED; 1312 WalkState->MethodDesc->Method.Concurrency = 1; 1313 } |
|
1284 } 1285 | 1314 } 1315 |
1316 if (WalkState->MethodDesc) 1317 { 1318 /* Decrement the thread count on the method parse tree */ 1319 1320 if (WalkState->MethodDesc->Method.ThreadCount) 1321 { 1322 WalkState->MethodDesc->Method.ThreadCount--; 1323 } 1324 } 1325 |
|
1286 /* We are done with this walk, move on to the parent if any */ 1287 1288 WalkState = AcpiDsPopWalkState (Thread); 1289 1290 /* Reset the current scope to the beginning of scope stack */ 1291 1292 AcpiDsScopeStackClear (WalkState); 1293 --- 79 unchanged lines hidden --- | 1326 /* We are done with this walk, move on to the parent if any */ 1327 1328 WalkState = AcpiDsPopWalkState (Thread); 1329 1330 /* Reset the current scope to the beginning of scope stack */ 1331 1332 AcpiDsScopeStackClear (WalkState); 1333 --- 79 unchanged lines hidden --- |