[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid
From: |
Bin Meng |
Subject: |
[PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid |
Date: |
Mon, 9 Jan 2023 23:26:55 +0800 |
env->mhartid is currently casted to long before printed, which drops
the high 32-bit for rv64 on 32-bit host. Use TARGET_FMT_lx instead.
Signed-off-by: Bin Meng <bmeng@tinylab.org>
---
target/riscv/cpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index cc75ca7667..a5ed6d3f63 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -660,9 +660,9 @@ static void riscv_cpu_realize(DeviceState *dev, Error
**errp)
(env->priv_ver < isa_edata_arr[i].min_version)) {
isa_ext_update_enabled(cpu, &isa_edata_arr[i], false);
#ifndef CONFIG_USER_ONLY
- warn_report("disabling %s extension for hart 0x%lx because "
- "privilege spec version does not match",
- isa_edata_arr[i].name, (unsigned long)env->mhartid);
+ warn_report("disabling %s extension for hart 0x" TARGET_FMT_lx
+ " because privilege spec version does not match",
+ isa_edata_arr[i].name, env->mhartid);
#else
warn_report("disabling %s extension because "
"privilege spec version does not match",
--
2.34.1
- [PATCH] target/riscv: Use TARGET_FMT_lx for env->mhartid,
Bin Meng <=