aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2014-06-17 02:15:32 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-06-24 00:05:32 -0400
commitd997c00c5a9b61474f7ff5f27ed64173bb007987 (patch)
tree7883aa7e32948134ebca9a68fe955bfa1a3e8941 /arch
parent2055fb41ea6bf9507d94b3515528249ce12409e3 (diff)
powerpc: Add ppc_global_function_entry()
ABIv2 has the concept of a global and local entry point to a function. In most cases we are interested in the local entry point, and so that is what ppc_function_entry() returns. However we have a case in the ftrace code where we want the global entry point, and there may be other places we need it too. Rather than special casing each, add an accessor. For ABIv1 and 32-bit there is only a single entry point, so we return that. That means it's safe for the caller to use this without also checking the ABI version. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/include/asm/code-patching.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h
index 37991e154ef8..840a5509b3f1 100644
--- a/arch/powerpc/include/asm/code-patching.h
+++ b/arch/powerpc/include/asm/code-patching.h
@@ -88,4 +88,15 @@ static inline unsigned long ppc_function_entry(void *func)
88#endif 88#endif
89} 89}
90 90
91static inline unsigned long ppc_global_function_entry(void *func)
92{
93#if defined(CONFIG_PPC64) && defined(_CALL_ELF) && _CALL_ELF == 2
94 /* PPC64 ABIv2 the global entry point is at the address */
95 return (unsigned long)func;
96#else
97 /* All other cases there is no change vs ppc_function_entry() */
98 return ppc_function_entry(func);
99#endif
100}
101
91#endif /* _ASM_POWERPC_CODE_PATCHING_H */ 102#endif /* _ASM_POWERPC_CODE_PATCHING_H */