aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/dret.h
blob: bef9ef2e26769c82fd37862cb3023de7e50f1d4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require_privilege(PRV_M);
set_pc_and_serialize(STATE.dpc);
/* The debug spec says we can't crash when prv is set to an invalid value. */
if (p->validate_priv(STATE.dcsr.prv)) {
  p->set_privilege(STATE.dcsr.prv);
}

/* We're not in Debug Mode anymore. */
STATE.dcsr.cause = 0;

if (STATE.dcsr.step)
  STATE.single_step = STATE.STEP_STEPPING;