X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/6942ebae59c3904674dce6b67cd07c43a3bbe00d..bb5ae5c85c0812c52e8d53187f2c6b0ee9525c8c:/lunaix-os/arch/aarch64/exception/context.S diff --git a/lunaix-os/arch/aarch64/exception/context.S b/lunaix-os/arch/aarch64/exception/context.S index e30f72d..23e875b 100644 --- a/lunaix-os/arch/aarch64/exception/context.S +++ b/lunaix-os/arch/aarch64/exception/context.S @@ -1,7 +1,13 @@ #define __ASM__ #include +#include #include "hart_fields.inc" +.section .data + .align 4 + .skip 256 + _aa64_csw_temp_stack: + .section .text .globl _aa64_evec_prehandle @@ -85,4 +91,22 @@ _aa64_switch_task: // TODO - b do_eret \ No newline at end of file + adr sp, _aa64_csw_temp_stack + + bl aa64_switch_ttbr + + bl switch_signposting + cbnz x0, _aa64_handle_signal + + b do_eret + + _aa64_handle_signal: + mov x1, #SPSR_EL0_preset + msr SPSR_EL1, x1 + + ldr x1, [x0, #sigact] + msr ELR_E1, x1 + + msr SP_EL0, x0 + + eret \ No newline at end of file