From 32d3b63cb91e54b923574ad9e8570a7459e0c761 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Tue, 13 Mar 2012 13:44:34 +0100 Subject: [PATCH 1/5] Use defines instead of numbers for cpu hotplug RH-Author: Igor Mammedov Message-id: <1331646277-28469-2-git-send-email-imammedo@redhat.com> Patchwork-id: 38481 O-Subject: [RHEL6.3 qemu-kvm PATCH 1/4] Use defines instead of numbers for cpu hotplug Bugzilla: 562886 RH-Acked-by: Gleb Natapov RH-Acked-by: Alex Williamson RH-Acked-by: Andrew Jones Bugzilla: 562886 Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=4146795 Cherry-pick from qemu-kvm: 82915d0c338 Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity Signed-off-by: Igor Mammedov --- hw/acpi.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) Signed-off-by: Michal Novotny --- hw/acpi.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index 6c5f3a6..e09c26b 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -40,6 +40,8 @@ #define PCI_EJ_BASE 0xae08 #define PCI_RMV_BASE 0xae0c +#define PIIX4_CPU_HOTPLUG_STATUS 4 + struct gpe_regs { uint16_t sts; /* status */ uint16_t en; /* enabled */ @@ -903,14 +905,14 @@ void piix4_acpi_system_hot_add_init(PCIBus *bus, const char *cpu_model) #if defined(TARGET_I386) static void enable_processor(struct gpe_regs *g, int cpu) { - g->sts |= 4; - g->cpus_sts[cpu/8] |= (1 << (cpu%8)); + g->sts |= PIIX4_CPU_HOTPLUG_STATUS; + g->cpus_sts[cpu / 8] |= (1 << (cpu % 8)); } static void disable_processor(struct gpe_regs *g, int cpu) { - g->sts |= 4; - g->cpus_sts[cpu/8] &= ~(1 << (cpu%8)); + g->sts |= PIIX4_CPU_HOTPLUG_STATUS; + g->cpus_sts[cpu / 8] &= ~(1 << (cpu % 8)); } void qemu_system_cpu_hot_add(int cpu, int state) -- 1.7.7.6