diff options
author | Alok Kataria <akataria@vmware.com> | 2008-07-01 14:43:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 01:43:28 -0400 |
commit | e93ef949fd9a3f237aedfb8e64414b28980530b8 (patch) | |
tree | 4856aa8bf0e02ed1692fe7b4f545c52cdc1705a3 /arch/x86 | |
parent | 8fbbc4b45ce3e4c0eeb15004c79c72b6896a79c2 (diff) |
x86: rename paravirtualized TSC functions
Rename the paravirtualized calculate_cpu_khz to calibrate_tsc.
In all cases, we actually calibrate_tsc and use that as the cpu_khz value.
Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Dan Hecht <dhecht@vmware.com>
Cc: Dan Hecht <dhecht@vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/paravirt.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/tsc.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/vmi_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/vmiclock_32.c | 4 | ||||
-rw-r--r-- | arch/x86/lguest/boot.c | 4 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/time.c | 4 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 2 |
8 files changed, 17 insertions, 21 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index e7e5652f65bc..e0f571d58c19 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -285,7 +285,7 @@ struct pv_time_ops pv_time_ops = { | |||
285 | .get_wallclock = native_get_wallclock, | 285 | .get_wallclock = native_get_wallclock, |
286 | .set_wallclock = native_set_wallclock, | 286 | .set_wallclock = native_set_wallclock, |
287 | .sched_clock = native_sched_clock, | 287 | .sched_clock = native_sched_clock, |
288 | .get_cpu_khz = native_calculate_cpu_khz, | 288 | .get_tsc_khz = native_calibrate_tsc, |
289 | }; | 289 | }; |
290 | 290 | ||
291 | struct pv_irq_ops pv_irq_ops = { | 291 | struct pv_irq_ops pv_irq_ops = { |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 94c16bdd5696..3c36f92160c9 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -123,9 +123,9 @@ static u64 __init tsc_read_refs(u64 *pm, u64 *hpet) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * tsc_calibrate - calibrate the tsc on boot | 126 | * native_calibrate_tsc - calibrate the tsc on boot |
127 | */ | 127 | */ |
128 | static unsigned int __init tsc_calibrate(void) | 128 | unsigned long native_calibrate_tsc(void) |
129 | { | 129 | { |
130 | unsigned long flags; | 130 | unsigned long flags; |
131 | u64 tsc1, tsc2, tr1, tr2, delta, pm1, pm2, hpet1, hpet2; | 131 | u64 tsc1, tsc2, tr1, tr2, delta, pm1, pm2, hpet1, hpet2; |
@@ -195,10 +195,6 @@ out: | |||
195 | return tsc_khz_val; | 195 | return tsc_khz_val; |
196 | } | 196 | } |
197 | 197 | ||
198 | unsigned long native_calculate_cpu_khz(void) | ||
199 | { | ||
200 | return tsc_calibrate(); | ||
201 | } | ||
202 | 198 | ||
203 | #ifdef CONFIG_X86_32 | 199 | #ifdef CONFIG_X86_32 |
204 | /* Only called from the Powernow K7 cpu freq driver */ | 200 | /* Only called from the Powernow K7 cpu freq driver */ |
@@ -208,8 +204,8 @@ int recalibrate_cpu_khz(void) | |||
208 | unsigned long cpu_khz_old = cpu_khz; | 204 | unsigned long cpu_khz_old = cpu_khz; |
209 | 205 | ||
210 | if (cpu_has_tsc) { | 206 | if (cpu_has_tsc) { |
211 | cpu_khz = calculate_cpu_khz(); | 207 | tsc_khz = calibrate_tsc(); |
212 | tsc_khz = cpu_khz; | 208 | cpu_khz = tsc_khz; |
213 | cpu_data(0).loops_per_jiffy = | 209 | cpu_data(0).loops_per_jiffy = |
214 | cpufreq_scale(cpu_data(0).loops_per_jiffy, | 210 | cpufreq_scale(cpu_data(0).loops_per_jiffy, |
215 | cpu_khz_old, cpu_khz); | 211 | cpu_khz_old, cpu_khz); |
@@ -487,10 +483,10 @@ void __init tsc_init(void) | |||
487 | if (!cpu_has_tsc) | 483 | if (!cpu_has_tsc) |
488 | return; | 484 | return; |
489 | 485 | ||
490 | cpu_khz = calculate_cpu_khz(); | 486 | tsc_khz = calibrate_tsc(); |
491 | tsc_khz = cpu_khz; | 487 | cpu_khz = tsc_khz; |
492 | 488 | ||
493 | if (!cpu_khz) { | 489 | if (!tsc_khz) { |
494 | mark_tsc_unstable("could not calculate TSC khz"); | 490 | mark_tsc_unstable("could not calculate TSC khz"); |
495 | return; | 491 | return; |
496 | } | 492 | } |
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index 946bf13b44ab..b15346092b7b 100644 --- a/arch/x86/kernel/vmi_32.c +++ b/arch/x86/kernel/vmi_32.c | |||
@@ -932,7 +932,7 @@ static inline int __init activate_vmi(void) | |||
932 | pv_apic_ops.setup_secondary_clock = vmi_time_ap_init; | 932 | pv_apic_ops.setup_secondary_clock = vmi_time_ap_init; |
933 | #endif | 933 | #endif |
934 | pv_time_ops.sched_clock = vmi_sched_clock; | 934 | pv_time_ops.sched_clock = vmi_sched_clock; |
935 | pv_time_ops.get_cpu_khz = vmi_cpu_khz; | 935 | pv_time_ops.get_tsc_khz = vmi_tsc_khz; |
936 | 936 | ||
937 | /* We have true wallclock functions; disable CMOS clock sync */ | 937 | /* We have true wallclock functions; disable CMOS clock sync */ |
938 | no_sync_cmos_clock = 1; | 938 | no_sync_cmos_clock = 1; |
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c index ba7d19e102b1..6953859fe289 100644 --- a/arch/x86/kernel/vmiclock_32.c +++ b/arch/x86/kernel/vmiclock_32.c | |||
@@ -69,8 +69,8 @@ unsigned long long vmi_sched_clock(void) | |||
69 | return cycles_2_ns(vmi_timer_ops.get_cycle_counter(VMI_CYCLES_AVAILABLE)); | 69 | return cycles_2_ns(vmi_timer_ops.get_cycle_counter(VMI_CYCLES_AVAILABLE)); |
70 | } | 70 | } |
71 | 71 | ||
72 | /* paravirt_ops.get_cpu_khz = vmi_cpu_khz */ | 72 | /* paravirt_ops.get_tsc_khz = vmi_tsc_khz */ |
73 | unsigned long vmi_cpu_khz(void) | 73 | unsigned long vmi_tsc_khz(void) |
74 | { | 74 | { |
75 | unsigned long long khz; | 75 | unsigned long long khz; |
76 | khz = vmi_timer_ops.get_cycle_frequency(); | 76 | khz = vmi_timer_ops.get_cycle_frequency(); |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index e72cf0793fbe..50dad44fb542 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -607,7 +607,7 @@ static unsigned long lguest_get_wallclock(void) | |||
607 | * what speed it runs at, or 0 if it's unusable as a reliable clock source. | 607 | * what speed it runs at, or 0 if it's unusable as a reliable clock source. |
608 | * This matches what we want here: if we return 0 from this function, the x86 | 608 | * This matches what we want here: if we return 0 from this function, the x86 |
609 | * TSC clock will give up and not register itself. */ | 609 | * TSC clock will give up and not register itself. */ |
610 | static unsigned long lguest_cpu_khz(void) | 610 | static unsigned long lguest_tsc_khz(void) |
611 | { | 611 | { |
612 | return lguest_data.tsc_khz; | 612 | return lguest_data.tsc_khz; |
613 | } | 613 | } |
@@ -998,7 +998,7 @@ __init void lguest_init(void) | |||
998 | /* time operations */ | 998 | /* time operations */ |
999 | pv_time_ops.get_wallclock = lguest_get_wallclock; | 999 | pv_time_ops.get_wallclock = lguest_get_wallclock; |
1000 | pv_time_ops.time_init = lguest_time_init; | 1000 | pv_time_ops.time_init = lguest_time_init; |
1001 | pv_time_ops.get_cpu_khz = lguest_cpu_khz; | 1001 | pv_time_ops.get_tsc_khz = lguest_tsc_khz; |
1002 | 1002 | ||
1003 | /* Now is a good time to look at the implementations of these functions | 1003 | /* Now is a good time to look at the implementations of these functions |
1004 | * before returning to the rest of lguest_init(). */ | 1004 | * before returning to the rest of lguest_init(). */ |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 3b980831602c..dcd4e51f2f16 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1062,7 +1062,7 @@ static const struct pv_time_ops xen_time_ops __initdata = { | |||
1062 | 1062 | ||
1063 | .set_wallclock = xen_set_wallclock, | 1063 | .set_wallclock = xen_set_wallclock, |
1064 | .get_wallclock = xen_get_wallclock, | 1064 | .get_wallclock = xen_get_wallclock, |
1065 | .get_cpu_khz = xen_cpu_khz, | 1065 | .get_tsc_khz = xen_tsc_khz, |
1066 | .sched_clock = xen_sched_clock, | 1066 | .sched_clock = xen_sched_clock, |
1067 | }; | 1067 | }; |
1068 | 1068 | ||
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 64f0038b9558..685b77470fc3 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -197,8 +197,8 @@ unsigned long long xen_sched_clock(void) | |||
197 | } | 197 | } |
198 | 198 | ||
199 | 199 | ||
200 | /* Get the CPU speed from Xen */ | 200 | /* Get the TSC speed from Xen */ |
201 | unsigned long xen_cpu_khz(void) | 201 | unsigned long xen_tsc_khz(void) |
202 | { | 202 | { |
203 | u64 xen_khz = 1000000ULL << 32; | 203 | u64 xen_khz = 1000000ULL << 32; |
204 | const struct pvclock_vcpu_time_info *info = | 204 | const struct pvclock_vcpu_time_info *info = |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 9a055592a307..d852ddbb3448 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -32,7 +32,7 @@ void __init xen_build_dynamic_phys_to_machine(void); | |||
32 | 32 | ||
33 | void xen_setup_timer(int cpu); | 33 | void xen_setup_timer(int cpu); |
34 | void xen_setup_cpu_clockevents(void); | 34 | void xen_setup_cpu_clockevents(void); |
35 | unsigned long xen_cpu_khz(void); | 35 | unsigned long xen_tsc_khz(void); |
36 | void __init xen_time_init(void); | 36 | void __init xen_time_init(void); |
37 | unsigned long xen_get_wallclock(void); | 37 | unsigned long xen_get_wallclock(void); |
38 | int xen_set_wallclock(unsigned long time); | 38 | int xen_set_wallclock(unsigned long time); |