17#define kSemaphoreOwnerIndex (0U)
18#define kSemaphoreCountIndex (1U)
20#define kSemaphoreCount (2U)
22#define kSemaphoreIncrementOwner(sem) (sem[kSemaphoreOwnerIndex]++)
23#define kSemaphoreDecrementOwner(sem) (sem[kSemaphoreOwnerIndex]--)
66 BOOL* condition =
nullptr) {
77 if (!condition || *condition) {
93 if (!condition || *condition) {
#define err_global_get()
Definition KPC.h:25
#define kSemaphoreOwnerIndex
Definition Semaphore.h:17
#define kSemaphoreCountIndex
Definition Semaphore.h:18
#define kSemaphoreCount
Definition Semaphore.h:20
BOOL Wait() override
Wait for the timer to stop spinning.
Definition HalTimer.cc:82
UPS inline definitions.
Definition Device.h:12
BOOL rtl_sem_wait(SemaphoreArr &sem, UInt64 owner, UInt64 timeout, BOOL *condition=nullptr)
Waits for the semaphore to be available, blocking until it is.
Definition Semaphore.h:65
constexpr KPCError kErrorSuccess
Definition KPC.h:32
UInt64 SemaphoreArr[kSemaphoreCount]
Semaphore structure used for synchronization.
Definition Semaphore.h:27
BOOL rtl_sem_acquire(SemaphoreArr &sem, UInt64 owner)
Initializes the semaphore with an owner and a count of zero.
Definition Semaphore.h:48
BOOL rtl_sem_is_valid(const SemaphoreArr &sem, UInt64 owner=0)
Checks if the semaphore is valid.
Definition Semaphore.h:30
constexpr KPCError kErrorUnavailable
Definition KPC.h:70
constexpr KPCError kErrorInvalidData
Definition KPC.h:56
BOOL rtl_sem_release(SemaphoreArr &sem)
Releases the semaphore, resetting its owner and count.
Definition Semaphore.h:37
constexpr KPCError kErrorTimeout
Definition KPC.h:68
__UINT64_TYPE__ UInt64
Definition Config.h:48