]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
arm64: asm: Add new-style position independent function annotations
authorMark Brown <broonie@kernel.org>
Mon, 6 Jan 2020 19:58:16 +0000 (19:58 +0000)
committerWill Deacon <will@kernel.org>
Wed, 8 Jan 2020 12:14:08 +0000 (12:14 +0000)
As part of an effort to make the annotations in assembly code clearer and
more consistent new macros have been introduced, including replacements
for ENTRY() and ENDPROC().

On arm64 we have ENDPIPROC(), a custom version of ENDPROC() which is
used for code that will need to run in position independent environments
like EFI, it creates an alias for the function with the prefix __pi_ and
then emits the standard ENDPROC. Add new-style macros to replace this
which expand to the standard SYM_FUNC_*() and SYM_FUNC_ALIAS_*(),
resulting in the same object code. These are added in linkage.h for
consistency with where the generic assembler code has its macros.

Signed-off-by: Mark Brown <broonie@kernel.org>
[will: Rename 'WEAK' macro, use ';' instead of ASM_NL, deprecate ENDPIPROC]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/linkage.h

index b8cf7c85ffa2a2e7c5cacd15910185d44fe751a8..4a4258f17c868f8acde2d5cfc7cdcfe325d55e82 100644 (file)
@@ -462,6 +462,7 @@ USER(\label, ic     ivau, \tmp2)                    // invalidate I line PoU
        .endm
 
 /*
+ * Deprecated! Use SYM_FUNC_{START,START_WEAK,END}_PI instead.
  * Annotate a function as position independent, i.e., safe to be called before
  * the kernel virtual mapping is activated.
  */
index 1b266292f0bee00ce1952005479053e820b5ca0e..ebee3113a62ff7bbc17e12f8de318e9db37caac3 100644 (file)
@@ -4,4 +4,20 @@
 #define __ALIGN                .align 2
 #define __ALIGN_STR    ".align 2"
 
+/*
+ * Annotate a function as position independent, i.e., safe to be called before
+ * the kernel virtual mapping is activated.
+ */
+#define SYM_FUNC_START_PI(x)                   \
+               SYM_FUNC_START_ALIAS(__pi_##x); \
+               SYM_FUNC_START(x)
+
+#define SYM_FUNC_START_WEAK_PI(x)              \
+               SYM_FUNC_START_ALIAS(__pi_##x); \
+               SYM_FUNC_START_WEAK(x)
+
+#define SYM_FUNC_END_PI(x)                     \
+               SYM_FUNC_END(x);                \
+               SYM_FUNC_END_ALIAS(__pi_##x)
+
 #endif