diff options
Diffstat (limited to 'hw/char/parallel.c')
-rw-r--r-- | hw/char/parallel.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/hw/char/parallel.c b/hw/char/parallel.c index c2b553f0d1..710cefcd94 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -641,3 +641,34 @@ static void parallel_register_types(void) } type_init(parallel_register_types) + +static bool parallel_init(ISABus *bus, int index, CharDriverState *chr) +{ + DeviceState *dev; + ISADevice *isadev; + + isadev = isa_try_create(bus, "isa-parallel"); + if (!isadev) { + return false; + } + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "index", index); + qdev_prop_set_chr(dev, "chardev", chr); + if (qdev_init(dev) < 0) { + return false; + } + return true; +} + +void parallel_hds_isa_init(ISABus *bus, int n) +{ + int i; + + assert(n <= MAX_PARALLEL_PORTS); + + for (i = 0; i < n; i++) { + if (parallel_hds[i]) { + parallel_init(bus, i, parallel_hds[i]); + } + } +} |