Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20791846 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Catalin Marinas
Browse files

arm64: use ENDPIPROC() to annotate position independent assembler routines



For more control over which functions are called with the MMU off or
with the UEFI 1:1 mapping active, annotate some assembler routines as
position independent. This is done by introducing ENDPIPROC(), which
replaces the ENDPROC() declaration of those routines.

Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent d4dddfdb
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -193,4 +193,15 @@ lr .req x30 // link register
	str	\src, [\tmp, :lo12:\sym]
	.endm

/*
 * Annotate a function as position independent, i.e., safe to be called before
 * the kernel virtual mapping is activated.
 */
#define ENDPIPROC(x)			\
	.globl	__pi_##x;		\
	.type 	__pi_##x, %function;	\
	.set	__pi_##x, x;		\
	.size	__pi_##x, . - x;	\
	ENDPROC(x)

#endif	/* __ASM_ASSEMBLER_H */
+1 −1
Original line number Diff line number Diff line
@@ -41,4 +41,4 @@ ENTRY(memchr)
	ret
2:	mov	x0, #0
	ret
ENDPROC(memchr)
ENDPIPROC(memchr)
+1 −1
Original line number Diff line number Diff line
@@ -255,4 +255,4 @@ CPU_LE( rev data2, data2 )
.Lret0:
	mov	result, #0
	ret
ENDPROC(memcmp)
ENDPIPROC(memcmp)
+1 −1
Original line number Diff line number Diff line
@@ -71,4 +71,4 @@
ENTRY(memcpy)
#include "copy_template.S"
	ret
ENDPROC(memcpy)
ENDPIPROC(memcpy)
+1 −1
Original line number Diff line number Diff line
@@ -194,4 +194,4 @@ ENTRY(memmove)
	tst	count, #0x3f
	b.ne	.Ltail63
	ret
ENDPROC(memmove)
ENDPIPROC(memmove)
Loading