aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/clock.h
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1996-08-02 21:16:13 +0000
committerBruce Evans <bde@FreeBSD.org>1996-08-02 21:16:13 +0000
commitd9927d111861fb154b70d171f002376e80b6d306 (patch)
tree468b09de3ff6a36f8aa2bdacf3048d0753491b51 /sys/amd64/include/clock.h
parent41ae0562ed9813dc9b30cf4b1024c20aba861854 (diff)
Notes
Diffstat (limited to 'sys/amd64/include/clock.h')
-rw-r--r--sys/amd64/include/clock.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/amd64/include/clock.h b/sys/amd64/include/clock.h
index 043936310dd5..f50da08c9905 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.14 1996/06/14 11:00:56 asami Exp $
+ * $Id: clock.h,v 1.15 1996/07/30 19:26:55 bde Exp $
*/
#ifndef _MACHINE_CLOCK_H_
@@ -21,7 +21,7 @@
*/
#define CPU_CLOCKUPDATE(otime, ntime) \
do { \
- if(i586_ctr_rate) { \
+ if (i586_ctr_freq != 0) { \
disable_intr(); \
i586_ctr_bias = i586_last_tick; \
*(otime) = *(ntime); \
@@ -40,7 +40,6 @@
#define I586_CTR_COMULTIPLIER_SHIFT 20
#define I586_CTR_MULTIPLIER_SHIFT 32
-#define I586_CTR_RATE_SHIFT 8
#if defined(KERNEL) && !defined(LOCORE)
#include <sys/cdefs.h>
@@ -57,12 +56,11 @@ extern int statclock_disable;
extern int wall_cmos_clock;
#if defined(I586_CPU) || defined(I686_CPU)
+extern u_int i586_ctr_bias;
extern u_int i586_ctr_comultiplier;
extern u_int i586_ctr_freq;
extern u_int i586_ctr_multiplier;
-extern unsigned i586_ctr_rate; /* fixed point */
extern long long i586_last_tick;
-extern long long i586_ctr_bias;
extern unsigned long i586_avg_tick;
#endif
extern int timer0_max_count;
@@ -77,11 +75,11 @@ cpu_thisticklen(u_long dflt)
long long old;
long len;
- if (i586_ctr_rate) {
+ if (i586_ctr_freq != 0) {
old = i586_last_tick;
i586_last_tick = rdtsc();
- len = ((i586_last_tick - old) << I586_CTR_RATE_SHIFT)
- / i586_ctr_rate;
+ len = ((i586_last_tick - old) * i586_ctr_multiplier)
+ >> I586_CTR_MULTIPLIER_SHIFT;
i586_avg_tick = i586_avg_tick * 15 / 16 + len / 16;
}
return dflt;