diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2017-09-29 23:02:49 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2017-09-29 23:02:49 +0000 |
commit | c39c15e23f7155ec7ad56f993e9e454f513fa561 (patch) | |
tree | dc85d94fea926a660b87e0ed430fcd96489db2e8 /sys/contrib/dev/acpica/components/dispatcher/dscontrol.c | |
parent | e8b437ef9acd737bfd18dc34562cce4e195e71b8 (diff) | |
parent | 2c673001fb88105f2d160032c4d4b76cb518e37f (diff) |
Merge ACPICA 20170929.
Notes
Notes:
svn path=/head/; revision=324109
Diffstat (limited to 'sys/contrib/dev/acpica/components/dispatcher/dscontrol.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/dispatcher/dscontrol.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c b/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c index b23a27389538..b719a67dd95d 100644 --- a/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c +++ b/sys/contrib/dev/acpica/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; } |