1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 #ifndef _ASM_POWERPC_BOOK3S_64_PKEYS_H
4 #define _ASM_POWERPC_BOOK3S_64_PKEYS_H
5 
6 #include <asm/book3s/64/hash-pkey.h>
7 
8 extern u64 __ro_after_init default_uamor;
9 extern u64 __ro_after_init default_amr;
10 extern u64 __ro_after_init default_iamr;
11 
12 static inline u64 vmflag_to_pte_pkey_bits(u64 vm_flags)
13 {
14 	if (!mmu_has_feature(MMU_FTR_PKEY))
15 		return 0x0UL;
16 
17 	if (radix_enabled())
18 		BUG();
19 	return hash__vmflag_to_pte_pkey_bits(vm_flags);
20 }
21 
22 static inline u16 pte_to_pkey_bits(u64 pteflags)
23 {
24 	if (radix_enabled())
25 		BUG();
26 	return hash__pte_to_pkey_bits(pteflags);
27 }
28 
29 #endif /*_ASM_POWERPC_KEYS_H */
30