Commit d997c00c authored by Michael Ellerman's avatar Michael Ellerman Committed by Benjamin Herrenschmidt

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: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 2055fb41
...@@ -88,4 +88,15 @@ static inline unsigned long ppc_function_entry(void *func) ...@@ -88,4 +88,15 @@ static inline unsigned long ppc_function_entry(void *func)
#endif #endif
} }
static inline unsigned long ppc_global_function_entry(void *func)
{
#if defined(CONFIG_PPC64) && defined(_CALL_ELF) && _CALL_ELF == 2
/* PPC64 ABIv2 the global entry point is at the address */
return (unsigned long)func;
#else
/* All other cases there is no change vs ppc_function_entry() */
return ppc_function_entry(func);
#endif
}
#endif /* _ASM_POWERPC_CODE_PATCHING_H */ #endif /* _ASM_POWERPC_CODE_PATCHING_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment