diff options
author | Andrew Waterman <andrew@sifive.com> | 2019-08-15 14:48:00 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2019-08-15 14:48:00 -0700 |
commit | 6d33722fe1c2f07c2c43feef04c17ad856d9b277 (patch) | |
tree | 97ff0769c86a0a6476cc16b355ccb7f674d9b33f | |
parent | d3e85ae435d1cdb782155530e9de83d6f14b6ae0 (diff) | |
download | env-6d33722fe1c2f07c2c43feef04c17ad856d9b277.zip env-6d33722fe1c2f07c2c43feef04c17ad856d9b277.tar.gz env-6d33722fe1c2f07c2c43feef04c17ad856d9b277.tar.bz2 |
Don't truncate the LFSR to 32 bits
This caused it to collapse to 0, preventing coherence_torture from doing
anything interesting at all...
-rw-r--r-- | v/vm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -210,7 +210,7 @@ void handle_trap(trapframe_t* tf) static void coherence_torture() { // cause coherence misses without affecting program semantics - unsigned int random = ENTROPY; + uint64_t random = ENTROPY; while (1) { uintptr_t paddr = DRAM_BASE + ((random % (2 * (MAX_TEST_PAGES + 1) * PGSIZE)) & -4); #ifdef __riscv_atomic @@ -225,7 +225,7 @@ static void coherence_torture() void vm_boot(uintptr_t test_addr) { - unsigned int random = ENTROPY; + uint64_t random = ENTROPY; if (read_csr(mhartid) > 0) coherence_torture(); |