]> Pileus Git - ~andy/linux/blobdiff - arch/i386/kernel/time.c
arch/i386/kernel/time: don't shadow 'irq' function arg
[~andy/linux] / arch / i386 / kernel / time.c
index 1302e4ab3c4f6789a74de1fb142df914f3164baa..78af572fd17c3e4a903aaf59062744455808e77a 100644 (file)
@@ -76,8 +76,6 @@ int pit_latch_buggy;              /* extern */
 unsigned int cpu_khz;  /* Detected as we calibrate the TSC */
 EXPORT_SYMBOL(cpu_khz);
 
-extern unsigned long wall_jiffies;
-
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 
@@ -130,25 +128,40 @@ static int set_rtc_mmss(unsigned long nowtime)
 
 int timer_ack;
 
-#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
 unsigned long profile_pc(struct pt_regs *regs)
 {
        unsigned long pc = instruction_pointer(regs);
 
-       if (!user_mode_vm(regs) && in_lock_functions(pc))
+#ifdef CONFIG_SMP
+       if (!user_mode_vm(regs) && in_lock_functions(pc)) {
+#ifdef CONFIG_FRAME_POINTER
                return *(unsigned long *)(regs->ebp + 4);
-
+#else
+               unsigned long *sp;
+               if ((regs->xcs & 3) == 0)
+                       sp = (unsigned long *)&regs->esp;
+               else
+                       sp = (unsigned long *)regs->esp;
+               /* Return address is either directly at stack pointer
+                  or above a saved eflags. Eflags has bits 22-31 zero,
+                  kernel addresses don't. */
+               if (sp[0] >> 22)
+                       return sp[0];
+               if (sp[1] >> 22)
+                       return sp[1];
+#endif
+       }
+#endif
        return pc;
 }
 EXPORT_SYMBOL(profile_pc);
-#endif
 
 /*
  * This is the same as the above, except we _also_ save the current
  * Time Stamp Counter value at the time of the timer interrupt, so that
  * we later on can estimate the time of day more exactly.
  */
-irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t timer_interrupt(int irq, void *dev_id)
 {
        /*
         * Here we are in the timer irq handler. We just have irqs locally
@@ -175,7 +188,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        }
 #endif
 
-       do_timer_interrupt_hook(regs);
+       do_timer_interrupt_hook();
 
 
        if (MCA_bus) {
@@ -188,15 +201,15 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                high bit of the PPI port B (0x61).  Note that some PS/2s,
                notably the 55SX, work fine if this is removed.  */
 
-               irq = inb_p( 0x61 );    /* read the current state */
-               outb_p( irq|0x80, 0x61 );       /* reset the IRQ */
+               u8 irq_v = inb_p( 0x61 );       /* read the current state */
+               outb_p( irq_v|0x80, 0x61 );     /* reset the IRQ */
        }
 
        write_sequnlock(&xtime_lock);
 
 #ifdef CONFIG_X86_LOCAL_APIC
        if (using_apic_timer)
-               smp_send_timer_broadcast_ipi(regs);
+               smp_send_timer_broadcast_ipi();
 #endif
 
        return IRQ_HANDLED;
@@ -314,7 +327,6 @@ static int timer_resume(struct sys_device *dev)
        do_settimeofday(&ts);
        write_seqlock_irqsave(&xtime_lock, flags);
        jiffies_64 += sleep_length;
-       wall_jiffies += sleep_length;
        write_sequnlock_irqrestore(&xtime_lock, flags);
        touch_softlockup_watchdog();
        return 0;