aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/wfi.h
blob: 299cb01f5c9a602fef625aa88ed349fa3897c8d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
if (STATE.v && STATE.prv == PRV_U) {
  require_novirt();
} else if (get_field(STATE.mstatus->read(), MSTATUS_TW)) {
  require_privilege(PRV_M);
} else if (STATE.v) { // VS-mode
  if (get_field(STATE.hstatus->read(), HSTATUS_VTW))
    require_novirt();
} else {
  require_privilege(PRV_S);
}
wfi();