mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
target/riscv: Remove the hardcoded SATP_MODE macro
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 6b701769d6621f45ba1739334198e36a64fe04df.1619234854.git.alistair.francis@wdc.com
This commit is contained in:
parent
4fd7455bb3
commit
419ddf00ed
4 changed files with 56 additions and 28 deletions
|
@ -150,9 +150,14 @@ static void mem_info_svxx(Monitor *mon, CPUArchState *env)
|
|||
target_ulong last_size;
|
||||
int last_attr;
|
||||
|
||||
base = (hwaddr)get_field(env->satp, SATP_PPN) << PGSHIFT;
|
||||
if (riscv_cpu_is_32bit(env)) {
|
||||
base = (hwaddr)get_field(env->satp, SATP32_PPN) << PGSHIFT;
|
||||
vm = get_field(env->satp, SATP32_MODE);
|
||||
} else {
|
||||
base = (hwaddr)get_field(env->satp, SATP64_PPN) << PGSHIFT;
|
||||
vm = get_field(env->satp, SATP64_MODE);
|
||||
}
|
||||
|
||||
vm = get_field(env->satp, SATP_MODE);
|
||||
switch (vm) {
|
||||
case VM_1_10_SV32:
|
||||
levels = 2;
|
||||
|
@ -215,9 +220,16 @@ void hmp_info_mem(Monitor *mon, const QDict *qdict)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(env->satp & SATP_MODE)) {
|
||||
monitor_printf(mon, "No translation or protection\n");
|
||||
return;
|
||||
if (riscv_cpu_is_32bit(env)) {
|
||||
if (!(env->satp & SATP32_MODE)) {
|
||||
monitor_printf(mon, "No translation or protection\n");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!(env->satp & SATP64_MODE)) {
|
||||
monitor_printf(mon, "No translation or protection\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
mem_info_svxx(mon, env);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue