1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 #ifndef _ASM_POWERPC_MMAN_H
5 #define _ASM_POWERPC_MMAN_H
7 #include <uapi/asm/mman.h>
11 #include <asm/cputable.h>
13 #include <linux/pkeys.h>
14 #include <asm/cpu_has_feature.h>
16 #ifdef CONFIG_PPC_MEM_KEYS
17 static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot,
20 return pkey_to_vmflag_bits(pkey);
22 #define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey)
24 static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags)
26 return __pgprot(vmflag_to_pte_pkey_bits(vm_flags));
28 #define arch_vm_get_page_prot(vm_flags) arch_vm_get_page_prot(vm_flags)
31 #endif /* CONFIG_PPC64 */
32 #endif /* _ASM_POWERPC_MMAN_H */