From 5edc9ef4a4bb8e83f71c2a5bd92f835b8f50e459 Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 17 Jul 2000 04:47:56 +0000 Subject: [PATCH] When computing the segment size, consider the maximum segment size in the DMA map. --- sys/arch/alpha/common/bus_dma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/alpha/common/bus_dma.c b/sys/arch/alpha/common/bus_dma.c index 86c9fdee5574..16a09c994fea 100644 --- a/sys/arch/alpha/common/bus_dma.c +++ b/sys/arch/alpha/common/bus_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.39 2000/06/29 09:02:56 mrg Exp $ */ +/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.39 2000/06/29 09:02:56 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $"); #include #include @@ -179,6 +179,8 @@ _bus_dmamap_load_buffer_direct_common(t, map, buf, buflen, p, flags, sgsize = NBPG - ((u_long)vaddr & PGOFSET); if (buflen < sgsize) sgsize = buflen; + if (map->_dm_maxsegsz < sgsize) + sgsize = map->_dm_maxsegsz; /* * Make sure we don't cross any boundaries.