Skip to contentSkip to conversation

hw/dma/rc4030: Move RC4030 declarations to its own 'rc4030.h' header

PATCH In review Philippe Mathieu-Daudé 3 participants 3 messages Jan 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/dma/rc4030: Move RC4030 declarations to its own 'rc4030.h' header

RC4030 declarations are not MIPS specific, no need to have them in all MIPS boards.

---
Based-on: <[email protected]>
"hw/pci-host/bonito: Housekeeping"

---
 hw/dma/rc4030.c         |  2 +-
 hw/mips/jazz.c          |  1 +
 include/hw/dma/rc4030.h | 21 +++++++++++++++++++++
 include/hw/mips/mips.h  |  9 ---------
 4 files changed, 23 insertions(+), 10 deletions(-)
 create mode 100644 include/hw/dma/rc4030.h
hw/dma/rc4030.c +1 -1
index aa1d323a36..6dbf6652ab 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "hw/irq.h"
-#include "hw/mips/mips.h"
+#include "hw/dma/rc4030.h"
 #include "hw/sysbus.h"
 #include "migration/vmstate.h"
 #include "qapi/error.h"
hw/mips/jazz.c +1 -0
index 6aefe9a61b..03882b5275 100644
@@ -29,6 +29,7 @@
 #include "hw/mips/cpudevs.h"
 #include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
+#include "hw/dma/rc4030.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
 #include "hw/isa/isa.h"
include/hw/dma/rc4030.h new file +21 -0
new file mode 100644
index 0000000000..e58f94576e
@@ -0,0 +1,21 @@
+/*
+ * QEMU JAZZ RC4030 chipset
+ *
+ * Copyright (c) 2007-2013 Hervé Poussineau
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef HW_DMA_RC4030_H
+#define HW_DMA_RC4030_H
+
+#include "exec/memory.h"
+
+/* rc4030.c */
+typedef struct rc4030DMAState *rc4030_dma;
+void rc4030_dma_read(void *dma, uint8_t *buf, int len);
+void rc4030_dma_write(void *dma, uint8_t *buf, int len);
+
+DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr);
+
+#endif
include/hw/mips/mips.h +0 -9
index 4d2db99952..34dd583500 100644
@@ -7,13 +7,4 @@
 /* Kernels can be configured with 64KB pages */
 #define INITRD_PAGE_SIZE (64 * KiB)
 
-#include "exec/memory.h"
-
-/* rc4030.c */
-typedef struct rc4030DMAState *rc4030_dma;
-void rc4030_dma_read(void *dma, uint8_t *buf, int len);
-void rc4030_dma_write(void *dma, uint8_t *buf, int len);
-
-DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr);
-
 #endif
Signature · 1 line
2.38.1
Acked-by on v1 1/1
#1 lore raw

Le 05/01/2023 à 14:10, Philippe Mathieu-Daudé a écrit :

Quoted 7 lines

RC4030 declarations are not MIPS specific, no need to have them in all MIPS boards.

---
Based-on: <[email protected]>
"hw/pci-host/bonito: Housekeeping"

Quoted 7 lines
---
  hw/dma/rc4030.c         |  2 +-
  hw/mips/jazz.c          |  1 +
  include/hw/dma/rc4030.h | 21 +++++++++++++++++++++
  include/hw/mips/mips.h  |  9 ---------
  4 files changed, 23 insertions(+), 10 deletions(-)

create mode 100644 include/hw/dma/rc4030.h

Quoted 71 lines
hw/dma/rc4030.c +1 -1
index aa1d323a36..6dbf6652ab 100644
@@ -25,7 +25,7 @@
  #include "qemu/osdep.h"
  #include "qemu/units.h"
  #include "hw/irq.h"
-#include "hw/mips/mips.h"
+#include "hw/dma/rc4030.h"
  #include "hw/sysbus.h"
  #include "migration/vmstate.h"
  #include "qapi/error.h"
hw/mips/jazz.c +1 -0
index 6aefe9a61b..03882b5275 100644
@@ -29,6 +29,7 @@
  #include "hw/mips/cpudevs.h"
  #include "hw/intc/i8259.h"
  #include "hw/dma/i8257.h"
