sysbus: Use TYPE_DEVICE GPIO functionality

Re-implement the Sysbus GPIOs to use the existing TYPE_DEVICE
GPIO named framework. A constant string name is chosen to avoid
conflicts with existing unnamed GPIOs.

This unifies GPIOs are IRQs for sysbus devices and allows removal
of all Sysbus state for GPIOs.

Any existing and future-added functionality for GPIOs is now
also available for sysbus IRQs.

Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Peter Crosthwaite 2014-09-25 22:24:15 -07:00 committed by Paolo Bonzini
parent 17a96a146c
commit b591721909
2 changed files with 6 additions and 21 deletions

View file

@ -8,7 +8,6 @@
#define QDEV_MAX_MMIO 32
#define QDEV_MAX_PIO 32
#define QDEV_MAX_IRQ 512
#define TYPE_SYSTEM_BUS "System"
#define SYSTEM_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
@ -33,6 +32,9 @@ typedef struct SysBusDevice SysBusDevice;
* SysBusDeviceClass is not overriding #DeviceClass.realize, so derived
* classes overriding it are not required to invoke its implementation.
*/
#define SYSBUS_DEVICE_GPIO_IRQ "sysbus-irq"
typedef struct SysBusDeviceClass {
/*< private >*/
DeviceClass parent_class;
@ -46,9 +48,6 @@ struct SysBusDevice {
DeviceState parent_obj;
/*< public >*/
int num_irq;
qemu_irq irqs[QDEV_MAX_IRQ];
qemu_irq *irqp[QDEV_MAX_IRQ];
int num_mmio;
struct {
hwaddr addr;