summaryrefslogtreecommitdiff
path: root/sys/dev/vt
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-11-19 05:10:07 +0000
committerWarner Losh <imp@FreeBSD.org>2021-11-19 05:10:07 +0000
commit706f4f705bf2bdfe7b03647feb21639996c6bcee (patch)
treed7f98cd6235f3bff3e2b862dafbf311c924e419f /sys/dev/vt
parent1076b8d267b3b99e848780e02b07933b358adda2 (diff)
Diffstat (limited to 'sys/dev/vt')
-rw-r--r--sys/dev/vt/vt_core.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 1bbb12d52ec3..c65c6cb62ea1 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -1095,7 +1095,7 @@ vt_allocate_keyboard(struct vt_device *vd)
#define DEVCTL_LEN 64
static void
-vtterm_devctl(bool enabled, int hz, sbintime_t duration)
+vtterm_devctl(bool enabled, bool hushed, int hz, sbintime_t duration)
{
struct sbuf sb;
char *buf;
@@ -1104,8 +1104,9 @@ vtterm_devctl(bool enabled, int hz, sbintime_t duration)
if (buf == NULL)
return;
sbuf_new(&sb, buf, DEVCTL_LEN, SBUF_FIXEDLEN);
- sbuf_printf(&sb, "enabled=%s hz=%d duration_ms=%d",
- enabled ? "true" : "false", hz, (int)(duration / SBT_1MS));
+ sbuf_printf(&sb, "enabled=%s hushed=%s hz=%d duration_ms=%d",
+ enabled ? "true" : "false", hushed ? "true" : "false",
+ hz, (int)(duration / SBT_1MS));
sbuf_finish(&sb);
if (sbuf_error(&sb) == 0)
devctl_notify("VT", "BELL", "RING", sbuf_data(&sb));
@@ -1119,8 +1120,8 @@ vtterm_bell(struct terminal *tm)
struct vt_window *vw = tm->tm_softc;
struct vt_device *vd = vw->vw_device;
- vtterm_devctl(vt_enable_bell, vw->vw_bell_pitch,
- vw->vw_bell_duration);
+ vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL,
+ vw->vw_bell_pitch, vw->vw_bell_duration);
if (!vt_enable_bell)
return;
@@ -1140,6 +1141,8 @@ vtterm_beep(struct terminal *tm, u_int param)
{
u_int freq;
sbintime_t period;
+ struct vt_window *vw = tm->tm_softc;
+ struct vt_device *vd = vw->vw_device;
if ((param == 0) || ((param & 0xffff) == 0)) {
vtterm_bell(tm);
@@ -1149,7 +1152,8 @@ vtterm_beep(struct terminal *tm, u_int param)
period = ((param >> 16) & 0xffff) * SBT_1MS;
freq = 1193182 / (param & 0xffff);
- vtterm_devctl(vt_enable_bell, freq, period);
+ vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL,
+ freq, period);
if (!vt_enable_bell)
return;