ACPI_STATUS AcpiUtMutexInitialize ( void) { UINT32 i; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (UtMutexInitialize); /* Create each of the predefined mutex objects */ for (i = 0; i < ACPI_NUM_MUTEX; i++) { Status = AcpiUtCreateMutex (i); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* Create the spinlocks for use at interrupt level or for speed */ Status = AcpiOsCreateLock (&AcpiGbl_GpeLock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiOsCreateLock (&AcpiGbl_HardwareLock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } Status = AcpiOsCreateLock (&AcpiGbl_ReferenceCountLock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Mutex for _OSI support */ Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Create the reader/writer lock for namespace access */ Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } return_ACPI_STATUS (Status); }
ACPI_STATUS AcpiOsInitialize ( void) { ACPI_STATUS Status; LARGE_INTEGER LocalTimerFrequency; #ifndef ACPI_SINGLE_THREADED /* Clear the semaphore info array */ memset (AcpiGbl_Semaphores, 0x00, sizeof (AcpiGbl_Semaphores)); #endif AcpiGbl_OutputFile = stdout; /* Get the timer frequency for use in AcpiOsGetTimer */ TimerFrequency = 0; if (QueryPerformanceFrequency (&LocalTimerFrequency)) { /* Frequency is in ticks per second */ TimerFrequency = LocalTimerFrequency.QuadPart; } Status = AcpiOsCreateLock (&AcpiGbl_PrintLock); if (ACPI_FAILURE (Status)) { return (Status); } return (AE_OK); }
ACPI_STATUS AcpiEvInitGlobalLockHandler ( void) { ACPI_STATUS Status; ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler); /* If Hardware Reduced flag is set, there is no global lock */ if (AcpiGbl_ReducedHardware) { return_ACPI_STATUS (AE_OK); } /* Attempt installation of the global lock handler */ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, AcpiEvGlobalLockHandler, NULL); /* * If the global lock does not exist on this platform, the attempt to * enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick). * Map to AE_OK, but mark global lock as not present. Any attempt to * actually use the global lock will be flagged with an error. */ AcpiGbl_GlobalLockPresent = FALSE; if (Status == AE_NO_HARDWARE_RESPONSE) { ACPI_ERROR ((AE_INFO, "No response from Global Lock hardware, disabling lock")); return_ACPI_STATUS (AE_OK); } Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } AcpiGbl_GlobalLockPending = FALSE; AcpiGbl_GlobalLockPresent = TRUE; return_ACPI_STATUS (Status); }
ACPI_STATUS AcpiOsInitialize ( void) { #if 0 ACPI_STATUS Status; AcpiGbl_OutputFile = stdout; Status = AcpiOsCreateLock (&AcpiGbl_PrintLock); if (ACPI_FAILURE (Status)) { return (Status); } #endif return (AE_OK); }
ACPI_STATUS AcpiOsInitialize ( void) { ACPI_STATUS Status; AcpiGbl_OutputFile = stdout; OsEnterLineEditMode (); Status = AcpiOsCreateLock (&AcpiGbl_PrintLock); if (ACPI_FAILURE (Status)) { return (Status); } return (AE_OK); }