Ejemplo n.º 1
0
ACPI_STATUS
AcpiExSystemDoSleep (
    UINT64                  HowLong)
{
    ACPI_FUNCTION_ENTRY ();


    /* Since this thread will sleep, we must release the interpreter */

    AcpiExRelinquishInterpreter ();

    /*
     * For compatibility with other ACPI implementations and to prevent
     * accidental deep sleeps, limit the sleep time to something reasonable.
     */
    if (HowLong > ACPI_MAX_SLEEP)
    {
        HowLong = ACPI_MAX_SLEEP;
    }

    AcpiOsSleep (HowLong);

    /* And now we must get the interpreter again */

    AcpiExReacquireInterpreter ();
    return (AE_OK);
}
Ejemplo n.º 2
0
ACPI_STATUS
AcpiExSystemDoSuspend (
    ACPI_INTEGER            HowLong)
{
    ACPI_FUNCTION_ENTRY ();


    /* Since this thread will sleep, we must release the interpreter */

    AcpiExRelinquishInterpreter ();

    AcpiOsSleep (HowLong);

    /* And now we must get the interpreter again */

    AcpiExReacquireInterpreter ();
    return (AE_OK);
}
Ejemplo n.º 3
0
ACPI_STATUS
AcpiExSystemWaitSemaphore (
    ACPI_SEMAPHORE          Semaphore,
    UINT16                  Timeout)
{
    ACPI_STATUS             Status;


    ACPI_FUNCTION_TRACE (ExSystemWaitSemaphore);


    Status = AcpiOsWaitSemaphore (Semaphore, 1, ACPI_DO_NOT_WAIT);
    if (ACPI_SUCCESS (Status))
    {
        return_ACPI_STATUS (Status);
    }

    if (Status == AE_TIME)
    {
        /* We must wait, so unlock the interpreter */

        AcpiExRelinquishInterpreter ();

        Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);

        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
            "*** Thread awake after blocking, %s\n",
            AcpiFormatException (Status)));

        /* Reacquire the interpreter */

       AcpiExReacquireInterpreter ();
    }

    return_ACPI_STATUS (Status);
}