diff --git a/src/decode.c b/src/decode.c index 71990cc9..c434b0fa 100644 --- a/src/decode.c +++ b/src/decode.c @@ -835,6 +835,8 @@ static inline bool op_system(rv_insn_t *ir, const uint32_t insn) ir->opcode = rv_insn_ebreak; break; case 0x105: /* WFI: Wait for Interrupt */ + ir->opcode = rv_insn_wfi; + break; case 0x002: /* URET: return from traps in U-mode */ case 0x202: /* HRET: return from traps in H-mode */ /* illegal instruction */ diff --git a/src/rv32_template.c b/src/rv32_template.c index 03a1273c..edd717c2 100644 --- a/src/rv32_template.c +++ b/src/rv32_template.c @@ -982,8 +982,9 @@ RVOP( RVOP( wfi, { + PC += 4; /* FIXME: Implement */ - return false; + goto end_op; }, GEN({ assert; /* FIXME: Implement */