diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/tsc.c | 5 | ||||
-rw-r--r-- | sys/amd64/include/cpu.h | 5 | ||||
-rw-r--r-- | sys/amd64/isa/clock.c | 5 | ||||
-rw-r--r-- | sys/i386/i386/tsc.c | 5 | ||||
-rw-r--r-- | sys/i386/include/cpu.h | 5 | ||||
-rw-r--r-- | sys/i386/isa/clock.c | 5 | ||||
-rw-r--r-- | sys/isa/atrtc.c | 5 |
7 files changed, 29 insertions, 6 deletions
diff --git a/sys/amd64/amd64/tsc.c b/sys/amd64/amd64/tsc.c index 1ad7bf4..aafa821 100644 --- a/sys/amd64/amd64/tsc.c +++ b/sys/amd64/amd64/tsc.c @@ -169,7 +169,12 @@ static u_int timer0_prescaler_count; static u_char timer0_state; static u_char timer2_state; static void (*timer_func) __P((struct clockframe *frame)) = hardclock; +#if defined(I386_CPU) || defined(I486_CPU) + u_int tsc_present; /* Not static; other parts of the kernel + * Need to know this */ +#else static u_int tsc_present; +#endif static unsigned i8254_get_timecount __P((struct timecounter *tc)); static unsigned tsc_get_timecount __P((struct timecounter *tc)); diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index 9293ba2..d7e2160 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -47,8 +47,6 @@ #include <machine/frame.h> #include <machine/segments.h> #include <machine/globals.h> -#include <machine/md_var.h> -#include <machine/specialreg.h> /* * definitions of cpu-dependent requirements @@ -145,9 +143,10 @@ static __inline u_int64_t get_cyclecount(void) { #if defined(I386_CPU) || defined(I486_CPU) + extern u_int tsc_present; struct timespec tv; - if ((cpu_feature & CPUID_TSC) == 0) { + if (!tsc_present) { nanotime(&tv); return (tv.tv_sec * (u_int64_t)1000000000 + tv.tv_nsec); } diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c index 1ad7bf4..aafa821 100644 --- a/sys/amd64/isa/clock.c +++ b/sys/amd64/isa/clock.c @@ -169,7 +169,12 @@ static u_int timer0_prescaler_count; static u_char timer0_state; static u_char timer2_state; static void (*timer_func) __P((struct clockframe *frame)) = hardclock; +#if defined(I386_CPU) || defined(I486_CPU) + u_int tsc_present; /* Not static; other parts of the kernel + * Need to know this */ +#else static u_int tsc_present; +#endif static unsigned i8254_get_timecount __P((struct timecounter *tc)); static unsigned tsc_get_timecount __P((struct timecounter *tc)); diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c index 1ad7bf4..aafa821 100644 --- a/sys/i386/i386/tsc.c +++ b/sys/i386/i386/tsc.c @@ -169,7 +169,12 @@ static u_int timer0_prescaler_count; static u_char timer0_state; static u_char timer2_state; static void (*timer_func) __P((struct clockframe *frame)) = hardclock; +#if defined(I386_CPU) || defined(I486_CPU) + u_int tsc_present; /* Not static; other parts of the kernel + * Need to know this */ +#else static u_int tsc_present; +#endif static unsigned i8254_get_timecount __P((struct timecounter *tc)); static unsigned tsc_get_timecount __P((struct timecounter *tc)); diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 9293ba2..d7e2160 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -47,8 +47,6 @@ #include <machine/frame.h> #include <machine/segments.h> #include <machine/globals.h> -#include <machine/md_var.h> -#include <machine/specialreg.h> /* * definitions of cpu-dependent requirements @@ -145,9 +143,10 @@ static __inline u_int64_t get_cyclecount(void) { #if defined(I386_CPU) || defined(I486_CPU) + extern u_int tsc_present; struct timespec tv; - if ((cpu_feature & CPUID_TSC) == 0) { + if (!tsc_present) { nanotime(&tv); return (tv.tv_sec * (u_int64_t)1000000000 + tv.tv_nsec); } diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c index 1ad7bf4..aafa821 100644 --- a/sys/i386/isa/clock.c +++ b/sys/i386/isa/clock.c @@ -169,7 +169,12 @@ static u_int timer0_prescaler_count; static u_char timer0_state; static u_char timer2_state; static void (*timer_func) __P((struct clockframe *frame)) = hardclock; +#if defined(I386_CPU) || defined(I486_CPU) + u_int tsc_present; /* Not static; other parts of the kernel + * Need to know this */ +#else static u_int tsc_present; +#endif static unsigned i8254_get_timecount __P((struct timecounter *tc)); static unsigned tsc_get_timecount __P((struct timecounter *tc)); diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c index 1ad7bf4..aafa821 100644 --- a/sys/isa/atrtc.c +++ b/sys/isa/atrtc.c @@ -169,7 +169,12 @@ static u_int timer0_prescaler_count; static u_char timer0_state; static u_char timer2_state; static void (*timer_func) __P((struct clockframe *frame)) = hardclock; +#if defined(I386_CPU) || defined(I486_CPU) + u_int tsc_present; /* Not static; other parts of the kernel + * Need to know this */ +#else static u_int tsc_present; +#endif static unsigned i8254_get_timecount __P((struct timecounter *tc)); static unsigned tsc_get_timecount __P((struct timecounter *tc)); |