]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc32: Remove clear_pages() and define clear_page() inline
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 9 Feb 2016 16:08:25 +0000 (17:08 +0100)
committerScott Wood <oss@buserror.net>
Fri, 11 Mar 2016 23:20:11 +0000 (17:20 -0600)
clear_pages() is never used expect by clear_page, and PPC32 is the
only architecture (still) having this function. Neither PPC64 nor
any other architecture has it.

This patch removes clear_pages() and moves clear_page() function
inline (same as PPC64) as it only is a few isns

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <oss@buserror.net>
arch/powerpc/include/asm/page_32.h
arch/powerpc/kernel/misc_32.S
arch/powerpc/kernel/ppc_ksyms_32.c

index 68d73b2a7bfc93b70d6479384937197d433b6c76..6a8e1797f22320c528bc28e369fb39816eda311f 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_POWERPC_PAGE_32_H
 #define _ASM_POWERPC_PAGE_32_H
 
+#include <asm/cache.h>
+
 #if defined(CONFIG_PHYSICAL_ALIGN) && (CONFIG_PHYSICAL_START != 0)
 #if (CONFIG_PHYSICAL_START % CONFIG_PHYSICAL_ALIGN) != 0
 #error "CONFIG_PHYSICAL_START must be a multiple of CONFIG_PHYSICAL_ALIGN"
@@ -36,9 +38,18 @@ typedef unsigned long long pte_basic_t;
 typedef unsigned long pte_basic_t;
 #endif
 
-struct page;
-extern void clear_pages(void *page, int order);
-static inline void clear_page(void *page) { clear_pages(page, 0); }
+/*
+ * Clear page using the dcbz instruction, which doesn't cause any
+ * memory traffic (except to write out any cache lines which get
+ * displaced).  This only works on cacheable memory.
+ */
+static inline void clear_page(void *addr)
+{
+       unsigned int i;
+
+       for (i = 0; i < PAGE_SIZE / L1_CACHE_BYTES; i++, addr += L1_CACHE_BYTES)
+               dcbz(addr);
+}
 extern void copy_page(void *to, void *from);
 
 #include <asm-generic/getorder.h>
index 7d1284f4d89e3ead0fb8e00a4c302ff155385fb0..181afc1d05d88e02642c9ce83a47a107a617ea52 100644 (file)
@@ -516,22 +516,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
        blr
 #endif /* CONFIG_BOOKE */
 
-/*
- * Clear pages using the dcbz instruction, which doesn't cause any
- * memory traffic (except to write out any cache lines which get
- * displaced).  This only works on cacheable memory.
- *
- * void clear_pages(void *page, int order) ;
- */
-_GLOBAL(clear_pages)
-       li      r0,PAGE_SIZE/L1_CACHE_BYTES
-       slw     r0,r0,r4
-       mtctr   r0
-1:     dcbz    0,r3
-       addi    r3,r3,L1_CACHE_BYTES
-       bdnz    1b
-       blr
-
 /*
  * Copy a whole page.  We use the dcbz instruction on the destination
  * to reduce memory traffic (it eliminates the unnecessary reads of
index 30ddd8a24eee9708977fa85e1192ac89697ed1f2..2bfaafe5be99e23433432ab418e92a315f2e1b7f 100644 (file)
@@ -10,7 +10,6 @@
 #include <asm/pgtable.h>
 #include <asm/dcr.h>
 
-EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
 EXPORT_SYMBOL(DMA_MODE_READ);
 EXPORT_SYMBOL(DMA_MODE_WRITE);