Date: Tue, 1 May 2001 15:19:11 +0400 (MSD) From: Alex Kapranoff <alex@kapran.bitmcnit.bryansk.su> To: FreeBSD-gnats-submit@freebsd.org Subject: kern/27008: kernel function sysbeep(xxx, 0) does produce sound Message-ID: <200105011119.f41BJB200747@kapran.bitmcnit.bryansk.su>
next in thread | raw e-mail | index | archive | help
>Number: 27008
>Category: kern
>Synopsis: kernel function sysbeep(xxx, 0) does produce sound
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue May 01 04:40:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Alex Kapranoff
>Release: FreeBSD 5.0-CURRENT i386
>Organization:
Inner Mongolia
>Environment:
System: FreeBSD kapran.bitmcnit.bryansk.su 5.0-CURRENT FreeBSD 5.0-CURRENT #5: Tue May 1 14:50:52 MSD 2001 root@kapran.bitmcnit.bryansk.su:/usr/src/sys/compile/KAPRAN i386
It's a p166/mmx box.
>Description:
kernel function sysbeep takes two arguments: pitch and
duration. When the duration == 0, it should obviously not produce
any sound, but it does (probably due to high interrupt latency
in -current). So lets make duration == 0 a special case.
>How-To-Repeat:
% kbdcontrol -b off
% echo "\a"
>Fix:
I've only tested i386 variant but the patches are identical
except for the alpha case.
diff -ur /sys/alpha/alpha/clock.c ./alpha/alpha/clock.c
--- /sys/alpha/alpha/clock.c Sat Apr 28 16:55:03 2001
+++ ./alpha/alpha/clock.c Tue May 1 15:12:06 2001
@@ -636,6 +636,8 @@
int
sysbeep(int pitch, int period)
{
+ if (!period)
+ return (0);
mtx_lock_spin(&clock_lock);
diff -ur /sys/i386/isa/clock.c ./i386/isa/clock.c
--- /sys/i386/isa/clock.c Sat Apr 28 05:37:44 2001
+++ ./i386/isa/clock.c Tue May 1 14:04:55 2001
@@ -524,7 +524,12 @@
int
sysbeep(int pitch, int period)
{
- int x = splclock();
+ int x;
+
+ if (!period)
+ return (0);
+
+ x = splclock();
if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT))
if (!beeping) {
diff -ur /sys/ia64/ia64/clock.c ./ia64/ia64/clock.c
--- /sys/ia64/ia64/clock.c Thu Dec 14 22:10:21 2000
+++ ./ia64/ia64/clock.c Tue May 1 15:12:36 2001
@@ -471,7 +471,12 @@
int
sysbeep(int pitch, int period)
{
- int x = splhigh();
+ int x;
+
+ if (!period)
+ return (0);
+
+ x = splhigh();
if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT))
if (!beeping) {
diff -ur /sys/pc98/pc98/clock.c ./pc98/pc98/clock.c
--- /sys/pc98/pc98/clock.c Sun Apr 1 12:06:08 2001
+++ ./pc98/pc98/clock.c Tue May 1 15:13:01 2001
@@ -577,7 +577,12 @@
int
sysbeep(int pitch, int period)
{
- int x = splclock();
+ int x;
+
+ if (!period)
+ return (0);
+
+ x = splclock();
#ifdef PC98
if (acquire_timer1(TIMER_SQWAVE|TIMER_16BIT))
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105011119.f41BJB200747>
