Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112709
b: refs/heads/master
c: f07f4f9
h: refs/heads/master
i:
  112707: 9e96ab4
v: v3
  • Loading branch information
Cyrill Gorcunov authored and Ingo Molnar committed Aug 15, 2008
1 parent 0687ccd commit acb0888
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: 36fef0949c14445d231a68663e8a01860f7caca3
refs/heads/master: f07f4f9046121ac803bc2f0ded3d77b7c2ab481b
10 changes: 8 additions & 2 deletions trunk/arch/x86/kernel/apic_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ int lapic_get_maxlvt(void)
return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
}

/* Clock divisor is set to 1 */
#define APIC_DIVISOR 1

/*
* This function sets up the local APIC timer, with a timeout of
* 'clocks' APIC bus clock. During calibration we actually call
Expand All @@ -262,6 +265,9 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
lvtt_value = LOCAL_TIMER_VECTOR;
if (!oneshot)
lvtt_value |= APIC_LVT_TIMER_PERIODIC;
if (!lapic_is_integrated())
lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);

if (!irqen)
lvtt_value |= APIC_LVT_MASKED;

Expand All @@ -276,7 +282,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
| APIC_TDR_DIV_16);

if (!oneshot)
apic_write(APIC_TMICT, clocks);
apic_write(APIC_TMICT, clocks / APIC_DIVISOR);
}

/*
Expand Down Expand Up @@ -446,7 +452,7 @@ static int __init calibrate_APIC_clock(void)
lapic_clockevent.min_delta_ns =
clockevent_delta2ns(0xF, &lapic_clockevent);

calibration_result = result / HZ;
calibration_result = (result * APIC_DIVISOR) / HZ;

/*
* Do a sanity check on the APIC calibration result
Expand Down

0 comments on commit acb0888

Please sign in to comment.