From nobody Mon Nov 04 13:55:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XhtJb5M49z5c66C; Mon, 04 Nov 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XhtJb4rY3z4R3N; Mon, 4 Nov 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730728511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QY0ljIjPSLzPRJfnDo1+dnafg1gH08WTdT21cUldpK4=; b=FCN3R16RzGJ0T5TiJYyCCKLDk0YSPjY1VfoFMxc5BiWy2iwQ1kBYZXr1+t7XeOzm5QgZ+T XUf/2sQckpw0G1w2MUsVe6uLL3ZMA0uhA5Vu1FXVJzk137TyNVw07LSkp8Bzufi2bOmYYd x8FSRDC/uSZEAdZtihklJAO4M1p26bhf0scQdyxbbcx9LOj3Z/7rSMSZTa+3iXWdbKSSaE +XdaGbwtC3YpYatILdKj8HZsvX5c0bgXkqIbSLlahkupvY6y6xF4r4mpTGmPEqKPvx9d32 zzHdZXoK+DC55p60tufMeyqdczZnUBodQNymZItEYaB7jUo7roF8WsOnjO0Cyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730728511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QY0ljIjPSLzPRJfnDo1+dnafg1gH08WTdT21cUldpK4=; b=gb4eEMZjN/RE5QCtxmd9Sl2zU17hEBIwrQJS5Lav6Lekw4jAJGrbEXt9ofVmoIQPlxAuRS o/wU3/K8myql+y7r8cRTLCTZ8nnyerXJqDjicrRT8cn3sytM+q7iW7cEr6Lycp8N36AQla 1N7/8hfJ3cOZTyH9iWSYKD87+UlUtxkR5zfoM93wzl79RL5LYU78lvfIfuXF7+hT+4SKbf yp6Bma9jEgLSxjeEpwbG2wLKpXG2ncv+4qVRm2Fso/dS+6FL2xxXW8LoahAno8dlNli3Gv TEKsgHVmm1AkJTm/otCMNoG441CglsAn3/XtArXz4kWSir1RvlP5Qhg6GhL4YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730728511; a=rsa-sha256; cv=none; b=kmFYZE3PMziVHk52bW0dVtH2j/GlqoMODt0dKneeZ+x7+S3DXo1O/tRElDZ64RJM7pgqC7 Rw4qB/qfZcRqyCWs72RvLrz02kecy1GYbydsEx54KC/E6VXzToUFXZ3A95zWLyGAI9DH4A KQgMtyH9Cy06RViQaSWGqClT0iVW4wNPLOjv0WzxOsiBxF3T5c/OFyinQyVT3oFTJgt1Fl wnZZYHXSu2hXvntFQmpaofEwR9x4OCKx0VWMhkU3y2rSlL4jrguvF2dVB0yE5K9b/B27Ts TOl0T73RZHGaj+kkuP8IjkPx0L1z8BRnA+ab4Q6XaWguRpSiMDcztAgptMMgwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XhtJb4S5szbwG; Mon, 4 Nov 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A4DtB3N046869; Mon, 4 Nov 2024 13:55:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4DtBHU046866; Mon, 4 Nov 2024 13:55:11 GMT (envelope-from git) Date: Mon, 4 Nov 2024 13:55:11 GMT Message-Id: <202411041355.4A4DtBHU046866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 752c25c01c17 - stable/14 - vt: add comments for KDMKTONE ioctl implementation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 752c25c01c171811bab622b558e97d611c228c7d Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=752c25c01c171811bab622b558e97d611c228c7d commit 752c25c01c171811bab622b558e97d611c228c7d Author: Ed Maste AuthorDate: 2024-11-01 16:29:32 +0000 Commit: Ed Maste CommitDate: 2024-11-04 13:54:10 +0000 vt: add comments for KDMKTONE ioctl implementation The KDMKTONE ioctl, introduced in commit 916347f77e6c, 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 (cherry picked from commit adba3c74209eb5d2197b9092002cc9d7505fd3c6) --- sys/dev/vt/vt_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index f3cc4e29cf07..50f12512a81c 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -1136,6 +1136,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) { @@ -1149,6 +1156,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);