We want the usual string operation to be available normally in the runtime services code, so mark them appropriately.
To implement the runtime services for rebooting and shutting down the system, move the smccc trampolines into the EFI runtime section as well. Signed-off-by: Ahmad Fatoum <[email protected]> --- arch/arm/cpu/smccc-call_32.S | 4 +++- arch/arm/cpu/smccc-call_64.S | 5 ++++- arch/arm/lib32/memcpy.S | 3 ++- arch/arm/lib32/memmove.S | 3 ++- arch/arm/lib32/memset.S | 3 ++- arch/arm/lib64/memcpy.S | 3 +++ arch/arm/lib64/memset.S | 3 +++ 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/arch/arm/cpu/smccc-call_32.S b/arch/arm/cpu/smccc-call_32.S index 9875e1f94755..02e892be5d8d 100644 --- a/arch/arm/cpu/smccc-call_32.S +++ b/arch/arm/cpu/smccc-call_32.S @@ -2,9 +2,11 @@ /* SPDX-FileCopyrightText: 2015 Linaro Limited */ #include <linux/linkage.h> - +#include <efi/attributes.h> #include <asm/unwind.h> +.section EFI_RUNTIME_SECTION(.text.smccc) + .arch_extension sec .arch_extension virt .arm diff --git a/arch/arm/cpu/smccc-call_64.S b/arch/arm/cpu/smccc-call_64.S index c2959050d2ef..45e334cfbe2c 100644 --- a/arch/arm/cpu/smccc-call_64.S +++ b/arch/arm/cpu/smccc-call_64.S @@ -2,9 +2,12 @@ /* SPDX-FileCopyrightText: 2015 Linaro Limited */ #include <linux/linkage.h> +#include <efi/attributes.h> #include <linux/arm-smccc.h> #include <asm/asm-offsets.h> +.section EFI_RUNTIME_SECTION(.text.smccc) + .macro SMCCC instr .cfi_startproc \instr #0 @@ -39,4 +42,4 @@ ENDPROC(__arm_smccc_smc) */ ENTRY(__arm_smccc_hvc) SMCCC hvc -ENDPROC(__arm_smccc_hvc) \ No newline at end of file +ENDPROC(__arm_smccc_hvc) diff --git a/arch/arm/lib32/memcpy.S b/arch/arm/lib32/memcpy.S index e48e077c5941..a5cc1a6c2f46 100644 --- a/arch/arm/lib32/memcpy.S +++ b/arch/arm/lib32/memcpy.S @@ -10,6 +10,7 @@ #include <linux/linkage.h> #include <asm/assembler.h> #include <asm/unwind.h> +#include <efi/attributes.h> #define LDR1W_SHIFT 0 #define STR1W_SHIFT 0 @@ -51,7 +52,7 @@ UNWIND( .save {r0, \regs} ) ldmfd sp!, {r0, \regs} .endm - .text +.section EFI_RUNTIME_SECTION(.text) /* Prototype: void *memcpy(void *dest, const void *src, size_t n); */ diff --git a/arch/arm/lib32/memmove.S b/arch/arm/lib32/memmove.S index 836286bc990f..59b4031b0797 100644 --- a/arch/arm/lib32/memmove.S +++ b/arch/arm/lib32/memmove.S @@ -10,8 +10,9 @@ #include <linux/linkage.h> #include <asm/assembler.h> #include <asm/unwind.h> +#include <efi/attributes.h> - .text + .section EFI_RUNTIME_SECTION(.text) /* * Prototype: void *memmove(void *dest, const void *src, size_t n); diff --git a/arch/arm/lib32/memset.S b/arch/arm/lib32/memset.S index 57dd1aa6daad..f3b0a683157b 100644 --- a/arch/arm/lib32/memset.S +++ b/arch/arm/lib32/memset.S @@ -9,8 +9,9 @@ #include <linux/linkage.h> #include <asm/assembler.h> #include <asm/unwind.h> +#include <efi/attributes.h> - .text + .section EFI_RUNTIME_SECTION(.text) .align 5 ENTRY(__memset) diff --git a/arch/arm/lib64/memcpy.S b/arch/arm/lib64/memcpy.S index 98b453d3fd79..a57ebee61aba 100644 --- a/arch/arm/lib64/memcpy.S +++ b/arch/arm/lib64/memcpy.S @@ -8,6 +8,7 @@ #include <linux/linkage.h> #include <asm/assembler.h> +#include <efi/attributes.h> /* Assumptions: * @@ -15,6 +16,8 @@ * */ +.section EFI_RUNTIME_SECTION(.text) + #define L(label) .L ## label #define dstin x0 diff --git a/arch/arm/lib64/memset.S b/arch/arm/lib64/memset.S index f059203983a2..d0659b424333 100644 --- a/arch/arm/lib64/memset.S +++ b/arch/arm/lib64/memset.S @@ -13,6 +13,9 @@ #include <linux/linkage.h> #include <asm/assembler.h> #include <asm/cache.h> +#include <efi/attributes.h> + +.section EFI_RUNTIME_SECTION(.text) /* * Fill in the buffer with character c (alignment handled by the hardware) -- 2.47.3
