summaryrefslogtreecommitdiff
path: root/hw/char/parallel.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-04-27 22:18:45 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-29 08:27:48 -0500
commitb0dc5ee6bd0b16986a0f45ca778f3ead2398b2ee (patch)
treedae86337e60d4f1e938ab263cb5ab58d686336b0 /hw/char/parallel.c
parentfe6f5deb6611c512abcb4cb46a275756295b3e79 (diff)
downloadqemu-b0dc5ee6bd0b16986a0f45ca778f3ead2398b2ee.tar.gz
parallel: QOM'ify
Introduce type constant and cast macro to obsolete DO_UPCAST(). Prepares for ISA realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1367093935-29091-11-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/char/parallel.c')
-rw-r--r--hw/char/parallel.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index b5e867f21c..8e48284520 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -80,8 +80,13 @@ typedef struct ParallelState {
int it_shift;
} ParallelState;
+#define TYPE_ISA_PARALLEL "isa-parallel"
+#define ISA_PARALLEL(obj) \
+ OBJECT_CHECK(ISAParallelState, (obj), TYPE_ISA_PARALLEL)
+
typedef struct ISAParallelState {
- ISADevice dev;
+ ISADevice parent_obj;
+
uint32_t index;
uint32_t iobase;
uint32_t isairq;
@@ -475,7 +480,7 @@ static const MemoryRegionPortio isa_parallel_portio_sw_list[] = {
static int parallel_isa_initfn(ISADevice *dev)
{
static int index;
- ISAParallelState *isa = DO_UPCAST(ISAParallelState, dev, dev);
+ ISAParallelState *isa = ISA_PARALLEL(dev);
ParallelState *s = &isa->state;
int base;
uint8_t dummy;
@@ -600,7 +605,7 @@ static void parallel_isa_class_initfn(ObjectClass *klass, void *data)
}
static const TypeInfo parallel_isa_info = {
- .name = "isa-parallel",
+ .name = TYPE_ISA_PARALLEL,
.parent = TYPE_ISA_DEVICE,
.instance_size = sizeof(ISAParallelState),
.class_init = parallel_isa_class_initfn,