aboutsummaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_hart.c
diff options
context:
space:
mode:
authorDong Du <Dd_nirvana@sjtu.edu.cn>2021-10-25 16:06:15 +0800
committerAnup Patel <anup@brainfault.org>2021-11-02 10:42:01 +0530
commit723aa88ff4cc44230cf871bda319905113003279 (patch)
tree495f11823e27d6a9c693e2a1d32c0f29817da625 /lib/sbi/sbi_hart.c
parent309e8bdf85ec7f7dd2f0907c4c9206a9ee639784 (diff)
downloadopensbi-723aa88ff4cc44230cf871bda319905113003279.zip
opensbi-723aa88ff4cc44230cf871bda319905113003279.tar.gz
opensbi-723aa88ff4cc44230cf871bda319905113003279.tar.bz2
lib: sbi: Refine addr format in sbi_printf
Although we have PRILX to help us print unsigned long without considering the 32bit/64bit differences, there are still some places using 08lx and 016lx manually --- leading to redundant code. This commit fixes the issue by using PRILX all the time. Signed-off-by: Dong Du <Dd_nirvana@sjtu.edu.cn> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_hart.c')
-rw-r--r--lib/sbi/sbi_hart.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 6254452..8eb0c38 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -150,17 +150,10 @@ void sbi_hart_delegation_dump(struct sbi_scratch *scratch,
/* No delegation possible as mideleg does not exist*/
return;
-#if __riscv_xlen == 32
- sbi_printf("%sMIDELEG%s: 0x%08lx\n",
+ sbi_printf("%sMIDELEG%s: 0x%" PRILX "\n",
prefix, suffix, csr_read(CSR_MIDELEG));
- sbi_printf("%sMEDELEG%s: 0x%08lx\n",
+ sbi_printf("%sMEDELEG%s: 0x%" PRILX "\n",
prefix, suffix, csr_read(CSR_MEDELEG));
-#else
- sbi_printf("%sMIDELEG%s: 0x%016lx\n",
- prefix, suffix, csr_read(CSR_MIDELEG));
- sbi_printf("%sMEDELEG%s: 0x%016lx\n",
- prefix, suffix, csr_read(CSR_MEDELEG));
-#endif
}
unsigned int sbi_hart_mhpm_count(struct sbi_scratch *scratch)