mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
target/riscv: add riscv_cpu_get_name()
We'll introduce generic errors that will output a CPU type name via its RISCVCPU pointer. Create a helper for that. Use the helper in tcg_cpu_realizefn() instead of hardcoding the 'host' CPU name. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20230926183109.165878-2-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
31778448f2
commit
b933720be2
3 changed files with 15 additions and 1 deletions
|
@ -563,7 +563,9 @@ static bool tcg_cpu_realize(CPUState *cs, Error **errp)
|
|||
Error *local_err = NULL;
|
||||
|
||||
if (object_dynamic_cast(OBJECT(cpu), TYPE_RISCV_CPU_HOST)) {
|
||||
error_setg(errp, "'host' CPU is not compatible with TCG acceleration");
|
||||
g_autofree char *name = riscv_cpu_get_name(cpu);
|
||||
error_setg(errp, "'%s' CPU is not compatible with TCG acceleration",
|
||||
name);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue