aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / kernel / tests / spinlock_tu.c
| 1 | /* spinlock_tu.c -- one freestanding translation unit around core/spinlock.h, compiled by "make spinlock-asm-check" |
| 2 | * for aarch64 and x86-64 so tools/ck_spinlock_asm_check.sh can check the instruction order. Not linked anywhere. */ |
| 3 | #include "spinlock.h" |
| 4 | |
| 5 | struct ck_spinlock ck_spin_asm_lock; |
| 6 | unsigned ck_spin_asm_count; |
| 7 | |
| 8 | void ck_spin_asm_locked(void); |
| 9 | void ck_spin_asm_locked(void) |
| 10 | { |
| 11 | ck_irqflags_t f = ck_spin_lock_irqsave(&ck_spin_asm_lock); |
| 12 | ck_spin_asm_count++; |
| 13 | ck_spin_unlock_irqrestore(&ck_spin_asm_lock, f); |
| 14 | } |