aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvenkatesh.pallipadi@intel.com <venkatesh.pallipadi@intel.com>2008-03-18 20:00:23 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:20 -0400
commitef354af4629e5cc76a3f64fc46d452f2b56d5a59 (patch)
tree679003181a4bc8cd65d90da1351929f7a2db8bc9
parent03d72aa18f15df9987fe5837284e15b9ccf6e3f8 (diff)
x86: PAT add set_memory_wc() interface
Add a set_memory_wc interface(), similar to set_memory_uc interface. Callers has to call set_memory_uc, set_memory_wb and set_memory_wc, set_memory_wb as pairs. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/mm/pageattr.c19
-rw-r--r--include/asm-x86/cacheflush.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 938df5e8402b..270cab2e6030 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -787,6 +787,25 @@ int set_memory_uc(unsigned long addr, int numpages)
787} 787}
788EXPORT_SYMBOL(set_memory_uc); 788EXPORT_SYMBOL(set_memory_uc);
789 789
790int _set_memory_wc(unsigned long addr, int numpages)
791{
792 return change_page_attr_set(addr, numpages,
793 __pgprot(_PAGE_CACHE_WC));
794}
795
796int set_memory_wc(unsigned long addr, int numpages)
797{
798 if (!pat_wc_enabled)
799 return set_memory_uc(addr, numpages);
800
801 if (reserve_memtype(addr, addr + numpages * PAGE_SIZE,
802 _PAGE_CACHE_WC, NULL))
803 return -EINVAL;
804
805 return _set_memory_wc(addr, numpages);
806}
807EXPORT_SYMBOL(set_memory_wc);
808
790int _set_memory_wb(unsigned long addr, int numpages) 809int _set_memory_wb(unsigned long addr, int numpages)
791{ 810{
792 return change_page_attr_clear(addr, numpages, 811 return change_page_attr_clear(addr, numpages,
diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h
index 5676fba10a09..90437d3f7610 100644
--- a/include/asm-x86/cacheflush.h
+++ b/include/asm-x86/cacheflush.h
@@ -35,8 +35,10 @@ int set_pages_ro(struct page *page, int numpages);
35int set_pages_rw(struct page *page, int numpages); 35int set_pages_rw(struct page *page, int numpages);
36 36
37int _set_memory_uc(unsigned long addr, int numpages); 37int _set_memory_uc(unsigned long addr, int numpages);
38int _set_memory_wc(unsigned long addr, int numpages);
38int _set_memory_wb(unsigned long addr, int numpages); 39int _set_memory_wb(unsigned long addr, int numpages);
39int set_memory_uc(unsigned long addr, int numpages); 40int set_memory_uc(unsigned long addr, int numpages);
41int set_memory_wc(unsigned long addr, int numpages);
40int set_memory_wb(unsigned long addr, int numpages); 42int set_memory_wb(unsigned long addr, int numpages);
41int set_memory_x(unsigned long addr, int numpages); 43int set_memory_x(unsigned long addr, int numpages);
42int set_memory_nx(unsigned long addr, int numpages); 44int set_memory_nx(unsigned long addr, int numpages);