xtensa: fix high memory/reserved memory collision
[cris-mirror.git] / include / linux / pkeys.h
blob0794ca78c379a609c576e975a1a0acbbb218d978
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_PKEYS_H
3 #define _LINUX_PKEYS_H
5 #include <linux/mm_types.h>
6 #include <asm/mmu_context.h>
8 #ifdef CONFIG_ARCH_HAS_PKEYS
9 #include <asm/pkeys.h>
10 #else /* ! CONFIG_ARCH_HAS_PKEYS */
11 #define arch_max_pkey() (1)
12 #define execute_only_pkey(mm) (0)
13 #define arch_override_mprotect_pkey(vma, prot, pkey) (0)
14 #define PKEY_DEDICATED_EXECUTE_ONLY 0
15 #define ARCH_VM_PKEY_FLAGS 0
17 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
19 return (pkey == 0);
22 static inline int mm_pkey_alloc(struct mm_struct *mm)
24 return -1;
27 static inline int mm_pkey_free(struct mm_struct *mm, int pkey)
29 return -EINVAL;
32 static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
33 unsigned long init_val)
35 return 0;
38 static inline void copy_init_pkru_to_fpregs(void)
42 #endif /* ! CONFIG_ARCH_HAS_PKEYS */
44 #endif /* _LINUX_PKEYS_H */