2019-05-27 06:55:01 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
*/
|
2012-10-09 08:47:26 +00:00
|
|
|
#ifndef _ASM_POWERPC_MMAN_H
|
|
|
|
#define _ASM_POWERPC_MMAN_H
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2012-10-09 08:47:26 +00:00
|
|
|
#include <uapi/asm/mman.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-07-07 14:28:54 +00:00
|
|
|
#ifdef CONFIG_PPC64
|
2008-07-14 09:25:57 +00:00
|
|
|
|
|
|
|
#include <asm/cputable.h>
|
|
|
|
#include <linux/mm.h>
|
2018-01-19 01:50:33 +00:00
|
|
|
#include <linux/pkeys.h>
|
2016-07-23 09:12:40 +00:00
|
|
|
#include <asm/cpu_has_feature.h>
|
2008-07-14 09:25:57 +00:00
|
|
|
|
2020-07-03 01:19:57 +00:00
|
|
|
#ifdef CONFIG_PPC_MEM_KEYS
|
2016-02-12 21:02:31 +00:00
|
|
|
static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot,
|
|
|
|
unsigned long pkey)
|
2008-07-07 14:28:54 +00:00
|
|
|
{
|
2020-07-03 01:19:57 +00:00
|
|
|
return pkey_to_vmflag_bits(pkey);
|
2008-07-07 14:28:54 +00:00
|
|
|
}
|
2016-02-12 21:02:31 +00:00
|
|
|
#define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey)
|
2008-07-07 14:28:54 +00:00
|
|
|
|
|
|
|
static inline pgprot_t arch_vm_get_page_prot(unsigned long vm_flags)
|
|
|
|
{
|
2020-07-03 01:19:57 +00:00
|
|
|
return __pgprot(vmflag_to_pte_pkey_bits(vm_flags));
|
2008-07-07 14:28:54 +00:00
|
|
|
}
|
|
|
|
#define arch_vm_get_page_prot(vm_flags) arch_vm_get_page_prot(vm_flags)
|
2020-07-03 01:19:57 +00:00
|
|
|
#endif
|
2008-07-07 14:28:54 +00:00
|
|
|
|
|
|
|
#endif /* CONFIG_PPC64 */
|
2005-09-07 20:27:09 +00:00
|
|
|
#endif /* _ASM_POWERPC_MMAN_H */
|