diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2017-09-29 17:08:30 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2017-09-29 17:08:30 +0000 |
commit | 2c673001fb88105f2d160032c4d4b76cb518e37f (patch) | |
tree | 3fc3b6aef8822267bd455907a6fce55c3f98b2ed /source/components/dispatcher | |
parent | 0810e26699e1b40b9384eca2137be6155de0a5ba (diff) |
Notes
Diffstat (limited to 'source/components/dispatcher')
-rw-r--r-- | source/components/dispatcher/dscontrol.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/components/dispatcher/dscontrol.c b/source/components/dispatcher/dscontrol.c index 897200a5efae9..7a06a1e6705a9 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; } |