fix compilation issues in aarch64 ports
[lunaix-os.git] / lunaix-os / arch / aarch64 / exception / context.S
index fd8584991b6ce274f50e8c2832ef1098c06b5bf6..e30f72d8e574453c926d964f01f3bef0ee327ace 100644 (file)
@@ -1,6 +1,6 @@
 #define __ASM__
 #include <asm/aa64_msrs.h>
 #define __ASM__
 #include <asm/aa64_msrs.h>
-#include "hart_field.inc"
+#include "hart_fields.inc"
 
 .section .text
     
 
 .section .text
     
@@ -8,12 +8,12 @@
     .globl _aa64_switch_task
 
     _aa64_evec_prehandle:
     .globl _aa64_switch_task
 
     _aa64_evec_prehandle:
-        # reservation for struct exec_param
-        sub   sp,  sp,  #8         # push  sp_el1
-        sub   sp,  sp,  #16        # push {sp_el0, link}
-        sub   sp,  sp,  #16        # push {spsr,   parent_hart}
+        // reservation for struct exec_param
+        sub   sp,  sp,  #8         // push  xzr
+        sub   sp,  sp,  #16        // push {sp_el0, link}
+        sub   sp,  sp,  #16        // push {spsr,   parent_hart}
 
 
-        stp   lr,  fp, [sp, #-16]!  # push {x31-x1}
+        stp   lr,  fp, [sp, #-16]! //push {x31-x1}
         stp  x28, x27, [sp, #-16]!
         stp  x26, x25, [sp, #-16]!
         stp  x24, x23, [sp, #-16]!
         stp  x28, x27, [sp, #-16]!
         stp  x26, x25, [sp, #-16]!
         stp  x24, x23, [sp, #-16]!
@@ -28,7 +28,7 @@
         stp   x6,  x5, [sp, #-16]!
         stp   x4,  x3, [sp, #-16]!
         stp   x2,  x1, [sp, #-16]!
         stp   x6,  x5, [sp, #-16]!
         stp   x4,  x3, [sp, #-16]!
         stp   x2,  x1, [sp, #-16]!
-        stp   x0, xzr, [sp, #-16]!  # push {x0, xzr}
+        stp   x0, xzr, [sp, #-16]!  // push {x0, xzr}
 
         add   x1, sp,  #hart_execp
 
 
         add   x1, sp,  #hart_execp
 
         mrs   x0, SPSR_EL1
         str   x0, [x1, #execp_spsr]
         
         mrs   x0, SPSR_EL1
         str   x0, [x1, #execp_spsr]
         
-        sub   x0, sp,  #hart_end
-        str   x0, [x1, #execp_spel1_saved]
-        
         mov   x0, sp
         bl    handle_exception
         
     do_eret:
         mov   x0, sp
         bl    handle_exception
         
     do_eret:
-        mov   sp,   x0
+        add   sp, x0,   xzr
 
         add   x1,   x0, #hart_execp
 
 
         add   x1,   x0, #hart_execp
 
         ldp  x27, x28, [sp, #16]!
         ldp   fp,  lr, [sp, #16]!
         
         ldp  x27, x28, [sp, #16]!
         ldp   fp,  lr, [sp, #16]!
         
-        # sp now point to the start of exec_param
+        // sp now point to the start of exec_param
 
 
-        ldr   sp,  [sp, #execp_spel1_saved]
+        sub   sp,  sp, #execp_end
 
         eret
 
     _aa64_switch_task:
 
         eret
 
     _aa64_switch_task:
-        # TODO
+        // TODO
         b     do_eret
\ No newline at end of file
         b     do_eret
\ No newline at end of file