Browse Source
Merge pull request #1055 from ctopal/umode_wfi
WFI condition fix
pull/1059/head
Andrew Waterman
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
riscv/insns/wfi.h
|
|
|
@ -5,7 +5,9 @@ if (STATE.v && STATE.prv == PRV_U) { |
|
|
|
} else if (STATE.v) { // VS-mode
|
|
|
|
if (get_field(STATE.hstatus->read(), HSTATUS_VTW)) |
|
|
|
require_novirt(); |
|
|
|
} else { |
|
|
|
} else if (p->extension_enabled('S')) { |
|
|
|
// When S-mode is implemented, then executing WFI in
|
|
|
|
// U-mode causes an illegal instruction exception.
|
|
|
|
require_privilege(PRV_S); |
|
|
|
} |
|
|
|
wfi(); |
|
|
|
|