diff options
Diffstat (limited to 'sys/contrib/dev/acpica/exsystem.c')
-rw-r--r-- | sys/contrib/dev/acpica/exsystem.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/sys/contrib/dev/acpica/exsystem.c b/sys/contrib/dev/acpica/exsystem.c index ae38ec8..ba4ef4e 100644 --- a/sys/contrib/dev/acpica/exsystem.c +++ b/sys/contrib/dev/acpica/exsystem.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Module Name: exsystem - Interface to OS services - * $Revision: 76 $ + * $Revision: 79 $ * *****************************************************************************/ @@ -188,11 +188,16 @@ AcpiExSystemWaitSemaphore ( * * FUNCTION: AcpiExSystemDoStall * - * PARAMETERS: HowLong - The amount of time to stall + * PARAMETERS: HowLong - The amount of time to stall, + * in microseconds * * RETURN: Status * * DESCRIPTION: Suspend running thread for specified amount of time. + * Note: ACPI specification requires that Stall() does not + * relinquish the processor, and delays longer than 100 usec + * should use Sleep() instead. We allow stalls up to 255 usec + * for compatibility with other interpreters and existing BIOSs. * ******************************************************************************/ @@ -206,19 +211,17 @@ AcpiExSystemDoStall ( ACPI_FUNCTION_ENTRY (); - if (HowLong > 1000) /* 1 millisecond */ + if (HowLong > 255) /* 255 microseconds */ { - /* Since this thread will sleep, we must release the interpreter */ - - AcpiExExitInterpreter (); - - AcpiOsSleep (0, (HowLong / 1000) + 1); - - /* And now we must get the interpreter again */ - - Status = AcpiExEnterInterpreter (); + /* + * Longer than 255 usec, this is an error + * + * (ACPI specifies 100 usec as max, but this gives some slack in + * order to support existing BIOSs) + */ + ACPI_REPORT_ERROR (("Stall: Time parameter is too large (%d)\n", HowLong)); + Status = AE_AML_OPERAND_VALUE; } - else { AcpiOsStall (HowLong); @@ -232,7 +235,8 @@ AcpiExSystemDoStall ( * * FUNCTION: AcpiExSystemDoSuspend * - * PARAMETERS: HowLong - The amount of time to suspend + * PARAMETERS: HowLong - The amount of time to suspend, + * in milliseconds * * RETURN: None * |