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:
Bo Gan 2024-03-05 18:35:36 -08:00 committed by Anup Patel
parent 2471cf2e6c
commit a17600c186
2 changed files with 2 additions and 2 deletions

View file

@ -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,
struct sbi_trap_info *trap);
const struct sbi_trap_info *trap);
struct sbi_trap_regs *sbi_trap_handler(struct sbi_trap_regs *regs);

View file

@ -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
*/
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;
#if __riscv_xlen == 32