summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-03-31 04:05:36 +0000
committerbde <bde@FreeBSD.org>1996-03-31 04:05:36 +0000
commitb26bbde39abed59833a579d4dc9ef2c51c4ae0aa (patch)
tree593fa91693fefd4a4c0ff91c25c705e7554e493d /sys
parent20ef589c863a5318deea9fcbefdfa88744a4ea4e (diff)
downloadFreeBSD-src-b26bbde39abed59833a579d4dc9ef2c51c4ae0aa.zip
FreeBSD-src-b26bbde39abed59833a579d4dc9ef2c51c4ae0aa.tar.gz
Moved rtcin() to clock.c.
Always delay using one inb(0x84) after each i/o in rtcin() - don't do this conditional on the bogus option DUMMY_NOPS not being defined. If you want an optionally slightly faster rtcin() again, then inline it and use a better named option or sysctl variable. It only needs to be fast in rtcintr().
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/support.S14
-rw-r--r--sys/amd64/amd64/support.s14
-rw-r--r--sys/amd64/amd64/tsc.c15
-rw-r--r--sys/amd64/include/clock.h3
-rw-r--r--sys/amd64/include/cpufunc.h3
-rw-r--r--sys/amd64/isa/clock.c15
-rw-r--r--sys/i386/i386/support.s14
-rw-r--r--sys/i386/i386/tsc.c15
-rw-r--r--sys/i386/include/clock.h3
-rw-r--r--sys/i386/include/cpufunc.h3
-rw-r--r--sys/i386/isa/clock.c15
-rw-r--r--sys/isa/atrtc.c15
12 files changed, 79 insertions, 50 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S
index 10dfe2f..df32d00 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 */
@@ -49,18 +49,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 10dfe2f..df32d00 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 */
@@ -49,18 +49,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 d9ae373..b4a01ce 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 8671311..f7ba36e95 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 756bb65..9e4896d 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 d9ae373..b4a01ce 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 10dfe2f..df32d00 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 */
@@ -49,18 +49,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 d9ae373..b4a01ce 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 8671311..f7ba36e95 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 756bb65..9e4896d 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 d9ae373..b4a01ce 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 d9ae373..b4a01ce 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)
{
OpenPOWER on IntegriCloud