diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2011-06-17 21:41:06 +0000 |
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2011-06-17 21:41:06 +0000 |
| commit | 5df88f46bbf686ad9a6f3ace974ff0d764d48cd8 (patch) | |
| tree | 26ac1140ee2ae222240b86fc45dea7d39d7f685b | |
| parent | 7000858ec66c8d6314a527e8db4783642747d109 (diff) | |
Notes
| -rw-r--r-- | sys/x86/x86/tsc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 70c176aad5e1..9501eee92a2e 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -461,7 +461,7 @@ init_TSC_tc(void) tsc_timecounter.tc_quality = 1000; init: - for (shift = 0; shift < 32 && (tsc_freq >> shift) > max_freq; shift++) + for (shift = 0; shift < 31 && (tsc_freq >> shift) > max_freq; shift++) ; if (shift > 0) { tsc_timecounter.tc_get_timecount = tsc_get_timecount_low; @@ -579,6 +579,9 @@ tsc_get_timecount(struct timecounter *tc __unused) static u_int tsc_get_timecount_low(struct timecounter *tc) { + uint32_t rv; - return (rdtsc() >> (int)(intptr_t)tc->tc_priv); + __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" + : "=a" (rv) : "c" ((int)(intptr_t)tc->tc_priv) : "edx"); + return (rv); } |
