Module Name: src Committed By: tsutsui Date: Mon May 7 18:16:38 UTC 2012
Modified Files: src/sys/arch/amiga/include: bus.h pci_machdep.h src/sys/arch/cesfic/include: bus.h src/sys/arch/hp300/include: bus.h src/sys/arch/luna68k/include: bus.h src/sys/arch/news68k/include: bus.h src/sys/sys: bus.h Log Message: 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@. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amiga/include/bus.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amiga/include/pci_machdep.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/cesfic/include/bus.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp300/include/bus.h cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/include/bus.h cvs rdiff -u -r1.8 -r1.9 src/sys/arch/news68k/include/bus.h cvs rdiff -u -r1.10 -r1.11 src/sys/sys/bus.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amiga/include/bus.h diff -u src/sys/arch/amiga/include/bus.h:1.25 src/sys/arch/amiga/include/bus.h:1.26 --- src/sys/arch/amiga/include/bus.h:1.25 Wed Sep 21 13:05:32 2011 +++ src/sys/arch/amiga/include/bus.h Mon May 7 18:16:38 2012 @@ -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_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: src/sys/arch/amiga/include/pci_machdep.h diff -u src/sys/arch/amiga/include/pci_machdep.h:1.4 src/sys/arch/amiga/include/pci_machdep.h:1.5 --- src/sys/arch/amiga/include/pci_machdep.h:1.4 Thu Jan 19 00:14:08 2012 +++ src/sys/arch/amiga/include/pci_machdep.h Mon May 7 18:16:38 2012 @@ -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 */ /* Index: src/sys/arch/cesfic/include/bus.h diff -u src/sys/arch/cesfic/include/bus.h:1.1 src/sys/arch/cesfic/include/bus.h:1.2 --- src/sys/arch/cesfic/include/bus.h:1.1 Sun Jan 2 08:22:35 2011 +++ src/sys/arch/cesfic/include/bus.h Mon May 7 18:16:38 2012 @@ -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 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: src/sys/arch/hp300/include/bus.h diff -u src/sys/arch/hp300/include/bus.h:1.17 src/sys/arch/hp300/include/bus.h:1.18 --- src/sys/arch/hp300/include/bus.h:1.17 Fri Feb 18 16:05:22 2011 +++ src/sys/arch/hp300/include/bus.h Mon May 7 18:16:38 2012 @@ -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 @@ __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: src/sys/arch/luna68k/include/bus.h diff -u src/sys/arch/luna68k/include/bus.h:1.12 src/sys/arch/luna68k/include/bus.h:1.13 --- src/sys/arch/luna68k/include/bus.h:1.12 Sun Feb 12 16:34:09 2012 +++ src/sys/arch/luna68k/include/bus.h Mon May 7 18:16:38 2012 @@ -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 @@ __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: src/sys/arch/news68k/include/bus.h diff -u src/sys/arch/news68k/include/bus.h:1.8 src/sys/arch/news68k/include/bus.h:1.9 --- src/sys/arch/news68k/include/bus.h:1.8 Mon Apr 28 20:23:30 2008 +++ src/sys/arch/news68k/include/bus.h Mon May 7 18:16:38 2012 @@ -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 @@ __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_ */ Index: src/sys/sys/bus.h diff -u src/sys/sys/bus.h:1.10 src/sys/sys/bus.h:1.11 --- src/sys/sys/bus.h:1.10 Thu Sep 1 15:10:32 2011 +++ src/sys/sys/bus.h Mon May 7 18:16:38 2012 @@ -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 @@ 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_ */