Commit 7d40aff8 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2}



Replace all uses of PPC64_ELF_ABI_v1 and PPC64_ELF_ABI_v2 by
resp CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2.

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ba13d59e8c50bc9aa6328f1c7f0c0d0278e0a3a7.1652074503.git.christophe.leroy@csgroup.eu
parent 661aa880
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ bool is_conditional_branch(ppc_inst_t instr);

static inline unsigned long ppc_function_entry(void *func)
{
#ifdef PPC64_ELF_ABI_v2
#ifdef CONFIG_PPC64_ELF_ABI_V2
	u32 *insn = func;

	/*
@@ -157,7 +157,7 @@ static inline unsigned long ppc_function_entry(void *func)
		return (unsigned long)(insn + 2);
	else
		return (unsigned long)func;
#elif defined(PPC64_ELF_ABI_v1)
#elif defined(CONFIG_PPC64_ELF_ABI_V1)
	/*
	 * On PPC64 ABIv1 the function pointer actually points to the
	 * function's descriptor. The first entry in the descriptor is the
@@ -171,7 +171,7 @@ static inline unsigned long ppc_function_entry(void *func)

static inline unsigned long ppc_global_function_entry(void *func)
{
#ifdef PPC64_ELF_ABI_v2
#ifdef CONFIG_PPC64_ELF_ABI_V2
	/* PPC64 ABIv2 the global entry point is at the address */
	return (unsigned long)func;
#else
@@ -188,7 +188,7 @@ static inline unsigned long ppc_global_function_entry(void *func)
static inline unsigned long ppc_kallsyms_lookup_name(const char *name)
{
	unsigned long addr;
#ifdef PPC64_ELF_ABI_v1
#ifdef CONFIG_PPC64_ELF_ABI_V1
	/* check for dot variant */
	char dot_name[1 + KSYM_NAME_LEN];
	bool dot_appended = false;
@@ -209,7 +209,7 @@ static inline unsigned long ppc_kallsyms_lookup_name(const char *name)
	if (!addr && dot_appended)
		/* Let's try the original non-dot symbol lookup	*/
		addr = kallsyms_lookup_name(name);
#elif defined(PPC64_ELF_ABI_v2)
#elif defined(CONFIG_PPC64_ELF_ABI_V2)
	addr = kallsyms_lookup_name(name);
	if (addr)
		addr = ppc_function_entry((void *)addr);
@@ -226,7 +226,7 @@ static inline unsigned long ppc_kallsyms_lookup_name(const char *name)
 */

/* This must match the definition of STK_GOT in <asm/ppc_asm.h> */
#ifdef PPC64_ELF_ABI_v2
#ifdef CONFIG_PPC64_ELF_ABI_V2
#define R2_STACK_OFFSET         24
#else
#define R2_STACK_OFFSET         40
+2 −2
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
 * those.
 */
#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
#ifdef PPC64_ELF_ABI_v1
#ifdef CONFIG_PPC64_ELF_ABI_V1
static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
{
	/* We need to skip past the initial dot, and the __se_sys alias */
@@ -83,7 +83,7 @@ static inline bool arch_syscall_match_sym_name(const char *sym, const char *name
		(!strncmp(sym, "ppc32_", 6) && !strcmp(sym + 6, name + 4)) ||
		(!strncmp(sym, "ppc64_", 6) && !strcmp(sym + 6, name + 4));
}
#endif /* PPC64_ELF_ABI_v1 */
#endif /* CONFIG_PPC64_ELF_ABI_V1 */
#endif /* CONFIG_FTRACE_SYSCALLS */

#ifdef CONFIG_PPC64
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

#include <asm/types.h>

#ifdef PPC64_ELF_ABI_v1
#ifdef CONFIG_PPC64_ELF_ABI_V1
#define cond_syscall(x) \
	asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n"		\
	     "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n")
+2 −2
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@
#define __STK_REG(i)   (112 + ((i)-14)*8)
#define STK_REG(i)     __STK_REG(__REG_##i)

#ifdef PPC64_ELF_ABI_v2
#ifdef CONFIG_PPC64_ELF_ABI_V2
#define STK_GOT		24
#define __STK_PARAM(i)	(32 + ((i)-3)*8)
#else
@@ -158,7 +158,7 @@
#endif
#define STK_PARAM(i)	__STK_PARAM(__REG_##i)

#ifdef PPC64_ELF_ABI_v2
#ifdef CONFIG_PPC64_ELF_ABI_V2

#define _GLOBAL(name) \
	.align 2 ; \
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ struct pt_regs
				 STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE)
#define STACK_FRAME_MARKER	12

#ifdef PPC64_ELF_ABI_v2
#ifdef CONFIG_PPC64_ELF_ABI_V2
#define STACK_FRAME_MIN_SIZE	32
#else
#define STACK_FRAME_MIN_SIZE	STACK_FRAME_OVERHEAD
Loading