Skip to content

Commit

Permalink
ref(riscv/sync_exceptions): use vcpu_writepc method
Browse files Browse the repository at this point in the history
Refactored the vCPU program counter incrementation by introducing
the architecture-agnostic method vcpu_writepc, aligning the
implementation with the approach used in the ARM architecture.

Signed-off-by: João Peixoto <[email protected]>
  • Loading branch information
joaopeixoto13 committed Sep 19, 2024
1 parent bdb870f commit 66bcb7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arch/riscv/sync_exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@ void sync_exception_handler(void)
ERROR("unkown synchronous exception (%d)", _scause);
}

cpu()->vcpu->regs.sepc += pc_step;
vcpu_writepc(cpu()->vcpu, vcpu_readpc(cpu()->vcpu) + pc_step);
}

0 comments on commit 66bcb7b

Please sign in to comment.