diff options
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/dispatcher/dscontrol.c | 17 | ||||
-rw-r--r-- | source/components/hardware/hwtimer.c | 27 | ||||
-rw-r--r-- | source/components/namespace/nsaccess.c | 14 | ||||
-rw-r--r-- | source/components/namespace/nssearch.c | 1 | ||||
-rw-r--r-- | source/components/parser/psobject.c | 9 | ||||
-rw-r--r-- | source/components/parser/psutils.c | 8 | ||||
-rw-r--r-- | source/components/utilities/utinit.c | 1 | ||||
-rw-r--r-- | source/components/utilities/utmath.c | 4 |
8 files changed, 38 insertions, 43 deletions
diff --git a/source/components/dispatcher/dscontrol.c b/source/components/dispatcher/dscontrol.c index 897200a5efae..7a06a1e6705a 100644 --- a/source/components/dispatcher/dscontrol.c +++ b/source/components/dispatcher/dscontrol.c @@ -234,7 +234,8 @@ AcpiDsExecBeginControlOp ( WalkState->ParserState.PkgEnd; ControlState->Control.Opcode = Op->Common.AmlOpcode; - + ControlState->Control.LoopTimeout = AcpiOsGetTimer () + + (UINT64) (AcpiGbl_MaxLoopIterations * ACPI_100NSEC_PER_SEC); /* Push the control state on this walk's control stack */ @@ -327,15 +328,15 @@ AcpiDsExecEndControlOp ( /* Predicate was true, the body of the loop was just executed */ /* - * This loop counter mechanism allows the interpreter to escape - * possibly infinite loops. This can occur in poorly written AML - * when the hardware does not respond within a while loop and the - * loop does not implement a timeout. + * This infinite loop detection mechanism allows the interpreter + * to escape possibly infinite loops. This can occur in poorly + * written AML when the hardware does not respond within a while + * loop and the loop does not implement a timeout. */ - ControlState->Control.LoopCount++; - if (ControlState->Control.LoopCount > AcpiGbl_MaxLoopIterations) + if (ACPI_TIME_AFTER (AcpiOsGetTimer (), + ControlState->Control.LoopTimeout)) { - Status = AE_AML_INFINITE_LOOP; + Status = AE_AML_LOOP_TIMEOUT; break; } diff --git a/source/components/hardware/hwtimer.c b/source/components/hardware/hwtimer.c index 358164ee8a31..0fc33e8acc06 100644 --- a/source/components/hardware/hwtimer.c +++ b/source/components/hardware/hwtimer.c @@ -283,7 +283,7 @@ AcpiGetTimerDuration ( UINT32 *TimeElapsed) { ACPI_STATUS Status; - UINT32 DeltaTicks; + UINT64 DeltaTicks; UINT64 Quotient; @@ -302,34 +302,33 @@ AcpiGetTimerDuration ( return_ACPI_STATUS (AE_SUPPORT); } + if (StartTicks == EndTicks) + { + *TimeElapsed = 0; + return_ACPI_STATUS (AE_OK); + } + /* * Compute Tick Delta: * Handle (max one) timer rollovers on 24-bit versus 32-bit timers. */ - if (StartTicks < EndTicks) - { - DeltaTicks = EndTicks - StartTicks; - } - else if (StartTicks > EndTicks) + DeltaTicks = EndTicks; + if (StartTicks > EndTicks) { if ((AcpiGbl_FADT.Flags & ACPI_FADT_32BIT_TIMER) == 0) { /* 24-bit Timer */ - DeltaTicks = (((0x00FFFFFF - StartTicks) + EndTicks) & 0x00FFFFFF); + DeltaTicks |= (UINT64) 1 << 24; } else { /* 32-bit Timer */ - DeltaTicks = (0xFFFFFFFF - StartTicks) + EndTicks; + DeltaTicks |= (UINT64) 1 << 32; } } - else /* StartTicks == EndTicks */ - { - *TimeElapsed = 0; - return_ACPI_STATUS (AE_OK); - } + DeltaTicks -= StartTicks; /* * Compute Duration (Requires a 64-bit multiply and divide): @@ -337,7 +336,7 @@ AcpiGetTimerDuration ( * TimeElapsed (microseconds) = * (DeltaTicks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY; */ - Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * ACPI_USEC_PER_SEC, + Status = AcpiUtShortDivide (DeltaTicks * ACPI_USEC_PER_SEC, ACPI_PM_TIMER_FREQUENCY, &Quotient, NULL); *TimeElapsed = (UINT32) Quotient; diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 0ae1fbdd0875..8f98ca68273e 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -775,19 +775,19 @@ AcpiNsLookup ( ThisNode = (ACPI_NAMESPACE_NODE *) ThisNode->Object; } } -#ifdef ACPI_ASL_COMPILER - if (!AcpiGbl_DisasmFlag && - (ThisNode->Flags & ANOBJ_IS_EXTERNAL)) - { - ThisNode->Flags |= IMPLICIT_EXTERNAL; - } -#endif } /* Special handling for the last segment (NumSegments == 0) */ else { +#ifdef ACPI_ASL_COMPILER + if (!AcpiGbl_DisasmFlag && (ThisNode->Flags & ANOBJ_IS_EXTERNAL)) + { + ThisNode->Flags &= ~IMPLICIT_EXTERNAL; + } +#endif + /* * Sanity typecheck of the target object: * diff --git a/source/components/namespace/nssearch.c b/source/components/namespace/nssearch.c index 3504092aedc3..3697ea4be007 100644 --- a/source/components/namespace/nssearch.c +++ b/source/components/namespace/nssearch.c @@ -545,6 +545,7 @@ AcpiNsSearchAndEnter ( (WalkState && WalkState->Opcode == AML_SCOPE_OP)) { NewNode->Flags |= ANOBJ_IS_EXTERNAL; + NewNode->Flags |= IMPLICIT_EXTERNAL; } #endif diff --git a/source/components/parser/psobject.c b/source/components/parser/psobject.c index 8f31750c5f7e..b6aa802590d6 100644 --- a/source/components/parser/psobject.c +++ b/source/components/parser/psobject.c @@ -500,15 +500,10 @@ AcpiPsCreateOp ( * external declaration opcode. Setting WalkState->Aml to * WalkState->ParserState.Aml + 2 moves increments the * WalkState->Aml past the object type and the paramcount of the - * external opcode. For the error message, only print the AML - * offset. We could attempt to print the name but this may cause - * a segmentation fault when printing the namepath because the - * AML may be incorrect. + * external opcode. */ - AcpiOsPrintf ( - "// Invalid external declaration at AML offset 0x%x.\n", - WalkState->Aml - WalkState->ParserState.AmlStart); WalkState->Aml = WalkState->ParserState.Aml + 2; + WalkState->ParserState.Aml = WalkState->Aml; return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); } #endif diff --git a/source/components/parser/psutils.c b/source/components/parser/psutils.c index 19ae3a9d4bdd..a04b2e50aabc 100644 --- a/source/components/parser/psutils.c +++ b/source/components/parser/psutils.c @@ -292,11 +292,11 @@ AcpiPsAllocOp ( { AcpiGbl_CurrentScope = Op; } - } - if (Gbl_CaptureComments) - { - ASL_CV_TRANSFER_COMMENTS (Op); + if (Gbl_CaptureComments) + { + ASL_CV_TRANSFER_COMMENTS (Op); + } } return (Op); diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index d1937a57aafd..faa34bbd20b7 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -334,7 +334,6 @@ AcpiUtInitGlobals ( AcpiGbl_NextOwnerIdOffset = 0; AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; AcpiGbl_OsiMutex = NULL; - AcpiGbl_MaxLoopIterations = ACPI_MAX_LOOP_COUNT; /* Hardware oriented */ diff --git a/source/components/utilities/utmath.c b/source/components/utilities/utmath.c index 4aa940251d18..a4c3fba36915 100644 --- a/source/components/utilities/utmath.c +++ b/source/components/utilities/utmath.c @@ -260,7 +260,7 @@ AcpiUtShortShiftLeft ( if ((Count & 63) >= 32) { OperandOvl.Part.Hi = OperandOvl.Part.Lo; - OperandOvl.Part.Lo ^= OperandOvl.Part.Lo; + OperandOvl.Part.Lo = 0; Count = (Count & 63) - 32; } ACPI_SHIFT_LEFT_64_BY_32 (OperandOvl.Part.Hi, @@ -305,7 +305,7 @@ AcpiUtShortShiftRight ( if ((Count & 63) >= 32) { OperandOvl.Part.Lo = OperandOvl.Part.Hi; - OperandOvl.Part.Hi ^= OperandOvl.Part.Hi; + OperandOvl.Part.Hi = 0; Count = (Count & 63) - 32; } ACPI_SHIFT_RIGHT_64_BY_32 (OperandOvl.Part.Hi, |