Keep tohost/fromhost at deterministic address
[riscv-tests.git] / benchmarks / common / crt.S
index 919461b8c35b178cc5e20d5a5553379af044582c..7c8fc19c7df581c5e59f279437f30235653e6caf 100644 (file)
   .text
   .globl _start
 _start:
-  j handle_reset
+  la t0, trap_entry
+  csrw mtvec, t0
 
-nmi_vector:
-  j nmi_vector
-
-trap_vector:
-  j trap_entry
-
-handle_reset:
   li  x1, 0
   li  x2, 0
   li  x3, 0
@@ -216,7 +210,7 @@ trap_entry:
   LREG x31, 31*REGBYTES(sp)
 
   addi sp, sp, 272
-  eret
+  mret
 
 .section ".tdata.begin"
 .globl _tdata_begin
@@ -229,3 +223,11 @@ _tdata_end:
 .section ".tbss.end"
 .globl _tbss_end
 _tbss_end:
+
+.section ".tohost","aw",@progbits
+.align 6
+.globl tohost
+tohost: .dword 0
+.align 6
+.globl fromhost
+fromhost: .dword 0