19 lines
491 B
C
19 lines
491 B
C
#pragma once
|
|
/**
|
|
* sys/arch/spinlock.h AVR Spinlock implementation
|
|
**/
|
|
|
|
#include <sys/cpu.h>
|
|
#include <sys/atomic.h>
|
|
#include <sys/trace.h>
|
|
|
|
#define SPINLOCK_INIT_UNLOCKED 0x00
|
|
#define SPINLOCK(name) spinlock_t name = SPINLOCK_INIT_UNLOCKED
|
|
|
|
typedef uint8_t spinlock_t;
|
|
|
|
void spinlock_lock(spinlock_t *spinlock);
|
|
void spinlock_release(spinlock_t *spinlock);
|
|
void spinlock_lock_irq(spinlock_t *spinlock,cpustate_t *state);
|
|
void spinlock_release_irq(spinlock_t *spinlock,cpustate_t *state);
|