diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/sh/include/asm/pgtable_32.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/sh/include/asm/pgtable_32.h')
-rw-r--r-- | arch/sh/include/asm/pgtable_32.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/sh/include/asm/pgtable_32.h b/arch/sh/include/asm/pgtable_32.h index c0d359ce337b..e172d696e52b 100644 --- a/arch/sh/include/asm/pgtable_32.h +++ b/arch/sh/include/asm/pgtable_32.h | |||
@@ -71,6 +71,8 @@ | |||
71 | #define _PAGE_EXT_KERN_WRITE 0x1000 /* EPR4-bit: Kernel space writable */ | 71 | #define _PAGE_EXT_KERN_WRITE 0x1000 /* EPR4-bit: Kernel space writable */ |
72 | #define _PAGE_EXT_KERN_READ 0x2000 /* EPR5-bit: Kernel space readable */ | 72 | #define _PAGE_EXT_KERN_READ 0x2000 /* EPR5-bit: Kernel space readable */ |
73 | 73 | ||
74 | #define _PAGE_EXT_WIRED 0x4000 /* software: Wire TLB entry */ | ||
75 | |||
74 | /* Wrapper for extended mode pgprot twiddling */ | 76 | /* Wrapper for extended mode pgprot twiddling */ |
75 | #define _PAGE_EXT(x) ((unsigned long long)(x) << 32) | 77 | #define _PAGE_EXT(x) ((unsigned long long)(x) << 32) |
76 | 78 | ||
@@ -108,7 +110,7 @@ static inline unsigned long copy_ptea_attributes(unsigned long x) | |||
108 | #define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE) | 110 | #define _PAGE_CLEAR_FLAGS (_PAGE_PROTNONE | _PAGE_ACCESSED | _PAGE_FILE) |
109 | #endif | 111 | #endif |
110 | 112 | ||
111 | #define _PAGE_FLAGS_HARDWARE_MASK (PHYS_ADDR_MASK & ~(_PAGE_CLEAR_FLAGS)) | 113 | #define _PAGE_FLAGS_HARDWARE_MASK (phys_addr_mask() & ~(_PAGE_CLEAR_FLAGS)) |
112 | 114 | ||
113 | /* Hardware flags, page size encoding */ | 115 | /* Hardware flags, page size encoding */ |
114 | #if !defined(CONFIG_MMU) | 116 | #if !defined(CONFIG_MMU) |
@@ -141,12 +143,14 @@ static inline unsigned long copy_ptea_attributes(unsigned long x) | |||
141 | # elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB) | 143 | # elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB) |
142 | # define _PAGE_SZHUGE (_PAGE_EXT_ESZ2 | _PAGE_EXT_ESZ3) | 144 | # define _PAGE_SZHUGE (_PAGE_EXT_ESZ2 | _PAGE_EXT_ESZ3) |
143 | # endif | 145 | # endif |
146 | # define _PAGE_WIRED (_PAGE_EXT(_PAGE_EXT_WIRED)) | ||
144 | #else | 147 | #else |
145 | # if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | 148 | # if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) |
146 | # define _PAGE_SZHUGE (_PAGE_SZ1) | 149 | # define _PAGE_SZHUGE (_PAGE_SZ1) |
147 | # elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) | 150 | # elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) |
148 | # define _PAGE_SZHUGE (_PAGE_SZ0 | _PAGE_SZ1) | 151 | # define _PAGE_SZHUGE (_PAGE_SZ0 | _PAGE_SZ1) |
149 | # endif | 152 | # endif |
153 | # define _PAGE_WIRED (0) | ||
150 | #endif | 154 | #endif |
151 | 155 | ||
152 | /* | 156 | /* |
@@ -344,7 +348,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
344 | #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) | 348 | #define pte_special(pte) ((pte).pte_low & _PAGE_SPECIAL) |
345 | 349 | ||
346 | #ifdef CONFIG_X2TLB | 350 | #ifdef CONFIG_X2TLB |
347 | #define pte_write(pte) ((pte).pte_high & _PAGE_EXT_USER_WRITE) | 351 | #define pte_write(pte) \ |
352 | ((pte).pte_high & (_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)) | ||
348 | #else | 353 | #else |
349 | #define pte_write(pte) ((pte).pte_low & _PAGE_RW) | 354 | #define pte_write(pte) ((pte).pte_low & _PAGE_RW) |
350 | #endif | 355 | #endif |
@@ -358,7 +363,7 @@ static inline pte_t pte_##fn(pte_t pte) { pte.pte_##h op; return pte; } | |||
358 | * individually toggled (and user permissions are entirely decoupled from | 363 | * individually toggled (and user permissions are entirely decoupled from |
359 | * kernel permissions), we attempt to couple them a bit more sanely here. | 364 | * kernel permissions), we attempt to couple them a bit more sanely here. |
360 | */ | 365 | */ |
361 | PTE_BIT_FUNC(high, wrprotect, &= ~_PAGE_EXT_USER_WRITE); | 366 | PTE_BIT_FUNC(high, wrprotect, &= ~(_PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE)); |
362 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); | 367 | PTE_BIT_FUNC(high, mkwrite, |= _PAGE_EXT_USER_WRITE | _PAGE_EXT_KERN_WRITE); |
363 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); | 368 | PTE_BIT_FUNC(high, mkhuge, |= _PAGE_SZHUGE); |
364 | #else | 369 | #else |