Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-dbg', 'acpi-misc' and 'acpi-pci'
[linux-2.6-microblaze.git] / arch / x86 / kernel / unwind_orc.c
index fa79e42..7f969b2 100644 (file)
@@ -320,12 +320,19 @@ EXPORT_SYMBOL_GPL(unwind_get_return_address);
 
 unsigned long *unwind_get_return_address_ptr(struct unwind_state *state)
 {
+       struct task_struct *task = state->task;
+
        if (unwind_done(state))
                return NULL;
 
        if (state->regs)
                return &state->regs->ip;
 
+       if (task != current && state->sp == task->thread.sp) {
+               struct inactive_task_frame *frame = (void *)task->thread.sp;
+               return &frame->ret_addr;
+       }
+
        if (state->sp)
                return (unsigned long *)state->sp - 1;