diff options
author | David S. Miller <davem@davemloft.net> | 2008-05-15 03:34:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-15 03:34:44 -0400 |
commit | 63fe46da9c380b3f2bbdf3765044649517cc717c (patch) | |
tree | 9478c1aca1d692b408955aea20c9cd9a37e589c0 /include/asm-x86/pgtable.h | |
parent | 99dd1a2b8347ac2ae802300b7862f6f7bcf17139 (diff) | |
parent | 066b2118976e6e7cc50eed39e2747c75343a23c4 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/iwlwifi/iwl-4965-rs.c
drivers/net/wireless/rt2x00/rt61pci.c
Diffstat (limited to 'include/asm-x86/pgtable.h')
-rw-r--r-- | include/asm-x86/pgtable.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 801b31f71452..55c3a0e3a8ce 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -57,7 +57,8 @@ | |||
57 | #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \ | 57 | #define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | \ |
58 | _PAGE_DIRTY) | 58 | _PAGE_DIRTY) |
59 | 59 | ||
60 | #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) | 60 | #define _PAGE_CHG_MASK (PTE_MASK | _PAGE_PCD | _PAGE_PWT | \ |
61 | _PAGE_ACCESSED | _PAGE_DIRTY) | ||
61 | 62 | ||
62 | #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) | 63 | #define _PAGE_CACHE_MASK (_PAGE_PCD | _PAGE_PWT) |
63 | #define _PAGE_CACHE_WB (0) | 64 | #define _PAGE_CACHE_WB (0) |
@@ -288,12 +289,21 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
288 | * Chop off the NX bit (if present), and add the NX portion of | 289 | * Chop off the NX bit (if present), and add the NX portion of |
289 | * the newprot (if present): | 290 | * the newprot (if present): |
290 | */ | 291 | */ |
291 | val &= _PAGE_CHG_MASK & ~_PAGE_NX; | 292 | val &= _PAGE_CHG_MASK; |
292 | val |= pgprot_val(newprot) & __supported_pte_mask; | 293 | val |= pgprot_val(newprot) & (~_PAGE_CHG_MASK) & __supported_pte_mask; |
293 | 294 | ||
294 | return __pte(val); | 295 | return __pte(val); |
295 | } | 296 | } |
296 | 297 | ||
298 | /* mprotect needs to preserve PAT bits when updating vm_page_prot */ | ||
299 | #define pgprot_modify pgprot_modify | ||
300 | static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | ||
301 | { | ||
302 | pgprotval_t preservebits = pgprot_val(oldprot) & _PAGE_CHG_MASK; | ||
303 | pgprotval_t addbits = pgprot_val(newprot); | ||
304 | return __pgprot(preservebits | addbits); | ||
305 | } | ||
306 | |||
297 | #define pte_pgprot(x) __pgprot(pte_val(x) & (0xfff | _PAGE_NX)) | 307 | #define pte_pgprot(x) __pgprot(pte_val(x) & (0xfff | _PAGE_NX)) |
298 | 308 | ||
299 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) | 309 | #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) |