restore audiobell api

This commit is contained in:
christos 2016-12-09 13:26:11 +00:00
parent 37817cca55
commit 86703f4f21
3 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: audiobell.c,v 1.10 2016/12/09 13:16:22 christos Exp $ */
/* $NetBSD: audiobell.c,v 1.11 2016/12/09 13:26:11 christos Exp $ */
/*
@ -32,7 +32,7 @@
*/
#include <sys/types.h>
__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.10 2016/12/09 13:16:22 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: audiobell.c,v 1.11 2016/12/09 13:26:11 christos Exp $");
#include <sys/audioio.h>
#include <sys/conf.h>
@ -137,14 +137,14 @@ audiobell_synthesize(uint8_t *buf, u_int pitch, u_int period, u_int volume)
}
void
audiobell(int unit, u_int pitch, u_int period, u_int volume, int poll)
audiobell(void *unit, u_int pitch, u_int period, u_int volume, int poll)
{
uint8_t *buf;
struct audio_info ai;
struct uio auio;
struct iovec aiov;
int size, len, offset;
dev_t audio = (dev_t)(AUDIO_DEVICE | unit);
dev_t audio = (dev_t)(AUDIO_DEVICE | *(int *)unit);
/* The audio system isn't built for polling. */
if (poll) return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: audiobellvar.h,v 1.8 2016/12/09 13:16:22 christos Exp $ */
/* $NetBSD: audiobellvar.h,v 1.9 2016/12/09 13:26:11 christos Exp $ */
/*-
* Copyright (c) 2004 Ben Harris
@ -38,4 +38,4 @@
* This function is designed to be passed to pckbd_hookup_bell() and
* equivalents.
*/
void audiobell(int, u_int, u_int, u_int, int);
void audiobell(void *, u_int, u_int, u_int, int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: spkr_synth.c,v 1.4 2016/12/09 13:16:22 christos Exp $ */
/* $NetBSD: spkr_synth.c,v 1.5 2016/12/09 13:26:11 christos Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: spkr_synth.c,v 1.4 2016/12/09 13:16:22 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: spkr_synth.c,v 1.5 2016/12/09 13:26:11 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -97,7 +97,7 @@ struct spkr_attach_args {
void
spkr_tone(u_int xhz, u_int ticks)
{
audiobell(beep_unit, xhz, ticks * (1000 / hz), 80, 0);
audiobell(&beep_unit, xhz, ticks * (1000 / hz), 80, 0);
}
void
@ -107,7 +107,7 @@ spkr_rest(int ticks)
printf("%s: %d\n", __func__, ticks);
#endif /* SPKRDEBUG */
if (ticks > 0)
audiobell(beep_unit, 0, ticks * (1000 / hz), 80, 0);
audiobell(&beep_unit, 0, ticks * (1000 / hz), 80, 0);
}
device_t
@ -202,7 +202,7 @@ bell_thread(void *arg)
bperiod = vb->period;
bvolume = vb->volume;
mutex_exit(&sc_bellock);
audiobell(beep_unit, bpitch, bperiod, bvolume, 0);
audiobell(&beep_unit, bpitch, bperiod, bvolume, 0);
}
}