ia64/xen-unstable

changeset 2761:f04632034699

bitkeeper revision 1.1159.1.297 (41810679UWr-FbiF6ilbN9cZPhKKUw)

Remove timer selection code, don't use do_timer_interrupt_hook and use *_seq*
functions on xtime_lock. Also remove asm-xen/asm-i386/timer.h which had no
needed changes.
author cl349@freefall.cl.cam.ac.uk
date Thu Oct 28 14:47:21 2004 +0000 (2004-10-28)
parents e20b88a13953
children b6703e4c6e16 4dcf33d2d96d
files .rootkeys linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h
line diff
     1.1 --- a/.rootkeys	Thu Oct 28 13:20:51 2004 +0000
     1.2 +++ b/.rootkeys	Thu Oct 28 14:47:21 2004 +0000
     1.3 @@ -210,7 +210,6 @@ 4107adf1E5O4ztGHNGMzCCNhcvqNow linux-2.6
     1.4  40f5623akIoBsQ3KxSB2kufkbgONXQ linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/fixmap.h
     1.5  4118b6a418gnL6AZsTdglC92YGqYTg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/highmem.h
     1.6  40f5623aJVXQwpJMOLE99XgvGsfQ8Q linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/io.h
     1.7 -40f5623am9BzluYFuV6EQfTd-so3dA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h
     1.8  40f5623aKXkBBxgpLx2NcvkncQ1Yyw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h
     1.9  40f5623aDMCsWOFO0jktZ4e8sjwvEg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h
    1.10  40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h
    1.11 @@ -229,7 +228,6 @@ 40f5623bzLvxr7WoJIxVf2OH4rCBJg linux-2.6
    1.12  40f5623bG_LzgG6-qwk292nTc5Wabw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/setup.h
    1.13  40f5623bgzm_9vwxpzJswlAxg298Gg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/synch_bitops.h
    1.14  40f5623bVdKP7Dt7qm8twu3NcnGNbA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/system.h
    1.15 -40f5623bSgGrvrGRpD71K-lIYqaGgg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h
    1.16  40f5623bc8LKPRO09wY5dGDnY_YCpw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/tlbflush.h
    1.17  41062ab7uFxnCq-KtPeAm-aV8CicgA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/vga.h
    1.18  40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/xor.h
     2.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c	Thu Oct 28 13:20:51 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c	Thu Oct 28 14:47:21 2004 +0000
     2.3 @@ -71,8 +71,6 @@
     2.4  extern spinlock_t i8259A_lock;
     2.5  int pit_latch_buggy;              /* extern */
     2.6  
     2.7 -#include "do_timer.h"
     2.8 -
     2.9  u64 jiffies_64 = INITIAL_JIFFIES;
    2.10  
    2.11  EXPORT_SYMBOL(jiffies_64);
    2.12 @@ -86,7 +84,7 @@ spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED
    2.13  spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED;
    2.14  EXPORT_SYMBOL(i8253_lock);
    2.15  
    2.16 -struct timer_opts *cur_timer = &timer_none;
    2.17 +struct timer_opts *cur_timer = &timer_tsc;
    2.18  
    2.19  /* These are peridically updated in shared_info, and then copied here. */
    2.20  u32 shadow_tsc_stamp;
    2.21 @@ -402,7 +400,9 @@ static inline void do_timer_interrupt(in
    2.22  	while (delta >= NS_PER_TICK) {
    2.23  		delta -= NS_PER_TICK;
    2.24  		processed_system_time += NS_PER_TICK;
    2.25 -		do_timer_interrupt_hook(regs);
    2.26 +		do_timer(regs);
    2.27 +		if (regs)
    2.28 +		    profile_tick(CPU_PROFILING, regs);
    2.29  	}
    2.30  
    2.31  	/*
    2.32 @@ -627,7 +627,6 @@ void __init time_init(void)
    2.33  	wall_to_monotonic.tv_nsec = -xtime.tv_nsec;
    2.34  	processed_system_time = shadow_system_time;
    2.35  
    2.36 -	cur_timer = select_timer();
    2.37  	printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);
    2.38  
    2.39  	time_irq = bind_virq_to_irq(VIRQ_TIMER);
    2.40 @@ -679,7 +678,7 @@ void time_suspend(void)
    2.41  void time_resume(void)
    2.42  {
    2.43      unsigned long flags;
    2.44 -    write_lock_irqsave(&xtime_lock, flags);
    2.45 +    write_seqlock_irqsave(&xtime_lock, flags);
    2.46      /* Get timebases for new environment. */ 
    2.47      __get_time_values_from_xen();
    2.48      /* Reset our own concept of passage of system time. */
    2.49 @@ -688,7 +687,7 @@ void time_resume(void)
    2.50      last_seen_tv.tv_sec = 0;
    2.51      /* Make sure we resync UTC time with Xen on next timer interrupt. */
    2.52      last_update_from_xen = 0;
    2.53 -    write_unlock_irqrestore(&xtime_lock, flags);
    2.54 +    write_sequnlock_irqrestore(&xtime_lock, flags);
    2.55  }
    2.56  
    2.57  /*
     3.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile	Thu Oct 28 13:20:51 2004 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile	Thu Oct 28 14:47:21 2004 +0000
     3.3 @@ -5,7 +5,7 @@
     3.4  XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
     3.5  
     3.6  obj-y :=	timer_tsc.o
     3.7 -c-obj-y :=	timer.o timer_none.o timer_pit.o
     3.8 +c-obj-y :=
     3.9  
    3.10  c-link	:=
    3.11  
     4.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h	Thu Oct 28 13:20:51 2004 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,83 +0,0 @@
     4.4 -/* defines for inline arch setup functions */
     4.5 -
     4.6 -#include <asm/apic.h>
     4.7 -
     4.8 -/**
     4.9 - * do_timer_interrupt_hook - hook into timer tick
    4.10 - * @regs:	standard registers from interrupt
    4.11 - *
    4.12 - * Description:
    4.13 - *	This hook is called immediately after the timer interrupt is ack'd.
    4.14 - *	It's primary purpose is to allow architectures that don't possess
    4.15 - *	individual per CPU clocks (like the CPU APICs supply) to broadcast the
    4.16 - *	timer interrupt as a means of triggering reschedules etc.
    4.17 - **/
    4.18 -
    4.19 -static inline void do_timer_interrupt_hook(struct pt_regs *regs)
    4.20 -{
    4.21 -	do_timer(regs);
    4.22 -/*
    4.23 - * In the SMP case we use the local APIC timer interrupt to do the
    4.24 - * profiling, except when we simulate SMP mode on a uniprocessor
    4.25 - * system, in that case we have to call the local interrupt handler.
    4.26 - */
    4.27 -#ifndef CONFIG_X86_LOCAL_APIC
    4.28 -	if (regs)
    4.29 -		profile_tick(CPU_PROFILING, regs);
    4.30 -#else
    4.31 -	if (regs && !using_apic_timer)
    4.32 -		smp_local_timer_interrupt(regs);
    4.33 -#endif
    4.34 -}
    4.35 -
    4.36 -
    4.37 -/* you can safely undefine this if you don't have the Neptune chipset */
    4.38 -
    4.39 -#define BUGGY_NEPTUN_TIMER
    4.40 -
    4.41 -/**
    4.42 - * do_timer_overflow - process a detected timer overflow condition
    4.43 - * @count:	hardware timer interrupt count on overflow
    4.44 - *
    4.45 - * Description:
    4.46 - *	This call is invoked when the jiffies count has not incremented but
    4.47 - *	the hardware timer interrupt has.  It means that a timer tick interrupt
    4.48 - *	came along while the previous one was pending, thus a tick was missed
    4.49 - **/
    4.50 -static inline int do_timer_overflow(int count)
    4.51 -{
    4.52 -	int i;
    4.53 -
    4.54 -	spin_lock(&i8259A_lock);
    4.55 -	/*
    4.56 -	 * This is tricky when I/O APICs are used;
    4.57 -	 * see do_timer_interrupt().
    4.58 -	 */
    4.59 -	i = inb(0x20);
    4.60 -	spin_unlock(&i8259A_lock);
    4.61 -	
    4.62 -	/* assumption about timer being IRQ0 */
    4.63 -	if (i & 0x01) {
    4.64 -		/*
    4.65 -		 * We cannot detect lost timer interrupts ... 
    4.66 -		 * well, that's why we call them lost, don't we? :)
    4.67 -		 * [hmm, on the Pentium and Alpha we can ... sort of]
    4.68 -		 */
    4.69 -		count -= LATCH;
    4.70 -	} else {
    4.71 -#ifdef BUGGY_NEPTUN_TIMER
    4.72 -		/*
    4.73 -		 * for the Neptun bug we know that the 'latch'
    4.74 -		 * command doesn't latch the high and low value
    4.75 -		 * of the counter atomically. Thus we have to 
    4.76 -		 * substract 256 from the counter 
    4.77 -		 * ... funny, isnt it? :)
    4.78 -		 */
    4.79 -		
    4.80 -		count -= 256;
    4.81 -#else
    4.82 -		printk("do_slow_gettimeoffset(): hardware timer problem?\n");
    4.83 -#endif
    4.84 -	}
    4.85 -	return count;
    4.86 -}
     5.1 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h	Thu Oct 28 13:20:51 2004 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,59 +0,0 @@
     5.4 -#ifndef _ASMi386_TIMER_H
     5.5 -#define _ASMi386_TIMER_H
     5.6 -
     5.7 -/**
     5.8 - * struct timer_ops - used to define a timer source
     5.9 - *
    5.10 - * @name: name of the timer.
    5.11 - * @init: Probes and initializes the timer. Takes clock= override 
    5.12 - *        string as an argument. Returns 0 on success, anything else
    5.13 - *        on failure.
    5.14 - * @mark_offset: called by the timer interrupt.
    5.15 - * @get_offset:  called by gettimeofday(). Returns the number of microseconds
    5.16 - *               since the last timer interupt.
    5.17 - * @monotonic_clock: returns the number of nanoseconds since the init of the
    5.18 - *                   timer.
    5.19 - * @delay: delays this many clock cycles.
    5.20 - */
    5.21 -struct timer_opts{
    5.22 -	char* name;
    5.23 -	int (*init)(char *override);
    5.24 -	void (*mark_offset)(void);
    5.25 -	unsigned long (*get_offset)(void);
    5.26 -	unsigned long long (*monotonic_clock)(void);
    5.27 -	void (*delay)(unsigned long);
    5.28 -};
    5.29 -
    5.30 -#define TICK_SIZE (tick_nsec / 1000)
    5.31 -
    5.32 -extern struct timer_opts* select_timer(void);
    5.33 -extern void clock_fallback(void);
    5.34 -void setup_pit_timer(void);
    5.35 -
    5.36 -/* Modifiers for buggy PIT handling */
    5.37 -
    5.38 -extern int pit_latch_buggy;
    5.39 -
    5.40 -extern struct timer_opts *cur_timer;
    5.41 -extern int timer_ack;
    5.42 -
    5.43 -/* list of externed timers */
    5.44 -extern struct timer_opts timer_none;
    5.45 -extern struct timer_opts timer_pit;
    5.46 -extern struct timer_opts timer_tsc;
    5.47 -#ifdef CONFIG_X86_CYCLONE_TIMER
    5.48 -extern struct timer_opts timer_cyclone;
    5.49 -#endif
    5.50 -extern struct timer_opts timer_xen;
    5.51 -
    5.52 -extern unsigned long calibrate_tsc(void);
    5.53 -extern void init_cpu_khz(void);
    5.54 -#ifdef CONFIG_HPET_TIMER
    5.55 -extern struct timer_opts timer_hpet;
    5.56 -extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
    5.57 -#endif
    5.58 -
    5.59 -#ifdef CONFIG_X86_PM_TIMER
    5.60 -extern struct timer_opts timer_pmtmr;
    5.61 -#endif
    5.62 -#endif