aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2014-05-20 07:31:04 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-05-21 03:10:32 -0400
commiteed542d6962ba33a689b4007a389f466e407bd74 (patch)
treed7ecb07cb30a0d4f20497fa6ef90d3829b4c701a /arch/sh/include
parentd6d211db37e75de2ddc3a4f979038c40df7cc79c (diff)
ftrace: Make CALLER_ADDRx macros more generic
Most archs with HAVE_ARCH_CALLER_ADDR have pretty much the same definitions of CALLER_ADDRx(n). Instead of duplicating the code for all the archs, define a ftrace_return_address0() and ftrace_return_address(n) that can be overwritten by the archs if they need to do something different. Instead of 7 macros in every arch, we now only have at most 2 (and actually only 1 as ftrace_return_address0() should be the same for all archs). The CALLER_ADDRx(n) will now be defined in linux/ftrace.h and use the ftrace_return_address*(n?) macros. This removes a lot of the duplicate code. Link: http://lkml.kernel.org/p/1400585464-30333-1-git-send-email-takahiro.akashi@linaro.org Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r--arch/sh/include/asm/ftrace.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/arch/sh/include/asm/ftrace.h b/arch/sh/include/asm/ftrace.h
index 13e9966464c2..e79fb6ebaa42 100644
--- a/arch/sh/include/asm/ftrace.h
+++ b/arch/sh/include/asm/ftrace.h
@@ -40,15 +40,7 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr)
40/* arch/sh/kernel/return_address.c */ 40/* arch/sh/kernel/return_address.c */
41extern void *return_address(unsigned int); 41extern void *return_address(unsigned int);
42 42
43#define HAVE_ARCH_CALLER_ADDR 43#define ftrace_return_address(n) return_address(n)
44
45#define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))
46#define CALLER_ADDR1 ((unsigned long)return_address(1))
47#define CALLER_ADDR2 ((unsigned long)return_address(2))
48#define CALLER_ADDR3 ((unsigned long)return_address(3))
49#define CALLER_ADDR4 ((unsigned long)return_address(4))
50#define CALLER_ADDR5 ((unsigned long)return_address(5))
51#define CALLER_ADDR6 ((unsigned long)return_address(6))
52 44
53#endif /* __ASSEMBLY__ */ 45#endif /* __ASSEMBLY__ */
54 46