diff options
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/isa/spkr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c index 8f4b8aadcb35..0f7ed61ceee6 100644 --- a/sys/i386/isa/spkr.c +++ b/sys/i386/isa/spkr.c @@ -10,10 +10,10 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> -#include <sys/buf.h> #include <sys/uio.h> #include <sys/conf.h> #include <sys/ctype.h> +#include <sys/malloc.h> #include <i386/isa/isa.h> #include <i386/isa/timerreg.h> #include <machine/clock.h> @@ -42,6 +42,8 @@ static struct cdevsw spkr_cdevsw = { /* bmaj */ -1 }; +MALLOC_DEFINE(M_SPKR, "spkr", "Speaker buffer"); + /**************** MACHINE DEPENDENT PART STARTS HERE ************************* * * This section defines a function tone() which causes a tone of given @@ -453,7 +455,7 @@ playstring(cp, slen) */ static int spkr_active = FALSE; /* exclusion flag */ -static struct buf *spkr_inbuf; /* incoming buf */ +static char *spkr_inbuf; /* incoming buf */ int spkropen(dev, flags, fmt, p) @@ -476,7 +478,7 @@ spkropen(dev, flags, fmt, p) (void) printf("spkropen: about to perform play initialization\n"); #endif /* DEBUG */ playinit(); - spkr_inbuf = geteblk(DEV_BSIZE); + spkr_inbuf = malloc(DEV_BSIZE, M_SPKR, M_WAITOK); spkr_active = TRUE; return(0); } @@ -504,7 +506,7 @@ spkrwrite(dev, uio, ioflag) int error; n = uio->uio_resid; - cp = spkr_inbuf->b_data; + cp = spkr_inbuf; error = uiomove(cp, n, uio); if (!error) { cp[n] = '\0'; @@ -531,7 +533,7 @@ spkrclose(dev, flags, fmt, p) { wakeup((caddr_t)&endtone); wakeup((caddr_t)&endrest); - brelse(spkr_inbuf); + free(spkr_inbuf, M_SPKR); spkr_active = FALSE; return(0); } |