mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-11-20 10:32:19 +00:00
lib: sbi_emulate_csr: Remove scratch and hartid parameter
We remove scratch and hartid parameter from various functions for CSR emulation because we can always get current HART id and current scratch pointer using just one CSR access. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
1 parent
cb78a48231
commit
d11c79cd97
3 files changed
+15
-14
No files matched your search
@@ -57,7 +57,7 @@ static int system_opcode_insn(ulong insn, u32 hartid, ulong mcause,
|
||||
return truly_illegal_insn(insn, hartid, mcause,
|
||||
regs, scratch);
|
||||
|
||||
if (sbi_emulate_csr_read(csr_num, hartid, regs, scratch, &csr_val))
|
||||
if (sbi_emulate_csr_read(csr_num, regs, &csr_val))
|
||||
return truly_illegal_insn(insn, hartid, mcause,
|
||||
regs, scratch);
|
||||
|
||||
@@ -87,8 +87,7 @@ static int system_opcode_insn(ulong insn, u32 hartid, ulong mcause,
|
||||
return truly_illegal_insn(insn, hartid, mcause, regs, scratch);
|
||||
};
|
||||
|
||||
if (do_write && sbi_emulate_csr_write(csr_num, hartid, regs,
|
||||
scratch, new_csr_val))
|
||||
if (do_write && sbi_emulate_csr_write(csr_num, regs, new_csr_val))
|
||||
return truly_illegal_insn(insn, hartid, mcause, regs, scratch);
|
||||
|
||||
SET_RD(insn, regs, csr_val);
|
||||
|
||||
Reference in new issue
Block a user