[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/25] hw/ide: Move IDE DMA related definitions to a separate head
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 20/25] hw/ide: Move IDE DMA related definitions to a separate header ide-dma.h |
Date: |
Wed, 21 Feb 2024 22:16:20 +0100 |
From: Thomas Huth <thuth@redhat.com>
These definitions are required outside of the hw/ide/ code, too,
so lets's move them from internal.h to a new header called ide-dma.h.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240220085505.30255-4-thuth@redhat.com>
[PMD: Use IDEDMAOps typedef in struct IDEDMA]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ide/ide-dma.h | 37 +++++++++++++++++++++++++++++++++++++
include/hw/ide/internal.h | 29 +----------------------------
2 files changed, 38 insertions(+), 28 deletions(-)
create mode 100644 include/hw/ide/ide-dma.h
diff --git a/include/hw/ide/ide-dma.h b/include/hw/ide/ide-dma.h
new file mode 100644
index 0000000000..d0b19ac9c5
--- /dev/null
+++ b/include/hw/ide/ide-dma.h
@@ -0,0 +1,37 @@
+#ifndef HW_IDE_DMA_H
+#define HW_IDE_DMA_H
+
+#include "block/aio.h"
+#include "qemu/iov.h"
+
+typedef struct IDEState IDEState;
+typedef struct IDEDMAOps IDEDMAOps;
+typedef struct IDEDMA IDEDMA;
+
+typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc *);
+typedef void DMAVoidFunc(const IDEDMA *);
+typedef int DMAIntFunc(const IDEDMA *, bool);
+typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len);
+typedef void DMAu32Func(const IDEDMA *, uint32_t);
+typedef void DMAStopFunc(const IDEDMA *, bool);
+
+struct IDEDMAOps {
+ DMAStartFunc *start_dma;
+ DMAVoidFunc *pio_transfer;
+ DMAInt32Func *prepare_buf;
+ DMAu32Func *commit_buf;
+ DMAIntFunc *rw_buf;
+ DMAVoidFunc *restart;
+ DMAVoidFunc *restart_dma;
+ DMAStopFunc *set_inactive;
+ DMAVoidFunc *cmd_done;
+ DMAVoidFunc *reset;
+};
+
+struct IDEDMA {
+ const IDEDMAOps *ops;
+ QEMUIOVector qiov;
+ BlockAIOCB *aiocb;
+};
+
+#endif
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 3bdcc75597..a3a6702eec 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -11,6 +11,7 @@
#include "sysemu/dma.h"
#include "hw/block/block.h"
#include "exec/ioport.h"
+#include "hw/ide/ide-dma.h"
/* debug IDE devices */
#define USE_DMA_CDROM
@@ -18,8 +19,6 @@
typedef struct IDEDevice IDEDevice;
typedef struct IDEState IDEState;
-typedef struct IDEDMA IDEDMA;
-typedef struct IDEDMAOps IDEDMAOps;
#define TYPE_IDE_BUS "IDE"
OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS)
@@ -332,13 +331,6 @@ typedef enum { IDE_HD, IDE_CD, IDE_CFATA } IDEDriveKind;
typedef void EndTransferFunc(IDEState *);
-typedef void DMAStartFunc(const IDEDMA *, IDEState *, BlockCompletionFunc *);
-typedef void DMAVoidFunc(const IDEDMA *);
-typedef int DMAIntFunc(const IDEDMA *, bool);
-typedef int32_t DMAInt32Func(const IDEDMA *, int32_t len);
-typedef void DMAu32Func(const IDEDMA *, uint32_t);
-typedef void DMAStopFunc(const IDEDMA *, bool);
-
struct unreported_events {
bool eject_request;
bool new_media;
@@ -460,25 +452,6 @@ struct IDEState {
int ncq_queues;
};
-struct IDEDMAOps {
- DMAStartFunc *start_dma;
- DMAVoidFunc *pio_transfer;
- DMAInt32Func *prepare_buf;
- DMAu32Func *commit_buf;
- DMAIntFunc *rw_buf;
- DMAVoidFunc *restart;
- DMAVoidFunc *restart_dma;
- DMAStopFunc *set_inactive;
- DMAVoidFunc *cmd_done;
- DMAVoidFunc *reset;
-};
-
-struct IDEDMA {
- const struct IDEDMAOps *ops;
- QEMUIOVector qiov;
- BlockAIOCB *aiocb;
-};
-
struct IDEBus {
BusState qbus;
IDEDevice *master;
--
2.41.0
- [PULL 10/25] hw/i386/pc: Do pc_cmos_init_late() from pc_machine_done(), (continued)
- [PULL 10/25] hw/i386/pc: Do pc_cmos_init_late() from pc_machine_done(), Philippe Mathieu-Daudé, 2024/02/21
- [PULL 11/25] hw/i386/x86: Turn apic_xrupt_override into class attribute, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 12/25] hw/i386/pc: Merge pc_guest_info_init() into pc_machine_initfn(), Philippe Mathieu-Daudé, 2024/02/21
- [PULL 13/25] hw/i386/pc: Defer smbios_set_defaults() to machine_done, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 14/25] hw/i386/pc: Confine system flash handling to pc_sysfw, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 15/25] hw/i386/pc_sysfw: Inline pc_system_flash_create() and remove it, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 16/25] hw/i386/pc_q35: Populate interrupt handlers before realizing LPC PCI function, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 17/25] hw/isa/meson.build: Sort alphabetically, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 18/25] hw/ide: Add the possibility to disable the CompactFlash device in the build, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 19/25] hw/ide: Split qdev.c into ide-bus.c and ide-dev.c, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 20/25] hw/ide: Move IDE DMA related definitions to a separate header ide-dma.h,
Philippe Mathieu-Daudé <=
- [PULL 21/25] hw/ide: Move IDE device related definitions to ide-dev.h, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 23/25] hw/ide: Remove the include/hw/ide.h legacy file, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 22/25] hw/ide: Move IDE bus related definitions to a new header ide-bus.h, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 24/25] hw/ide: Stop exposing internal.h to non-IDE files, Philippe Mathieu-Daudé, 2024/02/21
- [PULL 25/25] hw/sparc/leon3: Fix wrong usage of DO_UPCAST macro, Philippe Mathieu-Daudé, 2024/02/21
- Re: [PULL 00/25] Misc HW patches for 2024-02-21, Philippe Mathieu-Daudé, 2024/02/22