diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-03-18 17:36:02 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-04-08 18:13:16 +0200 |
commit | 47b43a1f414c5b3eb9eb7502d0b0be0d134259ba (patch) | |
tree | 9acfd03f458083a077ac79bd462d5360916f445f /hw/char | |
parent | 8d8b636d28a97af7bf43c3267d07f87b9530939a (diff) |
hw: move private headers to hw/ subdirectories.
Many headers are used only in a single directory. These can be
kept in hw/.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/char')
-rw-r--r-- | hw/char/ipack.c | 2 | ||||
-rw-r--r-- | hw/char/ipack.h | 79 | ||||
-rw-r--r-- | hw/char/ipoctal232.c | 2 | ||||
-rw-r--r-- | hw/char/tpci200.c | 2 |
4 files changed, 82 insertions, 3 deletions
diff --git a/hw/char/ipack.c b/hw/char/ipack.c index b1f46c10a4..e15540d5cd 100644 --- a/hw/char/ipack.c +++ b/hw/char/ipack.c @@ -8,7 +8,7 @@ * later version. */ -#include "hw/ipack.h" +#include "ipack.h" IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot) { diff --git a/hw/char/ipack.h b/hw/char/ipack.h new file mode 100644 index 0000000000..f2b7a12e05 --- /dev/null +++ b/hw/char/ipack.h @@ -0,0 +1,79 @@ +/* + * QEMU IndustryPack emulation + * + * Copyright (C) 2012 Igalia, S.L. + * Author: Alberto Garcia <agarcia@igalia.com> + * + * This code is licensed under the GNU GPL v2 or (at your option) any + * later version. + */ + +#ifndef QEMU_IPACK_H +#define QEMU_IPACK_H + +#include "hw/qdev.h" + +typedef struct IPackBus IPackBus; + +#define TYPE_IPACK_BUS "IndustryPack" +#define IPACK_BUS(obj) OBJECT_CHECK(IPackBus, (obj), TYPE_IPACK_BUS) + +struct IPackBus { + BusState qbus; + /* All fields are private */ + uint8_t n_slots; + uint8_t free_slot; + qemu_irq_handler set_irq; +}; + +typedef struct IPackDevice IPackDevice; +typedef struct IPackDeviceClass IPackDeviceClass; + +#define TYPE_IPACK_DEVICE "ipack-device" +#define IPACK_DEVICE(obj) \ + OBJECT_CHECK(IPackDevice, (obj), TYPE_IPACK_DEVICE) +#define IPACK_DEVICE_CLASS(klass) \ + OBJECT_CLASS_CHECK(IPackDeviceClass, (klass), TYPE_IPACK_DEVICE) +#define IPACK_DEVICE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(IPackDeviceClass, (obj), TYPE_IPACK_DEVICE) + +struct IPackDeviceClass { + DeviceClass parent_class; + + int (*init)(IPackDevice *dev); + int (*exit)(IPackDevice *dev); + + uint16_t (*io_read)(IPackDevice *dev, uint8_t addr); + void (*io_write)(IPackDevice *dev, uint8_t addr, uint16_t val); + + uint16_t (*id_read)(IPackDevice *dev, uint8_t addr); + void (*id_write)(IPackDevice *dev, uint8_t addr, uint16_t val); + + uint16_t (*int_read)(IPackDevice *dev, uint8_t addr); + void (*int_write)(IPackDevice *dev, uint8_t addr, uint16_t val); + + uint16_t (*mem_read16)(IPackDevice *dev, uint32_t addr); + void (*mem_write16)(IPackDevice *dev, uint32_t addr, uint16_t val); + + uint8_t (*mem_read8)(IPackDevice *dev, uint32_t addr); + void (*mem_write8)(IPackDevice *dev, uint32_t addr, uint8_t val); +}; + +struct IPackDevice { + DeviceState qdev; + int32_t slot; + /* IRQ objects for the IndustryPack INT0# and INT1# */ + qemu_irq *irq; +}; + +extern const VMStateDescription vmstate_ipack_device; + +#define VMSTATE_IPACK_DEVICE(_field, _state) \ + VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice) + +IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot); +void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent, + const char *name, uint8_t n_slots, + qemu_irq_handler handler); + +#endif diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c index 685fee2d2e..fcd0af31b4 100644 --- a/hw/char/ipoctal232.c +++ b/hw/char/ipoctal232.c @@ -8,7 +8,7 @@ * later version. */ -#include "hw/ipack.h" +#include "ipack.h" #include "qemu/bitops.h" #include "char/char.h" diff --git a/hw/char/tpci200.c b/hw/char/tpci200.c index e3408ef4ba..01706020be 100644 --- a/hw/char/tpci200.c +++ b/hw/char/tpci200.c @@ -8,7 +8,7 @@ * later version. */ -#include "hw/ipack.h" +#include "ipack.h" #include "hw/pci/pci.h" #include "qemu/bitops.h" #include <stdio.h> |