Port-m68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Incomplete bus.h



martin@ wrote:

> On Mon, May 07, 2012 at 02:05:01AM +0900, Izumi Tsutsui wrote:
> > After some thought, adding a new file could be a bit troublesome
> > so how about adding #ifdef __HAVE_NO_BUS_DMA in <sys/bus.h> instead?
> > At least if_axe.o compiles for news68k.
> 
> Sounds good to me.

I'll commit the attached changes tomorrow.
(only module builds are tested though)

Notes:
- for amiga I just move #include <m68k/bus_dma.h>
  from <machine/pci_machdep.h> to <machine/bus.h>
  because it would want real bus_dma implementation
- sun3 already has (incomplete) bus_dma(9) stuff
  for unreachable MI wscons so no change is necessary

---
Izumi Tsutsui


Index: sys/sys/bus.h
===================================================================
RCS file: /cvsroot/src/sys/sys/bus.h,v
retrieving revision 1.10
diff -u -p -r1.10 bus.h
--- sys/sys/bus.h       1 Sep 2011 15:10:32 -0000       1.10
+++ sys/sys/bus.h       6 May 2012 18:36:20 -0000
@@ -224,4 +224,25 @@ bool       bus_space_handle_is_equal(bus_space
 
 #endif /* __HAVE_NEW_STYLE_BUS_H */
 
+#ifdef __HAVE_NO_BUS_DMA
+/*
+ * XXX
+ * Dummy bus_dma(9) stuff for ports which don't bother to have
+ * unnecessary bus_dma(9) implementation to appease MI driver modules etc.
+ */
+typedef void *bus_dma_tag_t;
+
+typedef struct bus_dma_segment {
+       bus_addr_t ds_addr;
+       bus_size_t ds_len;
+} bus_dma_segment_t;
+
+typedef struct bus_dmamap {
+       bus_size_t dm_maxsegsz;
+       bus_size_t dm_mapsize;
+       int dm_nsegs;
+       bus_dma_segment_t *dm_segs;
+} *bus_dmamap_t;
+#endif /* __HAVE_NO_BUS_DMA */
+
 #endif /* _SYS_BUS_H_ */
Index: sys/arch/amiga/include/bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/include/bus.h,v
retrieving revision 1.25
diff -u -p -r1.25 bus.h
--- sys/arch/amiga/include/bus.h        21 Sep 2011 13:05:32 -0000      1.25
+++ sys/arch/amiga/include/bus.h        6 May 2012 18:36:20 -0000
@@ -280,5 +280,11 @@ extern const struct amiga_bus_space_meth
 extern const struct amiga_bus_space_methods amiga_bus_stride_4swap;
 extern const struct amiga_bus_space_methods amiga_bus_stride_16;
 
+/*
+ * XXX
+ * amiga doesn't have actual bus_dma(9) implementation for PCI devices yet.
+ */
+#include <m68k/bus_dma.h>
+
 #endif /* _AMIGA_BUS_H_ */
 
Index: sys/arch/amiga/include/pci_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/amiga/include/pci_machdep.h,v
retrieving revision 1.4
diff -u -p -r1.4 pci_machdep.h
--- sys/arch/amiga/include/pci_machdep.h        19 Jan 2012 00:14:08 -0000      
1.4
+++ sys/arch/amiga/include/pci_machdep.h        6 May 2012 18:36:20 -0000
@@ -36,8 +36,6 @@
 
 #include <machine/intr.h>
 
-#include <m68k/bus_dma.h>
-
 /* #define __HAVE_PCI_CONF_HOOK */
 
 /*
Index: sys/arch/cesfic/include/bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/cesfic/include/bus.h,v
retrieving revision 1.1
diff -u -p -r1.1 bus.h
--- sys/arch/cesfic/include/bus.h       2 Jan 2011 08:22:35 -0000       1.1
+++ sys/arch/cesfic/include/bus.h       6 May 2012 18:36:20 -0000
@@ -13,4 +13,9 @@ typedef psize_t       bus_size_t;
 typedef int     bus_space_tag_t;
 typedef int     bus_space_handle_t;
 
+/*
+ * There is no bus_dma(9)'fied bus drivers on this port.
+ */
+#define __HAVE_NO_BUS_DMA
+
 #endif /* _MACHINE_BUS_H_ */
Index: sys/arch/hp300/include/bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/hp300/include/bus.h,v
retrieving revision 1.17
diff -u -p -r1.17 bus.h
--- sys/arch/hp300/include/bus.h        18 Feb 2011 16:05:22 -0000      1.17
+++ sys/arch/hp300/include/bus.h        6 May 2012 18:36:20 -0000
@@ -772,4 +772,9 @@ __HP300_copy_region_N(4)
 
 #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
 
+/*
+ * There is no bus_dma(9)'fied bus drivers on this port.
+ */
+#define __HAVE_NO_BUS_DMA
+ 
 #endif /* _HP300_BUS_H_ */
Index: sys/arch/luna68k/include/bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/luna68k/include/bus.h,v
retrieving revision 1.12
diff -u -p -r1.12 bus.h
--- sys/arch/luna68k/include/bus.h      12 Feb 2012 16:34:09 -0000      1.12
+++ sys/arch/luna68k/include/bus.h      6 May 2012 18:36:20 -0000
@@ -591,4 +591,9 @@ __MACHINE_copy_region_N(4)
 
 #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
 
+/*
+ * There is no bus_dma(9)'fied bus drivers on this port.
+ */
+#define __HAVE_NO_BUS_DMA
+ 
 #endif /* _MACHINE_BUS_H_ */
Index: sys/arch/news68k/include/bus.h
===================================================================
RCS file: /cvsroot/src/sys/arch/news68k/include/bus.h,v
retrieving revision 1.8
diff -u -p -r1.8 bus.h
--- sys/arch/news68k/include/bus.h      28 Apr 2008 20:23:30 -0000      1.8
+++ sys/arch/news68k/include/bus.h      6 May 2012 18:36:20 -0000
@@ -591,4 +591,9 @@ __NEWS68K_copy_region_N(4)
 
 #define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
 
+/*
+ * There is no bus_dma(9)'fied bus drivers on this port.
+ */
+#define __HAVE_NO_BUS_DMA
+
 #endif /* _NEWS68K_BUS_H_ */


Home | Main Index | Thread Index | Old Index