summaryrefslogtreecommitdiff
path: root/v/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'v/entry.S')
-rw-r--r--v/entry.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/v/entry.S b/v/entry.S
index 460428a..e4f1ca4 100644
--- a/v/entry.S
+++ b/v/entry.S
@@ -10,7 +10,7 @@
# define REGBYTES 4
#endif
-#define STACK_TOP (_end + 131072)
+#define STACK_TOP (_end + 4096)
.section ".text.init","ax",@progbits
@@ -28,6 +28,9 @@ handle_reset:
la t0, trap_vector
csrw mtvec, t0
la sp, STACK_TOP - SIZEOF_TRAPFRAME_T
+ csrr t0, mhartid
+ slli t0, t0, 12
+ add sp, sp, t0
csrw mscratch, sp
li a1, 1337
la a0, userstart