[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 39/42] hw/isa/piix: Unexport PIIXState
From: |
Bernhard Beschow |
Subject: |
[PATCH 39/42] hw/isa/piix: Unexport PIIXState |
Date: |
Thu, 1 Sep 2022 18:26:10 +0200 |
The - deliberately exported - components can still be accessed
via QOM properties.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/isa/piix.c | 52 +++++++++++++++++++++++++++++++++
include/hw/southbridge/piix.h | 54 -----------------------------------
2 files changed, 52 insertions(+), 54 deletions(-)
diff --git a/hw/isa/piix.c b/hw/isa/piix.c
index e413d7e792..c503a6e836 100644
--- a/hw/isa/piix.c
+++ b/hw/isa/piix.c
@@ -26,20 +26,72 @@
#include "qemu/osdep.h"
#include "qemu/range.h"
#include "qapi/error.h"
+#include "qom/object.h"
+#include "hw/acpi/piix4.h"
#include "hw/dma/i8257.h"
+#include "hw/ide/pci.h"
#include "hw/intc/i8259.h"
#include "hw/southbridge/piix.h"
#include "hw/timer/i8254.h"
#include "hw/irq.h"
#include "hw/qdev-properties.h"
#include "hw/isa/isa.h"
+#include "hw/pci/pci.h"
+#include "hw/qdev-properties.h"
+#include "hw/rtc/mc146818rtc.h"
+#include "hw/usb/hcd-uhci.h"
#include "hw/xen/xen.h"
#include "sysemu/runstate.h"
#include "migration/vmstate.h"
#include "hw/acpi/acpi_aml_interface.h"
+#define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */
#define XEN_PIIX_NUM_PIRQS 128ULL
+struct PIIXState {
+ PCIDevice dev;
+
+ /*
+ * bitmap to track pic levels.
+ * The pic level is the logical OR of all the PCI irqs mapped to it
+ * So one PIC level is tracked by PIIX_NUM_PIRQS bits.
+ *
+ * PIRQ is mapped to PIC pins, we track it by
+ * PIIX_NUM_PIRQS * ISA_NUM_IRQS = 64 bits with
+ * pic_irq * PIIX_NUM_PIRQS + pirq
+ */
+#if ISA_NUM_IRQS * PIIX_NUM_PIRQS > 64
+#error "unable to encode pic state in 64bit in pic_levels."
+#endif
+ uint64_t pic_levels;
+
+ /* This member isn't used. Just for save/load compatibility */
+ int32_t pci_irq_levels_vmstate[PIIX_NUM_PIRQS];
+ uint8_t pci_irq_reset_mappings[PIIX_NUM_PIRQS];
+
+ ISAPICState pic;
+ RTCState rtc;
+ PCIIDEState ide;
+ UHCIState uhci;
+ PIIX4PMState pm;
+
+ uint32_t smb_io_base;
+
+ /* Reset Control Register contents */
+ uint8_t rcr;
+
+ /* IO memory region for Reset Control Register (PIIX_RCR_IOPORT) */
+ MemoryRegion rcr_mem;
+
+ bool has_acpi;
+ bool has_usb;
+ bool smm_enabled;
+};
+typedef struct PIIXState PIIXState;
+
+DECLARE_INSTANCE_CHECKER(PIIXState, PIIX_PCI_DEVICE,
+ TYPE_PIIX3_PCI_DEVICE)
+
static void piix_set_irq_pic(PIIXState *piix, int pic_irq)
{
qemu_set_irq(piix->pic.in_irqs[pic_irq],
diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h
index c9fa0f1aa6..0edc23710c 100644
--- a/include/hw/southbridge/piix.h
+++ b/include/hw/southbridge/piix.h
@@ -12,14 +12,6 @@
#ifndef HW_SOUTHBRIDGE_PIIX_H
#define HW_SOUTHBRIDGE_PIIX_H
-#include "hw/pci/pci.h"
-#include "qom/object.h"
-#include "hw/acpi/piix4.h"
-#include "hw/ide/pci.h"
-#include "hw/intc/i8259.h"
-#include "hw/rtc/mc146818rtc.h"
-#include "hw/usb/hcd-uhci.h"
-
/* PIRQRC[A:D]: PIRQx Route Control Registers */
#define PIIX_PIRQCA 0x60
#define PIIX_PIRQCB 0x61
@@ -32,53 +24,7 @@
*/
#define PIIX_RCR_IOPORT 0xcf9
-#define PIIX_NUM_PIRQS 4ULL /* PIRQ[A-D] */
-
-struct PIIXState {
- PCIDevice dev;
-
- /*
- * bitmap to track pic levels.
- * The pic level is the logical OR of all the PCI irqs mapped to it
- * So one PIC level is tracked by PIIX_NUM_PIRQS bits.
- *
- * PIRQ is mapped to PIC pins, we track it by
- * PIIX_NUM_PIRQS * ISA_NUM_IRQS = 64 bits with
- * pic_irq * PIIX_NUM_PIRQS + pirq
- */
-#if ISA_NUM_IRQS * PIIX_NUM_PIRQS > 64
-#error "unable to encode pic state in 64bit in pic_levels."
-#endif
- uint64_t pic_levels;
-
- /* This member isn't used. Just for save/load compatibility */
- int32_t pci_irq_levels_vmstate[PIIX_NUM_PIRQS];
- uint8_t pci_irq_reset_mappings[PIIX_NUM_PIRQS];
-
- ISAPICState pic;
- RTCState rtc;
- PCIIDEState ide;
- UHCIState uhci;
- PIIX4PMState pm;
-
- uint32_t smb_io_base;
-
- /* Reset Control Register contents */
- uint8_t rcr;
-
- /* IO memory region for Reset Control Register (PIIX_RCR_IOPORT) */
- MemoryRegion rcr_mem;
-
- bool has_acpi;
- bool has_usb;
- bool smm_enabled;
-};
-typedef struct PIIXState PIIXState;
-
#define TYPE_PIIX3_PCI_DEVICE "pci-piix3"
-DECLARE_INSTANCE_CHECKER(PIIXState, PIIX_PCI_DEVICE,
- TYPE_PIIX3_PCI_DEVICE)
-
#define TYPE_PIIX3_DEVICE "PIIX3"
#define TYPE_PIIX3_XEN_DEVICE "PIIX3-xen"
#define TYPE_PIIX4_PCI_DEVICE "piix4-isa"
--
2.37.3
- Re: [PATCH 26/42] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional, (continued)
- [PATCH 25/42] hw/isa/piix4: Move pci_ide_create_devs() call to board code, Bernhard Beschow, 2022/09/01
- [PATCH 35/42] hw/isa/piix: Harmonize names of reset control memory regions, Bernhard Beschow, 2022/09/01
- [PATCH 33/42] hw/isa/piix4: Prefix pci_slot_get_pirq() with "piix4_", Bernhard Beschow, 2022/09/01
- [PATCH 40/42] hw/isa/piix: Share PIIX3 base class with PIIX4, Bernhard Beschow, 2022/09/01
- [PATCH 37/42] hw/isa/piix: Rename functions to be shared for interrupt triggering, Bernhard Beschow, 2022/09/01
- [PATCH 38/42] hw/isa/piix: Consolidate IRQ triggering, Bernhard Beschow, 2022/09/01
- [PATCH 29/42] hw/isa/piix4: Use ISA PIC device, Bernhard Beschow, 2022/09/01
- [PATCH 36/42] hw/isa/piix: Reuse PIIX3 base class' realize method in PIIX4, Bernhard Beschow, 2022/09/01
- [PATCH 39/42] hw/isa/piix: Unexport PIIXState,
Bernhard Beschow <=
- [PATCH 34/42] hw/isa/piix3: Merge hw/isa/piix4.c, Bernhard Beschow, 2022/09/01
- [PATCH 42/42] hw/i386/acpi-build: Resolve PIIX ISA bridge rather than ACPI controller, Bernhard Beschow, 2022/09/01
- Re: [PATCH 00/42] Consolidate PIIX south bridges, Bernhard Beschow, 2022/09/08
- Re: [PATCH 00/42] Consolidate PIIX south bridges, Mark Cave-Ayland, 2022/09/18