vserver 1.9.5.x5
[linux-2.6.git] / arch / mips / kernel / time.c
index 915e553..648c822 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2001 MontaVista Software Inc.
  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
- * Copyright (c) 2003  Maciej W. Rozycki
+ * Copyright (c) 2003, 2004  Maciej W. Rozycki
  *
  * Common time service routines for MIPS machines. See
  * Documentation/mips/time.README.
@@ -11,7 +11,6 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -26,6 +25,7 @@
 #include <linux/module.h>
 
 #include <asm/bootinfo.h>
+#include <asm/compiler.h>
 #include <asm/cpu.h>
 #include <asm/cpu-features.h>
 #include <asm/div64.h>
@@ -52,13 +52,7 @@ EXPORT_SYMBOL(jiffies_64);
  */
 extern volatile unsigned long wall_jiffies;
 
-spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
-
-/*
- * whether we emulate local_timer_interrupts for SMP machines.
- */
-int emulate_local_timer_interrupt;
-
+DEFINE_SPINLOCK(rtc_lock);
 
 /*
  * By default we provide the null RTC ops
@@ -277,7 +271,7 @@ static unsigned long fixed_rate_gettimeoffset(void)
        __asm__("multu  %1,%2"
                : "=h" (res)
                : "r" (count), "r" (sll32_usecs_per_cycle)
-               : "lo", "accum");
+               : "lo", GCC_REG_ACCUM);
 
        /*
         * Due to possible jiffies inconsistencies, we need to check
@@ -332,7 +326,7 @@ static unsigned long calibrate_div32_gettimeoffset(void)
        __asm__("multu  %1,%2"
                : "=h" (res)
                : "r" (count), "r" (quotient)
-               : "lo", "accum");
+               : "lo", GCC_REG_ACCUM);
 
        /*
         * Due to possible jiffies inconsistencies, we need to check
@@ -374,7 +368,7 @@ static unsigned long calibrate_div64_gettimeoffset(void)
                                : "r" (timerhi), "m" (timerlo),
                                  "r" (tmp), "r" (USECS_PER_JIFFY),
                                  "r" (USECS_PER_JIFFY_FRAC)
-                               : "hi", "lo", "accum");
+                               : "hi", "lo", GCC_REG_ACCUM);
                        cached_quotient = quotient;
                }
        }
@@ -388,7 +382,7 @@ static unsigned long calibrate_div64_gettimeoffset(void)
        __asm__("multu  %1,%2"
                : "=h" (res)
                : "r" (count), "r" (quotient)
-               : "lo", "accum");
+               : "lo", GCC_REG_ACCUM);
 
        /*
         * Due to possible jiffies inconsistencies, we need to check
@@ -418,10 +412,7 @@ void local_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
        if (current->pid)
                profile_tick(CPU_PROFILING, regs);
-#ifdef CONFIG_SMP
-       /* in UP mode, update_process_times() is invoked by do_timer() */
        update_process_times(user_mode(regs));
-#endif
 }
 
 /*
@@ -505,7 +496,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                }
        }
 
-#if !defined(CONFIG_SMP)
        /*
         * In UP mode, we call local_timer_interrupt() to do profiling
         * and process accouting.
@@ -515,21 +505,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
         */
        local_timer_interrupt(irq, dev_id, regs);
 
-#else  /* CONFIG_SMP */
-
-       if (emulate_local_timer_interrupt) {
-               /*
-                * this is the place where we send out inter-process
-                * interrupts and let each CPU do its own profiling
-                * and process accouting.
-                *
-                * Obviously we need to call local_timer_interrupt() for
-                * the current CPU too.
-                */
-               panic("Not implemented yet!!!");
-       }
-#endif /* CONFIG_SMP */
-
        return IRQ_HANDLED;
 }