xref: /openbmc/linux/arch/x86/include/asm/shstk.h (revision 2d39a6add422ac78254927ec2194838c33ae4fb2)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_SHSTK_H
3 #define _ASM_X86_SHSTK_H
4 
5 #ifndef __ASSEMBLY__
6 #include <linux/types.h>
7 
8 struct task_struct;
9 
10 #ifdef CONFIG_X86_USER_SHADOW_STACK
11 struct thread_shstk {
12 	u64	base;
13 	u64	size;
14 };
15 
16 long shstk_prctl(struct task_struct *task, int option, unsigned long features);
17 void reset_thread_features(void);
18 void shstk_free(struct task_struct *p);
19 #else
20 static inline long shstk_prctl(struct task_struct *task, int option,
21 			       unsigned long arg2) { return -EINVAL; }
22 static inline void reset_thread_features(void) {}
23 static inline void shstk_free(struct task_struct *p) {}
24 #endif /* CONFIG_X86_USER_SHADOW_STACK */
25 
26 #endif /* __ASSEMBLY__ */
27 
28 #endif /* _ASM_X86_SHSTK_H */
29