summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/ptrace.h
diff options
context:
space:
mode:
authorMax Filippov2013-10-17 00:42:26 +0200
committerChris Zankel2014-01-14 19:19:58 +0100
commitf615136c06a791364f5afa8b8ba965315a6440f1 (patch)
treed9ced4cfdfd13438ce23384fbd64006bb74fd8b6 /arch/xtensa/include/asm/ptrace.h
parentxtensa: add MX irqchip (diff)
downloadkernel-qcow2-linux-f615136c06a791364f5afa8b8ba965315a6440f1.tar.gz
kernel-qcow2-linux-f615136c06a791364f5afa8b8ba965315a6440f1.tar.xz
kernel-qcow2-linux-f615136c06a791364f5afa8b8ba965315a6440f1.zip
xtensa: add SMP support
This is largely based on SMP code from the xtensa-2.6.29-smp tree by Piet Delaney, Marc Gauthier, Joe Taylor, Christian Zankel (and possibly other Tensilica folks). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/include/asm/ptrace.h')
-rw-r--r--arch/xtensa/include/asm/ptrace.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h
index 81f31bc9dde0..598e752dcbcd 100644
--- a/arch/xtensa/include/asm/ptrace.h
+++ b/arch/xtensa/include/asm/ptrace.h
@@ -59,9 +59,17 @@ struct pt_regs {
(task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
# define instruction_pointer(regs) ((regs)->pc)
+# define return_pointer(regs) (MAKE_PC_FROM_RA((regs)->areg[0], \
+ (regs)->areg[1]))
# ifndef CONFIG_SMP
# define profile_pc(regs) instruction_pointer(regs)
+# else
+# define profile_pc(regs) \
+ ({ \
+ in_lock_functions(instruction_pointer(regs)) ? \
+ return_pointer(regs) : instruction_pointer(regs); \
+ })
# endif
#define user_stack_pointer(regs) ((regs)->areg[1])