X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/43487eff262637a59a4c2c0272d7c4a824af3944..bb5ae5c85c0812c52e8d53187f2c6b0ee9525c8c:/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 index 0c861bb..a6e601b 100644 --- a/lunaix-os/arch/aarch64/exception/handler.c +++ b/lunaix-os/arch/aarch64/exception/handler.c @@ -2,6 +2,11 @@ #include #include +extern void +handle_mm_abort(struct hart_state* state); + +extern void +aa64_syscall(struct hart_state* hstate); static inline void update_thread_context(struct hart_state* state) @@ -21,10 +26,7 @@ update_thread_context(struct hart_state* state) } } -extern void -handle_mm_abort(struct hart_state* state); - -static void +static inline void handle_sync_exception(struct hart_state* hstate) { unsigned int ec; @@ -40,16 +42,27 @@ handle_sync_exception(struct hart_state* hstate) handle_mm_abort(hstate); break; + case EC_SVC: + aa64_syscall(hstate); + break; + default: fail("unhandled exception (synced)"); break; } } -static void +static inline void handle_async_exception(struct hart_state* hstate) { + int err = 0; + + err = gic_handle_irq(hstate); + if (!err) { + return; + } + // TODO do we have other cases of async exception? } struct hart_state*