X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/4bc10176c9f47063d8eddf8703832304b8151f5d..6be108db01439d3463342689446e457a315d6705:/lunaix-os/arch/aarch64/exception/handler.c diff --git a/lunaix-os/arch/aarch64/exception/handler.c b/lunaix-os/arch/aarch64/exception/handler.c new file mode 100644 index 0000000..ab2b806 --- /dev/null +++ b/lunaix-os/arch/aarch64/exception/handler.c @@ -0,0 +1,27 @@ +#include +#include + +static inline void +update_thread_context(struct hart_state* state) +{ + if (!current_thread) { + return; + } + + struct hart_state* parent = current_thread->hstate; + hart_push_state(parent, state); + current_thread->hstate = state; + + if (parent) { + state->depth = parent->depth + 1; + } +} + + +struct hart_state* +handle_exception(struct hart_state* hstate) +{ + update_thread_context(hstate); + + return hstate; +} \ No newline at end of file