[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/23] PPC: Bump MPIC up to 32 supported CPUs
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 08/23] PPC: Bump MPIC up to 32 supported CPUs |
Date: |
Thu, 21 Jul 2011 03:27:19 +0200 |
The MPIC emulation is now capable of handling up to 32 CPUs. Reflect that in
the code exporting the numbers out and fix an integer overflow while at it.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/openpic.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/hw/openpic.c b/hw/openpic.c
index 6630206..a8d7824 100644
--- a/hw/openpic.c
+++ b/hw/openpic.c
@@ -63,7 +63,7 @@
#elif defined(USE_MPCxxx)
-#define MAX_CPU 2
+#define MAX_CPU 32
#define MAX_IRQ 128
#define MAX_DBL 0
#define MAX_MBX 0
@@ -507,7 +507,7 @@ static inline void write_IRQreg (openpic_t *opp, int n_IRQ,
break;
case IRQ_IDE:
tmp = val & 0xC0000000;
- tmp |= val & ((1 << MAX_CPU) - 1);
+ tmp |= val & ((1ULL << MAX_CPU) - 1);
opp->src[n_IRQ].ide = tmp;
DPRINTF("Set IDE %d to 0x%08x\n", n_IRQ, opp->src[n_IRQ].ide);
break;
@@ -1288,7 +1288,7 @@ static void mpic_reset (void *opaque)
mpp->glbc = 0x80000000;
/* Initialise controller registers */
- mpp->frep = 0x004f0002;
+ mpp->frep = 0x004f0002 | ((MAX_CPU - 1) << 8);
mpp->veni = VENI;
mpp->pint = 0x00000000;
mpp->spve = 0x0000FFFF;
@@ -1685,10 +1685,6 @@ qemu_irq *mpic_init (target_phys_addr_t base, int
nb_cpus,
{mpic_cpu_read, mpic_cpu_write, MPIC_CPU_REG_START, MPIC_CPU_REG_SIZE},
};
- /* XXX: for now, only one CPU is supported */
- if (nb_cpus != 1)
- return NULL;
-
mpp = qemu_mallocz(sizeof(openpic_t));
for (i = 0; i < sizeof(list)/sizeof(list[0]); i++) {
--
1.6.0.2
- [Qemu-devel] [PATCH 19/23] PPC: KVM: Add stubs for kvm helper functions, (continued)
- [Qemu-devel] [PATCH 04/23] PPC: Add CPU local MMIO regions to MPIC, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 03/23] PPC: Add CPU definitions for up to 32 guest CPUs, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 18/23] PPC: KVM: Remove kvmppc_read_host_property, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 08/23] PPC: Bump MPIC up to 32 supported CPUs,
Alexander Graf <=
- [Qemu-devel] [PATCH 23/23] PPC: E500: Bump CPU count to 32, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 15/23] PPC: E500: Use generic kvm function for freq, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 05/23] PPC: Extend MPIC MMIO range, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 12/23] device tree: add nop_node, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 10/23] PPC: E500: Generate IRQ lines for many CPUs, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 09/23] PPC: E500: create multiple envs, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 13/23] PPC: bamboo: Move host fdt copy to target, Alexander Graf, 2011/07/20
- [Qemu-devel] [PATCH 11/23] PPC: E500: Use spin code for secondary CPUs, Alexander Graf, 2011/07/20