hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/include/asm/nohash/32/pte-44x.h
....@@ -85,14 +85,44 @@
8585 #define _PAGE_NO_CACHE 0x00000400 /* H: I bit */
8686 #define _PAGE_WRITETHRU 0x00000800 /* H: W bit */
8787
88
+/* No page size encoding in the linux PTE */
89
+#define _PAGE_PSIZE 0
90
+
91
+#define _PAGE_KERNEL_RO 0
92
+#define _PAGE_KERNEL_ROX _PAGE_EXEC
93
+#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW)
94
+#define _PAGE_KERNEL_RWX (_PAGE_DIRTY | _PAGE_RW | _PAGE_EXEC)
95
+
8896 /* TODO: Add large page lowmem mapping support */
8997 #define _PMD_PRESENT 0
9098 #define _PMD_PRESENT_MASK (PAGE_MASK)
9199 #define _PMD_BAD (~PAGE_MASK)
100
+#define _PMD_USER 0
92101
93102 /* ERPN in a PTE never gets cleared, ignore it */
94103 #define _PTE_NONE_MASK 0xffffffff00000000ULL
95104
105
+/*
106
+ * We define 2 sets of base prot bits, one for basic pages (ie,
107
+ * cacheable kernel and user pages) and one for non cacheable
108
+ * pages. We always set _PAGE_COHERENT when SMP is enabled or
109
+ * the processor might need it for DMA coherency.
110
+ */
111
+#define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED)
112
+#if defined(CONFIG_SMP)
113
+#define _PAGE_BASE (_PAGE_BASE_NC | _PAGE_COHERENT)
114
+#else
115
+#define _PAGE_BASE (_PAGE_BASE_NC)
116
+#endif
117
+
118
+/* Permission masks used to generate the __P and __S table */
119
+#define PAGE_NONE __pgprot(_PAGE_BASE)
120
+#define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW)
121
+#define PAGE_SHARED_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_RW | _PAGE_EXEC)
122
+#define PAGE_COPY __pgprot(_PAGE_BASE | _PAGE_USER)
123
+#define PAGE_COPY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
124
+#define PAGE_READONLY __pgprot(_PAGE_BASE | _PAGE_USER)
125
+#define PAGE_READONLY_X __pgprot(_PAGE_BASE | _PAGE_USER | _PAGE_EXEC)
96126
97127 #endif /* __KERNEL__ */
98128 #endif /* _ASM_POWERPC_NOHASH_32_PTE_44x_H */