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 10 static inline u64 vmflag_to_pte_pkey_bits(u64 vm_flags) 11 { 12 if (!mmu_has_feature(MMU_FTR_PKEY)) 13 return 0x0UL; 14 15 if (radix_enabled()) 16 BUG(); 17 return hash__vmflag_to_pte_pkey_bits(vm_flags); 18 } 19 20 static inline u16 pte_to_pkey_bits(u64 pteflags) 21 { 22 if (radix_enabled()) 23 BUG(); 24 return hash__pte_to_pkey_bits(pteflags); 25 } 26 27 #endif /*_ASM_POWERPC_KEYS_H */ 28