aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.h
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2011-02-05 14:51:57 +0000
committerBlue Swirl <blauwirbel@gmail.com>2011-02-20 09:31:21 +0000
commitdefdb20e1a8ac3a7200aaf190d7fb20a5ac8bcea (patch)
tree463910397a5000655b81603eb6a107995bf40caa /hw/pc.h
parente14da0af640e4255b15d81907a93a2637e14e478 (diff)
parallel: refactor device creation
Turn parallel_init into an inline function. Don't expose ParallelState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.h')
-rw-r--r--hw/pc.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/hw/pc.h b/hw/pc.h
index d5d2f42f96..443ba34d16 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -20,10 +20,21 @@ SerialState *serial_isa_init(int index, CharDriverState *chr);
void serial_set_frequency(SerialState *s, uint32_t frequency);
/* parallel.c */
+static inline bool parallel_init(int index, CharDriverState *chr)
+{
+ ISADevice *dev;
+
+ dev = isa_create("isa-parallel");
+ qdev_prop_set_uint32(&dev->qdev, "index", index);
+ qdev_prop_set_chr(&dev->qdev, "chardev", chr);
+ if (qdev_init(&dev->qdev) < 0) {
+ return false;
+ }
+ return true;
+}
-typedef struct ParallelState ParallelState;
-ParallelState *parallel_init(int index, CharDriverState *chr);
-ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, CharDriverState *chr);
+bool parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq,
+ CharDriverState *chr);
/* i8259.c */