[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 06/11] exec/ioport: Add portio_list_set_enabled()
From: |
Bernhard Beschow |
Subject: |
[PATCH v3 06/11] exec/ioport: Add portio_list_set_enabled() |
Date: |
Thu, 21 Dec 2023 16:07:45 +0100 |
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller
allow to enable or disable their SuperI/O functions. Add a convenience function
for implementing this in the VIA south bridges.
The naming of the functions is inspired by its memory_region_set_enabled()
pendant.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
docs/devel/migration.rst | 1 +
include/exec/ioport.h | 1 +
system/ioport.c | 9 +++++++++
3 files changed, 11 insertions(+)
diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst
index dc35a17461..9317091d1a 100644
--- a/docs/devel/migration.rst
+++ b/docs/devel/migration.rst
@@ -465,6 +465,7 @@ Examples of such API functions are:
- memory_region_set_address()
- memory_region_set_alias_offset()
- portio_list_set_address()
+ - portio_list_set_enabled()
Iterative device migration
--------------------------
diff --git a/include/exec/ioport.h b/include/exec/ioport.h
index 96858e5ac3..4397f12f93 100644
--- a/include/exec/ioport.h
+++ b/include/exec/ioport.h
@@ -71,6 +71,7 @@ void portio_list_add(PortioList *piolist,
struct MemoryRegion *address_space,
uint32_t addr);
void portio_list_del(PortioList *piolist);
+void portio_list_set_enabled(PortioList *piolist, bool enabled);
void portio_list_set_address(PortioList *piolist, uint32_t addr);
#endif /* IOPORT_H */
diff --git a/system/ioport.c b/system/ioport.c
index 000e0ee1af..fd551d0375 100644
--- a/system/ioport.c
+++ b/system/ioport.c
@@ -324,6 +324,15 @@ void portio_list_del(PortioList *piolist)
}
}
+void portio_list_set_enabled(PortioList *piolist, bool enabled)
+{
+ unsigned i;
+
+ for (i = 0; i < piolist->nr; ++i) {
+ memory_region_set_enabled(piolist->regions[i], enabled);
+ }
+}
+
void portio_list_set_address(PortioList *piolist, uint32_t addr)
{
MemoryRegionPortioList *mrpio;
--
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 03/11] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState, 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 04/11] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio, 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, 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 06/11] exec/ioport: Add portio_list_set_enabled(),
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 07/11] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC, Bernhard Beschow, 2023/12/21