xref: /linux/arch/x86/include/asm/mman.h (revision 03c11eb3b16dc0058589751dfd91f254be2be613)
1*659df86aSThomas Huth /* SPDX-License-Identifier: GPL-2.0 */
2*659df86aSThomas Huth #ifndef __ASM_MMAN_H__
3*659df86aSThomas Huth #define __ASM_MMAN_H__
4*659df86aSThomas Huth 
5*659df86aSThomas Huth #ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
6*659df86aSThomas Huth #define arch_calc_vm_prot_bits(prot, key) (		\
7*659df86aSThomas Huth 		((key) & 0x1 ? VM_PKEY_BIT0 : 0) |      \
8*659df86aSThomas Huth 		((key) & 0x2 ? VM_PKEY_BIT1 : 0) |      \
9*659df86aSThomas Huth 		((key) & 0x4 ? VM_PKEY_BIT2 : 0) |      \
10*659df86aSThomas Huth 		((key) & 0x8 ? VM_PKEY_BIT3 : 0))
11*659df86aSThomas Huth #endif
12*659df86aSThomas Huth 
13*659df86aSThomas Huth #include <uapi/asm/mman.h>
14*659df86aSThomas Huth 
15*659df86aSThomas Huth #endif /* __ASM_MMAN_H__ */
16