Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sys/dev Pull up revision 1.196 (requested by is in ticket...



details:   https://anonhg.NetBSD.org/src/rev/2bab58c4427b
branches:  netbsd-3
changeset: 576178:2bab58c4427b
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jun 11 11:18:32 2005 +0000

description:
Pull up revision 1.196 (requested by is in ticket #445):
Make sure buffer sizes are initialized correctly even when the pause state
is explicitly set.
Without this, the machine would crash for some audio hardware that needs
to divide by the block size (e.g., cs4281.c/cs4280.c).

diffstat:

 sys/dev/audio.c |  28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diffs (73 lines):

diff -r fed952a1187e -r 2bab58c4427b sys/dev/audio.c
--- a/sys/dev/audio.c   Sat Jun 11 08:57:12 2005 +0000
+++ b/sys/dev/audio.c   Sat Jun 11 11:18:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.192.4.1 2005/04/25 14:49:46 tron Exp $     */
+/*     $NetBSD: audio.c,v 1.192.4.2 2005/06/11 11:18:32 tron Exp $     */
 
 /*
  * Copyright (c) 1991-1993 Regents of the University of California.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.192.4.1 2005/04/25 14:49:46 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.192.4.2 2005/06/11 11:18:32 tron Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -3088,7 +3088,7 @@
        int oldpblksize, oldrblksize;
        u_int gain;
        boolean_t rbus, pbus;
-       boolean_t cleared, modechange;
+       boolean_t cleared, modechange, pausechange;
        u_char balance;
 
        hw = sc->hw_if;
@@ -3103,6 +3103,7 @@
        error = 0;
        cleared = FALSE;
        modechange = FALSE;
+       pausechange = FALSE;
 
        pp = sc->sc_pparams;    /* Temporary encoding storage in */
        rp = sc->sc_rparams;    /* case setting the modes fails. */
@@ -3325,24 +3326,13 @@
 
        if (SPECIFIED_CH(p->pause)) {
                sc->sc_pr.pause = p->pause;
-               if (!p->pause && !sc->sc_pbus && (sc->sc_mode & AUMODE_PLAY)) {
-                       s = splaudio();
-                       error = audiostartp(sc);
-                       splx(s);
-                       if (error)
-                               return error;
-               }
+               pbus = !p->pause;
+               pausechange = TRUE;
        }
        if (SPECIFIED_CH(r->pause)) {
                sc->sc_rr.pause = r->pause;
-               if (!r->pause && !sc->sc_rbus &&
-                   (sc->sc_mode & AUMODE_RECORD)) {
-                       s = splaudio();
-                       error = audiostartr(sc);
-                       splx(s);
-                       if (error)
-                               return error;
-               }
+               rbus = !r->pause;
+               pausechange = TRUE;
        }
 
        if (SPECIFIED(ai->blocksize)) {
@@ -3398,7 +3388,7 @@
                        return error;
        }
 
-       if (cleared) {
+       if (cleared || pausechange) {
                s = splaudio();
                error = audio_initbufs(sc);
                if (error) goto err;



Home | Main Index | Thread Index | Old Index