include: Make mstatus parameter optional for get_insn()

The mstatus parameter of get_insn() is used to return MSTATUS CSR
value which get_insn() saw. Most of the get_insn() callers don't
use the value returned in mstatus so this patch makes mstatus
parameter optional for get_insn().

Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Anup Patel
2019-03-30 18:43:49 +05:30
committed by Anup Patel
parent 13877c3a67
commit 78c87cd13a
3 changed files with 8 additions and 12 deletions

View File

@@ -122,14 +122,11 @@ int sbi_illegal_insn_handler(u32 hartid, ulong mcause,
struct sbi_trap_regs *regs,
struct sbi_scratch *scratch)
{
ulong mstatus;
ulong insn = csr_read(mbadaddr);
if (unlikely((insn & 3) != 3)) {
if (insn == 0) {
mstatus = csr_read(CSR_MSTATUS);
insn = get_insn(regs->mepc, &mstatus);
}
if (insn == 0)
insn = get_insn(regs->mepc, NULL);
if ((insn & 3) != 3)
return truly_illegal_insn(insn, hartid, mcause,
regs, scratch);