Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53926
b: refs/heads/master
c: 4637a74
h: refs/heads/master
v: v3
  • Loading branch information
David P. Reed authored and Andi Kleen committed May 2, 2007
1 parent 4d77d00 commit 7627340
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d016dd43b8df0228f1022f483f582eeb52d256e
refs/heads/master: 4637a74cf2ac3a3696d385c8624d84de789d1bbe
11 changes: 6 additions & 5 deletions trunk/arch/x86_64/kernel/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,14 +839,15 @@ static void setup_APIC_timer(unsigned int clocks)

static int __init calibrate_APIC_clock(void)
{
int apic, apic_start, tsc, tsc_start;
unsigned apic, apic_start;
unsigned long tsc, tsc_start;
int result;
/*
* Put whatever arbitrary (but long enough) timeout
* value into the APIC clock, we just want to get the
* counter running for calibration.
*/
__setup_APIC_LVTT(1000000000);
__setup_APIC_LVTT(4000000000);

apic_start = apic_read(APIC_TMCCT);
#ifdef CONFIG_X86_PM_TIMER
Expand All @@ -857,13 +858,13 @@ static int __init calibrate_APIC_clock(void)
} else
#endif
{
rdtscl(tsc_start);
rdtscll(tsc_start);

do {
apic = apic_read(APIC_TMCCT);
rdtscl(tsc);
rdtscll(tsc);
} while ((tsc - tsc_start) < TICK_COUNT &&
(apic - apic_start) < TICK_COUNT);
(apic_start - apic) < TICK_COUNT);

result = (apic_start - apic) * 1000L * tsc_khz /
(tsc - tsc_start);
Expand Down

0 comments on commit 7627340

Please sign in to comment.