summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael McKeown <mmckeown@princeton.edu>2018-09-06 16:33:12 -0700
committerAndrew Waterman <aswaterman@gmail.com>2018-09-06 16:33:12 -0700
commit8d6a8bac53b6aeedc3e460a4b9cdcb070591f697 (patch)
tree9c26820b72c3df23a775dee3a8ba788989f112f8
parent68cad7baf3ed0a4553fffd14726d24519ee1296a (diff)
downloadenv-8d6a8bac53b6aeedc3e460a4b9cdcb070591f697.zip
env-8d6a8bac53b6aeedc3e460a4b9cdcb070591f697.tar.gz
env-8d6a8bac53b6aeedc3e460a4b9cdcb070591f697.tar.bz2
Enable EXTRA_INIT macro to work in VM environment (#10)
-rw-r--r--v/entry.S1
-rw-r--r--v/riscv_test.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/v/entry.S b/v/entry.S
index 9719662..e3b5a97 100644
--- a/v/entry.S
+++ b/v/entry.S
@@ -32,6 +32,7 @@ handle_reset:
slli t0, t0, 12
add sp, sp, t0
csrw mscratch, sp
+ call extra_boot
la a0, userstart
j vm_boot
diff --git a/v/riscv_test.h b/v/riscv_test.h
index 8ca9ffd..751e037 100644
--- a/v/riscv_test.h
+++ b/v/riscv_test.h
@@ -15,6 +15,10 @@
#undef RVTEST_CODE_BEGIN
#define RVTEST_CODE_BEGIN \
.text; \
+ .global extra_boot; \
+extra_boot: \
+ EXTRA_INIT \
+ ret; \
.global userstart; \
userstart: \
init