diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 10dfe2ffcad3..df32d006c570 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: support.s,v 1.30 1995/12/27 18:54:51 davidg Exp $ + * $Id: support.s,v 1.31 1995/12/28 23:14:40 davidg Exp $ */ #include "assym.s" /* system definitions */ @@ -48,18 +48,6 @@ _bzero: .long _generic_bzero .text -/* - * Support for reading real time clock registers - */ -ENTRY(rtcin) /* rtcin(val) */ - movl 4(%esp),%eax - outb %al,$0x70 - FASTER_NOP - xorl %eax,%eax - inb $0x71,%al - FASTER_NOP - ret - /* * bcopy family * void bzero(void *base, u_int cnt) diff --git a/sys/amd64/amd64/support.s b/sys/amd64/amd64/support.s index 10dfe2ffcad3..df32d006c570 100644 --- a/sys/amd64/amd64/support.s +++ b/sys/amd64/amd64/support.s @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: support.s,v 1.30 1995/12/27 18:54:51 davidg Exp $ + * $Id: support.s,v 1.31 1995/12/28 23:14:40 davidg Exp $ */ #include "assym.s" /* system definitions */ @@ -48,18 +48,6 @@ _bzero: .long _generic_bzero .text -/* - * Support for reading real time clock registers - */ -ENTRY(rtcin) /* rtcin(val) */ - movl 4(%esp),%eax - outb %al,$0x70 - FASTER_NOP - xorl %eax,%eax - inb $0x71,%al - FASTER_NOP - ret - /* * bcopy family * void bzero(void *base, u_int cnt) diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c index d9ae3732d30a..b4a01cee1cb9 100644 --- a/sys/amd64/amd64/tsc.c +++ b/sys/amd64/amd64/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.51 1996/01/30 18:56:47 wollman Exp $ + * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ */ /* @@ -400,6 +400,19 @@ sysbeep(int pitch, int period) * RTC support routines */ +int +rtcin(reg) + int reg; +{ + u_char val; + + outb(IO_RTC, reg); + inb(0x84); + val = inb(IO_RTC + 1); + inb(0x84); + return (val); +} + static __inline void writertc(u_char reg, u_char val) { diff --git a/sys/amd64/include/clock.h b/sys/amd64/include/clock.h index 867131154b95..f7ba36e95b0f 100644 --- a/sys/amd64/include/clock.h +++ b/sys/amd64/include/clock.h @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $Id: clock.h,v 1.8 1995/12/24 08:10:49 davidg Exp $ + * $Id: clock.h,v 1.9 1996/01/30 18:56:24 wollman Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -95,6 +95,7 @@ int acquire_timer0 __P((int rate, int acquire_timer2 __P((int mode)); int release_timer0 __P((void)); int release_timer2 __P((void)); +int rtcin __P((int val)); int sysbeep __P((int pitch, int period)); #endif /* KERNEL && !LOCORE */ diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 756bb6584518..9e4896d80815 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.46 1996/03/26 19:57:56 wollman Exp $ + * $Id: cpufunc.h,v 1.47 1996/03/28 20:39:45 wollman Exp $ */ /* @@ -368,7 +368,6 @@ void load_cr3 __P((u_long cr3)); void ltr __P((u_short sel)); u_int rcr0 __P((void)); u_long rcr3 __P((void)); -int rtcin __P((int val)); /* * These functions are NOT in support.s and should be declared elsewhere. diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index d9ae3732d30a..b4a01cee1cb9 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.51 1996/01/30 18:56:47 wollman Exp $ + * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ */ /* @@ -400,6 +400,19 @@ sysbeep(int pitch, int period) * RTC support routines */ +int +rtcin(reg) + int reg; +{ + u_char val; + + outb(IO_RTC, reg); + inb(0x84); + val = inb(IO_RTC + 1); + inb(0x84); + return (val); +} + static __inline void writertc(u_char reg, u_char val) { diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s index 10dfe2ffcad3..df32d006c570 100644 --- a/sys/i386/i386/support.s +++ b/sys/i386/i386/support.s @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: support.s,v 1.30 1995/12/27 18:54:51 davidg Exp $ + * $Id: support.s,v 1.31 1995/12/28 23:14:40 davidg Exp $ */ #include "assym.s" /* system definitions */ @@ -48,18 +48,6 @@ _bzero: .long _generic_bzero .text -/* - * Support for reading real time clock registers - */ -ENTRY(rtcin) /* rtcin(val) */ - movl 4(%esp),%eax - outb %al,$0x70 - FASTER_NOP - xorl %eax,%eax - inb $0x71,%al - FASTER_NOP - ret - /* * bcopy family * void bzero(void *base, u_int cnt) diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c index d9ae3732d30a..b4a01cee1cb9 100644 --- a/sys/i386/i386/tsc.c +++ b/sys/i386/i386/tsc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.51 1996/01/30 18:56:47 wollman Exp $ + * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ */ /* @@ -400,6 +400,19 @@ sysbeep(int pitch, int period) * RTC support routines */ +int +rtcin(reg) + int reg; +{ + u_char val; + + outb(IO_RTC, reg); + inb(0x84); + val = inb(IO_RTC + 1); + inb(0x84); + return (val); +} + static __inline void writertc(u_char reg, u_char val) { diff --git a/sys/i386/include/clock.h b/sys/i386/include/clock.h index 867131154b95..f7ba36e95b0f 100644 --- a/sys/i386/include/clock.h +++ b/sys/i386/include/clock.h @@ -3,7 +3,7 @@ * Garrett Wollman, September 1994. * This file is in the public domain. * - * $Id: clock.h,v 1.8 1995/12/24 08:10:49 davidg Exp $ + * $Id: clock.h,v 1.9 1996/01/30 18:56:24 wollman Exp $ */ #ifndef _MACHINE_CLOCK_H_ @@ -95,6 +95,7 @@ int acquire_timer0 __P((int rate, int acquire_timer2 __P((int mode)); int release_timer0 __P((void)); int release_timer2 __P((void)); +int rtcin __P((int val)); int sysbeep __P((int pitch, int period)); #endif /* KERNEL && !LOCORE */ diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 756bb6584518..9e4896d80815 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.46 1996/03/26 19:57:56 wollman Exp $ + * $Id: cpufunc.h,v 1.47 1996/03/28 20:39:45 wollman Exp $ */ /* @@ -368,7 +368,6 @@ void load_cr3 __P((u_long cr3)); void ltr __P((u_short sel)); u_int rcr0 __P((void)); u_long rcr3 __P((void)); -int rtcin __P((int val)); /* * These functions are NOT in support.s and should be declared elsewhere. diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index d9ae3732d30a..b4a01cee1cb9 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.51 1996/01/30 18:56:47 wollman Exp $ + * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ */ /* @@ -400,6 +400,19 @@ sysbeep(int pitch, int period) * RTC support routines */ +int +rtcin(reg) + int reg; +{ + u_char val; + + outb(IO_RTC, reg); + inb(0x84); + val = inb(IO_RTC + 1); + inb(0x84); + return (val); +} + static __inline void writertc(u_char reg, u_char val) { diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index d9ae3732d30a..b4a01cee1cb9 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.51 1996/01/30 18:56:47 wollman Exp $ + * $Id: clock.c,v 1.53 1996/03/23 21:36:03 nate Exp $ */ /* @@ -400,6 +400,19 @@ sysbeep(int pitch, int period) * RTC support routines */ +int +rtcin(reg) + int reg; +{ + u_char val; + + outb(IO_RTC, reg); + inb(0x84); + val = inb(IO_RTC + 1); + inb(0x84); + return (val); +} + static __inline void writertc(u_char reg, u_char val) {