summaryrefslogtreecommitdiff
path: root/v/riscv_test.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-05-19 02:27:00 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-05-19 02:27:00 -0700
commitdac4ddd40078f31f4c2e766368c237eba84ef68c (patch)
tree49951629b42a1765dde2af0fa3bd3475eeaa38ad /v/riscv_test.h
parentbb05f5bc5c509e763108f954e23233ba946542ea (diff)
downloadenv-dac4ddd40078f31f4c2e766368c237eba84ef68c.zip
env-dac4ddd40078f31f4c2e766368c237eba84ef68c.tar.gz
env-dac4ddd40078f31f4c2e766368c237eba84ef68c.tar.bz2
Improve coverage of VM tests
The supervisor code now runs in supervisor mode with negative virtual addresses. This further stresses VM and tests some RV64 corner cases.
Diffstat (limited to 'v/riscv_test.h')
-rw-r--r--v/riscv_test.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/v/riscv_test.h b/v/riscv_test.h
index c690a32..1b38b5a 100644
--- a/v/riscv_test.h
+++ b/v/riscv_test.h
@@ -79,7 +79,7 @@ userstart: \
#define LFSR_NEXT(x) (((((x)^((x)>>1)) & 1) << 5) | ((x) >> 1))
#define PGSHIFT 12
-#define PGSIZE (1 << PGSHIFT)
+#define PGSIZE (1UL << PGSHIFT)
#define SIZEOF_TRAPFRAME_T 20776
#define SIZEOF_TRAPFRAME_T_SCALAR 296
@@ -139,7 +139,8 @@ typedef unsigned long pte_t;
#define PTIDXBITS (PGSHIFT - (sizeof(pte_t) == 8 ? 3 : 2))
#define VPN_BITS (PTIDXBITS * LEVELS)
#define VA_BITS (VPN_BITS + PGSHIFT)
-#define PTES_PER_PT (PGSIZE/sizeof(pte_t))
+#define PTES_PER_PT (1UL << RISCV_PGLEVEL_BITS)
+#define MEGAPAGE_SIZE (PTES_PER_PT * PGSIZE)
typedef struct
{