Skip to content

Commit 4ed6317

Browse files
authored
Merge pull request #470 from ChinYikMing/wfi
Add dummy WFI implementation (uniprocessor)
2 parents 34c3db0 + 8ac3c95 commit 4ed6317

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/decode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,8 @@ static inline bool op_system(rv_insn_t *ir, const uint32_t insn)
835835
ir->opcode = rv_insn_ebreak;
836836
break;
837837
case 0x105: /* WFI: Wait for Interrupt */
838+
ir->opcode = rv_insn_wfi;
839+
break;
838840
case 0x002: /* URET: return from traps in U-mode */
839841
case 0x202: /* HRET: return from traps in H-mode */
840842
/* illegal instruction */

src/rv32_template.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,9 @@ RVOP(
982982
RVOP(
983983
wfi,
984984
{
985+
PC += 4;
985986
/* FIXME: Implement */
986-
return false;
987+
goto end_op;
987988
},
988989
GEN({
989990
assert; /* FIXME: Implement */

0 commit comments

Comments
 (0)