Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=16e2011be67b8625c1c600f9742c2279be3c0c68 Commit: 16e2011be67b8625c1c600f9742c2279be3c0c68 Parent: 751de83c0c94a5235f14cff8549d3b39e745eb2b Author: Glauber de Oliveira Costa <[EMAIL PROTECTED]> AuthorDate: Wed Jan 30 13:31:03 2008 +0100 Committer: Ingo Molnar <[EMAIL PROTECTED]> CommitDate: Wed Jan 30 13:31:03 2008 +0100
x86: allow sched clock to be overridden by paravirt This patch turns the sched_clock into native_sched_clock. sched clock becomes a weak symbol, which can then give its place to a paravirt definition. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> --- arch/x86/kernel/tsc_64.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c index 32edd2c..204a908 100644 --- a/arch/x86/kernel/tsc_64.c +++ b/arch/x86/kernel/tsc_64.c @@ -63,7 +63,7 @@ static void set_cyc2ns_scale(unsigned long cpu_khz, int cpu) local_irq_restore(flags); } -unsigned long long sched_clock(void) +unsigned long long native_sched_clock(void) { unsigned long a = 0; @@ -77,6 +77,19 @@ unsigned long long sched_clock(void) return cycles_2_ns(a); } +/* We need to define a real function for sched_clock, to override the + weak default version */ +#ifdef CONFIG_PARAVIRT +unsigned long long sched_clock(void) +{ + return paravirt_sched_clock(); +} +#else +unsigned long long +sched_clock(void) __attribute__((alias("native_sched_clock"))); +#endif + + static int tsc_unstable; inline int check_tsc_unstable(void) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html