aboutsummaryrefslogtreecommitdiff
path: root/hw/riscv/sifive_plic.c
diff options
context:
space:
mode:
authorLike Xu <like.xu@linux.intel.com>2019-05-19 04:54:23 +0800
committerEduardo Habkost <ehabkost@redhat.com>2019-07-05 17:07:42 -0300
commitc447312747aae02298333e61e1ede0793cda47d8 (patch)
treee09a9406334254a9cb75506c8eb2da4fe30e3c2a /hw/riscv/sifive_plic.c
parentfe6b6346e997ff2ecef1e69a0ab9b1e521b68003 (diff)
hw/riscv: Replace global smp variables with machine smp properties
The global smp variables in riscv are replaced with smp machine properties. A local variable of the same name would be introduced in the declaration phase if it's used widely in the context OR replace it on the spot if it's only used once. No semantic changes. Signed-off-by: Like Xu <like.xu@linux.intel.com> Message-Id: <20190518205428.90532-6-like.xu@linux.intel.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> [ehabkost: fix spike_board_init()] [ehabkost: fix riscv_sifive_e_soc_init()] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/riscv/sifive_plic.c')
-rw-r--r--hw/riscv/sifive_plic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c
index 70a4413599..0950e89e15 100644
--- a/hw/riscv/sifive_plic.c
+++ b/hw/riscv/sifive_plic.c
@@ -24,6 +24,7 @@
#include "qemu/error-report.h"
#include "hw/sysbus.h"
#include "hw/pci/msi.h"
+#include "hw/boards.h"
#include "target/riscv/cpu.h"
#include "sysemu/sysemu.h"
#include "hw/riscv/sifive_plic.h"
@@ -439,6 +440,8 @@ static void sifive_plic_irq_request(void *opaque, int irq, int level)
static void sifive_plic_realize(DeviceState *dev, Error **errp)
{
+ MachineState *ms = MACHINE(qdev_get_machine());
+ unsigned int smp_cpus = ms->smp.cpus;
SiFivePLICState *plic = SIFIVE_PLIC(dev);
int i;