aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2007-10-12 17:04:06 -0400
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>2007-10-12 17:04:06 -0400
commitd03030e917047cf7f475e641cd2d6e83647392b0 (patch)
tree981933035017ec3a6fc083cac280dcc7839b2c60
parent500ff08b76878a45391fffc7a4c972883503050e (diff)
x86_64: Move apic calibration code around
Let the calibration code fill in calibration_result directly and move the variable on top of the file. Fixup a printk w/o log level while at it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
-rw-r--r--arch/x86/kernel/apic_64.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index a73b443a1236..b08c08ed36a7 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -55,6 +55,8 @@ static struct resource lapic_resource = {
55 .flags = IORESOURCE_MEM | IORESOURCE_BUSY, 55 .flags = IORESOURCE_MEM | IORESOURCE_BUSY,
56}; 56};
57 57
58static unsigned int calibration_result;
59
58/* 60/*
59 * cpu_mask that denotes the CPUs that needs timer interrupt coming in as 61 * cpu_mask that denotes the CPUs that needs timer interrupt coming in as
60 * IPIs in place of local APIC timers 62 * IPIs in place of local APIC timers
@@ -821,7 +823,7 @@ static void setup_APIC_timer(unsigned int clocks)
821 823
822#define TICK_COUNT 100000000 824#define TICK_COUNT 100000000
823 825
824static int __init calibrate_APIC_clock(void) 826static void __init calibrate_APIC_clock(void)
825{ 827{
826 unsigned apic, apic_start; 828 unsigned apic, apic_start;
827 unsigned long tsc, tsc_start; 829 unsigned long tsc, tsc_start;
@@ -855,17 +857,14 @@ static int __init calibrate_APIC_clock(void)
855 result = (apic_start - apic) * 1000L * tsc_khz / 857 result = (apic_start - apic) * 1000L * tsc_khz /
856 (tsc - tsc_start); 858 (tsc - tsc_start);
857 } 859 }
858 printk("result %d\n", result); 860 printk(KERN_DEBUG "APIC timer calibration result %d\n", result);
859
860 861
861 printk(KERN_INFO "Detected %d.%03d MHz APIC timer.\n", 862 printk(KERN_INFO "Detected %d.%03d MHz APIC timer.\n",
862 result / 1000 / 1000, result / 1000 % 1000); 863 result / 1000 / 1000, result / 1000 % 1000);
863 864
864 return result * APIC_DIVISOR / HZ; 865 calibration_result = result * APIC_DIVISOR / HZ;
865} 866}
866 867
867static unsigned int calibration_result;
868
869void __init setup_boot_APIC_clock (void) 868void __init setup_boot_APIC_clock (void)
870{ 869{
871 if (disable_apic_timer) { 870 if (disable_apic_timer) {
@@ -878,7 +877,7 @@ void __init setup_boot_APIC_clock (void)
878 877
879 local_irq_disable(); 878 local_irq_disable();
880 879
881 calibration_result = calibrate_APIC_clock(); 880 calibrate_APIC_clock();
882 /* 881 /*
883 * Now set up the timer for real. 882 * Now set up the timer for real.
884 */ 883 */
@@ -985,8 +984,6 @@ void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
985 apic_write(reg, v); 984 apic_write(reg, v);
986} 985}
987 986
988#undef APIC_DIVISOR
989
990/* 987/*
991 * Local timer interrupt handler. It does both profiling and 988 * Local timer interrupt handler. It does both profiling and
992 * process statistics/rescheduling. 989 * process statistics/rescheduling.