]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
66d37570 DH |
2 | #ifndef _LINUX_PKEYS_H |
3 | #define _LINUX_PKEYS_H | |
4 | ||
555934a7 | 5 | #include <linux/mm.h> |
66d37570 DH |
6 | |
7 | #ifdef CONFIG_ARCH_HAS_PKEYS | |
8 | #include <asm/pkeys.h> | |
9 | #else /* ! CONFIG_ARCH_HAS_PKEYS */ | |
10 | #define arch_max_pkey() (1) | |
62b5f7d0 DH |
11 | #define execute_only_pkey(mm) (0) |
12 | #define arch_override_mprotect_pkey(vma, prot, pkey) (0) | |
13 | #define PKEY_DEDICATED_EXECUTE_ONLY 0 | |
a8502b67 | 14 | #define ARCH_VM_PKEY_FLAGS 0 |
e8c24d3a | 15 | |
dbec10e5 ME |
16 | static inline int vma_pkey(struct vm_area_struct *vma) |
17 | { | |
18 | return 0; | |
19 | } | |
20 | ||
e8c24d3a DH |
21 | static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) |
22 | { | |
23 | return (pkey == 0); | |
24 | } | |
25 | ||
26 | static inline int mm_pkey_alloc(struct mm_struct *mm) | |
27 | { | |
28 | return -1; | |
29 | } | |
30 | ||
31 | static inline int mm_pkey_free(struct mm_struct *mm, int pkey) | |
32 | { | |
e8c24d3a DH |
33 | return -EINVAL; |
34 | } | |
35 | ||
36 | static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, | |
37 | unsigned long init_val) | |
38 | { | |
39 | return 0; | |
40 | } | |
41 | ||
4414ef95 ME |
42 | static inline bool arch_pkeys_enabled(void) |
43 | { | |
44 | return false; | |
45 | } | |
46 | ||
acd547b2 DH |
47 | static inline void copy_init_pkru_to_fpregs(void) |
48 | { | |
49 | } | |
50 | ||
66d37570 DH |
51 | #endif /* ! CONFIG_ARCH_HAS_PKEYS */ |
52 | ||
66d37570 | 53 | #endif /* _LINUX_PKEYS_H */ |