Fix previous (need to add IO_TIMER1 to the register offsets).
This commit is contained in:
parent
f9b8434a5c
commit
65e781f38c
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: joy_timer.c,v 1.2 2002/08/13 02:17:45 itojun Exp $ */
|
||||
/* $NetBSD: joy_timer.c,v 1.3 2002/08/13 02:42:54 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* XXX This _really_ should be rewritten such that it doesn't
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: joy_timer.c,v 1.2 2002/08/13 02:17:45 itojun Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: joy_timer.c,v 1.3 2002/08/13 02:42:54 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -57,17 +57,16 @@ __KERNEL_RCSID(0, "$NetBSD: joy_timer.c,v 1.2 2002/08/13 02:17:45 itojun Exp $")
|
|||
#include <dev/isa/isareg.h>
|
||||
|
||||
#include <dev/ic/joyvar.h>
|
||||
|
||||
#include <dev/ic/i8253reg.h>
|
||||
#include <dev/ic/i8253reg.h> /* XXX XXX XXX */
|
||||
|
||||
int
|
||||
joy_get_tick()
|
||||
{
|
||||
int low, high;
|
||||
|
||||
outb(TIMER_MODE, TIMER_SEL0);
|
||||
low = inb(TIMER_CNTR0);
|
||||
high = inb(TIMER_CNTR0);
|
||||
outb(IO_TIMER1+TIMER_MODE, TIMER_SEL0);
|
||||
low = inb(IO_TIMER1+TIMER_CNTR0);
|
||||
high = inb(IO_TIMER1+TIMER_CNTR0);
|
||||
|
||||
return ((high << 8) | low);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue