xref: /openbmc/linux/arch/parisc/include/asm/mman.h (revision 1587db11)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_MMAN_H__
3 #define __ASM_MMAN_H__
4 
5 #include <uapi/asm/mman.h>
6 
7 /* PARISC cannot allow mdwe as it needs writable stacks */
8 static inline bool arch_memory_deny_write_exec_supported(void)
9 {
10 	return false;
11 }
12 #define arch_memory_deny_write_exec_supported arch_memory_deny_write_exec_supported
13 
14 static inline unsigned long arch_calc_vm_flag_bits(unsigned long flags)
15 {
16 	/*
17 	 * The stack on parisc grows upwards, so if userspace requests memory
18 	 * for a stack, mark it with VM_GROWSUP so that the stack expansion in
19 	 * the fault handler will work.
20 	 */
21 	if (flags & MAP_STACK)
22 		return VM_GROWSUP;
23 
24 	return 0;
25 }
26 #define arch_calc_vm_flag_bits(flags) arch_calc_vm_flag_bits(flags)
27 
28 #endif /* __ASM_MMAN_H__ */
29