aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/sbsa-ref.c
diff options
context:
space:
mode:
authorLike Xu <like.xu@linux.intel.com>2019-05-19 04:54:26 +0800
committerEduardo Habkost <ehabkost@redhat.com>2019-07-05 17:08:03 -0300
commitcc7d44c2e0fc9dff1b9eef857f14a7fd31d71f46 (patch)
tree2c97f7323d5a5d36050c5fd36ebdcaf426f74f70 /hw/arm/sbsa-ref.c
parent0e11fc6955dddf752987b261a0176edf31b34dec (diff)
downloadqemu-cc7d44c2e0fc9dff1b9eef857f14a7fd31d71f46.zip
qemu-cc7d44c2e0fc9dff1b9eef857f14a7fd31d71f46.tar.gz
qemu-cc7d44c2e0fc9dff1b9eef857f14a7fd31d71f46.tar.bz2
hw/arm: Replace global smp variables with machine smp properties
The global smp variables in arm are replaced with smp machine properties. The init_cpus() and *_create_rpu() are refactored to pass MachineState. 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> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20190518205428.90532-9-like.xu@linux.intel.com> [ehabkost: Fix hw/arm/sbsa-ref.c and hw/arm/aspeed.c] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/arm/sbsa-ref.c')
-rw-r--r--hw/arm/sbsa-ref.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index ee53f0f..e8c65e3 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -328,6 +328,7 @@ static void create_secure_ram(SBSAMachineState *sms,
static void create_gic(SBSAMachineState *sms, qemu_irq *pic)
{
+ unsigned int smp_cpus = MACHINE(sms)->smp.cpus;
DeviceState *gicdev;
SysBusDevice *gicbusdev;
const char *gictype;
@@ -585,6 +586,8 @@ static void *sbsa_ref_dtb(const struct arm_boot_info *binfo, int *fdt_size)
static void sbsa_ref_init(MachineState *machine)
{
+ unsigned int smp_cpus = machine->smp.cpus;
+ unsigned int max_cpus = machine->smp.max_cpus;
SBSAMachineState *sms = SBSA_MACHINE(machine);
MachineClass *mc = MACHINE_GET_CLASS(machine);
MemoryRegion *sysmem = get_system_memory();
@@ -727,6 +730,7 @@ static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
static const CPUArchIdList *sbsa_ref_possible_cpu_arch_ids(MachineState *ms)
{
+ unsigned int max_cpus = ms->smp.max_cpus;
SBSAMachineState *sms = SBSA_MACHINE(ms);
int n;