Source-Changes-HG archive

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

[src/trunk]: src/sys Add dummy bus_dma(9) typedefs (enabled by __HAVE_NO_BUS_...



details:   https://anonhg.NetBSD.org/src/rev/ee8e605f3cc0
branches:  trunk
changeset: 779171:ee8e605f3cc0
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon May 07 18:16:38 2012 +0000

description:
Add dummy bus_dma(9) typedefs (enabled by __HAVE_NO_BUS_DMA) in <sys/bus.h>
for ports which don't bother to have unnecessary bus_dma(9) implementation
to appease MI driver modules that require bus_dma_tag_t.

For amiga, move <m68k/bus_dma.h> inclusion from <machine/pci_machdep.h>
to <machine/bus.h> since amiga will want actual bus_dma(9) in future
for PCI devices.

Fixes builds on sys/modules/if_axe etc on ancient ports.

"Sounds good" from martin@ on port-m68k@.

diffstat:

 sys/arch/amiga/include/bus.h         |   8 +++++++-
 sys/arch/amiga/include/pci_machdep.h |   4 +---
 sys/arch/cesfic/include/bus.h        |   7 ++++++-
 sys/arch/hp300/include/bus.h         |   7 ++++++-
 sys/arch/luna68k/include/bus.h       |   7 ++++++-
 sys/arch/news68k/include/bus.h       |   7 ++++++-
 sys/sys/bus.h                        |  23 ++++++++++++++++++++++-
 7 files changed, 54 insertions(+), 9 deletions(-)

diffs (150 lines):

diff -r bdef05118bab -r ee8e605f3cc0 sys/arch/amiga/include/bus.h
--- a/sys/arch/amiga/include/bus.h      Mon May 07 17:45:28 2012 +0000
+++ b/sys/arch/amiga/include/bus.h      Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.25 2011/09/21 13:05:32 rkujawa Exp $ */
+/*     $NetBSD: bus.h,v 1.26 2012/05/07 18:16:38 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996 Leo Weppelman.  All rights reserved.
@@ -280,5 +280,11 @@
 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_ */
 
diff -r bdef05118bab -r ee8e605f3cc0 sys/arch/amiga/include/pci_machdep.h
--- a/sys/arch/amiga/include/pci_machdep.h      Mon May 07 17:45:28 2012 +0000
+++ b/sys/arch/amiga/include/pci_machdep.h      Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.h,v 1.4 2012/01/19 00:14:08 rkujawa Exp $ */
+/*     $NetBSD: pci_machdep.h,v 1.5 2012/05/07 18:16:38 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,8 +36,6 @@
 
 #include <machine/intr.h>
 
-#include <m68k/bus_dma.h>
-
 /* #define __HAVE_PCI_CONF_HOOK */
 
 /*
diff -r bdef05118bab -r ee8e605f3cc0 sys/arch/cesfic/include/bus.h
--- a/sys/arch/cesfic/include/bus.h     Mon May 07 17:45:28 2012 +0000
+++ b/sys/arch/cesfic/include/bus.h     Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.h,v 1.1 2011/01/02 08:22:35 tsutsui Exp $ */
+/* $NetBSD: bus.h,v 1.2 2012/05/07 18:16:38 tsutsui Exp $ */
 
 /*
  * XXX: A dummy <machine/bus.h> for MI <sys/bus.h>.
@@ -13,4 +13,9 @@
 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_ */
diff -r bdef05118bab -r ee8e605f3cc0 sys/arch/hp300/include/bus.h
--- a/sys/arch/hp300/include/bus.h      Mon May 07 17:45:28 2012 +0000
+++ b/sys/arch/hp300/include/bus.h      Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.17 2011/02/18 16:05:22 tsutsui Exp $ */
+/*     $NetBSD: bus.h,v 1.18 2012/05/07 18:16:38 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -772,4 +772,9 @@
 
 #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_ */
diff -r bdef05118bab -r ee8e605f3cc0 sys/arch/luna68k/include/bus.h
--- a/sys/arch/luna68k/include/bus.h    Mon May 07 17:45:28 2012 +0000
+++ b/sys/arch/luna68k/include/bus.h    Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.12 2012/02/12 16:34:09 matt Exp $    */
+/*     $NetBSD: bus.h,v 1.13 2012/05/07 18:16:38 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -591,4 +591,9 @@
 
 #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_ */
diff -r bdef05118bab -r ee8e605f3cc0 sys/arch/news68k/include/bus.h
--- a/sys/arch/news68k/include/bus.h    Mon May 07 17:45:28 2012 +0000
+++ b/sys/arch/news68k/include/bus.h    Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.8 2008/04/28 20:23:30 martin Exp $   */
+/*     $NetBSD: bus.h,v 1.9 2012/05/07 18:16:38 tsutsui Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -591,4 +591,9 @@
 
 #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_ */
diff -r bdef05118bab -r ee8e605f3cc0 sys/sys/bus.h
--- a/sys/sys/bus.h     Mon May 07 17:45:28 2012 +0000
+++ b/sys/sys/bus.h     Mon May 07 18:16:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.10 2011/09/01 15:10:32 christos Exp $        */
+/*     $NetBSD: bus.h,v 1.11 2012/05/07 18:16:38 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -224,4 +224,25 @@
 
 #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_ */



Home | Main Index | Thread Index | Old Index