1 /* SPDX-License-Identifier: GPL-2.0 */
7 #include <asm/asm-offsets.h>
8 #include <asm/sysreg.h>
10 #ifdef CONFIG_SHADOW_CALL_STACK
13 .macro scs_load_current
14 get_current_task scs_sp
15 ldr scs_sp, [scs_sp, #TSK_TI_SCS_SP]
19 str scs_sp, [\tsk, #TSK_TI_SCS_SP]
22 .macro scs_load_current
27 #endif /* CONFIG_SHADOW_CALL_STACK */
32 #include <linux/scs.h>
33 #include <asm/cpufeature.h>
35 #ifdef CONFIG_UNWIND_PATCH_PAC_INTO_SCS
36 static inline void dynamic_scs_init(void)
38 extern bool __pi_dynamic_scs_is_enabled;
40 if (__pi_dynamic_scs_is_enabled) {
41 pr_info("Enabling dynamic shadow call stack\n");
42 static_branch_enable(&dynamic_scs_enabled);
46 static inline void dynamic_scs_init(void) {}
49 int __pi_scs_patch(const u8 eh_frame[], int size);
50 asmlinkage void __pi_scs_patch_vmlinux(void);
52 #endif /* __ASSEMBLY __ */
54 #endif /* _ASM_SCS_H */