smol-gilbraltar/include/synchronize.h

15 lines
436 B
C
Raw Permalink Normal View History

2024-12-23 00:46:17 +00:00
#ifndef __GILBRALTAR_SYNCHRONIZE__
#define __GILBRALTAR_SYNCHRONIZE__
#define enable_fiqs() __asm__ __volatile("msr DAIFClr, #1")
#define disable_fiqs() __asm__ __volatile("msr DAIFSet, #1")
#define enable_irqs() __asm__ __volatile("msr DAIFClr, #2")
#define disable_irqs() __asm__ __volatile("msr DAIFSet, #2")
enum level { TASK, IRQ, FIQ };
void gilbraltar_enter_critical(enum level);
void gilbraltar_leave_critical(void);
#endif