24 lines
528 B
C
24 lines
528 B
C
#pragma once
|
|
#include <types.h>
|
|
|
|
static inline void CPUYield() {
|
|
__asm__ volatile ("yield" ::: "memory");
|
|
}
|
|
|
|
static inline void CPUWaitForInterrupt() {
|
|
__asm__ volatile ("wfi" ::: "memory");
|
|
}
|
|
|
|
static inline void CPUDisableInterrupts() {
|
|
__asm__ volatile ("msr daifset, #3" ::: "memory");
|
|
}
|
|
|
|
static inline void CPUEnableInterrupts() {
|
|
__asm__ volatile ("msr daifclr, #3" ::: "memory");
|
|
}
|
|
|
|
static inline UInt64 CPUGetFAR() {
|
|
UInt64 far;
|
|
__asm__ volatile ("mrs %0, far_el1" : "=r" (far));
|
|
return far;
|
|
} |