MRET jump support

This commit is contained in:
vhaudiquet 2023-10-11 19:25:06 +02:00
parent c421595a95
commit 31941c0813

View File

@ -522,7 +522,9 @@ static void cpu_execute(rv32_cpu_t* cpu, instruction_t* instruction)
fprintf(stderr, "SRET: We don't support that.\n");
break;
case IMM_MRET:
fprintf(stderr, "MRET: We don't support that.\n");
// Act like a normal ret/jalr, with destination address being CSR_MEPC content
fprintf(stderr, "Warning: MRET: We don't support privilege mode change\n");
cpu->pc = cpu->csr[CSR_MEPC] - 4;
break;
default:
switch(instruction->func7)