1 #ifndef __LUNAIX_ARCH_HART_H
2 #define __LUNAIX_ARCH_HART_H
5 #include <lunaix/types.h>
24 struct hart_state* parent_state;
34 struct regcontext registers;
38 volatile struct exec_param* execp;
43 hart_vector_stamp(struct hart_state* hstate) {
44 return hstate->execp->vector;
47 static inline unsigned int
48 hart_ecause(struct hart_state* hstate) {
49 return hstate->execp->syndrome;
52 static inline struct hart_state*
53 hart_parent_state(struct hart_state* hstate)
55 return hstate->execp->parent_state;
59 hart_push_state(struct hart_state* p_hstate, struct hart_state* hstate)
61 hstate->execp->parent_state = p_hstate;
65 hart_pc(struct hart_state* hstate)
67 return hstate->execp->elink;
71 hart_sp(struct hart_state* hstate)
73 return hstate->execp->sp;
77 kernel_context(struct hart_state* hstate)
84 hart_stack_frame(struct hart_state* hstate)
86 return hstate->registers.fp;
91 #endif /* __LUNAIX_ARCH_HART_H */