thermal: fix Mediatek thermal controller build
[linux/fpc-iii.git] / arch / x86 / include / asm / pkeys.h
blob7b84565c916c7b0329ac92c79c789748ff9eeb28
1 #ifndef _ASM_X86_PKEYS_H
2 #define _ASM_X86_PKEYS_H
4 #define arch_max_pkey() (boot_cpu_has(X86_FEATURE_OSPKE) ? 16 : 1)
6 extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
7 unsigned long init_val);
9 /*
10 * Try to dedicate one of the protection keys to be used as an
11 * execute-only protection key.
13 #define PKEY_DEDICATED_EXECUTE_ONLY 15
14 extern int __execute_only_pkey(struct mm_struct *mm);
15 static inline int execute_only_pkey(struct mm_struct *mm)
17 if (!boot_cpu_has(X86_FEATURE_OSPKE))
18 return 0;
20 return __execute_only_pkey(mm);
23 extern int __arch_override_mprotect_pkey(struct vm_area_struct *vma,
24 int prot, int pkey);
25 static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma,
26 int prot, int pkey)
28 if (!boot_cpu_has(X86_FEATURE_OSPKE))
29 return 0;
31 return __arch_override_mprotect_pkey(vma, prot, pkey);
34 #endif /*_ASM_X86_PKEYS_H */