aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/core_bringup.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/kernel/core_bringup.S')
-rw-r--r--arch/riscv64/kernel/core_bringup.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/core_bringup.S b/arch/riscv64/kernel/core_bringup.S
index 8a5a6f5..db68dce 100644
--- a/arch/riscv64/kernel/core_bringup.S
+++ b/arch/riscv64/kernel/core_bringup.S
@@ -1,3 +1,4 @@
+#include "../kernel/csr.h"
#include "asm.h"
/* pic forces core_bringup to be placed in .got that we can access both from
@@ -11,6 +12,9 @@ riscv_bringup:
csrw satp, a1
sfence.vma
+ /* set scratch to zero in case we crash */
+ csrw CSR_SSCRATCH, x0
+
/* fetch the stack allocated to us at our hart index in smp_init_stacks */
lui t0, %hi(smp_init_stacks)
addi t0, t0, %lo(smp_init_stacks)