[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to '
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h' |
Date: |
Fri, 13 Dec 2019 17:47:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
On 12/13/19 5:17 PM, Philippe Mathieu-Daudé wrote:
Historically, QEMU started with only one X86 machine: the PC.
The 'hw/i386/pc.h' header was used to store all X86 and PC
declarations. Since we have now multiple machines based on the
X86 architecture, move the PC-specific declarations in a new
header.
We use 'internal' in the name to explicit this header is restricted
to the X86 architecture. Other architecture can not access it.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
Maybe name it 'pc_machine.h'?
I forgot to describe here (and in the cover), what's follow after this
patch.
Patch #13 moves PCMachineClass to
If you ignore PCMachineState, "hw/i386/pc.h" now only contains 76 lines,
and it is easier to see what is PC machine specific, what is X86
specific, and what is device generic (not X86 related at all):
- GSI is common to X86 (Paolo sent [3], [6])
- IOAPIC is common to X86
- i8259 is multiarch (Paolo [2])
- PCI_HOST definitions and pc_pci_hole64_start() are X86
- pc_machine_is_smm_enabled() is X86 (Paolo sent [5])
- hpet
- tsc (Paolo sent [3])
- 3 more functions
So we can move half of this file to "pc_internal.h" and the other to
One problem is the Q35 MCH north bridge which directly sets the PCI
PCMachineState->bus in q35_host_realize(). This seems a QOM violation
and is probably easily fixable.
Maybe I can apply Paolo's patches instead of this #12, move X86-generic
declarations to "hw/i386/x86.h", and directly git-move what's left of
"hw/i386/pc.h" to "pc_internal.h".
[3] https://www.mail-archive.com/address@hidden/msg664627.html
[2] https://www.mail-archive.com/address@hidden/msg664765.html
[5] https://www.mail-archive.com/address@hidden/msg664754.html
[6] https://www.mail-archive.com/address@hidden/msg664766.html
---
hw/i386/pc_internal.h | 144 ++++++++++++++++++++++++++++++++++++++++++
include/hw/i386/pc.h | 128 -------------------------------------
hw/i386/acpi-build.c | 1 +
hw/i386/pc.c | 1 +
hw/i386/pc_piix.c | 1 +
hw/i386/pc_q35.c | 1 +
hw/i386/pc_sysfw.c | 1 +
hw/i386/xen/xen-hvm.c | 1 +
8 files changed, 150 insertions(+), 128 deletions(-)
create mode 100644 hw/i386/pc_internal.h
- Re: [PATCH 06/12] hw/i386/ich9: Move unnecessary "pci_bridge.h" include, (continued)
- [PATCH 07/12] hw/ide/piix: Remove superfluous DEVICE() cast, Philippe Mathieu-Daudé, 2019/12/13
- [PATCH 08/12] hw/ide/piix: Use ARRAY_SIZE() instead of magic numbers, Philippe Mathieu-Daudé, 2019/12/13
- [PATCH 09/12] hw/intc/ioapic: Make ioapic_print_redtbl() static, Philippe Mathieu-Daudé, 2019/12/13
- [PATCH 10/12] hw/i386/pc: Rename allocate_cpu_irq from 'pc' to 'x86_machine', Philippe Mathieu-Daudé, 2019/12/13
- [PATCH 11/12] hw/i386/pc: Move x86_machine_allocate_cpu_irq() to 'hw/i386/x86.c', Philippe Mathieu-Daudé, 2019/12/13
- [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h', Philippe Mathieu-Daudé, 2019/12/13
- Re: [PATCH 12/12] hw/i386/pc: Move PC-machine specific declarations to 'pc_internal.h',
Philippe Mathieu-Daudé <=