aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2021-11-03 21:55:32 +0000
committerWarner Losh <imp@FreeBSD.org>2021-11-03 22:03:51 +0000
commit072d5b98c4318e20248a6fbea4a5ca7c96992cac (patch)
tree9e77c1a90a9947a8527f260f98a79e7c93ea101f /sys/kern
parent6b67753488cb506f05694c5f6d2e74cf53497c54 (diff)
downloadsrc-072d5b98c4318e20248a6fbea4a5ca7c96992cac.tar.gz
src-072d5b98c4318e20248a6fbea4a5ca7c96992cac.zip
sysbeep: Adjust interface to take a duration as a sbt
Change the 'period' argument to 'duration' and change its type to sbintime_t so we can more easily express different durations. Reviewed by: tsoome, glebius Differential Revision: https://reviews.freebsd.org/D32619
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_cons.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
index 780fce00387d..d33811f1e3c8 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -658,7 +658,7 @@ constty_timeout(void *arg)
#ifdef HAS_TIMER_SPKR
-static int beeping;
+static bool beeping;
static struct callout beeping_timer;
static void
@@ -666,11 +666,11 @@ sysbeepstop(void *chan)
{
timer_spkr_release();
- beeping = 0;
+ beeping = false;
}
int
-sysbeep(int pitch, int period)
+sysbeep(int pitch, sbintime_t duration)
{
if (timer_spkr_acquire()) {
@@ -681,8 +681,9 @@ sysbeep(int pitch, int period)
}
timer_spkr_setfreq(pitch);
if (!beeping) {
- beeping = period;
- callout_reset(&beeping_timer, period, sysbeepstop, NULL);
+ beeping = true;
+ callout_reset_sbt(&beeping_timer, duration, 0, sysbeepstop,
+ NULL, C_PREL(5));
}
return (0);
}
@@ -701,7 +702,7 @@ SYSINIT(sysbeep, SI_SUB_SOFTINTR, SI_ORDER_ANY, sysbeep_init, NULL);
*/
int
-sysbeep(int pitch __unused, int period __unused)
+sysbeep(int pitch __unused, sbintime_t duration __unused)
{
return (ENODEV);