From nobody Sat Nov 02 14:39:10 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 4XggNG44Wyz5c7VT; Sat, 02 Nov 2024 14:39:10 +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 4XggNG39qlz45ck; Sat, 2 Nov 2024 14:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730558350; 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=537y3Sjll2lhJsGeCVOOR2r9Ky52SBJli2sNU+UbnuU=; b=ulsE7GWsiuD/yW8WjadZkm2y2gqtVp1fRjJO6MxLHN0uxY5PccHD7CLO91O0huXOyvq8tj hoMFs0qzsZLXecp34Cm/ZAMInF+Vl1D2ve2ApVz3zWdD8IFhab1lHfdlp/FCeASY60nQQl tyqQtbXZv4aLCf1GOLQFL3KG8ny0+mnqX8XpIAlebzUnmjdsq5R4qcpen+OUNsa+xxwHMz rSkROxNwX/2I9woAnlx7HCkxN+AncbgFWLI8eyPWICqOi8Qsd0Dzr0aY/I8cBn1hy46LV5 N8rmHvVWhuCzJZQxhx47C8m26Pe295pldzlXkSKvKbXTVBuKOlwZtZ/q3rh5fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730558350; 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=537y3Sjll2lhJsGeCVOOR2r9Ky52SBJli2sNU+UbnuU=; b=naj1qcDBLLHhwFbXxmdu35ILTKvDPz0dsGs3gm+dWLdeQpaPMY3k9iYiwgpUl/xyrwfA7T u7s+52O+BahnQm1KR4NpnmvdqqV/xH67uNozkbWfHPwx/eSfjai9hScjKu76f8XNcbFnP8 u//ND74Jl2u1oid0UxlCW37t9X3AJGlIplQmOU0E+8SDfXO7lhjxEkviaHWT+DOyDwOXLf cCFTIZEmpaYMLLN7yreqXhTHbFaoIsAL4+/IetPxWQrmwZghDCueJJNl09p96D2FEJk9uc fRLUlsfscsLnLVxhBYR8j9gBkzcAwzvrdXbWXASGRC39VlD9RocJkBaSApnWFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730558350; a=rsa-sha256; cv=none; b=dYjcEl9K8y1n0Q/C4LZ0pnWsHobZ5yflacKM+kgPqmHsN9ZftP2itd4u/+pL6iizKSOOrp a1Vehyn4pfESCQswVv7RA714lXMf508ySAeo6bP/J4yQ0KtWVEW/Hqd8ySV5sV9uLwfl0a jLuIbzT35+CKHe77O4YJwYVC3T6p8ykOs5QGg3XTJhGipJxbQha/nqq1alM4ymULlkt+Du hf19jvcs7Gwnxb6IKyEuFESehefS5wlVUPvMf8YuwdzD4k0EClujIM79oMCw6sQqAKCROb T8tAhCkoRTFk/TsbXI8fQwVKNouymjM1YE2XvdIkJrweaOV9g6hx0uLKLP0/3w== 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 4XggNG2mklz16tf; Sat, 2 Nov 2024 14:39:10 +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 4A2EdAeM076015; Sat, 2 Nov 2024 14:39:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A2EdAff076012; Sat, 2 Nov 2024 14:39:10 GMT (envelope-from git) Date: Sat, 2 Nov 2024 14:39:10 GMT Message-Id: <202411021439.4A2EdAff076012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: adba3c74209e - main - 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/main X-Git-Reftype: branch X-Git-Commit: adba3c74209eb5d2197b9092002cc9d7505fd3c6 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=adba3c74209eb5d2197b9092002cc9d7505fd3c6 commit adba3c74209eb5d2197b9092002cc9d7505fd3c6 Author: Ed Maste AuthorDate: 2024-11-01 16:29:32 +0000 Commit: Ed Maste CommitDate: 2024-11-02 14:39:04 +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 --- 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 8f5e45306d61..87020b6e6f19 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -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);