xref: /linux/arch/powerpc/include/asm/pgtable-masks.h (revision a5a08dc90f4513d1a78582ec24b687fad01cc843)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_PGTABLE_MASKS_H
3 #define _ASM_POWERPC_PGTABLE_MASKS_H
4 
5 #ifndef _PAGE_NA
6 #define _PAGE_NA	0
7 #define _PAGE_RO	_PAGE_READ
8 #define _PAGE_ROX	(_PAGE_READ | _PAGE_EXEC)
9 #define _PAGE_RW	(_PAGE_READ | _PAGE_WRITE)
10 #define _PAGE_RWX	(_PAGE_READ | _PAGE_WRITE | _PAGE_EXEC)
11 #endif
12 
13 /* Permission flags for kernel mappings */
14 #ifndef _PAGE_KERNEL_RO
15 #define _PAGE_KERNEL_RO		_PAGE_RO
16 #define _PAGE_KERNEL_ROX	_PAGE_ROX
17 #define _PAGE_KERNEL_RW		(_PAGE_RW | _PAGE_DIRTY)
18 #define _PAGE_KERNEL_RWX	(_PAGE_RWX | _PAGE_DIRTY)
19 #endif
20 
21 /* Permission masks used to generate the __P and __S table */
22 #define PAGE_NONE	__pgprot(_PAGE_BASE | _PAGE_NA)
23 #define PAGE_SHARED	__pgprot(_PAGE_BASE | _PAGE_RW)
24 #define PAGE_SHARED_X	__pgprot(_PAGE_BASE | _PAGE_RWX)
25 #define PAGE_COPY	__pgprot(_PAGE_BASE | _PAGE_RO)
26 #define PAGE_COPY_X	__pgprot(_PAGE_BASE | _PAGE_ROX)
27 #define PAGE_READONLY	__pgprot(_PAGE_BASE | _PAGE_RO)
28 #define PAGE_READONLY_X	__pgprot(_PAGE_BASE | _PAGE_ROX)
29 
30 #endif /* _ASM_POWERPC_PGTABLE_MASKS_H */
31