[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/12] hw/char/serial-isa: Implement relocation and toggling f
From: |
Bernhard Beschow |
Subject: |
[PATCH v2 09/12] hw/char/serial-isa: Implement relocation and toggling for TYPE_ISA_SERIAL |
Date: |
Mon, 18 Dec 2023 19:51:11 +0100 |
Implement isa_serial_set_{enabled,iobase} in order to implement relocation and
toggling of SuperI/O functions in the VIA south bridges without breaking
encapsulation.
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 eb4254edde..ba9f8f21d7 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 2be8be980b..d51c9ec87c 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -187,3 +187,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->io, s->iobase);
+}
+
+void isa_serial_set_enabled(ISADevice *serial, bool enabled)
+{
+ memory_region_set_enabled(&ISA_SERIAL(serial)->io, enabled);
+}
--
2.43.0
- Re: [PATCH v2 02/12] hw/block/fdc-sysbus: Free struct FDCtrl from MemoryRegion, (continued)
- [PATCH v2 03/12] hw/char/serial: Free struct SerialState from MemoryRegion, Bernhard Beschow, 2023/12/18
- [PATCH v2 07/12] exec/ioport: Add portio_list_set_enabled(), Bernhard Beschow, 2023/12/18
- [PATCH v2 05/12] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio, Bernhard Beschow, 2023/12/18
- [PATCH v2 06/12] exec/ioport: Add portio_list_set_address(), Bernhard Beschow, 2023/12/18
- [PATCH v2 04/12] hw/char/parallel: Free struct ParallelState from PortioList, Bernhard Beschow, 2023/12/18
- [PATCH v2 10/12] hw/char/parallel-isa: Implement relocation and toggling for TYPE_ISA_PARALLEL, Bernhard Beschow, 2023/12/18
- [PATCH v2 09/12] hw/char/serial-isa: Implement relocation and toggling for TYPE_ISA_SERIAL,
Bernhard Beschow <=
- [PATCH v2 12/12] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Bernhard Beschow, 2023/12/18
- [PATCH v2 11/12] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions, Bernhard Beschow, 2023/12/18
- [PATCH v2 08/12] hw/block/fdc-isa: Implement relocation and toggling for TYPE_ISA_FDC, Bernhard Beschow, 2023/12/18