speaker(4): Update outdated comments
The comments in tone() were referring to pre-2000 logic that does not exist any more. This patch updates them. Signed-off-by: Raphael Poss <knz@thaumogen.net> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
This commit is contained in:
committed by
Warner Losh
parent
70ae0c4524
commit
03a515e989
+10
-4
@@ -71,23 +71,29 @@ tone(unsigned int thz, unsigned int centisecs)
|
|||||||
(void) printf("tone: thz=%d centisecs=%d\n", thz, centisecs);
|
(void) printf("tone: thz=%d centisecs=%d\n", thz, centisecs);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
/* set timer to generate clicks at given frequency in Hertz */
|
/*
|
||||||
|
* Acquire the i8254 clock, configure it to drive the speaker
|
||||||
|
* signal, and turn on the speaker.
|
||||||
|
*/
|
||||||
if (timer_spkr_acquire()) {
|
if (timer_spkr_acquire()) {
|
||||||
/* enter list of waiting procs ??? */
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
disable_intr();
|
disable_intr();
|
||||||
|
/* Configure the speaker with the tone frequency. */
|
||||||
timer_spkr_setfreq(thz);
|
timer_spkr_setfreq(thz);
|
||||||
enable_intr();
|
enable_intr();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set timeout to endtone function, then give up the timeslice.
|
* Make the current thread sleep while the tone is being
|
||||||
* This is so other processes can execute while the tone is being
|
|
||||||
* emitted.
|
* emitted.
|
||||||
*/
|
*/
|
||||||
timo = centisecs * hz / 100;
|
timo = centisecs * hz / 100;
|
||||||
if (timo > 0)
|
if (timo > 0)
|
||||||
tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", timo);
|
tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", timo);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Turn off the speaker and release the i8254 clock.
|
||||||
|
*/
|
||||||
timer_spkr_release();
|
timer_spkr_release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user