diff options
Diffstat (limited to 'arch/mn10300/kernel/time.c')
| -rw-r--r-- | arch/mn10300/kernel/time.c | 96 | 
1 files changed, 3 insertions, 93 deletions
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c index f860a340acc..67c6416a58f 100644 --- a/arch/mn10300/kernel/time.c +++ b/arch/mn10300/kernel/time.c @@ -40,21 +40,17 @@ unsigned long long sched_clock(void)  		unsigned long long ll;  		unsigned l[2];  	} tsc64, result; -	unsigned long tsc, tmp; +	unsigned long tmp;  	unsigned product[3]; /* 96-bit intermediate value */  	/* cnt32_to_63() is not safe with preemption */  	preempt_disable(); -	/* read the TSC value -	 */ -	tsc = get_cycles(); - -	/* expand to 64-bits. +	/* expand the tsc to 64-bits.  	 * - sched_clock() must be called once a minute or better or the  	 *   following will go horribly wrong - see cnt32_to_63()  	 */ -	tsc64.ll = cnt32_to_63(tsc) & 0x7fffffffffffffffULL; +	tsc64.ll = cnt32_to_63(get_cycles()) & 0x7fffffffffffffffULL;  	preempt_enable(); @@ -97,83 +93,6 @@ irqreturn_t local_timer_interrupt(void)  	return IRQ_HANDLED;  } -#ifndef CONFIG_GENERIC_TIME -/* - * advance the kernel's time keeping clocks (xtime and jiffies) - * - we use Timer 0 & 1 cascaded as a clock to nudge us the next time - *   there's a need to update - */ -static irqreturn_t timer_interrupt(int irq, void *dev_id) -{ -	unsigned tsc, elapse; -	irqreturn_t ret; - -	write_seqlock(&xtime_lock); - -	while (tsc = get_cycles(), -	       elapse = tsc - mn10300_last_tsc, /* time elapsed since last -						 * tick */ -	       elapse > MN10300_TSC_PER_HZ -	       ) { -		mn10300_last_tsc += MN10300_TSC_PER_HZ; - -		/* advance the kernel's time tracking system */ -		do_timer(1); -	} - -	write_sequnlock(&xtime_lock); - -	ret = local_timer_interrupt(); -#ifdef CONFIG_SMP -	send_IPI_allbutself(LOCAL_TIMER_IPI); -#endif -	return ret; -} - -static struct irqaction timer_irq = { -	.handler	= timer_interrupt, -	.flags		= IRQF_DISABLED | IRQF_SHARED | IRQF_TIMER, -	.name		= "timer", -}; -#endif /* CONFIG_GENERIC_TIME */ - -#ifdef CONFIG_CSRC_MN10300 -void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock) -{ -	u64 temp; -	u32 shift; - -	/* Find a shift value */ -	for (shift = 32; shift > 0; shift--) { -		temp = (u64) NSEC_PER_SEC << shift; -		do_div(temp, clock); -		if ((temp >> 32) == 0) -			break; -	} -	cs->shift = shift; -	cs->mult = (u32) temp; -} -#endif - -#if CONFIG_CEVT_MN10300 -void __cpuinit clockevent_set_clock(struct clock_event_device *cd, -				    unsigned int clock) -{ -	u64 temp; -	u32 shift; - -	/* Find a shift value */ -	for (shift = 32; shift > 0; shift--) { -		temp = (u64) clock << shift; -		do_div(temp, NSEC_PER_SEC); -		if ((temp >> 32) == 0) -			break; -	} -	cd->shift = shift; -	cd->mult = (u32) temp; -} -#endif -  /*   * initialise the various timers used by the main part of the kernel   */ @@ -185,11 +104,7 @@ void __init time_init(void)  	 */  	TMPSCNT |= TMPSCNT_ENABLE; -#ifdef CONFIG_GENERIC_TIME  	init_clocksource(); -#else -	startup_timestamp_counter(); -#endif  	printk(KERN_INFO  	       "timestamp counter I/O clock running at %lu.%02lu" @@ -198,12 +113,7 @@ void __init time_init(void)  	mn10300_last_tsc = read_timestamp_counter(); -#ifdef CONFIG_GENERIC_CLOCKEVENTS  	init_clockevents(); -#else -	reload_jiffies_counter(MN10300_JC_PER_HZ - 1); -	setup_jiffies_interrupt(TMJCIRQ, &timer_irq, CONFIG_TIMER_IRQ_LEVEL); -#endif  #ifdef CONFIG_MN10300_WD_TIMER  	/* start the watchdog timer */  | 
