xref: /linux/arch/s390/include/asm/arch-stackprotector.h (revision a619fe35ab41fded440d3762d4fbad84ff86a4d4)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef _ASM_S390_ARCH_STACKPROTECTOR_H
4 #define _ASM_S390_ARCH_STACKPROTECTOR_H
5 
6 extern unsigned long __stack_chk_guard;
7 extern int stack_protector_debug;
8 
9 void __stack_protector_apply_early(unsigned long kernel_start);
10 int __stack_protector_apply(unsigned long *start, unsigned long *end, unsigned long kernel_start);
11 
12 static inline void stack_protector_apply_early(unsigned long kernel_start)
13 {
14 	if (IS_ENABLED(CONFIG_STACKPROTECTOR))
15 		__stack_protector_apply_early(kernel_start);
16 }
17 
18 static inline int stack_protector_apply(unsigned long *start, unsigned long *end)
19 {
20 	if (IS_ENABLED(CONFIG_STACKPROTECTOR))
21 		return __stack_protector_apply(start, end, 0);
22 	return 0;
23 }
24 
25 #endif /* _ASM_S390_ARCH_STACKPROTECTOR_H */
26