| .. | .. |
|---|
| 85 | 85 | #define _PAGE_NO_CACHE 0x00000400 /* H: I bit */ |
|---|
| 86 | 86 | #define _PAGE_WRITETHRU 0x00000800 /* H: W bit */ |
|---|
| 87 | 87 | |
|---|
| 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 | + |
|---|
| 88 | 96 | /* TODO: Add large page lowmem mapping support */ |
|---|
| 89 | 97 | #define _PMD_PRESENT 0 |
|---|
| 90 | 98 | #define _PMD_PRESENT_MASK (PAGE_MASK) |
|---|
| 91 | 99 | #define _PMD_BAD (~PAGE_MASK) |
|---|
| 100 | +#define _PMD_USER 0 |
|---|
| 92 | 101 | |
|---|
| 93 | 102 | /* ERPN in a PTE never gets cleared, ignore it */ |
|---|
| 94 | 103 | #define _PTE_NONE_MASK 0xffffffff00000000ULL |
|---|
| 95 | 104 | |
|---|
| 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) |
|---|
| 96 | 126 | |
|---|
| 97 | 127 | #endif /* __KERNEL__ */ |
|---|
| 98 | 128 | #endif /* _ASM_POWERPC_NOHASH_32_PTE_44x_H */ |
|---|