mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
lib: sbi: change prototype of sbi_trap_redirect
sbi_trap_redirect now uses const pointer to `trap`. This ensures the caller that we never change `trap` in sbi_trap_redirect. Signed-off-by: Bo Gan <ganboing@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -225,7 +225,7 @@ static inline unsigned long sbi_regs_gva(const struct sbi_trap_regs *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
||||||
struct sbi_trap_info *trap);
|
const struct sbi_trap_info *trap);
|
||||||
|
|
||||||
struct sbi_trap_regs *sbi_trap_handler(struct sbi_trap_regs *regs);
|
struct sbi_trap_regs *sbi_trap_handler(struct sbi_trap_regs *regs);
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ static void __noreturn sbi_trap_error(const char *msg, int rc,
|
|||||||
* @return 0 on success and negative error code on failure
|
* @return 0 on success and negative error code on failure
|
||||||
*/
|
*/
|
||||||
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
int sbi_trap_redirect(struct sbi_trap_regs *regs,
|
||||||
struct sbi_trap_info *trap)
|
const struct sbi_trap_info *trap)
|
||||||
{
|
{
|
||||||
ulong hstatus, vsstatus, prev_mode;
|
ulong hstatus, vsstatus, prev_mode;
|
||||||
#if __riscv_xlen == 32
|
#if __riscv_xlen == 32
|
||||||
|
Reference in New Issue
Block a user