summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/clock.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-05-19 18:48:30 +0000
committerphk <phk@FreeBSD.org>1998-05-19 18:48:30 +0000
commit15e1fb4bace27bcfe283a97139194423cde6b8a9 (patch)
tree05f9d22241927b7c35c43c4727fd6781c6e507f6 /sys/i386/isa/clock.c
parentaf5985383486a23fcaee5d2383a4e8e08c7ae517 (diff)
downloadFreeBSD-src-15e1fb4bace27bcfe283a97139194423cde6b8a9.zip
FreeBSD-src-15e1fb4bace27bcfe283a97139194423cde6b8a9.tar.gz
Change a data type internal to the timecounters, and remove the "delta"
function. Reviewed, but not entirely approved by: bde
Diffstat (limited to 'sys/i386/isa/clock.c')
-rw-r--r--sys/i386/isa/clock.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index ade24c3..315e61a 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.118 1998/03/30 09:48:47 phk Exp $
+ * $Id: clock.c,v 1.119 1998/04/05 01:04:48 tegge Exp $
*/
/*
@@ -169,15 +169,13 @@ static u_char timer2_state;
static void (*timer_func) __P((struct clockframe *frame)) = hardclock;
static u_int tsc_present;
-static u_int64_t i8254_get_timecount __P((void));
+static unsigned i8254_get_timecount __P((void));
+static unsigned tsc_get_timecount __P((void));
static void set_timer_freq(u_int freq, int intr_freq);
-static u_int64_t tsc_get_timecount __P((void));
-static u_int32_t tsc_get_timedelta __P((struct timecounter *tc));
static struct timecounter tsc_timecounter[3] = {
- tsc_get_timedelta, /* get_timedelta */
tsc_get_timecount, /* get_timecount */
- ~0, /* counter_mask */
+ ~0u, /* counter_mask */
0, /* frequency */
"TSC" /* name */
};
@@ -186,9 +184,8 @@ SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
tsc_timecounter, sizeof(tsc_timecounter), "S,timecounter", "");
static struct timecounter i8254_timecounter[3] = {
- 0, /* get_timedelta */
i8254_get_timecount, /* get_timecount */
- (1ULL << 32) - 1, /* counter_mask */
+ ~0u, /* counter_mask */
0, /* frequency */
"i8254" /* name */
};
@@ -1132,10 +1129,10 @@ sysctl_machdep_tsc_freq SYSCTL_HANDLER_ARGS
SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_INT | CTLFLAG_RW,
0, sizeof(u_int), sysctl_machdep_tsc_freq, "I", "");
-static u_int64_t
+static u_int
i8254_get_timecount(void)
{
- u_int32_t count;
+ u_int count;
u_long ef;
u_int high, low;
@@ -1161,14 +1158,8 @@ i8254_get_timecount(void)
return (count);
}
-static u_int64_t
+static u_int
tsc_get_timecount(void)
{
- return ((u_int64_t)rdtsc());
-}
-
-static u_int32_t
-tsc_get_timedelta(struct timecounter *tc)
-{
- return ((u_int64_t)rdtsc() - tc->offset_count);
+ return (rdtsc());
}
OpenPOWER on IntegriCloud