Re: [PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-17 Thread Bernhard Beschow
Am 17. Dezember 2023 15:47:33 UTC schrieb BALATON Zoltan : >On Sun, 17 Dec 2023, Bernhard Beschow wrote: >> Exposing the internal header allows for exposing struct FDCtrlISABus which is >> encuraged by qdev guidelines. > >Hopefully the guidelines don't encourage this as object orientation indeed

Re: [PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-17 Thread BALATON Zoltan
On Sun, 17 Dec 2023, Bernhard Beschow wrote: Exposing the internal header allows for exposing struct FDCtrlISABus which is encuraged by qdev guidelines. Hopefully the guidelines don't encourage this as object orientation indeed encourages object encapsulation so only the object itseld should p

Re: [PATCH 12/12] hw/isa/vt82c686: Implement relocation of SuperI/O functions

2023-12-17 Thread BALATON Zoltan
On Sun, 17 Dec 2023, Bernhard Beschow wrote: The VIA south bridges are able to relocate and enable or disable their SuperI/O functions. So far this is hardcoded such that all functions are always enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy before ac

[PATCH 11/12] exec/ioport: Add portio_list_set_enabled()

2023-12-17 Thread Bernhard Beschow
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-

[PATCH 02/12] hw/i386/pc: No need to include hw/block/fdc.h in header

2023-12-17 Thread Bernhard Beschow
Only the source file uses fdc.h but not the header, so remove it from the public interface. Signed-off-by: Bernhard Beschow --- include/hw/i386/pc.h | 1 - hw/i386/pc.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index a

[PATCH 06/12] hw/block/fdc-isa: Expose struct FDCtrlISABus

2023-12-17 Thread Bernhard Beschow
Exposing device structs in headers is encuraged by qdev guidelines. Signed-off-by: Bernhard Beschow --- include/hw/block/fdc-isa.h | 15 +++ hw/block/fdc-isa.c | 17 - 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/include/hw/block/fdc-isa.h

[PATCH 05/12] hw/block/fdc: Move constant #define to where it is imposed

2023-12-17 Thread Bernhard Beschow
The MAX_FD is a limitation of struct FDCtrl which is defined in fdc.h. Now that this header is exposed the definition can be moved there. Signed-off-by: Bernhard Beschow --- include/hw/block/fdc-isa.h | 3 --- include/hw/block/fdc.h | 3 ++- hw/block/fdc.c | 1 - hw/i386/pc.c

[PATCH 08/12] hw/char/serial-isa: Export struct ISASerialState

2023-12-17 Thread Bernhard Beschow
Exposing device structs in headers is encuraged by qdev guidelines. Signed-off-by: Bernhard Beschow --- include/hw/char/serial-isa.h | 50 include/hw/char/serial.h | 7 - hw/char/serial-isa.c | 14 +- hw/i386/microvm-dt.c | 2

[PATCH 01/12] hw: Remove unused includes of hw/block/fdc.h

2023-12-17 Thread Bernhard Beschow
Results running grep: `grep -i -e "fdc" hw/ppc/prep.c` (no output) `grep -i -e "fdc" hw/m68k/next-cube.c` DPRINTF("FDCSR Write: %x\n", value); This indicates that hw/block/fdc.h isn't used there. Signed-off-by: Bernhard Beschow --- hw/m68k/next-cube.c | 1 - hw/ppc/prep.c | 1 -

[PATCH 09/12] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio

2023-12-17 Thread Bernhard Beschow
portio_list_add_1() creates a MemoryRegionPortioList instance which holds a MemoryRegion `mr` and an array of MemoryRegionPortio elements named `ports`. Each element in the array gets assigned the same value for its .base attribute. The same value also ends up as the .addr attribute of `mr` due to

[PATCH 12/12] hw/isa/vt82c686: Implement relocation of SuperI/O functions

2023-12-17 Thread Bernhard Beschow
The VIA south bridges are able to relocate and enable or disable their SuperI/O functions. So far this is hardcoded such that all functions are always enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy before activating such a function and issue an error in

[PATCH 07/12] MAINTAINERS: Add include/hw/char/serial*.h to the "PC Chipset" section

2023-12-17 Thread Bernhard Beschow
The source files are already in this section. Add the headers, too. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 939f518701..69135a45b4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1827,6 +1827,7 @@ F: hw/wa

[PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-17 Thread Bernhard Beschow
Exposing the internal header allows for exposing struct FDCtrlISABus which is encuraged by qdev guidelines. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 2 +- hw/block/fdc-internal.h => include/hw/block/fdc.h | 4 ++-- hw/block/fdc-isa.c

[PATCH 03/12] hw/block/fdc-isa: Rename header to match source file

2023-12-17 Thread Bernhard Beschow
Rename the header which allows for exposing fdc-internal.h (dropping the -internal suffix) which in turn allows for exposing struct FDCtrlISABus. Exposing a device struct is in line with OOM/qdev guidelines. Signed-off-by: Bernhard Beschow --- MAINTAINERS | 2 +- hw/blo

[PATCH 10/12] exec/ioport: Add portio_list_set_address()

2023-12-17 Thread Bernhard Beschow
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller are able to relocate their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. This convenience function relies on previous simplifications in exec/ioport which avoids some dupl

[PATCH 00/12] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2023-12-17 Thread Bernhard Beschow
This series implements relocation of the SuperI/O functions of the VIA south bridges which resolves some FIXME's. It is part of my via-apollo-pro-133t branch [1] which is an extension of bringing the VIA south bridges to the PC machine [2]. This branch is able to run some real-world X86 BIOSes in t