Skip to content

Commit 66bcb7b

Browse files
committed
ref(riscv/sync_exceptions): use vcpu_writepc method
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]>
1 parent bdb870f commit 66bcb7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/arch/riscv/sync_exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,5 @@ void sync_exception_handler(void)
152152
ERROR("unkown synchronous exception (%d)", _scause);
153153
}
154154

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

0 commit comments

Comments
 (0)