diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-01-30 07:34:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:07 -0500 |
commit | d1028a154c65d7fadd1b2d0276c077014d401ec7 (patch) | |
tree | efbdc19aa71fad0a83a0d0b431c9779f946e445a /arch/x86/mm/pageattr.c | |
parent | f62d0f008e889915c93631c04d4c7d871f05bea7 (diff) |
x86: make various pageattr.c functions static
change_page_attr_add is only used in pageattr.c now, so we can
make this function static.
change_page_attr() isn't used anywere at all anymore; this function
is a really bad API anyway so just remove the bloat entirely.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r-- | arch/x86/mm/pageattr.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index e5910ac37e59..e4d2b6930e61 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -210,7 +210,8 @@ repeat: | |||
210 | * Modules and drivers should use the set_memory_* APIs instead. | 210 | * Modules and drivers should use the set_memory_* APIs instead. |
211 | */ | 211 | */ |
212 | 212 | ||
213 | int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot) | 213 | static int change_page_attr_addr(unsigned long address, int numpages, |
214 | pgprot_t prot) | ||
214 | { | 215 | { |
215 | int err = 0, kernel_map = 0, i; | 216 | int err = 0, kernel_map = 0, i; |
216 | 217 | ||
@@ -252,36 +253,6 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot) | |||
252 | } | 253 | } |
253 | 254 | ||
254 | /** | 255 | /** |
255 | * change_page_attr - Change page table attributes in the linear mapping. | ||
256 | * @page: First page to change | ||
257 | * @numpages: Number of pages to change | ||
258 | * @prot: New protection/caching type (PAGE_*) | ||
259 | * | ||
260 | * Returns 0 on success, otherwise a negated errno. | ||
261 | * | ||
262 | * This should be used when a page is mapped with a different caching policy | ||
263 | * than write-back somewhere - some CPUs do not like it when mappings with | ||
264 | * different caching policies exist. This changes the page attributes of the | ||
265 | * in kernel linear mapping too. | ||
266 | * | ||
267 | * Caller must call global_flush_tlb() later to make the changes active. | ||
268 | * | ||
269 | * The caller needs to ensure that there are no conflicting mappings elsewhere | ||
270 | * (e.g. in user space) * This function only deals with the kernel linear map. | ||
271 | * | ||
272 | * For MMIO areas without mem_map use change_page_attr_addr() instead. | ||
273 | * | ||
274 | * Modules and drivers should use the set_pages_* APIs instead. | ||
275 | */ | ||
276 | int change_page_attr(struct page *page, int numpages, pgprot_t prot) | ||
277 | { | ||
278 | unsigned long addr = (unsigned long)page_address(page); | ||
279 | |||
280 | return change_page_attr_addr(addr, numpages, prot); | ||
281 | } | ||
282 | EXPORT_UNUSED_SYMBOL(change_page_attr); /* to be removed in 2.6.27 */ | ||
283 | |||
284 | /** | ||
285 | * change_page_attr_set - Change page table attributes in the linear mapping. | 256 | * change_page_attr_set - Change page table attributes in the linear mapping. |
286 | * @addr: Virtual address in linear mapping. | 257 | * @addr: Virtual address in linear mapping. |
287 | * @numpages: Number of pages to change | 258 | * @numpages: Number of pages to change |
@@ -294,15 +265,14 @@ EXPORT_UNUSED_SYMBOL(change_page_attr); /* to be removed in 2.6.27 */ | |||
294 | * different caching policies exist. This changes the page attributes of the | 265 | * different caching policies exist. This changes the page attributes of the |
295 | * in kernel linear mapping too. | 266 | * in kernel linear mapping too. |
296 | * | 267 | * |
297 | * Caller must call global_flush_tlb() later to make the changes active. | ||
298 | * | ||
299 | * The caller needs to ensure that there are no conflicting mappings elsewhere | 268 | * The caller needs to ensure that there are no conflicting mappings elsewhere |
300 | * (e.g. in user space) * This function only deals with the kernel linear map. | 269 | * (e.g. in user space) * This function only deals with the kernel linear map. |
301 | * | 270 | * |
302 | * This function is different from change_page_attr() in that only selected bits | 271 | * This function is different from change_page_attr() in that only selected bits |
303 | * are impacted, all other bits remain as is. | 272 | * are impacted, all other bits remain as is. |
304 | */ | 273 | */ |
305 | int change_page_attr_set(unsigned long addr, int numpages, pgprot_t prot) | 274 | static int change_page_attr_set(unsigned long addr, int numpages, |
275 | pgprot_t prot) | ||
306 | { | 276 | { |
307 | pgprot_t current_prot; | 277 | pgprot_t current_prot; |
308 | int level; | 278 | int level; |
@@ -332,15 +302,14 @@ int change_page_attr_set(unsigned long addr, int numpages, pgprot_t prot) | |||
332 | * different caching policies exist. This changes the page attributes of the | 302 | * different caching policies exist. This changes the page attributes of the |
333 | * in kernel linear mapping too. | 303 | * in kernel linear mapping too. |
334 | * | 304 | * |
335 | * Caller must call global_flush_tlb() later to make the changes active. | ||
336 | * | ||
337 | * The caller needs to ensure that there are no conflicting mappings elsewhere | 305 | * The caller needs to ensure that there are no conflicting mappings elsewhere |
338 | * (e.g. in user space) * This function only deals with the kernel linear map. | 306 | * (e.g. in user space) * This function only deals with the kernel linear map. |
339 | * | 307 | * |
340 | * This function is different from change_page_attr() in that only selected bits | 308 | * This function is different from change_page_attr() in that only selected bits |
341 | * are impacted, all other bits remain as is. | 309 | * are impacted, all other bits remain as is. |
342 | */ | 310 | */ |
343 | int change_page_attr_clear(unsigned long addr, int numpages, pgprot_t prot) | 311 | static int change_page_attr_clear(unsigned long addr, int numpages, |
312 | pgprot_t prot) | ||
344 | { | 313 | { |
345 | pgprot_t current_prot; | 314 | pgprot_t current_prot; |
346 | int level; | 315 | int level; |
@@ -549,3 +518,11 @@ void kernel_map_pages(struct page *page, int numpages, int enable) | |||
549 | __flush_tlb_all(); | 518 | __flush_tlb_all(); |
550 | } | 519 | } |
551 | #endif | 520 | #endif |
521 | |||
522 | /* | ||
523 | * The testcases use internal knowledge of the implementation that shouldn't | ||
524 | * be exposed to the rest of the kernel. Include these directly here. | ||
525 | */ | ||
526 | #ifdef CONFIG_CPA_DEBUG | ||
527 | #include "pageattr-test.c" | ||
528 | #endif | ||