headers: remove sched.h from interrupt.h
[safe/jmp/linux-2.6] / arch / arm / kernel / time.c
index cc5145b..d38cdf2 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/interrupt.h>
 #include <linux/time.h>
 #include <linux/init.h>
+#include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/timex.h>
 #include <linux/errno.h>
@@ -33,6 +34,7 @@
 
 #include <asm/leds.h>
 #include <asm/thread_info.h>
+#include <asm/stacktrace.h>
 #include <asm/mach/time.h>
 
 /*
@@ -55,14 +57,22 @@ EXPORT_SYMBOL(rtc_lock);
 #ifdef CONFIG_SMP
 unsigned long profile_pc(struct pt_regs *regs)
 {
-       unsigned long fp, pc = instruction_pointer(regs);
+       struct stackframe frame;
 
-       if (in_lock_functions(pc)) {
-               fp = regs->ARM_fp;
-               pc = pc_pointer(((unsigned long *)fp)[-1]);
-       }
+       if (!in_lock_functions(regs->ARM_pc))
+               return regs->ARM_pc;
+
+       frame.fp = regs->ARM_fp;
+       frame.sp = regs->ARM_sp;
+       frame.lr = regs->ARM_lr;
+       frame.pc = regs->ARM_pc;
+       do {
+               int ret = unwind_frame(&frame);
+               if (ret < 0)
+                       return 0;
+       } while (in_lock_functions(frame.pc));
 
-       return pc;
+       return frame.pc;
 }
 EXPORT_SYMBOL(profile_pc);
 #endif
@@ -130,7 +140,9 @@ static const struct leds_evt_name evt_names[] = {
        { "red",   led_red_on,   led_red_off   },
 };
 
-static ssize_t leds_store(struct sys_device *dev, const char *buf, size_t size)
+static ssize_t leds_store(struct sys_device *dev,
+                       struct sysdev_attribute *attr,
+                       const char *buf, size_t size)
 {
        int ret = -EINVAL, len = strcspn(buf, " ");