Lines Matching +full:lock +full:- +full:status
3 * Module Name: evglock - Global Lock support
11 * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
108 * any of its subsidiaries will export/re-export any technical data, process,
130 * 3. Neither the names of the above-listed copyright holders nor the names
175 * RETURN: Status
177 * DESCRIPTION: Install a handler for the global lock release event
185 ACPI_STATUS Status; in AcpiEvInitGlobalLockHandler() local
191 /* If Hardware Reduced flag is set, there is no global lock */ in AcpiEvInitGlobalLockHandler()
203 /* Attempt installation of the global lock handler */ in AcpiEvInitGlobalLockHandler()
205 Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, in AcpiEvInitGlobalLockHandler()
209 * If the global lock does not exist on this platform, the attempt to in AcpiEvInitGlobalLockHandler()
211 * Map to AE_OK, but mark global lock as not present. Any attempt to in AcpiEvInitGlobalLockHandler()
212 * actually use the global lock will be flagged with an error. in AcpiEvInitGlobalLockHandler()
215 if (Status == AE_NO_HARDWARE_RESPONSE) in AcpiEvInitGlobalLockHandler()
218 "No response from Global Lock hardware, disabling lock")); in AcpiEvInitGlobalLockHandler()
223 Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock); in AcpiEvInitGlobalLockHandler()
224 if (ACPI_FAILURE (Status)) in AcpiEvInitGlobalLockHandler()
226 return_ACPI_STATUS (Status); in AcpiEvInitGlobalLockHandler()
231 return_ACPI_STATUS (Status); in AcpiEvInitGlobalLockHandler()
241 * RETURN: Status
243 * DESCRIPTION: Remove the handler for the Global Lock
251 ACPI_STATUS Status; in AcpiEvRemoveGlobalLockHandler() local
258 Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL, in AcpiEvRemoveGlobalLockHandler()
262 return_ACPI_STATUS (Status); in AcpiEvRemoveGlobalLockHandler()
270 * PARAMETERS: Context - From thread interface, not used
274 * DESCRIPTION: Invoked directly from the SCI handler when a global lock
276 * request for the lock, signal the waiting thread.
284 ACPI_STATUS Status; in AcpiEvGlobalLockHandler() local
291 * If a request for the global lock is not actually pending, in AcpiEvGlobalLockHandler()
292 * we are done. This handles "spurious" global lock interrupts in AcpiEvGlobalLockHandler()
301 * Send a unit to the global lock semaphore. The actual acquisition in AcpiEvGlobalLockHandler()
302 * of the global lock will be performed by the waiting thread. in AcpiEvGlobalLockHandler()
304 Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1); in AcpiEvGlobalLockHandler()
305 if (ACPI_FAILURE (Status)) in AcpiEvGlobalLockHandler()
307 ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore")); in AcpiEvGlobalLockHandler()
324 * PARAMETERS: Timeout - Max time to wait for the lock, in millisec.
326 * RETURN: Status
328 * DESCRIPTION: Attempt to gain ownership of the Global Lock.
333 * Global Lock, and the OS would hold the lock until the last thread had
335 * lock, especially in the case where there is a tight handshake between the
337 * allows only one thread to acquire the HW Global Lock at a time, and makes
338 * the global lock appear as a standard mutex on the OS side.
347 ACPI_STATUS Status; in AcpiEvAcquireGlobalLock() local
358 Status = AcpiExSystemWaitMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex, in AcpiEvAcquireGlobalLock()
360 if (ACPI_FAILURE (Status)) in AcpiEvAcquireGlobalLock()
362 return_ACPI_STATUS (Status); in AcpiEvAcquireGlobalLock()
366 * Update the global lock handle and check for wraparound. The handle is in AcpiEvAcquireGlobalLock()
367 * only used for the external global lock interfaces, but it is updated in AcpiEvAcquireGlobalLock()
369 * lock via both the AML and the AcpiAcquireGlobalLock interfaces. The in AcpiEvAcquireGlobalLock()
380 * Make sure that a global lock actually exists. If not, just in AcpiEvAcquireGlobalLock()
381 * treat the lock as a standard mutex. in AcpiEvAcquireGlobalLock()
393 /* Attempt to acquire the actual hardware lock */ in AcpiEvAcquireGlobalLock()
400 "Acquired hardware Global Lock\n")); in AcpiEvAcquireGlobalLock()
405 * Did not get the lock. The pending bit was set above, and in AcpiEvAcquireGlobalLock()
406 * we must now wait until we receive the global lock in AcpiEvAcquireGlobalLock()
413 "Waiting for hardware Global Lock\n")); in AcpiEvAcquireGlobalLock()
416 * Wait for handshake with the global lock interrupt handler. in AcpiEvAcquireGlobalLock()
419 Status = AcpiExSystemWaitSemaphore ( in AcpiEvAcquireGlobalLock()
424 } while (ACPI_SUCCESS (Status)); in AcpiEvAcquireGlobalLock()
429 return_ACPI_STATUS (Status); in AcpiEvAcquireGlobalLock()
439 * RETURN: Status
441 * DESCRIPTION: Releases ownership of the Global Lock.
450 ACPI_STATUS Status = AE_OK; in AcpiEvReleaseGlobalLock() local
456 /* Lock must be already acquired */ in AcpiEvReleaseGlobalLock()
461 "Cannot release the ACPI Global Lock, it has not been acquired")); in AcpiEvReleaseGlobalLock()
467 /* Allow any thread to release the lock */ in AcpiEvReleaseGlobalLock()
477 Status = AcpiWriteBitRegister ( in AcpiEvReleaseGlobalLock()
481 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n")); in AcpiEvReleaseGlobalLock()
488 AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex); in AcpiEvReleaseGlobalLock()
489 return_ACPI_STATUS (Status); in AcpiEvReleaseGlobalLock()