diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-13 14:53:16 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-13 14:53:16 -0800 |
commit | a6525042bfdfcab128bd91fad264de10fd24a55e (patch) | |
tree | 088102ff69846c71c963e970a90d627498202928 /arch/x86/include | |
parent | b9a0d06a35c382c02f471a0815e2e27cdfe1c7f9 (diff) | |
parent | 58dab916dfb57328d50deb0aa9b3fc92efa248ff (diff) |
Merge branch 'x86-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86 PAT: remove CPA WARN_ON for zero pte
x86 PAT: return compatible mapping to remap_pfn_range callers
x86 PAT: change track_pfn_vma_new to take pgprot_t pointer param
x86 PAT: consolidate old memtype new memtype check into a function
x86 PAT: remove PFNMAP type on track_pfn_vma_new() error
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 83e69f4a37f..06bbcbd66e9 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -341,6 +341,25 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) #define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) +static inline int is_new_memtype_allowed(unsigned long flags, + unsigned long new_flags) +{ + /* + * Certain new memtypes are not allowed with certain + * requested memtype: + * - request is uncached, return cannot be write-back + * - request is write-combine, return cannot be write-back + */ + if ((flags == _PAGE_CACHE_UC_MINUS && + new_flags == _PAGE_CACHE_WB) || + (flags == _PAGE_CACHE_WC && + new_flags == _PAGE_CACHE_WB)) { + return 0; + } + + return 1; +} + #ifndef __ASSEMBLY__ /* Indicate that x86 has its own track and untrack pfn vma functions */ #define __HAVE_PFNMAP_TRACKING |