summaryrefslogtreecommitdiff
path: root/rtl/core/psr.sv
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-12-16 23:36:05 -0600
committerAlejandro Soto <alejandro@34project.org>2022-12-16 23:36:05 -0600
commitca8b6e6696e279f56faacad39501019c3762a1b7 (patch)
tree3622fc8bd082deeeec74b6db1869159ce3d17323 /rtl/core/psr.sv
parent9ebb4b712e1d6c97a999652d0b9105847eabd134 (diff)
Fix privilege escalation while in user mode
Diffstat (limited to 'rtl/core/psr.sv')
-rw-r--r--rtl/core/psr.sv3
1 files changed, 2 insertions, 1 deletions
diff --git a/rtl/core/psr.sv b/rtl/core/psr.sv
index 41982c0..7bbffe6 100644
--- a/rtl/core/psr.sv
+++ b/rtl/core/psr.sv
@@ -8,6 +8,7 @@ module core_psr
saved,
wr_flags,
wr_control,
+ escalating,
update_flags,
alu_v_valid,
input psr_flags alu_flags,
@@ -133,7 +134,7 @@ module core_psr
wr_clean.mode = mode;
end
- if(mode == `MODE_USR) begin
+ if(mode == `MODE_USR && !escalating) begin
wr_clean.mask = mask;
wr_clean.mode = `MODE_USR;
end