For the downstream distribution of QEMU, we want to compile without CONFIG_PARALLEL. Commit9157eee1b1
already moved the function parallel_hds_isa_init() (which is still required for linking) into a file that is included anyway, but commitbb3d5ea858
moved it to a separate file which is only compiled again if CONFIG_PARALLEL is set. To be able to link QEMU again without CONFIG_PARALLEL, the file should be considered for linking for all targets that have CONFIG_ISA_BUS. And while we're at it, add a proper comment in there with the rationale for the separate file. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1552297854-25847-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
40 lines
906 B
C
40 lines
906 B
C
/*
|
|
* QEMU Parallel PORT (ISA bus helpers)
|
|
*
|
|
* These functions reside in a separate file since they also might be
|
|
* required for linking when compiling QEMU without CONFIG_PARALLEL.
|
|
*
|
|
* Copyright (c) 2003 Fabrice Bellard
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
#include "qemu/osdep.h"
|
|
#include "sysemu/sysemu.h"
|
|
#include "hw/isa/isa.h"
|
|
#include "hw/char/parallel.h"
|
|
|
|
static void parallel_init(ISABus *bus, int index, Chardev *chr)
|
|
{
|
|
DeviceState *dev;
|
|
ISADevice *isadev;
|
|
|
|
isadev = isa_create(bus, "isa-parallel");
|
|
dev = DEVICE(isadev);
|
|
qdev_prop_set_uint32(dev, "index", index);
|
|
qdev_prop_set_chr(dev, "chardev", chr);
|
|
qdev_init_nofail(dev);
|
|
}
|
|
|
|
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]);
|
|
}
|
|
}
|
|
}
|