+#include "hw/dma/rc4030.h"
  #include "hw/char/serial.h"
  #include "hw/char/parallel.h"
  #include "hw/isa/isa.h"
include/hw/dma/rc4030.h new file +21 -0
new file mode 100644
index 0000000000..e58f94576e
@@ -0,0 +1,21 @@
+/*
+ * QEMU JAZZ RC4030 chipset
+ *
+ * Copyright (c) 2007-2013 Hervé Poussineau
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef HW_DMA_RC4030_H
+#define HW_DMA_RC4030_H
+
+#include "exec/memory.h"
+
+/* rc4030.c */
+typedef struct rc4030DMAState *rc4030_dma;
+void rc4030_dma_read(void *dma, uint8_t *buf, int len);
+void rc4030_dma_write(void *dma, uint8_t *buf, int len);
+
+DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr);
+
+#endif
include/hw/mips/mips.h +0 -9
index 4d2db99952..34dd583500 100644
@@ -7,13 +7,4 @@
  /* Kernels can be configured with 64KB pages */
  #define INITRD_PAGE_SIZE (64 * KiB)
 
-#include "exec/memory.h"
-
-/* rc4030.c */
-typedef struct rc4030DMAState *rc4030_dma;
-void rc4030_dma_read(void *dma, uint8_t *buf, int len);
-void rc4030_dma_write(void *dma, uint8_t *buf, int len);
-
-DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr);
-
  #endif
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé

Am 5. Januar 2023 13:10:38 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:

Quoted 75 lines

RC4030 declarations are not MIPS specific, no need to have them in all MIPS boards.

---
Based-on: <[email protected]>
"hw/pci-host/bonito: Housekeeping"
---

hw/dma/rc4030.c         |  2 +-
hw/mips/jazz.c          |  1 +
include/hw/dma/rc4030.h | 21 +++++++++++++++++++++
include/hw/mips/mips.h  |  9 ---------
4 files changed, 23 insertions(+), 10 deletions(-)

create mode 100644 include/hw/dma/rc4030.h

hw/dma/rc4030.c +1 -1
index aa1d323a36..6dbf6652ab 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "hw/irq.h"
-#include "hw/mips/mips.h"
+#include "hw/dma/rc4030.h"
 #include "hw/sysbus.h"
 #include "migration/vmstate.h"
 #include "qapi/error.h"
hw/mips/jazz.c +1 -0
index 6aefe9a61b..03882b5275 100644
@@ -29,6 +29,7 @@
 #include "hw/mips/cpudevs.h"
 #include "hw/intc/i8259.h"
 #include "hw/dma/i8257.h"
+#include "hw/dma/rc4030.h"
 #include "hw/char/serial.h"
 #include "hw/char/parallel.h"
 #include "hw/isa/isa.h"
include/hw/dma/rc4030.h new file +21 -0
new file mode 100644
index 0000000000..e58f94576e
@@ -0,0 +1,21 @@
+/*
+ * QEMU JAZZ RC4030 chipset
+ *
+ * Copyright (c) 2007-2013 Hervé Poussineau
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef HW_DMA_RC4030_H
+#define HW_DMA_RC4030_H
+
+#include "exec/memory.h"
+
+/* rc4030.c */
+typedef struct rc4030DMAState *rc4030_dma;
+void rc4030_dma_read(void *dma, uint8_t *buf, int len);
+void rc4030_dma_write(void *dma, uint8_t *buf, int len);
+
+DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr);
+
+#endif
include/hw/mips/mips.h +0 -0
index 4d2db99952..34dd583500 100644
@@ -7,13 +7,4 @@
 /* Kernels can be configured with 64KB pages */
 #define INITRD_PAGE_SIZE (64 * KiB)
 

include/hw/mips/mips.h line 10

Quoted 10 lines
include/hw/mips/mips.h +0 -9
-#include "exec/memory.h"
-
-/* rc4030.c */
-typedef struct rc4030DMAState *rc4030_dma;
-void rc4030_dma_read(void *dma, uint8_t *buf, int len);
-void rc4030_dma_write(void *dma, uint8_t *buf, int len);
-
-DeviceState *rc4030_init(rc4030_dma **dmas, IOMMUMemoryRegion **dma_mr);
-
 #endif