aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2021-10-22 16:01:33 +1000
committerAlistair Francis <alistair.francis@wdc.com>2021-10-28 14:39:23 +1000
commit7d10ff8a4de7a9bff1e7b25011f5eb43f24a6713 (patch)
tree5b4a794cf60587737258864cefb0543a9ec8fbcd
parent8486eb8cdcd336de8ae52d95da45af97f54db63e (diff)
downloadqemu-7d10ff8a4de7a9bff1e7b25011f5eb43f24a6713.zip
qemu-7d10ff8a4de7a9bff1e7b25011f5eb43f24a6713.tar.gz
qemu-7d10ff8a4de7a9bff1e7b25011f5eb43f24a6713.tar.bz2
hw/riscv: virt: Use the PLIC config helper function
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Message-id: 20211022060133.3045020-5-alistair.francis@opensource.wdc.com
-rw-r--r--hw/riscv/virt.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 28a5909..3af0741 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -748,24 +748,6 @@ static FWCfgState *create_fw_cfg(const MachineState *mc)
return fw_cfg;
}
-/*
- * Return the per-socket PLIC hart topology configuration string
- * (caller must free with g_free())
- */
-static char *plic_hart_config_string(int hart_count)
-{
- g_autofree const char **vals = g_new(const char *, hart_count + 1);
- int i;
-
- for (i = 0; i < hart_count; i++) {
- vals[i] = "MS";
- }
- vals[i] = NULL;
-
- /* g_strjoinv() obliges us to cast away const here */
- return g_strjoinv(",", (char **)vals);
-}
-
static void virt_machine_init(MachineState *machine)
{
const MemMapEntry *memmap = virt_memmap;
@@ -839,7 +821,7 @@ static void virt_machine_init(MachineState *machine)
}
/* Per-socket PLIC hart topology configuration string */
- plic_hart_config = plic_hart_config_string(hart_count);
+ plic_hart_config = riscv_plic_hart_config_string(hart_count);
/* Per-socket PLIC */
s->plic[i] = sifive_plic_create(