spkr.c (111119) | spkr.c (111748) |
---|---|
1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * modified for PC98 by Kakefuda 7 * | 1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * modified for PC98 by Kakefuda 7 * |
8 * $FreeBSD: head/sys/dev/speaker/spkr.c 111119 2003-02-19 05:47:46Z imp $ | 8 * $FreeBSD: head/sys/dev/speaker/spkr.c 111748 2003-03-02 16:54:40Z des $ |
9 */ 10 11#include <sys/param.h> 12#include <sys/systm.h> 13#include <sys/bus.h> 14#include <sys/kernel.h> 15#include <sys/module.h> 16#include <sys/uio.h> --- 118 unchanged lines hidden (view full) --- 135 SPEAKER_ON; 136 137 /* 138 * Set timeout to endtone function, then give up the timeslice. 139 * This is so other processes can execute while the tone is being 140 * emitted. 141 */ 142 if (ticks > 0) | 9 */ 10 11#include <sys/param.h> 12#include <sys/systm.h> 13#include <sys/bus.h> 14#include <sys/kernel.h> 15#include <sys/module.h> 16#include <sys/uio.h> --- 118 unchanged lines hidden (view full) --- 135 SPEAKER_ON; 136 137 /* 138 * Set timeout to endtone function, then give up the timeslice. 139 * This is so other processes can execute while the tone is being 140 * emitted. 141 */ 142 if (ticks > 0) |
143 tsleep((caddr_t)&endtone, SPKRPRI | PCATCH, "spkrtn", ticks); | 143 tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", ticks); |
144 SPEAKER_OFF; 145 sps = splclock(); 146 TIMER_RELEASE; 147 splx(sps); 148} 149 150/* rest for given number of ticks */ 151static void --- 4 unchanged lines hidden (view full) --- 156 * Set timeout to endrest function, then give up the timeslice. 157 * This is so other processes can execute while the rest is being 158 * waited out. 159 */ 160#ifdef DEBUG 161 (void) printf("rest: %d\n", ticks); 162#endif /* DEBUG */ 163 if (ticks > 0) | 144 SPEAKER_OFF; 145 sps = splclock(); 146 TIMER_RELEASE; 147 splx(sps); 148} 149 150/* rest for given number of ticks */ 151static void --- 4 unchanged lines hidden (view full) --- 156 * Set timeout to endrest function, then give up the timeslice. 157 * This is so other processes can execute while the rest is being 158 * waited out. 159 */ 160#ifdef DEBUG 161 (void) printf("rest: %d\n", ticks); 162#endif /* DEBUG */ 163 if (ticks > 0) |
164 tsleep((caddr_t)&endrest, SPKRPRI | PCATCH, "spkrrs", ticks); | 164 tsleep(&endrest, SPKRPRI | PCATCH, "spkrrs", ticks); |
165} 166 167/**************** PLAY STRING INTERPRETER BEGINS HERE ********************** 168 * 169 * Play string interpretation is modelled on IBM BASIC 2.0's PLAY statement; 170 * M[LNS] are missing; the ~ synonym and the _ slur mark and the octave- 171 * tracking facility are added. 172 * Requires tone(), rest(), and endtone(). String play is not interruptible --- 370 unchanged lines hidden (view full) --- 543#ifdef DEBUG 544 (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); 545#endif /* DEBUG */ 546 547 if (minor(dev) != 0) 548 return(ENXIO); 549 else 550 { | 165} 166 167/**************** PLAY STRING INTERPRETER BEGINS HERE ********************** 168 * 169 * Play string interpretation is modelled on IBM BASIC 2.0's PLAY statement; 170 * M[LNS] are missing; the ~ synonym and the _ slur mark and the octave- 171 * tracking facility are added. 172 * Requires tone(), rest(), and endtone(). String play is not interruptible --- 370 unchanged lines hidden (view full) --- 543#ifdef DEBUG 544 (void) printf("spkrclose: entering with dev = %s\n", devtoname(dev)); 545#endif /* DEBUG */ 546 547 if (minor(dev) != 0) 548 return(ENXIO); 549 else 550 { |
551 wakeup((caddr_t)&endtone); 552 wakeup((caddr_t)&endrest); | 551 wakeup(&endtone); 552 wakeup(&endrest); |
553 free(spkr_inbuf, M_SPKR); 554 spkr_active = FALSE; 555 return(0); 556 } 557} 558 559static int 560spkrioctl(dev, cmd, cmdarg, flags, td) --- 128 unchanged lines hidden --- | 553 free(spkr_inbuf, M_SPKR); 554 spkr_active = FALSE; 555 return(0); 556 } 557} 558 559static int 560spkrioctl(dev, cmd, cmdarg, flags, td) --- 128 unchanged lines hidden --- |