Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/upstream-linus
[linux-2.6.git] / arch / mips / kernel / process.c
index a8d53e5..b30cb25 100644 (file)
@@ -372,18 +372,18 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
 
 
 #ifdef CONFIG_KALLSYMS
-/* used by show_backtrace() */
-unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
-                          unsigned long pc, unsigned long *ra)
+/* generic stack unwinding function */
+unsigned long notrace unwind_stack_by_address(unsigned long stack_page,
+                                             unsigned long *sp,
+                                             unsigned long pc,
+                                             unsigned long *ra)
 {
-       unsigned long stack_page;
        struct mips_frame_info info;
        unsigned long size, ofs;
        int leaf;
        extern void ret_from_irq(void);
        extern void ret_from_exception(void);
 
-       stack_page = (unsigned long)task_stack_page(task);
        if (!stack_page)
                return 0;
 
@@ -442,6 +442,15 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
        *ra = 0;
        return __kernel_text_address(pc) ? pc : 0;
 }
+EXPORT_SYMBOL(unwind_stack_by_address);
+
+/* used by show_backtrace() */
+unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
+                          unsigned long pc, unsigned long *ra)
+{
+       unsigned long stack_page = (unsigned long)task_stack_page(task);
+       return unwind_stack_by_address(stack_page, sp, pc, ra);
+}
 #endif
 
 /*