Bug 25201 - pccard event and syscons beep duration depend on HZ
Summary: pccard event and syscons beep duration depend on HZ
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 4.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Warner Losh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-02-19 12:50 UTC by amorita
Modified: 2002-09-30 00:43 UTC (History)
0 users

See Also:


Attachments
file.diff (3.85 KB, patch)
2001-02-19 12:50 UTC, amorita
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description amorita 2001-02-19 12:50:02 UTC
The beep duration of pccard event and syscons is changed
on the kernel compiled with ``options HZ=1000'' option.

Checking code using sysbeep, I found hz depend coding in
sys/pccard/pccard_beep.c, sys/i386/isa/pcvt/pcvt_kbd.c,
sys/dev/syscons/syscons.h, sys/pc98/pc98/sc_machdep.h.

These four codes have hard coded duration of sysbeep function,
but the unit of sysbeep's duration argument is 1/hz second.
Thus, the duration scaling of hz is needed.

Furthermore, sc_bell's duration is loaded from escape sequence
in sys/dev/syscons/scterm-sc.c, sys/pc98/pc98/scterm-sck.c.
From kbdcontrol manual and usr.sbin/kbdcontrol/kbdcontrol.c coding,
the unit of duration value in escape sequence is 10msec.
Thus hz scaling is needed in the case hz != 100.

The codes calling timeout with hard coded ticks would cause the same problem.

Fix: o sys/pccard/pccard_beep.c
  Add hz scaling code to pccard_beep_sub and pccard_beep_start.

o sys/i386/isa/pcvt/pcvt_kbd.c
  Add hz scaling to PLING and PLONG macros.

o sys/dev/syscons/syscons.h, sys/pc98/pc98/sc_machdep.h
  Add hz scaling to BELL_DURATION macro.

o sys/dev/syscons/scterm-sc.c, sys/pc98/pc98/scterm-sck.c
  Add hz scaling code to ``set bell pitch and duration'' escape sequence.

----
How-To-Repeat: Add ``options HZ=1000'' and install new kernel.
Hear pccard beep/syscons beep.
Comment 1 Poul-Henning Kamp freebsd_committer freebsd_triage 2001-05-28 22:11:45 UTC
State Changed
From-To: open->analyzed

I have committed the syscons part of the patch, the 
pcvt, pc98 and pccard parts are left for the respective 
maintainers.
Comment 2 unfurl freebsd_committer freebsd_triage 2001-05-31 06:33:02 UTC
Responsible Changed
From-To: freebsd-bugs->imp

imp asked for it:wq
Comment 3 Warner Losh freebsd_committer freebsd_triage 2002-09-30 00:43:04 UTC
State Changed
From-To: analyzed->closed

I was the last straggler on this PR.  I've committed it, 
so it is time to close it.