add basic exception model and context switching for aarch64
[lunaix-os.git] / lunaix-os / arch / aarch64 / includes / asm / aa64_spsr.h
1 #ifndef __LUNAIX_AA64_SPSR_H
2 #define __LUNAIX_AA64_SPSR_H
3
4 #include <lunaix/types.h>
5 #include <lunaix/bits.h>
6
7 #define SPSR_EL          BITS(3, 2)
8 #define SPSR_SP          BIT(0)
9
10 static inline bool
11 spsr_from_el0(reg_t spsr)
12 {
13     return BITS_GET(spsr, SPSR_EL) == 0;
14 }
15
16 #endif /* __LUNAIX_AA64_SPSR_H */