0.3.1
|
Typedefs | |
typedef uint8_t | cpu_sync_lock_t |
An 8-bit integer value representing the lock index in the BIOS lock array. | |
Functions | |
static bool | cpu_sync_mutex (cpu_sync_lock_t b) |
Provide functionality of mutual exclusion. | |
static void | cpu_sync_mutex_clear (cpu_sync_lock_t b) |
Clear the lock. | |
static void | cpu_sync_spinlock (cpu_sync_lock_t b) |
Provide functionality of a spinlock. | |
static void | cpu_sync_spinlock_clear (cpu_sync_lock_t b) |
Clear the lock. | |
Description goes here.
typedef uint8_t cpu_sync_lock_t |
An 8-bit integer value representing the lock index in the BIOS lock array.
All functions, otherwise noted make use of an exclusive area in the first 0x4000
bytes of HWRAM for all the lock variables. The size of the "lock array" is 256 bytes, and each lock variable is 1-byte.
For the lock array, the user is responsible for keeping track of usage. There is no way to determine which locks are being used.
|
inlinestatic |
Provide functionality of mutual exclusion.
Implementation of the mutex is using test-and-set CPU instruction tas.b
.
b | The lock index in the lock array. |
true
if locking was previously unlocked, otherwise false
.
|
inlinestatic |
Clear the lock.
b
is not atomic.b | The lock index in the lock array. |
|
inlinestatic |
Provide functionality of a spinlock.
Busy wait in a loop while repeatedly checking if the b
is available.
b | The lock index in the lock array. |
|
inlinestatic |
Clear the lock.
b
is not atomic.b | The lock index in the lock array. |