diff mbox series

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

Message ID 20230105131038.49549-1-philmd@linaro.org
State New
Headers show
Series hw/dma/rc4030: Move RC4030 declarations to its own 'rc4030.h' header | expand

Commit Message

Philippe Mathieu-Daudé Jan. 5, 2023, 1:10 p.m. UTC
RC4030 declarations are not MIPS specific, no need to
have them in all MIPS boards.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
Based-on: <20230105130710.49264-1-philmd@linaro.org>
          "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

Comments

Hervé Poussineau Jan. 5, 2023, 10:11 p.m. UTC | #1
Le 05/01/2023 à 14:10, Philippe Mathieu-Daudé a écrit :
> RC4030 declarations are not MIPS specific, no need to
> have them in all MIPS boards.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> Based-on: <20230105130710.49264-1-philmd@linaro.org>
>            "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

Acked-by: Hervé Poussineau <hpoussin@reactos.org>

> 
> diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
> index aa1d323a36..6dbf6652ab 100644
> --- a/hw/dma/rc4030.c
> +++ b/hw/dma/rc4030.c
> @@ -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"
> diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
> index 6aefe9a61b..03882b5275 100644
> --- a/hw/mips/jazz.c
> +++ b/hw/mips/jazz.c
> @@ -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"
> diff --git a/include/hw/dma/rc4030.h b/include/hw/dma/rc4030.h
> new file mode 100644
> index 0000000000..e58f94576e
> --- /dev/null
> +++ b/include/hw/dma/rc4030.h
> @@ -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
> diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
> index 4d2db99952..34dd583500 100644
> --- a/include/hw/mips/mips.h
> +++ b/include/hw/mips/mips.h
> @@ -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
Bernhard Beschow Jan. 5, 2023, 10:25 p.m. UTC | #2
Am 5. Januar 2023 13:10:38 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>RC4030 declarations are not MIPS specific, no need to
>have them in all MIPS boards.
>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>---
>Based-on: <20230105130710.49264-1-philmd@linaro.org>
>          "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
>
>diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
>index aa1d323a36..6dbf6652ab 100644
>--- a/hw/dma/rc4030.c
>+++ b/hw/dma/rc4030.c
>@@ -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"
>diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
>index 6aefe9a61b..03882b5275 100644
>--- a/hw/mips/jazz.c
>+++ b/hw/mips/jazz.c
>@@ -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"
>diff --git a/include/hw/dma/rc4030.h b/include/hw/dma/rc4030.h
>new file mode 100644
>index 0000000000..e58f94576e
>--- /dev/null
>+++ b/include/hw/dma/rc4030.h
>@@ -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
>diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
>index 4d2db99952..34dd583500 100644
>--- a/include/hw/mips/mips.h
>+++ b/include/hw/mips/mips.h
>@@ -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: Bernhard Beschow <shentey@gmail.com>
diff mbox series

Patch

diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index aa1d323a36..6dbf6652ab 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -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"
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index 6aefe9a61b..03882b5275 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -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"
diff --git a/include/hw/dma/rc4030.h b/include/hw/dma/rc4030.h
new file mode 100644
index 0000000000..e58f94576e
--- /dev/null
+++ b/include/hw/dma/rc4030.h
@@ -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
diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
index 4d2db99952..34dd583500 100644
--- a/include/hw/mips/mips.h
+++ b/include/hw/mips/mips.h
@@ -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