mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
parallel: refactor device creation
Turn parallel_init into an inline function. Don't expose ParallelState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
e14da0af64
commit
defdb20e1a
2 changed files with 19 additions and 19 deletions
17
hw/pc.h
17
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;
|
||||
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
||||
bool parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq,
|
||||
CharDriverState *chr);
|
||||
|
||||
/* i8259.c */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue