Unify spinlocks
This commit is contained in:
parent
c1a2c75054
commit
85ffed0c20
7 changed files with 56 additions and 59 deletions
|
|
@ -48,4 +48,13 @@ void push_off(void);
|
|||
/** @copydoc pop_off */
|
||||
void pop_off(void);
|
||||
|
||||
typedef struct {
|
||||
volatile uint32_t v; // 0 = unlocked, 1 = locked
|
||||
} spinlock_t;
|
||||
|
||||
void spinlock_init(spinlock_t *l);
|
||||
bool spin_trylock(spinlock_t *l);
|
||||
void spin_unlock(spinlock_t *l);
|
||||
void spin_lock(spinlock_t *l);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue