diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-08-15 07:51:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-15 07:51:21 -0400 |
commit | f07f4f9046121ac803bc2f0ded3d77b7c2ab481b (patch) | |
tree | af97718a18d84017978d1b2fe382eceaa261f48e /arch/x86/kernel | |
parent | 36fef0949c14445d231a68663e8a01860f7caca3 (diff) |
x86: apic - unify __setup_APIC_LVTT
To be able to unify this function we RE-introduce
APIC_DIVISOR for 64bit mode. This snipped was eliminated
in some time ago in a sake of clenup but now we need it
again since it allow up to get rid of #ifdef(s).
And lapic_is_integrated call is added in apic_64.c but
since we always have APIC integrated on 64bit cpu compiler
will ignore this call.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic_64.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 1e925be861e4..ac399d0f65c0 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -244,6 +244,9 @@ int lapic_get_maxlvt(void) | |||
244 | return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; | 244 | return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; |
245 | } | 245 | } |
246 | 246 | ||
247 | /* Clock divisor is set to 1 */ | ||
248 | #define APIC_DIVISOR 1 | ||
249 | |||
247 | /* | 250 | /* |
248 | * This function sets up the local APIC timer, with a timeout of | 251 | * This function sets up the local APIC timer, with a timeout of |
249 | * 'clocks' APIC bus clock. During calibration we actually call | 252 | * 'clocks' APIC bus clock. During calibration we actually call |
@@ -262,6 +265,9 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) | |||
262 | lvtt_value = LOCAL_TIMER_VECTOR; | 265 | lvtt_value = LOCAL_TIMER_VECTOR; |
263 | if (!oneshot) | 266 | if (!oneshot) |
264 | lvtt_value |= APIC_LVT_TIMER_PERIODIC; | 267 | lvtt_value |= APIC_LVT_TIMER_PERIODIC; |
268 | if (!lapic_is_integrated()) | ||
269 | lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV); | ||
270 | |||
265 | if (!irqen) | 271 | if (!irqen) |
266 | lvtt_value |= APIC_LVT_MASKED; | 272 | lvtt_value |= APIC_LVT_MASKED; |
267 | 273 | ||
@@ -276,7 +282,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) | |||
276 | | APIC_TDR_DIV_16); | 282 | | APIC_TDR_DIV_16); |
277 | 283 | ||
278 | if (!oneshot) | 284 | if (!oneshot) |
279 | apic_write(APIC_TMICT, clocks); | 285 | apic_write(APIC_TMICT, clocks / APIC_DIVISOR); |
280 | } | 286 | } |
281 | 287 | ||
282 | /* | 288 | /* |
@@ -446,7 +452,7 @@ static int __init calibrate_APIC_clock(void) | |||
446 | lapic_clockevent.min_delta_ns = | 452 | lapic_clockevent.min_delta_ns = |
447 | clockevent_delta2ns(0xF, &lapic_clockevent); | 453 | clockevent_delta2ns(0xF, &lapic_clockevent); |
448 | 454 | ||
449 | calibration_result = result / HZ; | 455 | calibration_result = (result * APIC_DIVISOR) / HZ; |
450 | 456 | ||
451 | /* | 457 | /* |
452 | * Do a sanity check on the APIC calibration result | 458 | * Do a sanity check on the APIC calibration result |