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 | |
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>
-rw-r--r-- | arch/x86/mm/Makefile_32 | 1 | ||||
-rw-r--r-- | arch/x86/mm/Makefile_64 | 1 | ||||
-rw-r--r-- | arch/x86/mm/pageattr.c | 51 | ||||
-rw-r--r-- | include/asm-x86/cacheflush.h | 1 |
4 files changed, 14 insertions, 40 deletions
diff --git a/arch/x86/mm/Makefile_32 b/arch/x86/mm/Makefile_32 index af0d39bea6c5..ffa6d46a1e73 100644 --- a/arch/x86/mm/Makefile_32 +++ b/arch/x86/mm/Makefile_32 | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | obj-y := init_32.o pgtable_32.o fault_32.o ioremap.o extable.o pageattr.o mmap.o | 5 | obj-y := init_32.o pgtable_32.o fault_32.o ioremap.o extable.o pageattr.o mmap.o |
6 | 6 | ||
7 | obj-$(CONFIG_CPA_DEBUG) += pageattr-test.o | ||
8 | obj-$(CONFIG_NUMA) += discontig_32.o | 7 | obj-$(CONFIG_NUMA) += discontig_32.o |
9 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | 8 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o |
10 | obj-$(CONFIG_HIGHMEM) += highmem_32.o | 9 | obj-$(CONFIG_HIGHMEM) += highmem_32.o |
diff --git a/arch/x86/mm/Makefile_64 b/arch/x86/mm/Makefile_64 index b564b5a760da..27a090c86e9b 100644 --- a/arch/x86/mm/Makefile_64 +++ b/arch/x86/mm/Makefile_64 | |||
@@ -7,4 +7,3 @@ obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | |||
7 | obj-$(CONFIG_NUMA) += numa_64.o | 7 | obj-$(CONFIG_NUMA) += numa_64.o |
8 | obj-$(CONFIG_K8_NUMA) += k8topology_64.o | 8 | obj-$(CONFIG_K8_NUMA) += k8topology_64.o |
9 | obj-$(CONFIG_ACPI_NUMA) += srat_64.o | 9 | obj-$(CONFIG_ACPI_NUMA) += srat_64.o |
10 | obj-$(CONFIG_CPA_DEBUG) += pageattr-test.o | ||
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 | ||
diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h index a95afaf1240d..d15ff359d3e3 100644 --- a/include/asm-x86/cacheflush.h +++ b/include/asm-x86/cacheflush.h | |||
@@ -27,7 +27,6 @@ | |||
27 | void global_flush_tlb(void); | 27 | void global_flush_tlb(void); |
28 | int __deprecated_for_modules change_page_attr(struct page *page, int numpages, | 28 | int __deprecated_for_modules change_page_attr(struct page *page, int numpages, |
29 | pgprot_t prot); | 29 | pgprot_t prot); |
30 | int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); | ||
31 | 30 | ||
32 | int set_pages_uc(struct page *page, int numpages); | 31 | int set_pages_uc(struct page *page, int numpages); |
33 | int set_pages_wb(struct page *page, int numpages); | 32 | int set_pages_wb(struct page *page, int numpages); |