From 91a7a0b37b09c2939f21f80c9d82b7324e43c593 Mon Sep 17 00:00:00 2001 From: Constantine Sapuntzakis Date: Thu, 12 Apr 2001 07:46:47 +0000 Subject: The old code was broken and always allocated for a 16-bit DMA channel, which has different alignment restrictions than the 8-bit DMA channel. Fix from NetBSD. --- sys/dev/isa/sbdsp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c index 01ad1c2a3ef..02b09401981 100644 --- a/sys/dev/isa/sbdsp.c +++ b/sys/dev/isa/sbdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbdsp.c,v 1.15 2001/02/03 05:22:24 mickey Exp $ */ +/* $OpenBSD: sbdsp.c,v 1.16 2001/04/12 07:46:46 csapuntz Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -2196,8 +2196,15 @@ sb_malloc(addr, size, pool, flags) int flags; { struct sbdsp_softc *sc = addr; + int drq; - return isa_malloc(sc->sc_isa, 4, size, pool, flags); + /* 8-bit has more restrictive alignment */ + if (sc->sc_drq8 != -1) + drq = sc->sc_drq8; + else + drq = sc->sc_drq16; + + return isa_malloc(sc->sc_isa, drq, size, pool, flags); } void -- cgit v1.2.3