diff options
author | Greg Kurz | 2018-11-27 14:06:31 +0100 |
---|---|---|
committer | David Gibson | 2018-12-20 23:24:23 +0100 |
commit | 2104d4f5bc8f296b3f6f9272bceb8ecfb9581043 (patch) | |
tree | 52f3562d7f9d646c1b71f22c9a3d997a5cb7bb99 /hw/intc/ompic.c | |
parent | mac_newworld: simplify IRQ wiring (diff) | |
download | qemu-2104d4f5bc8f296b3f6f9272bceb8ecfb9581043.tar.gz qemu-2104d4f5bc8f296b3f6f9272bceb8ecfb9581043.tar.xz qemu-2104d4f5bc8f296b3f6f9272bceb8ecfb9581043.zip |
e500: simplify IRQ wiring
The OpenPIC have 5 outputs per connected CPU. The machine init code hence
needs a bi-dimensional array (smp_cpu lines, 5 columns) to wire up the irqs
between the PIC and the CPUs.
The current code first allocates an array of smp_cpus pointers to qemu_irq
type, then it allocates another array of smp_cpus * 5 qemu_irq and fills the
first array with pointers to each line of the second array. This is rather
convoluted.
Simplify the logic by introducing a structured type that describes all the
OpenPIC outputs for a single CPU, ie, fixed size of 5 qemu_irq, and only
allocate a smp_cpu sized array of those.
This also allows to use g_new(T, n) instead of g_malloc(sizeof(T) * n)
as recommended in HACKING.
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc/ompic.c')
0 files changed, 0 insertions, 0 deletions