Index: 2006-01-05/arch/i386/kernel/time-xen.c =================================================================== --- 2006-01-05.orig/arch/i386/kernel/time-xen.c 2006-01-09 11:54:28.000000000 +0100 +++ 2006-01-05/arch/i386/kernel/time-xen.c 2006-01-09 15:34:26.000000000 +0100 @@ -57,7 +57,12 @@ #include #include #include +#ifdef __i386__ #include +#else +#define TICK_SIZE (tick_nsec / 1000) +#include +#endif #include "mach_time.h" @@ -100,11 +105,6 @@ EXPORT_SYMBOL(rtc_lock); DEFINE_SPINLOCK(i8253_lock); EXPORT_SYMBOL(i8253_lock); -extern struct init_timer_opts timer_tsc_init; -extern struct timer_opts timer_tsc; -#define timer_none timer_tsc -struct timer_opts *cur_timer __read_mostly = &timer_tsc; - /* These are peridically updated in shared_info, and then copied here. */ struct shadow_time_info { u64 tsc_timestamp; /* TSC at last update of time vals. */ @@ -146,8 +146,7 @@ static int __init __independent_wallcloc } __setup("independent_wallclock", __independent_wallclock); -int tsc_disable __initdata = 0; - +#ifdef __i386__ static void delay_tsc(unsigned long loops) { unsigned long bclock, now; @@ -160,10 +159,12 @@ static void delay_tsc(unsigned long loop } while ((now-bclock) < loops); } -struct timer_opts timer_tsc = { +static struct timer_opts timer_tsc = { .name = "tsc", .delay = delay_tsc, }; +struct timer_opts *cur_timer __read_mostly = &timer_tsc; +#endif /* * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction, @@ -699,7 +700,6 @@ void notify_arch_cmos_timer(void) static long clock_cmos_diff, sleep_start; -static struct timer_opts *last_timer; static int timer_suspend(struct sys_device *dev, pm_message_t state) { /* @@ -708,10 +708,6 @@ static int timer_suspend(struct sys_devi clock_cmos_diff = -get_cmos_time(); clock_cmos_diff += get_seconds(); sleep_start = get_cmos_time(); - last_timer = cur_timer; - cur_timer = &timer_none; - if (last_timer->suspend) - last_timer->suspend(state); return 0; } @@ -733,10 +729,6 @@ static int timer_resume(struct sys_devic write_sequnlock_irqrestore(&xtime_lock, flags); jiffies += sleep_length; wall_jiffies += sleep_length; - if (last_timer->resume) - last_timer->resume(); - cur_timer = last_timer; - last_timer = NULL; touch_softlockup_watchdog(); return 0; } Index: 2006-01-05/include/asm-x86_64/mach-xen/asm/timer.h =================================================================== --- 2006-01-05.orig/include/asm-x86_64/mach-xen/asm/timer.h 2006-01-09 16:17:25.813637640 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -#ifndef _ASMi386_TIMER_H -#define _ASMi386_TIMER_H -#include - -/** - * struct timer_ops - used to define a timer source - * - * @name: name of the timer. - * @init: Probes and initializes the timer. Takes clock= override - * string as an argument. Returns 0 on success, anything else - * on failure. - * @mark_offset: called by the timer interrupt. - * @get_offset: called by gettimeofday(). Returns the number of microseconds - * since the last timer interupt. - * @monotonic_clock: returns the number of nanoseconds since the init of the - * timer. - * @delay: delays this many clock cycles. - */ -struct timer_opts { - char* name; - void (*mark_offset)(void); - unsigned long (*get_offset)(void); - unsigned long long (*monotonic_clock)(void); - void (*delay)(unsigned long); - unsigned long (*read_timer)(void); - int (*suspend)(pm_message_t state); - int (*resume)(void); -}; - -struct init_timer_opts { - int (*init)(char *override); - struct timer_opts *opts; -}; - -#define TICK_SIZE (tick_nsec / 1000) - -extern struct timer_opts* __init select_timer(void); -extern void clock_fallback(void); -void setup_pit_timer(void); - -/* Modifiers for buggy PIT handling */ - -extern int pit_latch_buggy; - -extern struct timer_opts *cur_timer; -extern int timer_ack; - -/* list of externed timers */ -extern struct timer_opts timer_none; -extern struct timer_opts timer_pit; -extern struct init_timer_opts timer_pit_init; -extern struct init_timer_opts timer_tsc_init; -#ifdef CONFIG_X86_CYCLONE_TIMER -extern struct init_timer_opts timer_cyclone_init; -#endif - -extern unsigned long calibrate_tsc(void); -extern void init_cpu_khz(void); -#ifdef CONFIG_HPET_TIMER -extern struct init_timer_opts timer_hpet_init; -extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr); -#endif - -#ifdef CONFIG_X86_PM_TIMER -extern struct init_timer_opts timer_pmtmr_init; -#endif -#endif Index: 2006-01-05/arch/i386/kernel/cpu/common-xen.c =================================================================== --- 2006-01-05.orig/arch/i386/kernel/cpu/common-xen.c 2006-01-09 16:17:25.811637944 +0100 +++ 2006-01-05/arch/i386/kernel/cpu/common-xen.c 2006-01-09 15:35:35.000000000 +0100 @@ -387,9 +387,11 @@ void __devinit identify_cpu(struct cpuin * we do "generic changes." */ +#ifndef CONFIG_XEN /* TSC disabled? */ if ( tsc_disable ) clear_bit(X86_FEATURE_TSC, c->x86_capability); +#endif /* FXSR disabled? */ if (disable_x86_fxsr) { @@ -596,12 +598,14 @@ void __cpuinit cpu_init(void) if (cpu_has_vme || cpu_has_de) clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); +#ifndef CONFIG_XEN if (tsc_disable && cpu_has_tsc) { printk(KERN_NOTICE "Disabling TSC...\n"); /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/ clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability); set_in_cr4(X86_CR4_TSD); } +#endif cpu_gdt_init(&cpu_gdt_descr[cpu]);