summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-05-25 15:36:11 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-05-25 15:36:11 -0700
commite0d1ea452c2a40ca47ec720e7da8c31daa317307 (patch)
treec800585214488e718e7c27ef8607218225568265
parente0010519c57a2b88d0d03d38c21ba0a68f81f2e2 (diff)
downloadenv-e0d1ea452c2a40ca47ec720e7da8c31daa317307.zip
env-e0d1ea452c2a40ca47ec720e7da8c31daa317307.tar.gz
env-e0d1ea452c2a40ca47ec720e7da8c31daa317307.tar.bz2
Keep tohost/fromhost at deterministic address
-rw-r--r--encoding.h9
-rw-r--r--p/link.ld1
-rw-r--r--p/riscv_test.h4
-rw-r--r--v/riscv_test.h3
4 files changed, 10 insertions, 7 deletions
diff --git a/encoding.h b/encoding.h
index 5405148..bdba5f2 100644
--- a/encoding.h
+++ b/encoding.h
@@ -39,6 +39,9 @@
#define MIP_STIP (1 << IRQ_S_TIMER)
#define MIP_HTIP (1 << IRQ_H_TIMER)
#define MIP_MTIP (1 << IRQ_M_TIMER)
+#define MIP_SEIP (1 << IRQ_S_EXT)
+#define MIP_HEIP (1 << IRQ_H_EXT)
+#define MIP_MEIP (1 << IRQ_M_EXT)
#define SIP_SSIP MIP_SSIP
#define SIP_STIP MIP_STIP
@@ -61,9 +64,9 @@
#define IRQ_S_TIMER 5
#define IRQ_H_TIMER 6
#define IRQ_M_TIMER 7
-#define IRQ_S_DEV 9
-#define IRQ_H_DEV 10
-#define IRQ_M_DEV 11
+#define IRQ_S_EXT 9
+#define IRQ_H_EXT 10
+#define IRQ_M_EXT 11
#define IRQ_COP 12
#define IRQ_HOST 13
diff --git a/p/link.ld b/p/link.ld
index 525fe34..59a9253 100644
--- a/p/link.ld
+++ b/p/link.ld
@@ -4,6 +4,7 @@ SECTIONS
{
. = 0x80000000;
.text.init : { *(.text.init) }
+ .tohost ALIGN(0x1000) : { *(.tohost) }
.text : { *(.text) }
.data ALIGN(0x1000) : { *(.data) }
.bss : { *(.bss) }
diff --git a/p/riscv_test.h b/p/riscv_test.h
index d3e8027..d15b4fe 100644
--- a/p/riscv_test.h
+++ b/p/riscv_test.h
@@ -83,7 +83,7 @@
#define INTERRUPT_HANDLER j other_exception /* No interrupts should occur */
#define RVTEST_CODE_BEGIN \
- .text; \
+ .section .text.init; \
.align 6; \
.weak stvec_handler; \
.weak mtvec_handler; \
@@ -177,8 +177,10 @@ 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; \
+ .popsection; \
.align 4; .global begin_signature; begin_signature:
#define RVTEST_DATA_END .align 4; .global end_signature; end_signature:
diff --git a/v/riscv_test.h b/v/riscv_test.h
index 4e9210a..880544a 100644
--- a/v/riscv_test.h
+++ b/v/riscv_test.h
@@ -34,9 +34,6 @@ userstart: \
// Data Section Macro
//-----------------------------------------------------------------------
-#undef RVTEST_DATA_BEGIN
-#define RVTEST_DATA_BEGIN
-
#undef RVTEST_DATA_END
#define RVTEST_DATA_END