Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/qbus Must check B_PHYS, not b_proc, if it is DMA to ...
details: https://anonhg.NetBSD.org/src/rev/5d3f850dbbd8
branches: trunk
changeset: 532761:5d3f850dbbd8
user: ragge <ragge%NetBSD.org@localhost>
date: Fri Jun 14 11:57:21 2002 +0000
description:
Must check B_PHYS, not b_proc, if it is DMA to userspace, otherwise the
machine will crash. This fixes a panic when a Unibus adapter runs out
of map registers (happens frequently), reported by Johnny Billquist.
diffstat:
sys/dev/qbus/uda.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (29 lines):
diff -r b1e691922ca6 -r 5d3f850dbbd8 sys/dev/qbus/uda.c
--- a/sys/dev/qbus/uda.c Fri Jun 14 11:32:15 2002 +0000
+++ b/sys/dev/qbus/uda.c Fri Jun 14 11:57:21 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uda.c,v 1.42 2001/11/13 07:11:25 lukem Exp $ */
+/* $NetBSD: uda.c,v 1.43 2002/06/14 11:57:21 ragge Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* Copyright (c) 1988 Regents of the University of California.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uda.c,v 1.42 2001/11/13 07:11:25 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uda.c,v 1.43 2002/06/14 11:57:21 ragge Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -283,7 +283,9 @@
int err;
err = bus_dmamap_load(sc->sc_dmat, mxi->mxi_dmam, bp->b_data,
- bp->b_bcount, bp->b_proc, BUS_DMA_NOWAIT);
+ bp->b_bcount, (bp->b_flags & B_PHYS ? bp->b_proc : 0),
+ BUS_DMA_NOWAIT);
+
if (err)
return 0;
mscp_dgo(sc->sc_softc, mxi);
Home |
Main Index |
Thread Index |
Old Index