17 lines
333 B
C
17 lines
333 B
C
#ifndef _SPINLOCK_H_
|
|
#define _SPINLOCK_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
struct spinlock {
|
|
uint8_t locked;
|
|
uint8_t priority_locked;
|
|
uint8_t priority_unlocked;
|
|
};
|
|
|
|
void spinlock_lock(struct spinlock *lock);
|
|
void spinlock_unlock(struct spinlock *lock);
|
|
void spinlock_init(struct spinlock *lock, uint8_t priority);
|
|
|
|
#endif /* _SPINLOCK_H_ */
|