summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliweiwei90 <34847211+liweiwei90@users.noreply.github.com>2021-09-25 10:44:35 +0800
committerGitHub <noreply@github.com>2021-09-24 19:44:35 -0700
commit81e58d0068858978c2415ae115144078434ea31d (patch)
treed31a54eac2e2ec853359b8dfb6dfd811c6b2a2f3
parent0666378f353599d01fc48562b431b1dd049faab5 (diff)
downloadenv-81e58d0068858978c2415ae115144078434ea31d.zip
env-81e58d0068858978c2415ae115144078434ea31d.tar.gz
env-81e58d0068858978c2415ae115144078434ea31d.tar.bz2
update riscv_arch.h to support QEMU (#31)
* update riscv_arch.h to support QEMU: add size attribute for tohost/fromhost add writing zero to (tohost + 4) to write_tohost * revert the align of tohost/fromhost to 64 bytes
-rw-r--r--p/riscv_test.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/p/riscv_test.h b/p/riscv_test.h
index a08f49e..fe14f08 100644
--- a/p/riscv_test.h
+++ b/p/riscv_test.h
@@ -190,6 +190,7 @@ handle_exception: \
1: ori TESTNUM, TESTNUM, 1337; \
write_tohost: \
sw TESTNUM, tohost, t5; \
+ sw zero, tohost + 4, t5; \
j write_tohost; \
reset_vector: \
INIT_XREG; \
@@ -259,8 +260,8 @@ reset_vector: \
#define RVTEST_DATA_BEGIN \
EXTRA_DATA \
.pushsection .tohost,"aw",@progbits; \
- .align 6; .global tohost; tohost: .dword 0; \
- .align 6; .global fromhost; fromhost: .dword 0; \
+ .align 6; .global tohost; tohost: .dword 0; .size tohost, 8; \
+ .align 6; .global fromhost; fromhost: .dword 0; .size fromhost, 8;\
.popsection; \
.align 4; .global begin_signature; begin_signature: