X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fmips%2Fau1000%2Fcommon%2Ftime.c;h=fe418f1620c3b62245352ed2259be0d086cf3bf0;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=f58f454cdc8cf53447b2bbc618f01d4b63047811;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c index f58f454cd..fe418f162 100644 --- a/arch/mips/au1000/common/time.c +++ b/arch/mips/au1000/common/time.c @@ -38,11 +38,12 @@ #include #include #include +#include +#include #include #include #include -#include #include #include @@ -68,7 +69,7 @@ extern void startup_match20_interrupt(void); static unsigned long last_pc0, last_match20; #endif -static spinlock_t time_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(time_lock); static inline void ack_r4ktimer(unsigned long newval) { @@ -99,6 +100,9 @@ void mips_timer_interrupt(struct pt_regs *regs) kstat_this_cpu.irqs[irq]++; do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif r4k_cur += r4k_offset; ack_r4ktimer(r4k_cur); @@ -137,6 +141,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) while (time_elapsed > 0) { do_timer(regs); +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif time_elapsed -= MATCH20_INC; last_match20 += MATCH20_INC; jiffie_drift++; @@ -153,6 +160,9 @@ void counter0_irq(int irq, void *dev_id, struct pt_regs *regs) if (jiffie_drift >= 999) { jiffie_drift -= 999; do_timer(regs); /* increment jiffies by one */ +#ifndef CONFIG_SMP + update_process_times(user_mode(regs)); +#endif } } @@ -294,8 +304,7 @@ unsigned long cal_r4koff(void) /* This is for machines which generate the exact clock. */ #define USECS_PER_JIFFY (1000000/HZ) -#define USECS_PER_JIFFY_FRAC (0x100000000*1000000/HZ&0xffffffff) - +#define USECS_PER_JIFFY_FRAC (0x100000000LL*1000000/HZ&0xffffffff) static unsigned long div64_32(unsigned long v1, unsigned long v2, unsigned long v3) @@ -342,9 +351,9 @@ static unsigned long do_fast_cp0_gettimeoffset(void) __asm__("multu\t%1,%2\n\t" "mfhi\t%0" - :"=r" (res) - :"r" (count), - "r" (quotient)); + : "=r" (res) + : "r" (count), "r" (quotient) + : "hi", "lo", GCC_REG_ACCUM); /* * Due to possible jiffies inconsistencies, we need to check @@ -397,10 +406,6 @@ void au1xxx_timer_setup(struct irqaction *irq) r4k_cur = (read_c0_count() + r4k_offset); write_c0_compare(r4k_cur); - /* no RTC on the pb1000 */ - xtime.tv_sec = 0; - //xtime.tv_usec = 0; - #ifdef CONFIG_PM /* * setup counter 0, since it keeps ticking after a