qemu/hw/arm/pic_cpu.c
Peter Maydell 7c1840b686 target-arm: Make IRQ and FIQ gpio lines on the CPU object
Now that ARMCPU is a subclass of DeviceState, we can make the
CPU's inbound IRQ and FIQ lines be simply gpio lines, which
means we can remove the odd arm_pic shim.

We retain the arm_pic_init_cpu() function as a backwards
compatibility shim layer so we can convert the board models
to get the IRQ and FIQ lines directly from the ARMCPU
object one at a time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1375977856-25046-2-git-send-email-peter.maydell@linaro.org
2013-08-20 14:54:28 +01:00

26 lines
653 B
C

/*
* Generic ARM Programmable Interrupt Controller support.
*
* Copyright (c) 2006 CodeSourcery.
* Written by Paul Brook
*
* This code is licensed under the LGPL
*/
#include "hw/hw.h"
#include "hw/arm/arm.h"
/* Backwards compatibility shim; this can disappear when all
* board models have been updated to get IRQ and FIQ lines directly
* from the ARMCPU object rather than by calling this function.
*/
qemu_irq *arm_pic_init_cpu(ARMCPU *cpu)
{
DeviceState *dev = DEVICE(cpu);
qemu_irq *irqs = g_new(qemu_irq, 2);
irqs[0] = qdev_get_gpio_in(dev, ARM_CPU_IRQ);
irqs[1] = qdev_get_gpio_in(dev, ARM_CPU_FIQ);
return irqs;
}