[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 08/43] hw/ide/piix: Introduce TYPE_ macros for PIIX IDE contro
From: |
Bernhard Beschow |
Subject: |
[PATCH v2 08/43] hw/ide/piix: Introduce TYPE_ macros for PIIX IDE controllers |
Date: |
Sat, 22 Oct 2022 17:04:33 +0200 |
Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/i386/pc_piix.c | 3 ++-
hw/ide/piix.c | 5 +++--
hw/isa/piix4.c | 3 ++-
include/hw/ide/piix.h | 7 +++++++
4 files changed, 14 insertions(+), 4 deletions(-)
create mode 100644 include/hw/ide/piix.h
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 5caef9bfc9..e26509a935 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -40,6 +40,7 @@
#include "hw/usb.h"
#include "net/net.h"
#include "hw/ide/pci.h"
+#include "hw/ide/piix.h"
#include "hw/irq.h"
#include "sysemu/kvm.h"
#include "hw/kvm/clock.h"
@@ -260,7 +261,7 @@ static void pc_init1(MachineState *machine,
if (pcmc->pci_enabled) {
PCIDevice *dev;
- dev = pci_create_simple(pci_bus, piix3_devfn + 1, "piix3-ide");
+ dev = pci_create_simple(pci_bus, piix3_devfn + 1, TYPE_PIIX3_IDE);
pci_ide_create_devs(dev);
idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index de1f4f0efb..267dbf37db 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -36,6 +36,7 @@
#include "sysemu/blockdev.h"
#include "sysemu/dma.h"
+#include "hw/ide/piix.h"
#include "hw/ide/pci.h"
#include "trace.h"
@@ -202,7 +203,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo piix3_ide_info = {
- .name = "piix3-ide",
+ .name = TYPE_PIIX3_IDE,
.parent = TYPE_PCI_IDE,
.class_init = piix3_ide_class_init,
};
@@ -224,7 +225,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void
*data)
}
static const TypeInfo piix4_ide_info = {
- .name = "piix4-ide",
+ .name = TYPE_PIIX4_IDE,
.parent = TYPE_PCI_IDE,
.class_init = piix4_ide_class_init,
};
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index c88d3bf3bf..e05e65d3bc 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -28,6 +28,7 @@
#include "hw/irq.h"
#include "hw/southbridge/piix.h"
#include "hw/pci/pci.h"
+#include "hw/ide/piix.h"
#include "hw/isa/isa.h"
#include "hw/intc/i8259.h"
#include "hw/dma/i8257.h"
@@ -277,7 +278,7 @@ static void piix4_init(Object *obj)
PIIX4State *s = PIIX4_PCI_DEVICE(obj);
object_initialize_child(obj, "rtc", &s->rtc, TYPE_MC146818_RTC);
- object_initialize_child(obj, "ide", &s->ide, "piix4-ide");
+ object_initialize_child(obj, "ide", &s->ide, TYPE_PIIX4_IDE);
object_initialize_child(obj, "uhci", &s->uhci, "piix4-usb-uhci");
object_initialize_child(obj, "pm", &s->pm, TYPE_PIIX4_PM);
diff --git a/include/hw/ide/piix.h b/include/hw/ide/piix.h
new file mode 100644
index 0000000000..ef3ef3d62d
--- /dev/null
+++ b/include/hw/ide/piix.h
@@ -0,0 +1,7 @@
+#ifndef HW_IDE_PIIX_H
+#define HW_IDE_PIIX_H
+
+#define TYPE_PIIX3_IDE "piix3-ide"
+#define TYPE_PIIX4_IDE "piix4-ide"
+
+#endif /* HW_IDE_PIIX_H */
--
2.38.1
- [PATCH v2 00/43] Consolidate PIIX south bridges, Bernhard Beschow, 2022/10/22
- [PATCH v2 01/43] hw/i386/pc: Create DMA controllers in south bridges, Bernhard Beschow, 2022/10/22
- [PATCH v2 03/43] hw/isa/piix3: Remove extra ';' outside of functions, Bernhard Beschow, 2022/10/22
- [PATCH v2 02/43] hw/i386/pc_piix: Allow for setting properties before realizing PIIX3 south bridge, Bernhard Beschow, 2022/10/22
- [PATCH v2 04/43] hw/isa/piix3: Add size constraints to rcr_ops, Bernhard Beschow, 2022/10/22
- [PATCH v2 05/43] hw/isa/piix3: Modernize reset handling, Bernhard Beschow, 2022/10/22
- [PATCH v2 06/43] hw/isa/piix3: Prefer pci_address_space() over get_system_memory(), Bernhard Beschow, 2022/10/22
- [PATCH v2 07/43] hw/isa/piix4: Rename wrongly named method, Bernhard Beschow, 2022/10/22
- [PATCH v2 08/43] hw/ide/piix: Introduce TYPE_ macros for PIIX IDE controllers,
Bernhard Beschow <=
- [PATCH v2 09/43] hw/usb/hcd-uhci: Introduce TYPE_ defines for device models, Bernhard Beschow, 2022/10/22
- [PATCH v2 10/43] hw/i386/pc: Create RTC controllers in south bridges, Bernhard Beschow, 2022/10/22
- [PATCH v2 11/43] hw/i386/pc: No need for rtc_state to be an out-parameter, Bernhard Beschow, 2022/10/22
- [PATCH v2 12/43] hw/isa/piix3: Create USB controller in host device, Bernhard Beschow, 2022/10/22
- [PATCH v2 13/43] hw/isa/piix3: Create power management controller in host device, Bernhard Beschow, 2022/10/22
- [PATCH v2 14/43] hw/intc/i8259: Introduce i8259 proxy "isa-pic", Bernhard Beschow, 2022/10/22