2008-02-23 00:25:31 +01:00
|
|
|
#ifndef _SPINLOCK_H_
|
|
|
|
#define _SPINLOCK_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
struct spinlock {
|
|
|
|
uint8_t locked;
|
|
|
|
uint8_t priority_unlocked;
|
|
|
|
};
|
|
|
|
|
2008-02-24 20:07:46 +01:00
|
|
|
void isr_spinlock_lock(struct spinlock *lock);
|
2008-02-23 00:25:31 +01:00
|
|
|
void spinlock_lock(struct spinlock *lock);
|
2008-02-24 20:07:46 +01:00
|
|
|
|
|
|
|
void isr_spinlock_unlock(struct spinlock *lock);
|
2008-02-23 00:25:31 +01:00
|
|
|
void spinlock_unlock(struct spinlock *lock);
|
2008-02-24 20:07:46 +01:00
|
|
|
|
|
|
|
void spinlock_init(struct spinlock *lock);
|
2008-02-23 00:25:31 +01:00
|
|
|
|
|
|
|
#endif /* _SPINLOCK_H_ */
|