git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
aa64: finalise context switch, page fault handler and syscall
[lunaix-os.git]
/
lunaix-os
/
arch
/
aarch64
/
includes
/
asm
/
hart.h
diff --git
a/lunaix-os/arch/aarch64/includes/asm/hart.h
b/lunaix-os/arch/aarch64/includes/asm/hart.h
index fa1f4bfd165f7b30322d84bc398c9b98e27ff13c..52571e67a07664f5aee5379a8834c51e7655ed39 100644
(file)
--- a/
lunaix-os/arch/aarch64/includes/asm/hart.h
+++ b/
lunaix-os/arch/aarch64/includes/asm/hart.h
@@
-43,12
+43,14
@@
struct hart_state
} compact align(16);
static inline int
} compact align(16);
static inline int
-hart_vector_stamp(struct hart_state* hstate) {
+hart_vector_stamp(struct hart_state* hstate)
+{
return BITS_GET(hstate->execp.syndrome, SYNDROME_ETYPE);
}
static inline unsigned int
return BITS_GET(hstate->execp.syndrome, SYNDROME_ETYPE);
}
static inline unsigned int
-hart_ecause(struct hart_state* hstate) {
+hart_ecause(struct hart_state* hstate)
+{
return hstate->execp.syndrome;
}
return hstate->execp.syndrome;
}
@@
-79,8
+81,10
@@
hart_sp(struct hart_state* hstate)
static inline bool
kernel_context(struct hart_state* hstate)
{
static inline bool
kernel_context(struct hart_state* hstate)
{
- // TODO
- return false;
+ reg_t spsr;
+
+ spsr = hstate->execp.spsr;
+ return !spsr_from_el0(spsr);
}
static inline ptr_t
}
static inline ptr_t