summaryrefslogtreecommitdiffstats
path: root/sys/isa/syscons_isa.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2005-05-14 09:10:02 +0000
committernyan <nyan@FreeBSD.org>2005-05-14 09:10:02 +0000
commit99f1b222339d6eee1c65e04ad1def3c866f155b0 (patch)
treed6652ab4639c3a5c5eb85fbf3822f9f54a92d8b1 /sys/isa/syscons_isa.c
parentcb84f02ba844fdbece84784ccefc57126f36d66f (diff)
downloadFreeBSD-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/isa/syscons_isa.c')
-rw-r--r--sys/isa/syscons_isa.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c
index d271d09..3f750ef 100644
--- a/sys/isa/syscons_isa.c
+++ b/sys/isa/syscons_isa.c
@@ -43,14 +43,14 @@ __FBSDID("$FreeBSD$");
#include <machine/clock.h>
#include <machine/md_var.h>
+#include <machine/ppireg.h>
+#include <machine/timerreg.h>
#include <machine/pc/bios.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_param.h>
-#include <i386/isa/timerreg.h>
-
#define BIOS_CLKED (1 << 6)
#define BIOS_NLKED (1 << 5)
#define BIOS_SLKED (1 << 4)
@@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$");
#include <dev/syscons/syscons.h>
-#include <isa/isareg.h>
#include <isa/isavar.h>
static devclass_t sc_devclass;
@@ -256,22 +255,18 @@ int
sc_tone(int herz)
{
#if defined(__i386__) || defined(__amd64__)
- int pitch;
-
if (herz) {
/* set command for counter 2, 2 byte write */
- if (acquire_timer2(TIMER_16BIT | TIMER_SQWAVE))
+ if (timer_spkr_acquire())
return EBUSY;
/* set pitch */
- pitch = timer_freq/herz;
- outb(TIMER_CNTR2, pitch);
- outb(TIMER_CNTR2, pitch >> 8);
+ spkr_set_pitch(timer_freq / herz);
/* enable counter 2 output to speaker */
- outb(IO_PPI, inb(IO_PPI) | 3);
+ ppi_spkr_on();
} else {
/* disable counter 2 output to speaker */
- outb(IO_PPI, inb(IO_PPI) & 0xFC);
- release_timer2();
+ ppi_spkr_off();
+ timer_spkr_release();
}
#endif
OpenPOWER on IntegriCloud