[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 100/126] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/id
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 100/126] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h' |
Date: |
Mon, 27 Feb 2023 15:01:47 +0100 |
"hw/ide.h" is a mixed bag of lost IDE declarations.
Extract mmio_ide_init_drives() and the TYPE_MMIO_IDE QOM
declarations to a new "hw/ide/mmio.h" header.
Document the SysBus interface.
Message-Id: <20230215112712.23110-4-philmd@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ide/mmio.c | 5 +----
hw/sh4/r2d.c | 2 +-
include/hw/ide.h | 3 ---
include/hw/ide/mmio.h | 26 ++++++++++++++++++++++++++
4 files changed, 28 insertions(+), 8 deletions(-)
create mode 100644 include/hw/ide/mmio.h
diff --git a/hw/ide/mmio.c b/hw/ide/mmio.c
index 08493930b7..6bf9048b1e 100644
--- a/hw/ide/mmio.c
+++ b/hw/ide/mmio.c
@@ -29,9 +29,9 @@
#include "qemu/module.h"
#include "sysemu/dma.h"
+#include "hw/ide/mmio.h"
#include "hw/ide/internal.h"
#include "hw/qdev-properties.h"
-#include "qom/object.h"
/***********************************************************/
/* MMIO based ide port
@@ -39,9 +39,6 @@
* dedicated ide controller, which is often seen on embedded boards.
*/
-#define TYPE_MMIO_IDE "mmio-ide"
-OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE)
-
struct MMIOIDEState {
/*< private >*/
SysBusDevice parent_obj;
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index d7020d6d2b..826a0a31b5 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -38,7 +38,7 @@
#include "hw/qdev-properties.h"
#include "net/net.h"
#include "sh7750_regs.h"
-#include "hw/ide.h"
+#include "hw/ide/mmio.h"
#include "hw/irq.h"
#include "hw/loader.h"
#include "hw/usb.h"
diff --git a/include/hw/ide.h b/include/hw/ide.h
index 60f1f4f714..5f8c36b2aa 100644
--- a/include/hw/ide.h
+++ b/include/hw/ide.h
@@ -8,9 +8,6 @@
ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
DriveInfo *hd0, DriveInfo *hd1);
-/* ide-mmio.c */
-void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1);
-
int ide_get_geometry(BusState *bus, int unit,
int16_t *cyls, int8_t *heads, int8_t *secs);
int ide_get_bios_chs_trans(BusState *bus, int unit);
diff --git a/include/hw/ide/mmio.h b/include/hw/ide/mmio.h
new file mode 100644
index 0000000000..d726a49848
--- /dev/null
+++ b/include/hw/ide/mmio.h
@@ -0,0 +1,26 @@
+/*
+ * QEMU IDE Emulation: mmio support (for embedded).
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ * Copyright (c) 2006 Openedhand Ltd.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef HW_IDE_MMIO_H
+#define HW_IDE_MMIO_H
+
+#include "qom/object.h"
+
+/*
+ * QEMU interface:
+ * + sysbus IRQ 0: asserted by the IDE channel
+ * + sysbus MMIO region 0: data registers
+ * + sysbus MMIO region 1: status & control registers
+ */
+#define TYPE_MMIO_IDE "mmio-ide"
+OBJECT_DECLARE_SIMPLE_TYPE(MMIOIDEState, MMIO_IDE)
+
+void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1);
+
+#endif
--
2.38.1
- [PULL 091/126] hw/display/sm501: Implement more 2D raster operations, (continued)
- [PULL 091/126] hw/display/sm501: Implement more 2D raster operations, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 092/126] hw/display/sm501: Add fallbacks to pixman routines, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 093/126] hw/ppc/sam460ex: Correctly set MAL properties, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 094/126] block/vvfat: Remove pointless check of NDEBUG, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 095/126] scripts/checkpatch.pl: Do not allow assert(0), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 096/126] MAINTAINERS: Mark IDE and Floppy as "Odd Fixes", Philippe Mathieu-Daudé, 2023/02/27
- [PULL 099/126] hw/ide/mmio: Use CamelCase for MMIO_IDE state name, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 101/126] hw/ide/isa: Extract TYPE_ISA_IDE declarations to 'hw/ide/isa.h', Philippe Mathieu-Daudé, 2023/02/27
- [PULL 103/126] hw/ide/atapi: Restrict 'scsi/constants.h' inclusion, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 098/126] hw/ide/ahci: Trace ncq write command as write instead of read, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 100/126] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h',
Philippe Mathieu-Daudé <=
- [PULL 102/126] hw/ide/isa: Remove intermediate ISAIDEState::irq variable, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 097/126] hw/i386/xen: Remove unused 'hw/ide.h' include from header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 105/126] hw/ide: Include 'exec/ioport.h' instead of 'hw/isa/isa.h', Philippe Mathieu-Daudé, 2023/02/27
- [PULL 107/126] hw/ide: Rename ide_set_irq() -> ide_bus_set_irq(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 106/126] hw/ide: Un-inline ide_set_irq(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 108/126] hw/ide: Rename ide_create_drive() -> ide_bus_create_drive(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 111/126] hw/ide: Rename ide_init2() -> ide_bus_init_output_irq(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 112/126] hw/ide: Rename idebus_active_if() -> ide_bus_active_if(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 116/126] hw/ide/piix: Remove unused includes, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 104/126] hw/ide: Remove unused 'qapi/qapi-types-run-state.h', Philippe Mathieu-Daudé, 2023/02/27