summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_trap.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-11-16 13:38:27 +0300
committerAnup Patel <anup@brainfault.org>2019-11-21 11:24:13 +0300
commit838657c0524f148d8aaec8225cd0ab9e2e2c7303 (patch)
treec73c3551b6d9e58ec3d96edb43468688aacb8660 /lib/sbi/sbi_trap.c
parent215421ca610a64b8ec188c96ea8588ae2de41fb7 (diff)
downloadopensbi-838657c0524f148d8aaec8225cd0ab9e2e2c7303.tar.xz
include: Remove ilen member of struct unpriv_trap
We simplify struct unpriv_trap by removing ilen member. This can be achieved by ensuring that at all unpriv load/store instructions are 4 bytes long using GCC assembler option. Additionally, this also reduces few instructions from unpriv load/store functions. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_trap.c')
-rw-r--r--lib/sbi/sbi_trap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi/sbi_trap.c b/lib/sbi/sbi_trap.c
index 93a0404..5274c8b 100644
--- a/lib/sbi/sbi_trap.c
+++ b/lib/sbi/sbi_trap.c
@@ -262,7 +262,7 @@ void sbi_trap_handler(struct sbi_trap_regs *regs, struct sbi_scratch *scratch)
uptrap = sbi_hart_get_trap_info(scratch);
if ((regs->mstatus & MSTATUS_MPRV) && uptrap) {
rc = 0;
- regs->mepc += uptrap->ilen;
+ regs->mepc += 4;
uptrap->cause = mcause;
uptrap->tval = mtval;
} else {