Port-m68k archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Incomplete bus.h
martin@ wrote:
> On Sun, May 06, 2012 at 12:09:03AM +0900, Izumi Tsutsui wrote:
> > To appease unusable USB modules for ancient ports,
> > it's less confusing to add dummy bus_dma typedef's
> > like arch/mmeye/include/bus_defs.h.
>
> That is a good idea (though in case of Amiga, if the pci_machdep.h include
> is correct, we should move that instead).
>
> > (should we have MI bus_dma_dummy.h or so?)
>
> Sounds like a good idea as well.
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.
---
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 16:57:00 -0000
@@ -224,4 +224,24 @@ bool bus_space_handle_is_equal(bus_space
#endif /* __HAVE_NEW_STYLE_BUS_H */
+#ifdef __HAVE_NO_BUS_DMA
+/*
+ * Dummy bus_dma(9) stuff for ports which don't need bus_dma(9) implementation
+ * to appease MI drivers that require bus_dma_tag_t 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/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 16:57:00 -0000
@@ -591,4 +591,9 @@ __NEWS68K_copy_region_N(4)
#define BUS_SPACE_ALIGNED_POINTER(p, t) ALIGNED_POINTER(p, t)
+/*
+ * news68k doesn't have bus_dma(9)'fied bus drivers
+ */
+#define __HAVE_NO_BUS_DMA
+
#endif /* _NEWS68K_BUS_H_ */
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index