mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
vt: add comments for KDMKTONE ioctl implementation
The KDMKTONE ioctl, introduced in commit 916347f77e
, is used to beep
the PC speaker. For historical reasons the frequency is specified as an
8254 PIT divisor for a 1.19MHz clock. Linux provides this same ioctl.
Add a comment to vtterm_beep to avoid someone wanting to "fix" this in
the future.
Also add an XXX comment that the period unit is supposed to be "timer
ticks." Note that nothing in the base system uses this ioctl.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47395
This commit is contained in:
parent
3aac51cbb9
commit
adba3c7420
@ -1135,6 +1135,13 @@ vtterm_bell(struct terminal *tm)
|
||||
sysbeep(vw->vw_bell_pitch, vw->vw_bell_duration);
|
||||
}
|
||||
|
||||
/*
|
||||
* Beep with user-provided frequency and duration as specified by a KDMKTONE
|
||||
* ioctl (compatible with Linux). The frequency is specified as a 8254 PIT
|
||||
* divisor for a 1.19MHz clock.
|
||||
*
|
||||
* See https://tldp.org/LDP/lpg/node83.html.
|
||||
*/
|
||||
static void
|
||||
vtterm_beep(struct terminal *tm, u_int param)
|
||||
{
|
||||
@ -1148,6 +1155,7 @@ vtterm_beep(struct terminal *tm, u_int param)
|
||||
return;
|
||||
}
|
||||
|
||||
/* XXX period unit is supposed to be "timer ticks." */
|
||||
period = ((param >> 16) & 0xffff) * SBT_1MS;
|
||||
freq = 1193182 / (param & 0xffff);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user