diff options
author | Arjan van de Ven <arjan@infradead.org> | 2008-01-30 07:34:06 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:06 -0500 |
commit | 75cbade8ea3127a84e3da7c2c15808e54f0df7e8 (patch) | |
tree | b91fd5e8f9f5f8da0da55a7783c70fc3149cbf2d /include/asm-x86 | |
parent | e81d5dc41b67349c06e80658227c9156738f0df1 (diff) |
x86: a new API for drivers/etc to control cache and other page attributes
Right now, if drivers or other code want to change, say, a cache attribute of a
page, the only API they have is change_page_attr(). c-p-a is a really bad API
for this, because it forces the caller to know *ALL* the attributes he wants
for the page, not just the 1 thing he wants to change. So code that wants to
set a page uncachable, needs to be aware of the NX status as well etc etc etc.
This patch introduces a set of new APIs for this, set_pages_<attr> and
set_memory_<attr>, that offer a logical change to the user, and leave all
attributes not implied by the requested logical change alone.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/cacheflush.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h index fccb563e2305..7b928d55c190 100644 --- a/include/asm-x86/cacheflush.h +++ b/include/asm-x86/cacheflush.h | |||
@@ -27,6 +27,21 @@ | |||
27 | void global_flush_tlb(void); | 27 | void global_flush_tlb(void); |
28 | int change_page_attr(struct page *page, int numpages, pgprot_t prot); | 28 | int change_page_attr(struct page *page, int numpages, pgprot_t prot); |
29 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); | 29 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); |
30 | |||
31 | int set_pages_uc(struct page *page, int numpages); | ||
32 | int set_pages_wb(struct page *page, int numpages); | ||
33 | int set_pages_x(struct page *page, int numpages); | ||
34 | int set_pages_nx(struct page *page, int numpages); | ||
35 | int set_pages_ro(struct page *page, int numpages); | ||
36 | int set_pages_rw(struct page *page, int numpages); | ||
37 | |||
38 | int set_memory_uc(unsigned long addr, int numpages); | ||
39 | int set_memory_wb(unsigned long addr, int numpages); | ||
40 | int set_memory_x(unsigned long addr, int numpages); | ||
41 | int set_memory_nx(unsigned long addr, int numpages); | ||
42 | int set_memory_ro(unsigned long addr, int numpages); | ||
43 | int set_memory_rw(unsigned long addr, int numpages); | ||
44 | |||
30 | void clflush_cache_range(void *addr, int size); | 45 | void clflush_cache_range(void *addr, int size); |
31 | 46 | ||
32 | #ifdef CONFIG_DEBUG_RODATA | 47 | #ifdef CONFIG_DEBUG_RODATA |