diff options
Diffstat (limited to 'sys/i386/isa/clock.c')
-rw-r--r-- | sys/i386/isa/clock.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index eb8f282..5350c79 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -77,13 +77,14 @@ __FBSDID("$FreeBSD$"); #include <machine/apicvar.h> #endif #include <machine/specialreg.h> +#include <machine/ppireg.h> +#include <machine/timerreg.h> -#include <i386/isa/isa.h> #include <isa/rtc.h> #ifdef DEV_ISA +#include <isa/isareg.h> #include <isa/isavar.h> #endif -#include <i386/isa/timerreg.h> #ifdef DEV_MCA #include <i386/bios/mca_machdep.h> @@ -379,8 +380,8 @@ DELAY(int n) static void sysbeepstop(void *chan) { - outb(IO_PPI, inb(IO_PPI)&0xFC); /* disable counter2 output to speaker */ - release_timer2(); + ppi_spkr_off(); /* disable counter2 output to speaker */ + timer_spkr_release(); beeping = 0; } @@ -389,19 +390,18 @@ sysbeep(int pitch, int period) { int x = splclock(); - if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) + if (timer_spkr_acquire()) if (!beeping) { /* Something else owns it. */ splx(x); return (-1); /* XXX Should be EBUSY, but nobody cares anyway. */ } mtx_lock_spin(&clock_lock); - outb(TIMER_CNTR2, pitch); - outb(TIMER_CNTR2, (pitch>>8)); + spkr_set_pitch(pitch); mtx_unlock_spin(&clock_lock); if (!beeping) { /* enable counter2 output to speaker */ - outb(IO_PPI, inb(IO_PPI) | 3); + ppi_spkr_on(); beeping = period; timeout(sysbeepstop, (void *)NULL, period); } |