Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163320411
D32619.id97347.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D32619.id97347.diff
View Options
Index: sys/dev/mlx/mlx.c
===================================================================
--- sys/dev/mlx/mlx.c
+++ sys/dev/mlx/mlx.c
@@ -1083,7 +1083,7 @@
mlx_pause_action(sc); /* pause is running */
sc->mlx_pause.mp_when = 0;
- sysbeep(500, hz);
+ sysbeep(500, SBT_1S);
/*
* Bus pause still running?
@@ -1095,9 +1095,9 @@
if (time_second >= sc->mlx_pause.mp_howlong) {
mlx_pause_action(sc);
sc->mlx_pause.mp_which = 0; /* pause is complete */
- sysbeep(500, hz);
+ sysbeep(500, SBT_1S);
} else {
- sysbeep((time_second % 5) * 100 + 500, hz/8);
+ sysbeep((time_second % 5) * 100 + 500, SBT_1S / 8);
}
/*
Index: sys/dev/syscons/syscons.c
===================================================================
--- sys/dev/syscons/syscons.c
+++ sys/dev/syscons/syscons.c
@@ -4258,6 +4258,11 @@
}
}
+/*
+ * pitch is the divisor for 1.193182MHz PIT clock. By dividing 1193172 / pitch,
+ * we convert it back to Hz.
+ * duration is in ticks of 1/hz.
+ */
void
sc_bell(scr_stat *scp, int pitch, int duration)
{
@@ -4277,7 +4282,7 @@
} else if (duration != 0 && pitch != 0) {
if (scp != scp->sc->cur_scp)
pitch *= 2;
- sysbeep(1193182 / pitch, duration);
+ sysbeep(1193182 / pitch, SBT_1S * duration / hz);
}
}
Index: sys/dev/vt/vt_core.c
===================================================================
--- sys/dev/vt/vt_core.c
+++ sys/dev/vt/vt_core.c
@@ -118,8 +118,8 @@
#define VT_TIMERFREQ 25
/* Bell pitch/duration. */
-#define VT_BELLDURATION ((5 * hz + 99) / 100)
-#define VT_BELLPITCH 800
+#define VT_BELLDURATION (SBT_1S / 20)
+#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */
#define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \
(vw)->vw_number)
@@ -1100,7 +1100,7 @@
if (vd->vd_flags & VDF_QUIET_BELL)
return;
- sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION);
+ sysbeep(VT_BELLPITCH, VT_BELLDURATION);
}
static void
@@ -1116,7 +1116,7 @@
return;
}
- period = ((param >> 16) & 0xffff) * hz / 1000;
+ period = ((param >> 16) & 0xffff) * SBT_1MS;
freq = 1193182 / (param & 0xffff);
sysbeep(freq, period);
Index: sys/i386/i386/trap.c
===================================================================
--- sys/i386/i386/trap.c
+++ sys/i386/i386/trap.c
@@ -414,7 +414,7 @@
#endif
if (time_second - lastalert > 10) {
log(LOG_WARNING, "NMI: power fail\n");
- sysbeep(880, hz);
+ sysbeep(880, SBT_1S);
lastalert = time_second;
}
return;
@@ -671,7 +671,7 @@
#ifdef POWERFAIL_NMI
if (time_second - lastalert > 10) {
log(LOG_WARNING, "NMI: power fail\n");
- sysbeep(880, hz);
+ sysbeep(880, SBT_1S);
lastalert = time_second;
}
return;
Index: sys/kern/kern_cons.c
===================================================================
--- sys/kern/kern_cons.c
+++ sys/kern/kern_cons.c
@@ -670,7 +670,7 @@
}
int
-sysbeep(int pitch, int period)
+sysbeep(int pitch, sbintime_t duration)
{
if (timer_spkr_acquire()) {
@@ -681,8 +681,8 @@
}
timer_spkr_setfreq(pitch);
if (!beeping) {
- beeping = period;
- callout_reset(&beeping_timer, period, sysbeepstop, NULL);
+ beeping = duration;
+ callout_reset_sbt(&beeping_timer, duration, 0, sysbeepstop, NULL, C_PREL(1));
}
return (0);
}
Index: sys/sys/systm.h
===================================================================
--- sys/sys/systm.h
+++ sys/sys/systm.h
@@ -467,7 +467,7 @@
void realitexpire(void *);
-int sysbeep(int hertz, int period);
+int sysbeep(int hertz, sbintime_t duration);
void hardclock(int cnt, int usermode);
void hardclock_sync(int cpu);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 2:12 AM (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35388416
Default Alt Text
D32619.id97347.diff (3 KB)
Attached To
Mode
D32619: sysbeep: Adjust interface to take a duration as a sbt
Attached
Detach File
Event Timeline
Log In to Comment