Browse Source

For misaligned fetch, set mepc = addr of branch/jump

pull/18/head
Andrew Waterman 11 years ago
parent
commit
6c965e11dc
  1. 6
      riscv/decode.h

6
riscv/decode.h

@ -153,7 +153,11 @@ private:
#define sext_xlen(x) (((sreg_t)(x) << (64-xlen)) >> (64-xlen))
#define zext_xlen(x) (((reg_t)(x) << (64-xlen)) >> (64-xlen))
#define set_pc(x) (npc = sext_xlen(x))
#define set_pc(x) \
do { if ((x) & 3 /* For now... */) \
throw trap_instruction_address_misaligned(x); \
npc = sext_xlen(x); \
} while(0)
#define validate_csr(which, write) ({ \
unsigned my_priv = get_field(STATE.mstatus, MSTATUS_PRV); \

Loading…
Cancel
Save