Greg Kurz 9929301ee1 mac_newworld: 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>
2018-12-21 09:24:23 +11:00
..
2018-12-16 16:32:43 +00:00
2018-12-16 16:32:43 +00:00
2018-12-16 16:32:43 +00:00
2018-10-24 06:44:59 -03:00
2018-12-16 16:32:43 +00:00
2018-10-24 06:44:59 -03:00
2018-12-16 16:32:43 +00:00
2018-12-14 13:30:51 +00:00
2018-11-08 14:42:37 +00:00
2016-01-29 15:07:25 +00:00
2018-12-21 09:24:23 +11:00
2018-12-20 10:29:08 +01:00
2018-11-27 15:35:15 +01:00
2018-12-20 10:29:08 +01:00
2018-12-11 22:26:44 +00:00