Require 4-byte instruction alignment until RVC is reimplemented
authorAndrew Waterman <aswaterman@gmail.com>
Sat, 3 Jan 2015 07:17:44 +0000 (23:17 -0800)
committerAndrew Waterman <aswaterman@gmail.com>
Sat, 3 Jan 2015 07:17:44 +0000 (23:17 -0800)
riscv/mmu.h

index d24ed187bf30e1f868c8a059c133b771c39e9b46..329f29140ec485212c0f5d81c4bb226dec7d26e2 100644 (file)
@@ -89,7 +89,8 @@ public:
     if (likely(entry->tag == addr))
       return entry;
 
-    char* iaddr = (char*)translate(addr, 2, false, true);
+    bool rvc = false; // set this dynamically once RVC is re-implemented
+    char* iaddr = (char*)translate(addr, rvc ? 2 : 4, false, true);
     insn_bits_t insn = *(uint16_t*)iaddr;
 
     if (unlikely(insn_length(insn) == 2)) {