1 #include <lunaix/process.h>
3 #include <asm/aa64_exception.h>
7 update_thread_context(struct hart_state* state)
13 struct hart_state* parent = current_thread->hstate;
14 hart_push_state(parent, state);
16 current_thread->hstate = state;
17 current_thread->ustack_top = state->execp.sp_el0;
20 state->depth = parent->depth + 1;
25 handle_mm_abort(struct hart_state* state);
28 handle_sync_exception(struct hart_state* hstate)
32 ec = esr_ec(hstate->execp.syndrome);
40 handle_mm_abort(hstate);
44 fail("unhandled exception (synced)");
50 handle_async_exception(struct hart_state* hstate)
56 handle_exception(struct hart_state* hstate)
58 update_thread_context(hstate);
60 if (hart_vector_stamp(hstate) == EXCEPTION_SYNC) {
61 handle_sync_exception(hstate);
63 handle_async_exception(hstate);