Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157401220
D54168.id167831.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54168.id167831.diff
View Options
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c
--- a/sys/dev/speaker/spkr.c
+++ b/sys/dev/speaker/spkr.c
@@ -74,23 +74,29 @@
(void) printf("tone: thz=%d centisecs=%d\n", thz, centisecs);
#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()) {
- /* enter list of waiting procs ??? */
return;
}
disable_intr();
+ /* Configure the speaker with the tone frequency. */
timer_spkr_setfreq(thz);
enable_intr();
/*
- * Set timeout to endtone function, then give up the timeslice.
- * This is so other processes can execute while the tone is being
+ * Make the current thread sleep while the tone is being
* emitted.
*/
timo = centisecs * hz / 100;
if (timo > 0)
tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", timo);
+
+ /*
+ * Turn off the speaker and release the i8254 clock.
+ */
timer_spkr_release();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 22, 12:26 AM (1 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33410717
Default Alt Text
D54168.id167831.diff (1 KB)
Attached To
Mode
D54168: speaker(4): drop NEEDGIANT
Attached
Detach File
Event Timeline
Log In to Comment