ARMv8: using asmoffset for the stack field in coredata
authorReto Achermann <reto.achermann@inf.ethz.ch>
Sat, 4 Mar 2017 11:30:11 +0000 (12:30 +0100)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Sat, 4 Mar 2017 11:30:11 +0000 (12:30 +0100)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

kernel/arch/armv8/boot_entry.S
tools/asmoffsets/asmoffsets.c

index 477d7e8..e8e9c87 100644 (file)
@@ -14,6 +14,7 @@
 #define ASM_FILE 1
 #endif
 #include <multiboot2.h>
+#include <asmoffsets.h>
 
 
 .section .boot, "ax"
@@ -82,7 +83,7 @@ boot_entry:
  */
 
 psci_or_parking_boot:
-    ldr x1, [x0]
+    ldr x1, [x0, #OFFSETOF_COREDATA_KERNEL_STACK]
     mov sp, x1
     b boot_app_init
 
index dd439c2..d75c39e 100644 (file)
 #include <barrelfish_kpi/arm_core_data.h>
 #endif
 
+#ifdef __aarch64__
+#include <barrelfish_kpi/arm_core_data.h>
+#endif
+
 /* wrap everything inside a dummy function, to keep the compiler happy */
 #ifdef __ICC
 int main(void)
@@ -155,6 +159,7 @@ void dummy(void)
     DECL(DISP_DISABLED_AREA, struct dispatcher_shared_aarch64, disabled_save_area);
     DECL(DISP_TRAP_AREA, struct dispatcher_shared_aarch64, trap_save_area);
     DECL(DISP_GENERIC, struct dispatcher_aarch64, generic);
+    DECL(COREDATA_KERNEL_STACK, struct armv8_core_data, kernel_stack)
 #endif // __aarch64__
 
     DECL(LMP_ENDPOINT_DELIVERED, struct lmp_endpoint_kern, delivered);