1 #ifndef __LUNAIX_ARCH_HART_H
2 #define __LUNAIX_ARCH_HART_H
5 #include <lunaix/types.h>
6 #include <lunaix/bits.h>
7 #include <asm/aa64_spsr.h>
9 #define SYNDROME_ETYPE BITFIELD(63, 56)
27 struct hart_state* parent_state;
41 struct regcontext registers;
42 struct exec_param execp;
46 hart_vector_stamp(struct hart_state* hstate)
48 return BITS_GET(hstate->execp.syndrome, SYNDROME_ETYPE);
51 static inline unsigned int
52 hart_ecause(struct hart_state* hstate)
54 return hstate->execp.syndrome;
57 static inline struct hart_state*
58 hart_parent_state(struct hart_state* hstate)
60 return hstate->execp.parent_state;
64 hart_push_state(struct hart_state* p_hstate, struct hart_state* hstate)
66 hstate->execp.parent_state = p_hstate;
70 hart_pc(struct hart_state* hstate)
72 return hstate->execp.link;
76 hart_sp(struct hart_state* hstate)
78 return __ptr(&hstate[-1]);
82 kernel_context(struct hart_state* hstate)
86 spsr = hstate->execp.spsr;
87 return !spsr_from_el0(spsr);
91 hart_stack_frame(struct hart_state* hstate)
93 return hstate->registers.fp;
98 #endif /* __LUNAIX_ARCH_HART_H */