forked from Mirrors/opensbi
lib: Use sbi_dprintf() for invalid CSRs
We should sbi_dprintf() instead of sbi_printf() for invalid CSRs because we are forwarding invalid CSR access back to S-mode. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -83,8 +83,8 @@ int sbi_emulate_csr_read(int csr_num, u32 hartid, ulong mstatus,
|
|||||||
*csr_val = csr_read(CSR_MHPMEVENT4);
|
*csr_val = csr_read(CSR_MHPMEVENT4);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sbi_printf("%s: hartid%d: invalid csr_num=0x%x\n", __func__,
|
sbi_dprintf(scratch, "%s: hartid%d: invalid csr_num=0x%x\n",
|
||||||
hartid, csr_num);
|
__func__, hartid, csr_num);
|
||||||
return SBI_ENOTSUPP;
|
return SBI_ENOTSUPP;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -128,8 +128,8 @@ int sbi_emulate_csr_write(int csr_num, u32 hartid, ulong mstatus,
|
|||||||
csr_write(CSR_MHPMEVENT4, csr_val);
|
csr_write(CSR_MHPMEVENT4, csr_val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sbi_printf("%s: hartid%d: invalid csr_num=0x%x\n", __func__,
|
sbi_dprintf(scratch, "%s: hartid%d: invalid csr_num=0x%x\n",
|
||||||
hartid, csr_num);
|
__func__, hartid, csr_num);
|
||||||
return SBI_ENOTSUPP;
|
return SBI_ENOTSUPP;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user