diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-04-12 07:46:47 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-04-12 07:46:47 +0000 |
commit | 91a7a0b37b09c2939f21f80c9d82b7324e43c593 (patch) | |
tree | 23146ada622310e04dd9adda03dd17ffb269e0af /sys/dev | |
parent | 141946a8ba84b5841b2387cd84bdf6662fb05fd7 (diff) |
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.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/isa/sbdsp.c | 11 |
1 files changed, 9 insertions, 2 deletions
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 |