diff options
author | nyan <nyan@FreeBSD.org> | 2005-05-14 09:10:02 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2005-05-14 09:10:02 +0000 |
commit | 99f1b222339d6eee1c65e04ad1def3c866f155b0 (patch) | |
tree | d6652ab4639c3a5c5eb85fbf3822f9f54a92d8b1 /sys/i386/isa/clock.c | |
parent | cb84f02ba844fdbece84784ccefc57126f36d66f (diff) | |
download | FreeBSD-src-99f1b222339d6eee1c65e04ad1def3c866f155b0.zip FreeBSD-src-99f1b222339d6eee1c65e04ad1def3c866f155b0.tar.gz |
- Move timerreg.h to <arch>/include and split i8253 specific defines into
i8253reg.h, and add some defines to control a speaker.
- Move PPI related defines from i386/isa/spkr.c into ppireg.h and use them.
- Move IO_{PPI,TIMER} defines into ppireg.h and timerreg.h respectively.
- Use isa/isareg.h rather than <arch>/isa/isa.h.
Tested on: i386, pc98
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); } |