12
#include "qemu/osdep.h"
13
#include "sysemu/sysemu.h"
14
#include "hw/isa/isa.h"
15
#include "hw/qdev-properties.h"
16
#include "hw/char/parallel-isa.h"
17
#include "hw/char/parallel.h"
18
#include "qapi/error.h"
20
static void parallel_init(ISABus *bus, int index, Chardev *chr)
25
isadev = isa_new(TYPE_ISA_PARALLEL);
27
qdev_prop_set_uint32(dev, "index", index);
28
qdev_prop_set_chr(dev, "chardev", chr);
29
isa_realize_and_unref(isadev, bus, &error_fatal);
32
void parallel_hds_isa_init(ISABus *bus, int n)
36
assert(n <= MAX_PARALLEL_PORTS);
38
for (i = 0; i < n; i++) {
39
if (parallel_hds[i]) {
40
parallel_init(bus, i, parallel_hds[i]);
45
void isa_parallel_set_iobase(ISADevice *parallel, hwaddr iobase)
47
ISAParallelState *s = ISA_PARALLEL(parallel);
49
parallel->ioport_id = iobase;
51
portio_list_set_address(&s->portio_list, s->iobase);
54
void isa_parallel_set_enabled(ISADevice *parallel, bool enabled)
56
portio_list_set_enabled(&ISA_PARALLEL(parallel)->portio_list, enabled);