nds32: Fix the symbols undefined issue by exporting them.
authorGreentime Hu <greentime@andestech.com>
Thu, 19 Apr 2018 07:45:45 +0000 (15:45 +0800)
committerGreentime Hu <greentime@andestech.com>
Wed, 23 May 2018 05:26:20 +0000 (13:26 +0800)
It broke the 'allmodconfig' build.
  LD      vmlinux
  SYSMAP  System.map
  Building modules, stage 2.
  MODPOST 5028 modules
ERROR: "flush_dcache_page" [net/sunrpc/xprtrdma/rpcrdma.ko] undefined!
ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
ERROR: "save_stack_trace" [kernel/backtracetest.ko] undefined!
ERROR: "clear_page" [fs/ocfs2/dlm/ocfs2_dlm.ko] undefined!
ERROR: "copy_page" [fs/nilfs2/nilfs2.ko] undefined!
...

Signed-off-by: Greentime Hu <greentime@andestech.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
arch/nds32/include/asm/Kbuild
arch/nds32/include/asm/page.h
arch/nds32/kernel/stacktrace.c
arch/nds32/lib/copy_page.S
arch/nds32/mm/cacheflush.c
arch/nds32/mm/init.c

index a64e87cc8b494e5ae05763a7e7d2a64b0723f685..142e612aa639872cfca42d2ca588735b48c03202 100644 (file)
@@ -16,6 +16,7 @@ generic-y += dma.h
 generic-y += emergency-restart.h
 generic-y += errno.h
 generic-y += exec.h
+generic-y += export.h
 generic-y += fb.h
 generic-y += fcntl.h
 generic-y += ftrace.h
index e27365c097b60ee97dd535543b5d3c7f0db6e06d..947f0491c9a717cefd1b3d0549ae867c333e716c 100644 (file)
@@ -27,6 +27,9 @@ extern void copy_user_highpage(struct page *to, struct page *from,
                               unsigned long vaddr, struct vm_area_struct *vma);
 extern void clear_user_highpage(struct page *page, unsigned long vaddr);
 
+void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
+                   struct page *to);
+void clear_user_page(void *addr, unsigned long vaddr, struct page *page);
 #define __HAVE_ARCH_COPY_USER_HIGHPAGE
 #define clear_user_highpage    clear_user_highpage
 #else
index bc70113c0e844672eb8918a46a8cba42c7151221..8b231e910ea68980dbd517be895200ad19e49f55 100644 (file)
@@ -9,6 +9,7 @@ void save_stack_trace(struct stack_trace *trace)
 {
        save_stack_trace_tsk(current, trace);
 }
+EXPORT_SYMBOL_GPL(save_stack_trace);
 
 void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
 {
@@ -45,3 +46,4 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
                fpn = (unsigned long *)fpp;
        }
 }
+EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
index 4a2ff85f17ee81b45028dbe64d76dfbf25630f22..f8701ed161a8baa905d3b6273a0916a50333da4c 100644 (file)
@@ -2,6 +2,7 @@
 // Copyright (C) 2005-2017 Andes Technology Corporation
 
 #include <linux/linkage.h>
+#include <asm/export.h>
 #include <asm/page.h>
 
        .text
@@ -16,6 +17,7 @@ ENTRY(copy_page)
        popm    $r2, $r10
        ret
 ENDPROC(copy_page)
+EXPORT_SYMBOL(copy_page)
 
 ENTRY(clear_page)
        pushm   $r1, $r9
@@ -35,3 +37,4 @@ ENTRY(clear_page)
        popm    $r1, $r9
         ret
 ENDPROC(clear_page)
+EXPORT_SYMBOL(clear_page)
index bd52918d5923b816f9568c4fcce4d634658e840a..ee44ad96b6ed86f09657ac1bcba30e63aeaa042c 100644 (file)
@@ -147,6 +147,25 @@ void flush_cache_vunmap(unsigned long start, unsigned long end)
        cpu_icache_inval_all();
 }
 
+void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
+                   struct page *to)
+{
+       cpu_dcache_wbinval_page((unsigned long)vaddr);
+       cpu_icache_inval_page((unsigned long)vaddr);
+       copy_page(vto, vfrom);
+       cpu_dcache_wbinval_page((unsigned long)vto);
+       cpu_icache_inval_page((unsigned long)vto);
+}
+
+void clear_user_page(void *addr, unsigned long vaddr, struct page *page)
+{
+       cpu_dcache_wbinval_page((unsigned long)vaddr);
+       cpu_icache_inval_page((unsigned long)vaddr);
+       clear_page(addr);
+       cpu_dcache_wbinval_page((unsigned long)addr);
+       cpu_icache_inval_page((unsigned long)addr);
+}
+
 void copy_user_highpage(struct page *to, struct page *from,
                        unsigned long vaddr, struct vm_area_struct *vma)
 {
@@ -213,6 +232,7 @@ void flush_dcache_page(struct page *page)
                local_irq_restore(flags);
        }
 }
+EXPORT_SYMBOL(flush_dcache_page);
 
 void copy_to_user_page(struct vm_area_struct *vma, struct page *page,
                       unsigned long vaddr, void *dst, void *src, int len)
@@ -272,6 +292,7 @@ void flush_kernel_dcache_page(struct page *page)
        cpu_dcache_wbinval_page((unsigned long)page_address(page));
        local_irq_restore(flags);
 }
+EXPORT_SYMBOL(flush_kernel_dcache_page);
 
 void flush_kernel_vmap_range(void *addr, int size)
 {
@@ -301,6 +322,7 @@ void flush_icache_range(unsigned long start, unsigned long end)
        cpu_cache_wbinval_range(start, end, 1);
        local_irq_restore(flags);
 }
+EXPORT_SYMBOL(flush_icache_range);
 
 void flush_icache_page(struct vm_area_struct *vma, struct page *page)
 {
index 93ee0160720bfd2a44f23da640328dc2d9068400..c713d2ad55dc9a430777b41a3485380a98896f1a 100644 (file)
@@ -30,6 +30,7 @@ extern unsigned long phys_initrd_size;
  * zero-initialized data and COW.
  */
 struct page *empty_zero_page;
+EXPORT_SYMBOL(empty_zero_page);
 
 static void __init zone_sizes_init(void)
 {