version 1.5, 2006/06/13 17:37:06 |
version 1.5.6.5, 2008/03/17 09:14:36 |
Line 89 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 89 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#ifdef i386 |
#ifdef i386 |
#include "opt_enhanced_speedstep.h" |
#include "opt_enhanced_speedstep.h" |
#endif |
#endif |
|
#ifdef i386 |
|
#include "opt_powernow_k7.h" |
|
#endif |
|
#include "opt_powernow_k8.h" |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/systm.h> |
#include <sys/systm.h> |
Line 109 int tsc_is_broken = 0; |
|
Line 113 int tsc_is_broken = 0; |
|
|
|
static int64_t tsc_cal_val; /* last calibrate time stamp */ |
static int64_t tsc_cal_val; /* last calibrate time stamp */ |
|
|
static timecounter_get_t tsc_get_timecount; |
timecounter_get_t tsc_get_timecount; |
|
timecounter_get_t tsc_slow_timecount; |
static timecounter_pps_t tsc_calibrate; |
static timecounter_pps_t tsc_calibrate; |
|
|
void tsc_calibrate_cpu(struct cpu_info *); |
void tsc_calibrate_cpu(struct cpu_info *); |
Line 120 static struct timecounter tsc_timecounte |
|
Line 125 static struct timecounter tsc_timecounte |
|
~0u, /* counter_mask */ |
~0u, /* counter_mask */ |
0, /* frequency */ |
0, /* frequency */ |
"TSC", /* name */ |
"TSC", /* name */ |
#if defined(ENHANCED_SPEEDSTEP) |
#if (defined(ENHANCED_SPEEDSTEP) || defined(POWERNOW_K7) || defined(POWERNOW_K8)) |
-100, /* don't pick TSC automatically */ |
-100, /* don't pick TSC automatically */ |
/* if frequency changes might affect TSC */ |
/* if frequency changes might affect TSC */ |
#else |
#else |
800, /* quality (adjusted in code) */ |
800, /* quality (adjusted in code) */ |
#endif |
#endif |
|
NULL, |
|
NULL, |
}; |
}; |
|
|
void |
void |
|
|
|
|
do { |
do { |
tscval[0] = rdtsc(); |
tscval[0] = rdtsc(); |
DELAY(100000); |
i8254_delay(100000); |
tscval[1] = rdtsc(); |
tscval[1] = rdtsc(); |
} while (tscval[1] < tscval[0]); |
} while (tscval[1] < tscval[0]); |
|
|
Line 169 init_TSC_tc(void) |
|
Line 176 init_TSC_tc(void) |
|
/* |
/* |
* pick up tick count scaled to reference tick count |
* pick up tick count scaled to reference tick count |
*/ |
*/ |
static u_int |
u_int |
tsc_get_timecount(struct timecounter *tc) |
tsc_slow_timecount(struct timecounter *tc) |
{ |
{ |
struct cpu_info *ci = curcpu(); |
struct cpu_info *ci = curcpu(); |
int64_t rcc, cc; |
int64_t rcc, cc; |