qemu-patch-raspberry4/hw/intc
Greg Kurz a005b3ef50 xics: report errors with the QEMU Error API
Using the return value to report errors is error prone:
- xics_alloc() returns -1 on error but spapr_vio_busdev_realize() errors
  on 0
- xics_alloc_block() returns the unclear value of ics->offset - 1 on error
  but both rtas_ibm_change_msi() and spapr_phb_realize() error on 0

This patch adds an errp argument to xics_alloc() and xics_alloc_block() to
report errors. The return value of these functions is a valid IRQ number
if errp is NULL. It is undefined otherwise.

The corresponding error traces get promotted to error messages. Note that
the "can't allocate IRQ" error message in spapr_vio_busdev_realize() also
moves to xics_alloc(). Similar error message consolidation isn't really
applicable to xics_alloc_block() because callers have extra context (device
config address, MSI or MSIX).

This fixes the issues mentioned above.

Based on previous work from Brian W. Hart.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-02-28 16:19:02 +11:00
..
allwinner-a10-pic.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
apic.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
apic_common.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
arm_gic.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
arm_gic_common.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
arm_gic_kvm.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
arm_gicv2m.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
arm_gicv3_common.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
arm_gicv3_kvm.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
armv7m_nvic.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
bcm2835_ic.c all: Clean up includes 2016-02-16 14:29:28 +00:00
bcm2836_control.c all: Clean up includes 2016-02-16 14:29:28 +00:00
etraxfs_pic.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
exynos4210_combiner.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
exynos4210_gic.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
gic_internal.h hw/intc/arm_gic: Change behavior of IAR writes 2015-05-12 11:57:18 +01:00
grlib_irqmp.c sparc: Clean up includes 2016-01-29 15:07:22 +00:00
heathrow_pic.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
i8259.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
i8259_common.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
imx_avic.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
ioapic.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
ioapic_common.c x86: Clean up includes 2016-01-29 15:07:22 +00:00
lm32_pic.c lm32: Clean up includes 2016-01-29 15:07:22 +00:00
Makefile.objs bcm2836_control: add bcm2836 ARM control logic 2016-02-03 15:00:45 +00:00
omap_intc.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
openpic.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
openpic_kvm.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
pl190.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
puv3_intc.c unicore: Clean up includes 2016-01-29 15:07:22 +00:00
realview_gic.c arm: Clean up includes 2016-01-29 15:07:23 +00:00
s390_flic.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
s390_flic_kvm.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
sh_intc.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
slavio_intctl.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00
vgic_common.h intc/gic: Extract some reusable vGIC code 2015-09-24 01:29:36 +01:00
xics.c xics: report errors with the QEMU Error API 2016-02-28 16:19:02 +11:00
xics_kvm.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
xilinx_intc.c hw/intc: Clean up includes 2016-01-29 15:07:24 +00:00