Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / arch / sparc64 / kernel / time.c
index 8dcbfbf..f84da4f 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/cpudata.h>
 #include <asm/uaccess.h>
 #include <asm/prom.h>
+#include <asm/irq_regs.h>
 
 DEFINE_SPINLOCK(mostek_lock);
 DEFINE_SPINLOCK(rtc_lock);
@@ -53,8 +54,6 @@ void __iomem *mstk48t02_regs = NULL;
 unsigned long ds1287_regs = 0UL;
 #endif
 
-extern unsigned long wall_jiffies;
-
 static void __iomem *mstk48t08_regs;
 static void __iomem *mstk48t59_regs;
 
@@ -454,7 +453,7 @@ static inline void timer_check_rtc(void)
        }
 }
 
-irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
+irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
        unsigned long ticks, compare, pstate;
 
@@ -462,10 +461,10 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 
        do {
 #ifndef CONFIG_SMP
-               profile_tick(CPU_PROFILING, regs);
-               update_process_times(user_mode(regs));
+               profile_tick(CPU_PROFILING);
+               update_process_times(user_mode(get_irq_regs()));
 #endif
-               do_timer(regs);
+               do_timer(1);
 
                /* Guarantee that the following sequences execute
                 * uninterrupted.
@@ -496,7 +495,7 @@ void timer_tick_interrupt(struct pt_regs *regs)
 {
        write_seqlock(&xtime_lock);
 
-       do_timer(regs);
+       do_timer(1);
 
        timer_check_rtc();
 
@@ -788,12 +787,15 @@ static int __devinit clock_probe(struct of_device *op, const struct of_device_id
        if (!regs)
                return -ENOMEM;
 
+#ifdef CONFIG_PCI
        if (!strcmp(model, "ds1287") ||
            !strcmp(model, "m5819") ||
            !strcmp(model, "m5819p") ||
            !strcmp(model, "m5823")) {
                ds1287_regs = (unsigned long) regs;
-       } else if (model[5] == '0' && model[6] == '2') {
+       } else
+#endif
+       if (model[5] == '0' && model[6] == '2') {
                mstk48t02_regs = regs;
        } else if(model[5] == '0' && model[6] == '8') {
                mstk48t08_regs = regs;
@@ -925,8 +927,6 @@ static void sparc64_start_timers(void)
        __asm__ __volatile__("wrpr      %0, 0x0, %%pstate"
                             : /* no outputs */
                             : "r" (pstate));
-
-       local_irq_enable();
 }
 
 struct freq_table {
@@ -982,7 +982,7 @@ static struct time_interpolator sparc64_cpu_interpolator = {
 };
 
 /* The quotient formula is taken from the IA64 port. */
-#define SPARC64_NSEC_PER_CYC_SHIFT     30UL
+#define SPARC64_NSEC_PER_CYC_SHIFT     10UL
 void __init time_init(void)
 {
        unsigned long clock = sparc64_init_timers();
@@ -1327,7 +1327,7 @@ static int mini_rtc_release(struct inode *inode, struct file *file)
 }
 
 
-static struct file_operations mini_rtc_fops = {
+static const struct file_operations mini_rtc_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = mini_rtc_ioctl,
        .open           = mini_rtc_open,