[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 08/11] hw/char/serial-isa: Implement relocation and enabling/d
From: |
Bernhard Beschow |
Subject: |
[PATCH v3 08/11] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL |
Date: |
Thu, 21 Dec 2023 16:07:47 +0100 |
The real SuperI/O chips emulated by QEMU allow for relocating and enabling or
disabling their SuperI/O functions via software. So far this is not implemented.
Prepare for that by adding isa_serial_set_{enabled,iobase}.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
include/hw/char/serial.h | 2 ++
hw/char/serial-isa.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h
index 8ba7eca3d6..6e14099ee7 100644
--- a/include/hw/char/serial.h
+++ b/include/hw/char/serial.h
@@ -112,5 +112,7 @@ SerialMM *serial_mm_init(MemoryRegion *address_space,
#define TYPE_ISA_SERIAL "isa-serial"
void serial_hds_isa_init(ISABus *bus, int from, int to);
+void isa_serial_set_iobase(ISADevice *serial, hwaddr iobase);
+void isa_serial_set_enabled(ISADevice *serial, bool enabled);
#endif
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index 141a6cb168..62fb529e39 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -184,3 +184,17 @@ void serial_hds_isa_init(ISABus *bus, int from, int to)
}
}
}
+
+void isa_serial_set_iobase(ISADevice *serial, hwaddr iobase)
+{
+ ISASerialState *s = ISA_SERIAL(serial);
+
+ serial->ioport_id = iobase;
+ s->iobase = iobase;
+ memory_region_set_address(&s->state.io, s->iobase);
+}
+
+void isa_serial_set_enabled(ISADevice *serial, bool enabled)
+{
+ memory_region_set_enabled(&ISA_SERIAL(serial)->state.io, enabled);
+}
--
2.43.0
- [PATCH v3 00/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Bernhard Beschow, 2023/12/21
- [PATCH v3 01/11] hw/block/fdc-isa: Move portio_list from FDCtrl to FDCtrlISABus, Bernhard Beschow, 2023/12/21
- [PATCH v3 02/11] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus, Bernhard Beschow, 2023/12/21
- [PATCH v3 03/11] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState, Bernhard Beschow, 2023/12/21
- [PATCH v3 04/11] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio, Bernhard Beschow, 2023/12/21
- [PATCH v3 06/11] exec/ioport: Add portio_list_set_enabled(), Bernhard Beschow, 2023/12/21
- [PATCH v3 05/11] exec/ioport: Add portio_list_set_address(), Bernhard Beschow, 2023/12/21
- [PATCH v3 08/11] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL,
Bernhard Beschow <=
- [PATCH v3 09/11] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL, Bernhard Beschow, 2023/12/21
- [PATCH v3 10/11] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions, Bernhard Beschow, 2023/12/21
- [PATCH v3 11/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Bernhard Beschow, 2023/12/21
- [PATCH v3 07/11] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC, Bernhard Beschow, 2023/12/21