Commit ef354af4 authored by venkatesh.pallipadi@intel.com's avatar venkatesh.pallipadi@intel.com Committed by Ingo Molnar

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: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 03d72aa1
...@@ -787,6 +787,25 @@ int set_memory_uc(unsigned long addr, int numpages) ...@@ -787,6 +787,25 @@ int set_memory_uc(unsigned long addr, int numpages)
} }
EXPORT_SYMBOL(set_memory_uc); EXPORT_SYMBOL(set_memory_uc);
int _set_memory_wc(unsigned long addr, int numpages)
{
return change_page_attr_set(addr, numpages,
__pgprot(_PAGE_CACHE_WC));
}
int set_memory_wc(unsigned long addr, int numpages)
{
if (!pat_wc_enabled)
return set_memory_uc(addr, numpages);
if (reserve_memtype(addr, addr + numpages * PAGE_SIZE,
_PAGE_CACHE_WC, NULL))
return -EINVAL;
return _set_memory_wc(addr, numpages);
}
EXPORT_SYMBOL(set_memory_wc);
int _set_memory_wb(unsigned long addr, int numpages) int _set_memory_wb(unsigned long addr, int numpages)
{ {
return change_page_attr_clear(addr, numpages, return change_page_attr_clear(addr, numpages,
......
...@@ -35,8 +35,10 @@ int set_pages_ro(struct page *page, int numpages); ...@@ -35,8 +35,10 @@ int set_pages_ro(struct page *page, int numpages);
int set_pages_rw(struct page *page, int numpages); int set_pages_rw(struct page *page, int numpages);
int _set_memory_uc(unsigned long addr, int numpages); int _set_memory_uc(unsigned long addr, int numpages);
int _set_memory_wc(unsigned long addr, int numpages);
int _set_memory_wb(unsigned long addr, int numpages); int _set_memory_wb(unsigned long addr, int numpages);
int set_memory_uc(unsigned long addr, int numpages); int set_memory_uc(unsigned long addr, int numpages);
int set_memory_wc(unsigned long addr, int numpages);
int set_memory_wb(unsigned long addr, int numpages); int set_memory_wb(unsigned long addr, int numpages);
int set_memory_x(unsigned long addr, int numpages); int set_memory_x(unsigned long addr, int numpages);
int set_memory_nx(unsigned long addr, int numpages); int set_memory_nx(unsigned long addr, int numpages);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment