aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/pgtable.h3
-rw-r--r--arch/x86/mm/pat.c8
-rw-r--r--include/asm-generic/pgtable.h4
3 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 6968d4f6be3e..579f8ceee948 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -168,6 +168,9 @@
168 168
169#ifndef __ASSEMBLY__ 169#ifndef __ASSEMBLY__
170 170
171#define pgprot_writecombine pgprot_writecombine
172extern pgprot_t pgprot_writecombine(pgprot_t prot);
173
171/* 174/*
172 * ZERO_PAGE is a global shared page that is always zero: used 175 * ZERO_PAGE is a global shared page that is always zero: used
173 * for zero-mapped memory areas etc.. 176 * for zero-mapped memory areas etc..
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index 1069ffecf77d..d5254bae84f4 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -832,6 +832,14 @@ void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn,
832 } 832 }
833} 833}
834 834
835pgprot_t pgprot_writecombine(pgprot_t prot)
836{
837 if (pat_enabled)
838 return __pgprot(pgprot_val(prot) | _PAGE_CACHE_WC);
839 else
840 return pgprot_noncached(prot);
841}
842
835#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) 843#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)
836 844
837/* get Nth element of the linked list */ 845/* get Nth element of the linked list */
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index ef87f889ef62..b84633801fb6 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -129,6 +129,10 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
129#define move_pte(pte, prot, old_addr, new_addr) (pte) 129#define move_pte(pte, prot, old_addr, new_addr) (pte)
130#endif 130#endif
131 131
132#ifndef pgprot_writecombine
133#define pgprot_writecombine pgprot_noncached
134#endif
135
132/* 136/*
133 * When walking page tables, get the address of the next boundary, 137 * When walking page tables, get the address of the next boundary,
134 * or the end address of the range if that comes earlier. Although no 138 * or the end address of the range if that comes earlier. Although no