From 7dd7f8baa25f376a1037f751afe9ff92b1e0a635 Mon Sep 17 00:00:00 2001 From: fvdl Date: Sun, 15 Jun 2003 23:08:53 +0000 Subject: [PATCH] Handle 64bit DMA addresses on PCI for platforms that can (currently only enabled on amd64). Add a dmat64 field to various PCI attach structures, and pass it down where needed. Implement a simple new function called pci_dma64_available(pa) to test if 64bit DMA addresses may be used. This returns 1 iff _PCI_HAVE_DMA64 is defined in , and there is more than 4G of memory. --- sys/arch/algor/algor/machdep.c | 3 ++- sys/arch/algor/dev/bonito_mainbus.c | 3 ++- sys/arch/algor/dev/vtpbc_mainbus.c | 4 +++- sys/arch/algor/include/bus.h | 4 +++- sys/arch/alpha/include/bus.h | 4 +++- sys/arch/alpha/pci/a12c.c | 7 ++++--- sys/arch/alpha/pci/apecs.c | 5 +++-- sys/arch/alpha/pci/cia.c | 5 +++-- sys/arch/alpha/pci/dwlpx.c | 5 +++-- sys/arch/alpha/pci/irongate.c | 5 +++-- sys/arch/alpha/pci/lca.c | 5 +++-- sys/arch/alpha/pci/mcpcia.c | 5 +++-- sys/arch/alpha/pci/tsc.c | 5 +++-- sys/arch/alpha/pci/ttwoga.c | 5 +++-- sys/arch/amd64/amd64/mainbus.c | 3 ++- sys/arch/amd64/include/pci_machdep.h | 4 +++- sys/arch/arc/include/bus.h | 4 +++- sys/arch/arc/pci/necpb.c | 3 ++- sys/arch/arm/footbridge/footbridge.c | 5 +++-- sys/arch/arm/include/bus.h | 4 +++- sys/arch/arm/ixp12x0/ixp12x0.c | 5 +++-- sys/arch/arm/s3c2xx0/s3c2800_pci.c | 3 ++- sys/arch/arm/xscale/becc.c | 3 ++- sys/arch/arm/xscale/i80312.c | 3 ++- sys/arch/arm/xscale/i80321.c | 3 ++- sys/arch/atari/include/bus.h | 4 +++- sys/arch/bebox/bebox/mainbus.c | 3 ++- sys/arch/cobalt/dev/gt.c | 3 ++- sys/arch/cobalt/include/bus.h | 4 +++- sys/arch/dreamcast/dev/g2/gapspci.c | 3 ++- sys/arch/dreamcast/include/bus.h | 4 +++- sys/arch/evbarm/ifpga/ifpga.c | 3 ++- sys/arch/evbmips/malta/dev/gt.c | 4 ++-- sys/arch/evbppc/walnut/pci/pchb.c | 3 ++- sys/arch/hp700/include/bus.h | 4 +++- sys/arch/hpcmips/include/bus.h | 4 +++- sys/arch/hpcmips/vr/vrc4172pci.c | 3 ++- sys/arch/hpcmips/vr/vrpciu.c | 3 ++- sys/arch/hpcsh/include/bus.h | 4 +++- sys/arch/i386/i386/mainbus.c | 5 +++-- sys/arch/i386/pci/pchb.c | 5 +++-- sys/arch/macppc/include/bus.h | 4 +++- sys/arch/macppc/pci/bandit.c | 3 ++- sys/arch/macppc/pci/grackle.c | 3 ++- sys/arch/macppc/pci/uninorth.c | 3 ++- sys/arch/mipsco/include/bus.h | 4 +++- sys/arch/mvmeppc/mvmeppc/mainbus.c | 3 ++- sys/arch/newsmips/include/bus.h | 4 +++- sys/arch/ofppc/firepower/firepower.c | 3 ++- sys/arch/ofppc/include/bus.h | 4 +++- sys/arch/playstation2/include/bus.h | 4 +++- sys/arch/pmax/include/bus.h | 4 +++- sys/arch/powerpc/include/bus.h | 4 +++- sys/arch/powerpc/include/ibm4xx/bus.h | 4 +++- sys/arch/prep/prep/mainbus.c | 3 ++- sys/arch/sandpoint/sandpoint/mainbus.c | 3 ++- sys/arch/sgimips/include/bus.h | 4 +++- sys/arch/sgimips/pci/macepci.c | 3 ++- sys/arch/sh5/include/bus.h | 4 +++- sys/arch/sparc/include/bus.h | 4 +++- sys/arch/sparc/sparc/msiiep.c | 5 +++-- sys/arch/sparc64/dev/psycho.c | 3 ++- sys/arch/sparc64/include/bus.h | 4 +++- sys/arch/sun68k/include/bus.h | 4 +++- sys/arch/vax/include/bus.h | 4 +++- sys/arch/x68k/include/bus.h | 5 ++++- sys/arch/x86/include/bus.h | 4 +++- sys/arch/x86/include/pci_machdep.h | 5 ++++- sys/arch/x86/pci/pci_machdep.c | 26 ++++++++++++++++++++++++-- sys/dev/pci/if_bge.c | 7 +++++-- sys/dev/pci/pci.c | 19 +++++++++++++++++-- sys/dev/pci/pcivar.h | 7 ++++++- sys/dev/pci/ppb.c | 5 +++-- 73 files changed, 237 insertions(+), 93 deletions(-) diff --git a/sys/arch/algor/algor/machdep.c b/sys/arch/algor/algor/machdep.c index 8727186ad330..23ba21a657fe 100644 --- a/sys/arch/algor/algor/machdep.c +++ b/sys/arch/algor/algor/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.20 2003/06/14 17:01:07 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.21 2003/06/15 23:08:53 fvdl Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -804,6 +804,7 @@ algor_get_ethaddr(struct pci_attach_args *pa, u_int8_t *buf) * XXX doesn't completely suck. */ pa->pa_dmat = &p4032_configuration.ac_pci_pf_dmat; + pa->pa_dmat64 = NULL; #endif return (1); } diff --git a/sys/arch/algor/dev/bonito_mainbus.c b/sys/arch/algor/dev/bonito_mainbus.c index 9ef28a5d216a..e7a427ae85b2 100644 --- a/sys/arch/algor/dev/bonito_mainbus.c +++ b/sys/arch/algor/dev/bonito_mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: bonito_mainbus.c,v 1.6 2003/01/01 00:35:30 thorpej Exp $ */ +/* $NetBSD: bonito_mainbus.c,v 1.7 2003/06/15 23:08:54 fvdl Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -112,6 +112,7 @@ bonito_mainbus_attach(struct device *parent, struct device *self, void *aux) pba.pba_iot = &acp->ac_iot; pba.pba_memt = &acp->ac_memt; pba.pba_dmat = &acp->ac_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &acp->ac_pc; } #endif /* ALGOR_P6032 */ diff --git a/sys/arch/algor/dev/vtpbc_mainbus.c b/sys/arch/algor/dev/vtpbc_mainbus.c index 516254bfd52e..f7eadd71a57f 100644 --- a/sys/arch/algor/dev/vtpbc_mainbus.c +++ b/sys/arch/algor/dev/vtpbc_mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: vtpbc_mainbus.c,v 1.10 2003/01/01 00:35:30 thorpej Exp $ */ +/* $NetBSD: vtpbc_mainbus.c,v 1.11 2003/06/15 23:08:54 fvdl Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -121,6 +121,7 @@ vtpbc_mainbus_attach(struct device *parent, struct device *self, void *aux) pba.pba_iot = &acp->ac_iot; pba.pba_memt = &acp->ac_memt; pba.pba_dmat = &acp->ac_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &acp->ac_pc; } #elif defined(ALGOR_P5064) @@ -130,6 +131,7 @@ vtpbc_mainbus_attach(struct device *parent, struct device *self, void *aux) pba.pba_iot = &acp->ac_iot; pba.pba_memt = &acp->ac_memt; pba.pba_dmat = &acp->ac_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &acp->ac_pc; } #endif /* ALGOR_P4032 || ALGOR_P5064 */ diff --git a/sys/arch/algor/include/bus.h b/sys/arch/algor/include/bus.h index a35fd7f06cdf..28512b209460 100644 --- a/sys/arch/algor/include/bus.h +++ b/sys/arch/algor/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.7 2003/01/28 01:07:52 kent Exp $ */ +/* $NetBSD: bus.h,v 1.8 2003/06/15 23:08:54 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -529,6 +529,8 @@ struct uio; typedef struct algor_bus_dma_tag *bus_dma_tag_t; typedef struct algor_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/alpha/include/bus.h b/sys/arch/alpha/include/bus.h index 5f7d294a8423..7e10795f1c2c 100644 --- a/sys/arch/alpha/include/bus.h +++ b/sys/arch/alpha/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.48 2003/01/28 01:07:52 kent Exp $ */ +/* $NetBSD: bus.h,v 1.49 2003/06/15 23:08:54 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -550,6 +550,8 @@ typedef enum { typedef struct alpha_bus_dma_tag *bus_dma_tag_t; typedef struct alpha_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/alpha/pci/a12c.c b/sys/arch/alpha/pci/a12c.c index 471cfec2d575..497ae6da3003 100644 --- a/sys/arch/alpha/pci/a12c.c +++ b/sys/arch/alpha/pci/a12c.c @@ -1,4 +1,4 @@ -/* $NetBSD: a12c.c,v 1.13 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: a12c.c,v 1.14 2003/06/15 23:08:54 fvdl Exp $ */ /* [Notice revision 2.2] * Copyright (c) 1997, 1998 Avalon Computer Systems, Inc. @@ -38,7 +38,7 @@ #include "opt_avalon_a12.h" /* Config options headers */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.13 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: a12c.c,v 1.14 2003/06/15 23:08:54 fvdl Exp $"); #include #include @@ -143,7 +143,7 @@ a12cattach(parent, self, aux) a12c_init(ccp, 1); /* XXX print chipset information */ - printf(": driver %s over logic %x\n", "$Revision: 1.13 $", + printf(": driver %s over logic %x\n", "$Revision: 1.14 $", A12_ALL_EXTRACT(REGVAL(A12_VERS))); pci_a12_pickintr(ccp); @@ -154,6 +154,7 @@ a12cattach(parent, self, aux) pba.pba_iot = 0; pba.pba_memt = ccp->ac_memt; pba.pba_dmat = &ccp->ac_dmat_direct; + pba.pba_dmat64 = NULL; pba.pba_pc = &ccp->ac_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/apecs.c b/sys/arch/alpha/pci/apecs.c index 4ca841ec93dd..a817b48ef0b3 100644 --- a/sys/arch/alpha/pci/apecs.c +++ b/sys/arch/alpha/pci/apecs.c @@ -1,4 +1,4 @@ -/* $NetBSD: apecs.c,v 1.42 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: apecs.c,v 1.43 2003/06/15 23:08:54 fvdl Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: apecs.c,v 1.42 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apecs.c,v 1.43 2003/06/15 23:08:54 fvdl Exp $"); #include #include @@ -245,6 +245,7 @@ apecsattach(parent, self, aux) pba.pba_memt = &acp->ac_memt; pba.pba_dmat = alphabus_dma_get_tag(&acp->ac_dmat_direct, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &acp->ac_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/cia.c b/sys/arch/alpha/pci/cia.c index c613cca45407..b118d508a7b3 100644 --- a/sys/arch/alpha/pci/cia.c +++ b/sys/arch/alpha/pci/cia.c @@ -1,4 +1,4 @@ -/* $NetBSD: cia.c,v 1.61 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: cia.c,v 1.62 2003/06/15 23:08:54 fvdl Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.61 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cia.c,v 1.62 2003/06/15 23:08:54 fvdl Exp $"); #include #include @@ -415,6 +415,7 @@ ciaattach(parent, self, aux) pba.pba_memt = &ccp->cc_memt; pba.pba_dmat = alphabus_dma_get_tag(&ccp->cc_dmat_direct, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &ccp->cc_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/dwlpx.c b/sys/arch/alpha/pci/dwlpx.c index c2e926c1e8e7..f95918ad0323 100644 --- a/sys/arch/alpha/pci/dwlpx.c +++ b/sys/arch/alpha/pci/dwlpx.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwlpx.c,v 1.27 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: dwlpx.c,v 1.28 2003/06/15 23:08:54 fvdl Exp $ */ /* * Copyright (c) 1997 by Matthew Jacob @@ -32,7 +32,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.27 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwlpx.c,v 1.28 2003/06/15 23:08:54 fvdl Exp $"); #include #include @@ -171,6 +171,7 @@ dwlpxattach(parent, self, aux) pba.pba_memt = &sc->dwlpx_cc.cc_memt; pba.pba_dmat = /* start with direct, may change... */ alphabus_dma_get_tag(&sc->dwlpx_cc.cc_dmat_direct, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &sc->dwlpx_cc.cc_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/irongate.c b/sys/arch/alpha/pci/irongate.c index 2a0afe81e43d..a2a21ed756c5 100644 --- a/sys/arch/alpha/pci/irongate.c +++ b/sys/arch/alpha/pci/irongate.c @@ -1,4 +1,4 @@ -/* $NetBSD: irongate.c,v 1.10 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: irongate.c,v 1.11 2003/06/15 23:08:55 fvdl Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: irongate.c,v 1.10 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: irongate.c,v 1.11 2003/06/15 23:08:55 fvdl Exp $"); #include #include @@ -183,6 +183,7 @@ irongate_attach(struct device *parent, struct device *self, void *aux) pba.pba_memt = &icp->ic_memt; pba.pba_dmat = alphabus_dma_get_tag(&icp->ic_dmat_pci, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &icp->ic_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/lca.c b/sys/arch/alpha/pci/lca.c index 8af16462c968..d9bd21b1d18f 100644 --- a/sys/arch/alpha/pci/lca.c +++ b/sys/arch/alpha/pci/lca.c @@ -1,4 +1,4 @@ -/* $NetBSD: lca.c,v 1.40 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: lca.c,v 1.41 2003/06/15 23:08:55 fvdl Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -69,7 +69,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.40 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lca.c,v 1.41 2003/06/15 23:08:55 fvdl Exp $"); #include #include @@ -249,6 +249,7 @@ lcaattach(parent, self, aux) pba.pba_memt = &lcp->lc_memt; pba.pba_dmat = alphabus_dma_get_tag(&lcp->lc_dmat_direct, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &lcp->lc_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/mcpcia.c b/sys/arch/alpha/pci/mcpcia.c index 171097a2d1b2..d0a31ec60fb4 100644 --- a/sys/arch/alpha/pci/mcpcia.c +++ b/sys/arch/alpha/pci/mcpcia.c @@ -1,4 +1,4 @@ -/* $NetBSD: mcpcia.c,v 1.16 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: mcpcia.c,v 1.17 2003/06/15 23:08:55 fvdl Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.16 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcpcia.c,v 1.17 2003/06/15 23:08:55 fvdl Exp $"); #include #include @@ -212,6 +212,7 @@ mcpciaattach(parent, self, aux) pba.pba_memt = &ccp->cc_memt; pba.pba_dmat = /* start with direct, may change... */ alphabus_dma_get_tag(&ccp->cc_dmat_direct, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &ccp->cc_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/tsc.c b/sys/arch/alpha/pci/tsc.c index c0cbb594d999..56d548838251 100644 --- a/sys/arch/alpha/pci/tsc.c +++ b/sys/arch/alpha/pci/tsc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tsc.c,v 1.10 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: tsc.c,v 1.11 2003/06/15 23:08:55 fvdl Exp $ */ /*- * Copyright (c) 1999 by Ross Harvey. All rights reserved. @@ -35,7 +35,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.10 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.11 2003/06/15 23:08:55 fvdl Exp $"); #include #include @@ -195,6 +195,7 @@ tspattach(parent, self, aux) pba.pba_memt = &pcp->pc_memt; pba.pba_dmat = alphabus_dma_get_tag(&pcp->pc_dmat_direct, ALPHA_BUS_PCI); + pba.pba_dmat64 = NULL; pba.pba_pc = &pcp->pc_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/alpha/pci/ttwoga.c b/sys/arch/alpha/pci/ttwoga.c index a831454f8ea6..d2f527604cba 100644 --- a/sys/arch/alpha/pci/ttwoga.c +++ b/sys/arch/alpha/pci/ttwoga.c @@ -1,4 +1,4 @@ -/* $NetBSD: ttwoga.c,v 1.6 2003/01/01 00:39:20 thorpej Exp $ */ +/* $NetBSD: ttwoga.c,v 1.7 2003/06/15 23:08:55 fvdl Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: ttwoga.c,v 1.6 2003/01/01 00:39:20 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ttwoga.c,v 1.7 2003/06/15 23:08:55 fvdl Exp $"); #include #include @@ -264,6 +264,7 @@ ttwopciattach(struct device *parent, struct device *self, void *aux) npba.pba_memt = &tcp->tc_memt; npba.pba_dmat = alphabus_dma_get_tag(&tcp->tc_dmat_direct, ALPHA_BUS_PCI); + npba.pba_dmat64 = NULL; npba.pba_pc = &tcp->tc_pc; npba.pba_bus = 0; npba.pba_bridgetag = NULL; diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c index 4f2c54005a9b..bd06b9274d67 100644 --- a/sys/arch/amd64/amd64/mainbus.c +++ b/sys/arch/amd64/amd64/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.5 2003/05/29 20:22:33 fvdl Exp $ */ +/* $NetBSD: mainbus.c,v 1.6 2003/06/15 23:08:55 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -218,6 +218,7 @@ mainbus_attach(parent, self, aux) mba.mba_pba.pba_iot = X86_BUS_SPACE_IO; mba.mba_pba.pba_memt = X86_BUS_SPACE_MEM; mba.mba_pba.pba_dmat = &pci_bus_dma_tag; + mba.mba_pba.pba_dmat64 = &pci_bus_dma64_tag; mba.mba_pba.pba_pc = NULL; mba.mba_pba.pba_flags = pci_bus_flags(); mba.mba_pba.pba_bus = 0; diff --git a/sys/arch/amd64/include/pci_machdep.h b/sys/arch/amd64/include/pci_machdep.h index f3469f9d94f2..4464fd21adc9 100644 --- a/sys/arch/amd64/include/pci_machdep.h +++ b/sys/arch/amd64/include/pci_machdep.h @@ -1,3 +1,5 @@ -/* $NetBSD: pci_machdep.h,v 1.1 2003/04/26 18:39:45 fvdl Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.2 2003/06/15 23:08:55 fvdl Exp $ */ + +#define _PCI_HAVE_DMA64 #include diff --git a/sys/arch/arc/include/bus.h b/sys/arch/arc/include/bus.h index 677b5bfc552f..8b45da8d1094 100644 --- a/sys/arch/arc/include/bus.h +++ b/sys/arch/arc/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.15 2003/01/28 01:07:53 kent Exp $ */ +/* $NetBSD: bus.h,v 1.16 2003/06/15 23:08:55 fvdl Exp $ */ /* NetBSD: bus.h,v 1.27 2000/03/15 16:44:50 drochner Exp */ /* $OpenBSD: bus.h,v 1.15 1999/08/11 23:15:21 niklas Exp $ */ @@ -711,6 +711,8 @@ struct uio; typedef struct arc_bus_dma_tag *bus_dma_tag_t; typedef struct arc_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/arc/pci/necpb.c b/sys/arch/arc/pci/necpb.c index cef8dc59afd3..4555b790fec9 100644 --- a/sys/arch/arc/pci/necpb.c +++ b/sys/arch/arc/pci/necpb.c @@ -1,4 +1,4 @@ -/* $NetBSD: necpb.c,v 1.14 2003/01/01 00:32:05 thorpej Exp $ */ +/* $NetBSD: necpb.c,v 1.15 2003/06/15 23:08:56 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -240,6 +240,7 @@ necpbattach(parent, self, aux) pba.pba_iot = &sc->sc_ncp->nc_iot; pba.pba_memt = &sc->sc_ncp->nc_memt; pba.pba_dmat = &sc->sc_ncp->nc_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &sc->sc_ncp->nc_pc; pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; pba.pba_bus = 0; diff --git a/sys/arch/arm/footbridge/footbridge.c b/sys/arch/arm/footbridge/footbridge.c index 1dd09fcba162..29c30a76aa6c 100644 --- a/sys/arch/arm/footbridge/footbridge.c +++ b/sys/arch/arm/footbridge/footbridge.c @@ -1,4 +1,4 @@ -/* $NetBSD: footbridge.c,v 1.13 2003/03/23 14:12:25 chris Exp $ */ +/* $NetBSD: footbridge.c,v 1.14 2003/06/15 23:08:56 fvdl Exp $ */ /* * Copyright (c) 1997,1998 Mark Brinicombe. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: footbridge.c,v 1.13 2003/03/23 14:12:25 chris Exp $"); +__KERNEL_RCSID(0, "$NetBSD: footbridge.c,v 1.14 2003/06/15 23:08:56 fvdl Exp $"); #include #include @@ -213,6 +213,7 @@ footbridge_attach(parent, self, aux) fba.fba_pba.pba_iot = &footbridge_pci_io_bs_tag; fba.fba_pba.pba_memt = &footbridge_pci_mem_bs_tag; fba.fba_pba.pba_dmat = &footbridge_pci_bus_dma_tag; + fba.fba_pba.pba_dmat64 = NULL; fba.fba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; fba.fba_pba.pba_bus = 0; fba.fba_pba.pba_bridgetag = NULL; diff --git a/sys/arch/arm/include/bus.h b/sys/arch/arm/include/bus.h index 27096016b582..be2b03af1124 100644 --- a/sys/arch/arm/include/bus.h +++ b/sys/arch/arm/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.9 2003/01/28 01:07:53 kent Exp $ */ +/* $NetBSD: bus.h,v 1.10 2003/06/15 23:08:56 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -655,6 +655,8 @@ struct uio; typedef struct arm32_bus_dma_tag *bus_dma_tag_t; typedef struct arm32_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/arm/ixp12x0/ixp12x0.c b/sys/arch/arm/ixp12x0/ixp12x0.c index 47c00babe500..34da45be4476 100644 --- a/sys/arch/arm/ixp12x0/ixp12x0.c +++ b/sys/arch/arm/ixp12x0/ixp12x0.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixp12x0.c,v 1.7 2003/03/25 06:12:46 igy Exp $ */ +/* $NetBSD: ixp12x0.c,v 1.8 2003/06/15 23:08:56 fvdl Exp $ */ /* * Copyright (c) 2002, 2003 * Ichiro FUKUHARA . @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ixp12x0.c,v 1.7 2003/03/25 06:12:46 igy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixp12x0.c,v 1.8 2003/06/15 23:08:56 fvdl Exp $"); #include #include @@ -184,6 +184,7 @@ ixp12x0_attach(sc) pba.pba_iot = &sc->ia_pci_iot; pba.pba_memt = &sc->ia_pci_memt; pba.pba_dmat = &sc->ia_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_bus = 0; /* bus number = 0 */ pba.pba_intrswiz = 0; /* XXX */ pba.pba_intrtag = 0; diff --git a/sys/arch/arm/s3c2xx0/s3c2800_pci.c b/sys/arch/arm/s3c2xx0/s3c2800_pci.c index 91f2e21ae0fa..f397a1637223 100644 --- a/sys/arch/arm/s3c2xx0/s3c2800_pci.c +++ b/sys/arch/arm/s3c2xx0/s3c2800_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: s3c2800_pci.c,v 1.4 2003/05/12 07:49:10 bsh Exp $ */ +/* $NetBSD: s3c2800_pci.c,v 1.5 2003/06/15 23:08:57 fvdl Exp $ */ /* * Copyright (c) 2002 Fujitsu Component Limited @@ -336,6 +336,7 @@ sspci_attach(struct device *parent, struct device *self, void *aux) pci_pba.pba_iot = &sspci_io_tag; pci_pba.pba_memt = &sspci_mem_tag; pci_pba.pba_dmat = pci_dma_tag; + pci_pba.pba_dmat64 = NULL; pci_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; pci_pba.pba_bus = 0; pci_pba.pba_bridgetag = NULL; diff --git a/sys/arch/arm/xscale/becc.c b/sys/arch/arm/xscale/becc.c index 1107da60b0d5..5ab2ff157e61 100644 --- a/sys/arch/arm/xscale/becc.c +++ b/sys/arch/arm/xscale/becc.c @@ -1,4 +1,4 @@ -/* $NetBSD: becc.c,v 1.5 2003/05/30 18:38:02 thorpej Exp $ */ +/* $NetBSD: becc.c,v 1.6 2003/06/15 23:08:57 fvdl Exp $ */ /* * Copyright (c) 2002, 2003 Wasabi Systems, Inc. @@ -201,6 +201,7 @@ becc_attach(struct becc_softc *sc) pba.pba_iot = &sc->sc_pci_iot; pba.pba_memt = &sc->sc_pci_memt; pba.pba_dmat = &sc->sc_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &sc->sc_pci_chipset; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/arm/xscale/i80312.c b/sys/arch/arm/xscale/i80312.c index d98dc7749a9a..639c9c3a9bf7 100644 --- a/sys/arch/arm/xscale/i80312.c +++ b/sys/arch/arm/xscale/i80312.c @@ -1,4 +1,4 @@ -/* $NetBSD: i80312.c,v 1.13 2003/01/01 00:46:15 thorpej Exp $ */ +/* $NetBSD: i80312.c,v 1.14 2003/06/15 23:08:57 fvdl Exp $ */ /* * Copyright (c) 2001, 2002 Wasabi Systems, Inc. @@ -276,6 +276,7 @@ i80312_attach(struct i80312_softc *sc) pba.pba_iot = &sc->sc_pci_iot; pba.pba_memt = &sc->sc_pci_memt; pba.pba_dmat = &sc->sc_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &sc->sc_pci_chipset; pba.pba_bus = PPB_BUSINFO_SECONDARY(preg); pba.pba_bridgetag = NULL; diff --git a/sys/arch/arm/xscale/i80321.c b/sys/arch/arm/xscale/i80321.c index 3a83d697dc50..dfdc2f3fe033 100644 --- a/sys/arch/arm/xscale/i80321.c +++ b/sys/arch/arm/xscale/i80321.c @@ -1,4 +1,4 @@ -/* $NetBSD: i80321.c,v 1.12 2003/02/06 03:16:48 briggs Exp $ */ +/* $NetBSD: i80321.c,v 1.13 2003/06/15 23:08:57 fvdl Exp $ */ /* * Copyright (c) 2002 Wasabi Systems, Inc. @@ -269,6 +269,7 @@ i80321_attach(struct i80321_softc *sc) pba.pba_iot = &sc->sc_pci_iot; pba.pba_memt = &sc->sc_pci_memt; pba.pba_dmat = &sc->sc_pci_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &sc->sc_pci_chipset; pba.pba_bus = preg; pba.pba_bridgetag = NULL; diff --git a/sys/arch/atari/include/bus.h b/sys/arch/atari/include/bus.h index 72e8ebaa67f4..906de5a32775 100644 --- a/sys/arch/atari/include/bus.h +++ b/sys/arch/atari/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.29 2003/01/28 01:07:56 kent Exp $ */ +/* $NetBSD: bus.h,v 1.30 2003/06/15 23:08:57 fvdl Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -574,6 +574,8 @@ struct uio; typedef struct atari_bus_dma_tag *bus_dma_tag_t; typedef struct atari_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/bebox/bebox/mainbus.c b/sys/arch/bebox/bebox/mainbus.c index 89db43f72173..de65657e1893 100644 --- a/sys/arch/bebox/bebox/mainbus.c +++ b/sys/arch/bebox/bebox/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.15 2003/02/02 20:43:17 matt Exp $ */ +/* $NetBSD: mainbus.c,v 1.16 2003/06/15 23:08:57 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -109,6 +109,7 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) mba.mba_pba.pba_iot = &bebox_io_bs_tag; mba.mba_pba.pba_memt = &bebox_mem_bs_tag; mba.mba_pba.pba_dmat = &pci_bus_dma_tag; + mba.mba_pba.pba_dmat64 = NULL; mba.mba_pba.pba_bus = 0; mba.mba_pba.pba_bridgetag = NULL; mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; diff --git a/sys/arch/cobalt/dev/gt.c b/sys/arch/cobalt/dev/gt.c index 929672390bd5..8daa9e89fe2e 100644 --- a/sys/arch/cobalt/dev/gt.c +++ b/sys/arch/cobalt/dev/gt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gt.c,v 1.7 2002/10/02 05:07:44 thorpej Exp $ */ +/* $NetBSD: gt.c,v 1.8 2003/06/15 23:08:58 fvdl Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -83,6 +83,7 @@ gt_attach(parent, self, aux) #if NPCI > 0 pba.pba_busname = "pci"; pba.pba_dmat = &pci_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/cobalt/include/bus.h b/sys/arch/cobalt/include/bus.h index 539172ce0b27..24f808cbb545 100644 --- a/sys/arch/cobalt/include/bus.h +++ b/sys/arch/cobalt/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.9 2003/01/28 01:07:56 kent Exp $ */ +/* $NetBSD: bus.h,v 1.10 2003/06/15 23:08:58 fvdl Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -505,6 +505,8 @@ struct uio; typedef struct cobalt_bus_dma_tag *bus_dma_tag_t; typedef struct cobalt_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/dreamcast/dev/g2/gapspci.c b/sys/arch/dreamcast/dev/g2/gapspci.c index 62b0bcd31e90..f4e65021d1ac 100644 --- a/sys/arch/dreamcast/dev/g2/gapspci.c +++ b/sys/arch/dreamcast/dev/g2/gapspci.c @@ -1,4 +1,4 @@ -/* $NetBSD: gapspci.c,v 1.9 2003/01/01 01:28:29 thorpej Exp $ */ +/* $NetBSD: gapspci.c,v 1.10 2003/06/15 23:08:58 fvdl Exp $ */ /*- * Copyright (c) 2001 Marcus Comstedt @@ -125,6 +125,7 @@ gaps_attach(struct device *parent, struct device *self, void *aux) pba.pba_busname = "pci"; pba.pba_memt = sc->sc_memt; pba.pba_dmat = &sc->sc_dmat; + pba.pba_dmat64 = NULL; pba.pba_bus = 0; pba.pba_bridgetag = NULL; pba.pba_flags = PCI_FLAGS_MEM_ENABLED; diff --git a/sys/arch/dreamcast/include/bus.h b/sys/arch/dreamcast/include/bus.h index f2663b0910ab..536a4fbe3f0a 100644 --- a/sys/arch/dreamcast/include/bus.h +++ b/sys/arch/dreamcast/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.7 2003/01/28 01:07:57 kent Exp $ */ +/* $NetBSD: bus.h,v 1.8 2003/06/15 23:08:58 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -481,6 +481,8 @@ struct uio; typedef struct dreamcast_bus_dma_tag *bus_dma_tag_t; typedef struct dreamcast_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/evbarm/ifpga/ifpga.c b/sys/arch/evbarm/ifpga/ifpga.c index df18bc0595e0..498990348f1d 100644 --- a/sys/arch/evbarm/ifpga/ifpga.c +++ b/sys/arch/evbarm/ifpga/ifpga.c @@ -1,4 +1,4 @@ -/* $NetBSD: ifpga.c,v 1.14 2003/01/01 01:29:59 thorpej Exp $ */ +/* $NetBSD: ifpga.c,v 1.15 2003/06/15 23:08:58 fvdl Exp $ */ /* * Copyright (c) 2001 ARM Ltd @@ -343,6 +343,7 @@ ifpga_attach(struct device *parent, struct device *self, void *aux) pci_pba.pba_iot = &ifpga_pci_io_tag; pci_pba.pba_memt = &ifpga_pci_mem_tag; pci_pba.pba_dmat = &ifpga_pci_bus_dma_tag; + pci_pba.pba_dmat64 = NULL; pci_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; pci_pba.pba_bus = 0; pci_pba.pba_bridgetag = NULL; diff --git a/sys/arch/evbmips/malta/dev/gt.c b/sys/arch/evbmips/malta/dev/gt.c index 022b1c54474a..dcae49737296 100644 --- a/sys/arch/evbmips/malta/dev/gt.c +++ b/sys/arch/evbmips/malta/dev/gt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gt.c,v 1.5 2002/10/02 15:45:17 thorpej Exp $ */ +/* $NetBSD: gt.c,v 1.6 2003/06/15 23:08:59 fvdl Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -119,7 +119,7 @@ gt_attach(parent, self, aux) pba.pba_iot = &mcp->mc_iot; pba.pba_memt = &mcp->mc_memt; pba.pba_dmat = &mcp->mc_pci_dmat; /* pci_bus_dma_tag */ - //pba.pba_dmat = &pci_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_pc = &mcp->mc_pc; config_found(self, &pba, gt_print); diff --git a/sys/arch/evbppc/walnut/pci/pchb.c b/sys/arch/evbppc/walnut/pci/pchb.c index e70b1d8ea7b6..ead6272f5ac6 100644 --- a/sys/arch/evbppc/walnut/pci/pchb.c +++ b/sys/arch/evbppc/walnut/pci/pchb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pchb.c,v 1.1 2002/12/09 12:16:25 scw Exp $ */ +/* $NetBSD: pchb.c,v 1.2 2003/06/15 23:08:59 fvdl Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -162,6 +162,7 @@ pchbattach(struct device *parent, struct device *self, void *aux) /* PCI memory window is directly mapped */ pba.pba_memt = ibm4xx_make_bus_space_tag(0, 0); pba.pba_dmat = &ibm4xx_default_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_bus = 0; pba.pba_bridgetag = NULL; pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED; diff --git a/sys/arch/hp700/include/bus.h b/sys/arch/hp700/include/bus.h index a3361d4e02c5..40ad6baa0551 100644 --- a/sys/arch/hp700/include/bus.h +++ b/sys/arch/hp700/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.4 2003/01/28 01:07:58 kent Exp $ */ +/* $NetBSD: bus.h,v 1.5 2003/06/15 23:08:59 fvdl Exp $ */ /* $OpenBSD: bus.h,v 1.13 2001/07/30 14:15:59 art Exp $ */ @@ -330,6 +330,8 @@ struct uio; typedef const struct hppa_bus_dma_tag *bus_dma_tag_t; typedef struct hppa_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/hpcmips/include/bus.h b/sys/arch/hpcmips/include/bus.h index c72f8345993d..8125408bf1ad 100644 --- a/sys/arch/hpcmips/include/bus.h +++ b/sys/arch/hpcmips/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.16 2003/01/28 01:07:58 kent Exp $ */ +/* $NetBSD: bus.h,v 1.17 2003/06/15 23:08:59 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -951,6 +951,8 @@ typedef struct bus_dma_segment bus_dma_segment_t; typedef struct bus_dmamap *bus_dmamap_t; #endif /* ! BUS_DMA_MD_TYPES */ +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus DMA operaion table */ diff --git a/sys/arch/hpcmips/vr/vrc4172pci.c b/sys/arch/hpcmips/vr/vrc4172pci.c index e24a7ee5b318..35014a732c6d 100644 --- a/sys/arch/hpcmips/vr/vrc4172pci.c +++ b/sys/arch/hpcmips/vr/vrc4172pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: vrc4172pci.c,v 1.8 2003/01/01 01:40:28 thorpej Exp $ */ +/* $NetBSD: vrc4172pci.c,v 1.9 2003/06/15 23:09:00 fvdl Exp $ */ /*- * Copyright (c) 2002 TAKEMURA Shin @@ -196,6 +196,7 @@ vrc4172pci_attach(struct device *parent, struct device *self, void *aux) pba.pba_iot = sc->sc_iot; pba.pba_memt = sc->sc_iot; pba.pba_dmat = &hpcmips_default_bus_dma_tag.bdt; + pba.pba_dmat64 = NULL; pba.pba_bus = 0; pba.pba_bridgetag = NULL; pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED | diff --git a/sys/arch/hpcmips/vr/vrpciu.c b/sys/arch/hpcmips/vr/vrpciu.c index a1cd32d306e1..22ca3b19ab0b 100644 --- a/sys/arch/hpcmips/vr/vrpciu.c +++ b/sys/arch/hpcmips/vr/vrpciu.c @@ -1,4 +1,4 @@ -/* $NetBSD: vrpciu.c,v 1.12 2003/01/01 01:40:28 thorpej Exp $ */ +/* $NetBSD: vrpciu.c,v 1.13 2003/06/15 23:09:00 fvdl Exp $ */ /*- * Copyright (c) 2001 Enami Tsugutomo. @@ -297,6 +297,7 @@ vrpciu_attach(struct device *parent, struct device *self, void *aux) */ pba.pba_memt = sc->sc_iot; pba.pba_dmat = &hpcmips_default_bus_dma_tag.bdt; + pba.pba_dmat64 = NULL; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/hpcsh/include/bus.h b/sys/arch/hpcsh/include/bus.h index 015a8b43a720..00c3062d26cf 100644 --- a/sys/arch/hpcsh/include/bus.h +++ b/sys/arch/hpcsh/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.8 2003/01/28 01:07:59 kent Exp $ */ +/* $NetBSD: bus.h,v 1.9 2003/06/15 23:09:00 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998, 2000, 2001, 2002 The NetBSD Foundation, Inc. @@ -626,6 +626,8 @@ struct uio; typedef struct hpcsh_bus_dma_tag *bus_dma_tag_t; typedef struct hpcsh_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/i386/i386/mainbus.c b/sys/arch/i386/i386/mainbus.c index 261794484cd5..66a8e7f3894f 100644 --- a/sys/arch/i386/i386/mainbus.c +++ b/sys/arch/i386/i386/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.51 2003/05/29 20:22:31 fvdl Exp $ */ +/* $NetBSD: mainbus.c,v 1.52 2003/06/15 23:09:01 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.51 2003/05/29 20:22:31 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.52 2003/06/15 23:09:01 fvdl Exp $"); #include #include @@ -291,6 +291,7 @@ mainbus_attach(parent, self, aux) mba.mba_pba.pba_iot = X86_BUS_SPACE_IO; mba.mba_pba.pba_memt = X86_BUS_SPACE_MEM; mba.mba_pba.pba_dmat = &pci_bus_dma_tag; + mba.mba_pba.pba_dmat64 = NULL; mba.mba_pba.pba_pc = NULL; mba.mba_pba.pba_flags = pci_bus_flags(); mba.mba_pba.pba_bus = 0; diff --git a/sys/arch/i386/pci/pchb.c b/sys/arch/i386/pci/pchb.c index e72293f57709..30821085b060 100644 --- a/sys/arch/i386/pci/pchb.c +++ b/sys/arch/i386/pci/pchb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pchb.c,v 1.42 2003/04/16 07:37:09 scw Exp $ */ +/* $NetBSD: pchb.c,v 1.43 2003/06/15 23:09:01 fvdl Exp $ */ /*- * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.42 2003/04/16 07:37:09 scw Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.43 2003/06/15 23:09:01 fvdl Exp $"); #include #include @@ -313,6 +313,7 @@ pchbattach(struct device *parent, struct device *self, void *aux) pba.pba_iot = pa->pa_iot; pba.pba_memt = pa->pa_memt; pba.pba_dmat = pa->pa_dmat; + pba.pba_dmat64 = pa->pa_dmat64; pba.pba_pc = pa->pa_pc; pba.pba_flags = attachflags; pba.pba_bus = pbnum; diff --git a/sys/arch/macppc/include/bus.h b/sys/arch/macppc/include/bus.h index 536f8a8ec32a..d49041dfee48 100644 --- a/sys/arch/macppc/include/bus.h +++ b/sys/arch/macppc/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.15 2003/01/28 01:08:01 kent Exp $ */ +/* $NetBSD: bus.h,v 1.16 2003/06/15 23:09:01 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -779,6 +779,8 @@ struct uio; typedef struct macppc_bus_dma_tag *bus_dma_tag_t; typedef struct macppc_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/macppc/pci/bandit.c b/sys/arch/macppc/pci/bandit.c index 9ae2f7cf1d43..4869b7bdeeda 100644 --- a/sys/arch/macppc/pci/bandit.c +++ b/sys/arch/macppc/pci/bandit.c @@ -1,4 +1,4 @@ -/* $NetBSD: bandit.c,v 1.21 2003/01/01 01:47:31 thorpej Exp $ */ +/* $NetBSD: bandit.c,v 1.22 2003/06/15 23:09:02 fvdl Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -122,6 +122,7 @@ bandit_attach(parent, self, aux) pba.pba_memt = pc->memt; pba.pba_iot = pc->iot; pba.pba_dmat = &pci_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_bus = pc->bus; pba.pba_bridgetag = NULL; pba.pba_pc = pc; diff --git a/sys/arch/macppc/pci/grackle.c b/sys/arch/macppc/pci/grackle.c index 377ce5403afc..e604359e7596 100644 --- a/sys/arch/macppc/pci/grackle.c +++ b/sys/arch/macppc/pci/grackle.c @@ -1,4 +1,4 @@ -/* $NetBSD: grackle.c,v 1.6 2003/01/01 01:47:31 thorpej Exp $ */ +/* $NetBSD: grackle.c,v 1.7 2003/06/15 23:09:02 fvdl Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -122,6 +122,7 @@ grackle_attach(parent, self, aux) pba.pba_memt = pc->memt; pba.pba_iot = pc->iot; pba.pba_dmat = &pci_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_bus = pc->bus; pba.pba_bridgetag = NULL; pba.pba_pc = pc; diff --git a/sys/arch/macppc/pci/uninorth.c b/sys/arch/macppc/pci/uninorth.c index c1df98471045..bbe31745aa5b 100644 --- a/sys/arch/macppc/pci/uninorth.c +++ b/sys/arch/macppc/pci/uninorth.c @@ -1,4 +1,4 @@ -/* $NetBSD: uninorth.c,v 1.7 2003/01/01 01:47:31 thorpej Exp $ */ +/* $NetBSD: uninorth.c,v 1.8 2003/06/15 23:09:02 fvdl Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -134,6 +134,7 @@ uninorth_attach(parent, self, aux) pba.pba_memt = pc->memt; pba.pba_iot = pc->iot; pba.pba_dmat = &pci_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_bus = pc->bus; pba.pba_bridgetag = NULL; pba.pba_pc = pc; diff --git a/sys/arch/mipsco/include/bus.h b/sys/arch/mipsco/include/bus.h index 644556a69f22..fd120dff1296 100644 --- a/sys/arch/mipsco/include/bus.h +++ b/sys/arch/mipsco/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.10 2003/01/28 01:08:02 kent Exp $ */ +/* $NetBSD: bus.h,v 1.11 2003/06/15 23:09:02 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -803,6 +803,8 @@ struct uio; typedef struct mipsco_bus_dma_tag *bus_dma_tag_t; typedef struct mipsco_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/mvmeppc/mvmeppc/mainbus.c b/sys/arch/mvmeppc/mvmeppc/mainbus.c index 4d17b57b60b9..782a7f93d2fb 100644 --- a/sys/arch/mvmeppc/mvmeppc/mainbus.c +++ b/sys/arch/mvmeppc/mvmeppc/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.5 2003/01/01 01:53:00 thorpej Exp $ */ +/* $NetBSD: mainbus.c,v 1.6 2003/06/15 23:09:02 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -121,6 +121,7 @@ mainbus_attach(parent, self, aux) mba.mba_pba.pba_iot = &mvmeppc_pci_io_bs_tag; mba.mba_pba.pba_memt = &mvmeppc_pci_mem_bs_tag; mba.mba_pba.pba_dmat = &pci_bus_dma_tag; + mba.mba_pba.pba_dmat64 = NULL; mba.mba_pba.pba_bus = 0; mba.mba_pba.pba_bridgetag = NULL; mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; diff --git a/sys/arch/newsmips/include/bus.h b/sys/arch/newsmips/include/bus.h index de9b5bd38868..50684db629ed 100644 --- a/sys/arch/newsmips/include/bus.h +++ b/sys/arch/newsmips/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.7 2003/01/28 01:08:04 kent Exp $ */ +/* $NetBSD: bus.h,v 1.8 2003/06/15 23:09:03 fvdl Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -506,6 +506,8 @@ struct uio; typedef struct newsmips_bus_dma_tag *bus_dma_tag_t; typedef struct newsmips_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/ofppc/firepower/firepower.c b/sys/arch/ofppc/firepower/firepower.c index ed0baab8c216..0ccc9dad8741 100644 --- a/sys/arch/ofppc/firepower/firepower.c +++ b/sys/arch/ofppc/firepower/firepower.c @@ -1,4 +1,4 @@ -/* $NetBSD: firepower.c,v 1.8 2003/02/03 17:09:58 matt Exp $ */ +/* $NetBSD: firepower.c,v 1.9 2003/06/15 23:09:03 fvdl Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -340,6 +340,7 @@ firepower_attach(struct device *parent, struct device *self, void *aux) pba.pba_iot = &cp->c_iot; pba.pba_memt = &cp->c_memt; pba.pba_dmat = &cp->c_dmat_pci; + pba.pba_dmat64 = NULL; pba.pba_pc = &cp->c_pc; pba.pba_bus = 0; pba.pba_bridgetag = NULL; diff --git a/sys/arch/ofppc/include/bus.h b/sys/arch/ofppc/include/bus.h index 061e5daad318..45cb9c6a5fcd 100644 --- a/sys/arch/ofppc/include/bus.h +++ b/sys/arch/ofppc/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.3 2003/01/28 01:08:04 kent Exp $ */ +/* $NetBSD: bus.h,v 1.4 2003/06/15 23:09:03 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -523,6 +523,8 @@ struct uio; typedef struct powerpc_bus_dma_tag *bus_dma_tag_t; typedef struct powerpc_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/playstation2/include/bus.h b/sys/arch/playstation2/include/bus.h index 7da99b17e9c9..75af01bb98f5 100644 --- a/sys/arch/playstation2/include/bus.h +++ b/sys/arch/playstation2/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.4 2003/01/28 01:08:04 kent Exp $ */ +/* $NetBSD: bus.h,v 1.5 2003/06/15 23:09:03 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -755,6 +755,8 @@ struct uio; typedef struct playstation2_bus_dma_tag *bus_dma_tag_t; typedef struct playstation2_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/pmax/include/bus.h b/sys/arch/pmax/include/bus.h index 0644b6b8f78f..36fabdbac76a 100644 --- a/sys/arch/pmax/include/bus.h +++ b/sys/arch/pmax/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.18 2003/01/28 01:08:05 kent Exp $ */ +/* $NetBSD: bus.h,v 1.19 2003/06/15 23:09:04 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -518,6 +518,8 @@ struct uio; typedef struct pmax_bus_dma_tag *bus_dma_tag_t; typedef struct pmax_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/powerpc/include/bus.h b/sys/arch/powerpc/include/bus.h index 1a1184131bb3..ee2e7797c4ad 100644 --- a/sys/arch/powerpc/include/bus.h +++ b/sys/arch/powerpc/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.10 2003/06/12 08:47:21 scw Exp $ */ +/* $NetBSD: bus.h,v 1.11 2003/06/15 23:09:04 fvdl Exp $ */ /* $OpenBSD: bus.h,v 1.1 1997/10/13 10:53:42 pefo Exp $ */ /*- @@ -652,6 +652,8 @@ struct uio; typedef struct powerpc_bus_dma_tag *bus_dma_tag_t; typedef struct powerpc_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/powerpc/include/ibm4xx/bus.h b/sys/arch/powerpc/include/ibm4xx/bus.h index b5104bccecd8..0547128bf02a 100644 --- a/sys/arch/powerpc/include/ibm4xx/bus.h +++ b/sys/arch/powerpc/include/ibm4xx/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.2 2003/03/11 10:40:17 hannken Exp $ */ +/* $NetBSD: bus.h,v 1.3 2003/06/15 23:09:04 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -883,6 +883,8 @@ struct uio; typedef struct ibm4xx_bus_dma_tag *bus_dma_tag_t; typedef struct ibm4xx_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/prep/prep/mainbus.c b/sys/arch/prep/prep/mainbus.c index 637f1417366a..5d228eca6b20 100644 --- a/sys/arch/prep/prep/mainbus.c +++ b/sys/arch/prep/prep/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.15 2003/01/01 02:03:39 thorpej Exp $ */ +/* $NetBSD: mainbus.c,v 1.16 2003/06/15 23:09:04 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -143,6 +143,7 @@ mainbus_attach(parent, self, aux) mba.mba_pba.pba_iot = &prep_io_space_tag; mba.mba_pba.pba_memt = &prep_mem_space_tag; mba.mba_pba.pba_dmat = &pci_bus_dma_tag; + mba.mba_pba.pba_dmat64 = NULL; mba.mba_pba.pba_pc = &pc; mba.mba_pba.pba_bus = 0; mba.mba_pba.pba_bridgetag = NULL; diff --git a/sys/arch/sandpoint/sandpoint/mainbus.c b/sys/arch/sandpoint/sandpoint/mainbus.c index 290026c44bad..04c24f9c055d 100644 --- a/sys/arch/sandpoint/sandpoint/mainbus.c +++ b/sys/arch/sandpoint/sandpoint/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.13 2003/02/02 20:43:25 matt Exp $ */ +/* $NetBSD: mainbus.c,v 1.14 2003/06/15 23:09:05 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -119,6 +119,7 @@ mainbus_attach(parent, self, aux) mba.mba_pba.pba_iot = &sandpoint_io_bs_tag; mba.mba_pba.pba_memt = &sandpoint_mem_bs_tag; mba.mba_pba.pba_dmat = &pci_bus_dma_tag; + mba.mba_pba.pba_dmat64 = NULL; mba.mba_pba.pba_bus = 0; mba.mba_pba.pba_pc = 0; mba.mba_pba.pba_bridgetag = NULL; diff --git a/sys/arch/sgimips/include/bus.h b/sys/arch/sgimips/include/bus.h index 3648a77d3b25..5be9b3f43fdf 100644 --- a/sys/arch/sgimips/include/bus.h +++ b/sys/arch/sgimips/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.7 2003/01/28 01:08:05 kent Exp $ */ +/* $NetBSD: bus.h,v 1.8 2003/06/15 23:09:05 fvdl Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -507,6 +507,8 @@ struct uio; typedef struct sgimips_bus_dma_tag *bus_dma_tag_t; typedef struct sgimips_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/sgimips/pci/macepci.c b/sys/arch/sgimips/pci/macepci.c index 3cfaa9fcccf6..7e8cc6c64438 100644 --- a/sys/arch/sgimips/pci/macepci.c +++ b/sys/arch/sgimips/pci/macepci.c @@ -1,4 +1,4 @@ -/* $NetBSD: macepci.c,v 1.10 2003/01/19 23:08:54 rafal Exp $ */ +/* $NetBSD: macepci.c,v 1.11 2003/06/15 23:09:05 fvdl Exp $ */ /* * Copyright (c) 2001 Christopher Sekiya @@ -185,6 +185,7 @@ macepci_attach(parent, self, aux) /*XXX*/ pba.pba_iot = 4; /*XXX*/ pba.pba_memt = 2; pba.pba_dmat = &pci_bus_dma_tag; + pba.pba_dmat64 = NULL; pba.pba_bus = 0; pba.pba_bridgetag = NULL; pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED | diff --git a/sys/arch/sh5/include/bus.h b/sys/arch/sh5/include/bus.h index f58652a2a671..c25698123cbd 100644 --- a/sys/arch/sh5/include/bus.h +++ b/sys/arch/sh5/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.5 2003/03/29 22:07:14 scw Exp $ */ +/* $NetBSD: bus.h,v 1.6 2003/06/15 23:09:05 fvdl Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -911,6 +911,8 @@ struct sh5_bus_dmamap; typedef const struct sh5_bus_dma_tag *bus_dma_tag_t; typedef struct sh5_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/sparc/include/bus.h b/sys/arch/sparc/include/bus.h index 0e0dacc5d8a5..9fbdae55db23 100644 --- a/sys/arch/sparc/include/bus.h +++ b/sys/arch/sparc/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.38 2003/01/28 01:08:06 kent Exp $ */ +/* $NetBSD: bus.h,v 1.39 2003/06/15 23:09:05 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -1306,6 +1306,8 @@ struct uio; typedef struct sparc_bus_dma_tag *bus_dma_tag_t; typedef struct sparc_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/sparc/sparc/msiiep.c b/sys/arch/sparc/sparc/msiiep.c index e200ad53a323..25e300957f6d 100644 --- a/sys/arch/sparc/sparc/msiiep.c +++ b/sys/arch/sparc/sparc/msiiep.c @@ -1,4 +1,4 @@ -/* $NetBSD: msiiep.c,v 1.18 2003/04/08 15:16:14 uwe Exp $ */ +/* $NetBSD: msiiep.c,v 1.19 2003/06/15 23:09:06 fvdl Exp $ */ /* * Copyright (c) 2001 Valeriy E. Ushakov @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.18 2003/04/08 15:16:14 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.19 2003/06/15 23:09:06 fvdl Exp $"); #include #include @@ -368,6 +368,7 @@ mspcic_attach(parent, self, aux) pba.pba_iot = sc->sc_iot; pba.pba_memt = sc->sc_memt; pba.pba_dmat = sc->sc_dmat; + pba.pba_dmat64 = NULL; pba.pba_pc = &mspcic_pc_tag; pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED; diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index e93efa051716..ca2099ae8b80 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $NetBSD: psycho.c,v 1.62 2003/05/17 01:38:39 nakayama Exp $ */ +/* $NetBSD: psycho.c,v 1.63 2003/06/15 23:09:06 fvdl Exp $ */ /* * Copyright (c) 2001, 2002 Eduardo E. Horvath @@ -588,6 +588,7 @@ found: pba.pba_busname = "pci"; pba.pba_flags = sc->sc_psycho_this->pp_flags; pba.pba_dmat = sc->sc_psycho_this->pp_dmat; + pba.pba_dmat64 = NULL; pba.pba_iot = sc->sc_psycho_this->pp_iot; pba.pba_memt = sc->sc_psycho_this->pp_memt; diff --git a/sys/arch/sparc64/include/bus.h b/sys/arch/sparc64/include/bus.h index adc850710523..97d9ad669ec3 100644 --- a/sys/arch/sparc64/include/bus.h +++ b/sys/arch/sparc64/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.44 2003/05/05 09:36:51 martin Exp $ */ +/* $NetBSD: bus.h,v 1.45 2003/06/15 23:09:06 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -1555,6 +1555,8 @@ struct uio; typedef struct sparc_bus_dma_tag *bus_dma_tag_t; typedef struct sparc_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/sun68k/include/bus.h b/sys/arch/sun68k/include/bus.h index c8c8035df729..2ab61c6f7a68 100644 --- a/sys/arch/sun68k/include/bus.h +++ b/sys/arch/sun68k/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.4 2003/01/28 01:08:07 kent Exp $ */ +/* $NetBSD: bus.h,v 1.5 2003/06/15 23:09:07 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -1050,6 +1050,8 @@ struct uio; typedef struct sun68k_bus_dma_tag *bus_dma_tag_t; typedef struct sun68k_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/vax/include/bus.h b/sys/arch/vax/include/bus.h index bd71fd39d8fb..7e7f664a43de 100644 --- a/sys/arch/vax/include/bus.h +++ b/sys/arch/vax/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.21 2003/01/28 01:08:07 kent Exp $ */ +/* $NetBSD: bus.h,v 1.22 2003/06/15 23:09:07 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -919,6 +919,8 @@ typedef enum { typedef struct vax_bus_dma_tag *bus_dma_tag_t; typedef struct vax_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/x68k/include/bus.h b/sys/arch/x68k/include/bus.h index ecc6ecf1cd95..00b79987a9cf 100644 --- a/sys/arch/x68k/include/bus.h +++ b/sys/arch/x68k/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.10 2003/01/28 01:08:08 kent Exp $ */ +/* $NetBSD: bus.h,v 1.11 2003/06/15 23:09:08 fvdl Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -767,6 +767,9 @@ struct uio; typedef struct x68k_bus_dma *bus_dma_tag_t; typedef struct x68k_bus_dmamap *bus_dmamap_t; + +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + struct x68k_bus_dma { /* * The `bounce threshold' is checked while we are loading diff --git a/sys/arch/x86/include/bus.h b/sys/arch/x86/include/bus.h index 9169f56ce47c..9c21a2258249 100644 --- a/sys/arch/x86/include/bus.h +++ b/sys/arch/x86/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.2 2003/05/07 21:33:57 fvdl Exp $ */ +/* $NetBSD: bus.h,v 1.3 2003/06/15 23:09:08 fvdl Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -1044,6 +1044,8 @@ struct uio; typedef struct x86_bus_dma_tag *bus_dma_tag_t; typedef struct x86_bus_dmamap *bus_dmamap_t; +#define BUS_DMA_TAG_VALID(t) ((t) != (bus_dma_tag_t)0) + /* * bus_dma_segment_t * diff --git a/sys/arch/x86/include/pci_machdep.h b/sys/arch/x86/include/pci_machdep.h index f13209f8dc87..fa14f4eea33b 100644 --- a/sys/arch/x86/include/pci_machdep.h +++ b/sys/arch/x86/include/pci_machdep.h @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.2 2003/06/15 23:09:08 fvdl Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -64,6 +64,9 @@ union x86_pci_tag_u { }; extern struct x86_bus_dma_tag pci_bus_dma_tag; +#ifdef _LP64 +extern struct x86_bus_dma_tag pci_bus_dma64_tag; +#endif /* * Types provided to machine-independent PCI code diff --git a/sys/arch/x86/pci/pci_machdep.c b/sys/arch/x86/pci/pci_machdep.c index bb345e006c87..e7daf4a38fd4 100644 --- a/sys/arch/x86/pci/pci_machdep.c +++ b/sys/arch/x86/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.4 2003/05/29 20:22:32 fvdl Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.5 2003/06/15 23:09:08 fvdl Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -80,7 +80,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.4 2003/05/29 20:22:32 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.5 2003/06/15 23:09:08 fvdl Exp $"); #include #include @@ -203,6 +203,28 @@ struct x86_bus_dma_tag pci_bus_dma_tag = { _bus_dmamem_mmap, }; +#ifdef _LP64 +struct x86_bus_dma_tag pci_bus_dma64_tag = { + 0, + 0, + 0, + NULL, /* _may_bounce */ + _bus_dmamap_create, + _bus_dmamap_destroy, + _bus_dmamap_load, + _bus_dmamap_load_mbuf, + _bus_dmamap_load_uio, + _bus_dmamap_load_raw, + _bus_dmamap_unload, + NULL, + _bus_dmamem_alloc, + _bus_dmamem_free, + _bus_dmamem_map, + _bus_dmamem_unmap, + _bus_dmamem_mmap, +}; +#endif + void pci_attach_hook(parent, self, pba) struct device *parent, *self; diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 244b464e1110..1aecb6eb889c 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.40 2003/06/01 20:26:14 fvdl Exp $ */ +/* $NetBSD: if_bge.c,v 1.41 2003/06/15 23:09:08 fvdl Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -2016,7 +2016,10 @@ bge_attach(parent, self, aux) aprint_normal(", Ethernet address %s\n", ether_sprintf(eaddr)); /* Allocate the general information block and ring buffers. */ - sc->bge_dmatag = pa->pa_dmat; + if (pci_dma64_available(pa)) + sc->bge_dmatag = pa->pa_dmat64; + else + sc->bge_dmatag = pa->pa_dmat; DPRINTFN(5, ("bus_dmamem_alloc\n")); if (bus_dmamem_alloc(sc->bge_dmatag, sizeof(struct bge_ring_data), PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) { diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 3c2dc5767026..95f55375ee7a 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci.c,v 1.79 2003/05/03 18:02:37 thorpej Exp $ */ +/* $NetBSD: pci.c,v 1.80 2003/06/15 23:09:09 fvdl Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998 @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.79 2003/05/03 18:02:37 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.80 2003/06/15 23:09:09 fvdl Exp $"); #include "opt_pci.h" @@ -48,6 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.79 2003/05/03 18:02:37 thorpej Exp $"); #include #include +#include + #include "locators.h" #ifdef PCI_CONFIG_DUMP @@ -175,6 +177,7 @@ do { \ sc->sc_iot = pba->pba_iot; sc->sc_memt = pba->pba_memt; sc->sc_dmat = pba->pba_dmat; + sc->sc_dmat64 = pba->pba_dmat64; sc->sc_pc = pba->pba_pc; sc->sc_bus = pba->pba_bus; sc->sc_bridgetag = pba->pba_bridgetag; @@ -275,6 +278,7 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag, pa.pa_iot = sc->sc_iot; pa.pa_memt = sc->sc_memt; pa.pa_dmat = sc->sc_dmat; + pa.pa_dmat64 = sc->sc_dmat64; pa.pa_pc = pc; pa.pa_bus = bus; pa.pa_device = device; @@ -611,3 +615,14 @@ pci_vpd_write(pci_chipset_tag_t pc, pcitag_t tag, int offset, int count, return (0); } + +int +pci_dma64_available(struct pci_attach_args *pa) +{ +#ifdef _PCI_HAVE_DMA64 + if (BUS_DMA_TAG_VALID(pa->pa_dmat64) && + ((uint64_t)physmem << PAGE_SHIFT) > 0xffffffffULL) + return 1; +#endif + return 0; +} diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index 69aa1b9405db..ae3eba28bf74 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: pcivar.h,v 1.55 2003/03/25 21:56:20 thorpej Exp $ */ +/* $NetBSD: pcivar.h,v 1.56 2003/06/15 23:09:09 fvdl Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -66,6 +66,7 @@ struct pcibus_attach_args { bus_space_tag_t pba_iot; /* pci i/o space tag */ bus_space_tag_t pba_memt; /* pci mem space tag */ bus_dma_tag_t pba_dmat; /* DMA tag */ + bus_dma_tag_t pba_dmat64; /* DMA tag */ pci_chipset_tag_t pba_pc; int pba_flags; /* flags; see below */ @@ -92,6 +93,7 @@ struct pci_attach_args { bus_space_tag_t pa_iot; /* pci i/o space tag */ bus_space_tag_t pa_memt; /* pci mem space tag */ bus_dma_tag_t pa_dmat; /* DMA tag */ + bus_dma_tag_t pa_dmat64; /* DMA tag */ pci_chipset_tag_t pa_pc; int pa_flags; /* flags; see below */ @@ -147,6 +149,7 @@ struct pci_softc { struct device sc_dev; bus_space_tag_t sc_iot, sc_memt; bus_dma_tag_t sc_dmat; + bus_dma_tag_t sc_dmat64; pci_chipset_tag_t sc_pc; int sc_bus, sc_maxndevs; pcitag_t *sc_bridgetag; @@ -230,6 +233,8 @@ int pci_vpd_write __P((pci_chipset_tag_t, pcitag_t, int, int, pcireg_t *)); char *pci_findvendor __P((pcireg_t)); int pci_find_device(struct pci_attach_args *pa, int (*match)(struct pci_attach_args *)); +int pci_dma64_available(struct pci_attach_args *); + #endif /* _KERNEL */ diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c index 64070682576f..8323a817f5e1 100644 --- a/sys/dev/pci/ppb.c +++ b/sys/dev/pci/ppb.c @@ -1,4 +1,4 @@ -/* $NetBSD: ppb.c,v 1.25 2003/01/01 00:10:23 thorpej Exp $ */ +/* $NetBSD: ppb.c,v 1.26 2003/06/15 23:09:09 fvdl Exp $ */ /* * Copyright (c) 1996, 1998 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.25 2003/01/01 00:10:23 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.26 2003/06/15 23:09:09 fvdl Exp $"); #include #include @@ -124,6 +124,7 @@ ppbattach(parent, self, aux) pba.pba_iot = pa->pa_iot; pba.pba_memt = pa->pa_memt; pba.pba_dmat = pa->pa_dmat; + pba.pba_dmat64 = pa->pa_dmat64; pba.pba_pc = pc; pba.pba_flags = pa->pa_flags & ~PCI_FLAGS_MRM_OKAY; pba.pba_bus = PPB_BUSINFO_SECONDARY(busdata);