Skip to content

Commit

Permalink
#1 normal_pc + 4 for exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingkai-Li committed Aug 19, 2023
1 parent 02f3de2 commit f4248ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riscv/processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ void processor_t::take_trap(trap_t& t, reg_t epc)
}
}
/*normal_pc & normal_sp*/
state.pc = state.normal_pc;
state.pc = state.normal_pc + 4;
updateRC(state.cap_pc.node_id, -1);
state.cap_pc.reset();
state.XPR.write(2, state.normal_sp);
Expand All @@ -1096,7 +1096,7 @@ void processor_t::take_trap(trap_t& t, reg_t epc)
else {
/*switch_cap is invalid*/
/*pc & sp*/
state.pc = state.normal_pc;
state.pc = state.normal_pc + 4;
updateRC(state.cap_pc.node_id, -1);
state.cap_pc.reset();
state.XPR.write(2, state.normal_sp);
Expand Down

0 comments on commit f4248ef

Please sign in to comment.