Skip to contentSkip to conversation

m68k: merge mmu and non-mmu kernel/m68k_ksyms.c files

PATCH New Greg Ungerer 1 participant 6 messages Apr 8, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover m68k: merge mmu and non-mmu kernel/m68k_ksyms.c files

The following patch series cleans up and merges the m68k and m68knommu m68k_syms.c file. Most of the work is in re-organizing and cleaning up the m68knommu parts. The final file merge is pretty simple then.

 a/arch/m68k/kernel/m68k_ksyms_no.c  |   44 ------------------------------------
 arch/m68k/kernel/m68k_ksyms_mm.c    |   16 -------------
 arch/m68k/kernel/m68k_ksyms_no.c    |   21 -----------------
 arch/m68k/kernel/process_no.c       |    1 
 b/arch/m68k/kernel/m68k_ksyms.c     |   35 +++++++++++++++++++++++++---
 b/arch/m68k/kernel/m68k_ksyms_no.c  |    4 ---
 b/arch/m68k/kernel/process_no.c     |    1 
 b/arch/m68k/lib/checksum_no.c       |    3 ++
 b/arch/m68k/platform/coldfire/dma.c |    3 ++
 9 files changed, 39 insertions(+), 89 deletions(-)
#1 lore raw

PATCH 1/5 m68knommu: move EXPORT of dump_fpu to function definition

The EXPORT_SYMBOL(dump_fpu) belongs at the definition of the function, not in some other random code file. So move it there.

---
 arch/m68k/kernel/m68k_ksyms_no.c |    4 ----
 arch/m68k/kernel/process_no.c    |    1 +
 2 files changed, 1 insertions(+), 4 deletions(-)
arch/m68k/kernel/m68k_ksyms_no.c +0 -4
index c26717b..ab747e4 100644
@@ -16,12 +16,8 @@
 #include <asm/checksum.h>
 #include <asm/current.h>
 
-extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
-
 /* platform dependent support */
 
-EXPORT_SYMBOL(dump_fpu);
-
 EXPORT_SYMBOL(ip_fast_csum);
 
 EXPORT_SYMBOL(kernel_thread);
arch/m68k/kernel/process_no.c +1 -0
index e2a63af..eedadc2 100644
@@ -283,6 +283,7 @@ int dump_fpu(struct pt_regs *regs, struct user_m68kfp_struct *fpu)
 #endif
 	return 1;
 }
+EXPORT_SYMBOL(dump_fpu);
 
 /*
  *	Generic dumping code. Used for panic and debug.
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/5 m68knommu: move EXPORT of local checksumming functions to definitions

The EXPORT_SYMBOL() of the local lib checksum functions belongs with the definitions, not in some other random code file. So move then there.

---
 arch/m68k/kernel/m68k_ksyms_no.c |    5 -----
 arch/m68k/lib/checksum_no.c      |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/m68k/kernel/m68k_ksyms_no.c +0 -5
index ab747e4..daed932 100644
@@ -18,13 +18,8 @@
 
 /* platform dependent support */
 
-EXPORT_SYMBOL(ip_fast_csum);
-
 EXPORT_SYMBOL(kernel_thread);
 
-/* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy_nocheck);
-
 /*
  * libgcc functions - functions that are used internally by the
  * compiler...  (prototypes are not correct though, but that
arch/m68k/lib/checksum_no.c +3 -0
index eccf25d..e4c6354 100644
@@ -101,6 +101,7 @@ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
 {
 	return (__force __sum16)~do_csum(iph,ihl*4);
 }
+EXPORT_SYMBOL(ip_fast_csum);
 #endif
 
 /*
@@ -140,6 +141,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst,
 	memcpy(dst, (__force const void *)src, len);
 	return csum_partial(dst, len, sum);
 }
+EXPORT_SYMBOL(csum_partial_copy_from_user);
 
 /*
  * copy from ds while checksumming, otherwise like csum_partial
@@ -151,3 +153,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum)
 	memcpy(dst, src, len);
 	return csum_partial(dst, len, sum);
 }
+EXPORT_SYMBOL(csum_partial_copy_nocheck);
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 3/5 m68knommu: move EXPORT of kernel_thread to function definition

The EXPORT_SYMBOL(kernel_thread) belongs at the definition of that function, not in some other random code file. So move it there.

---
 arch/m68k/kernel/m68k_ksyms_no.c |    4 ----
 arch/m68k/kernel/process_no.c    |    1 +
 2 files changed, 1 insertions(+), 4 deletions(-)
arch/m68k/kernel/m68k_ksyms_no.c +0 -4
index daed932..11effaa 100644
@@ -16,10 +16,6 @@
 #include <asm/checksum.h>
 #include <asm/current.h>
 
-/* platform dependent support */
-
-EXPORT_SYMBOL(kernel_thread);
-
 /*
  * libgcc functions - functions that are used internally by the
  * compiler...  (prototypes are not correct though, but that
arch/m68k/kernel/process_no.c +1 -0
index eedadc2..9b86ad1 100644
@@ -151,6 +151,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
 	set_fs(fs);
 	return retval;
 }
+EXPORT_SYMBOL(kernel_thread);
 
 void flush_thread(void)
 {
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 4/5 m68knommu: remove un-needed exporting of COLDFIRE symbols

There is no reason most of the symbols enclosed in a conditional on CONFIG_COLDFIRE need to be exported. And they sure don't need to be doing it in m68k_ksyms_no.c. Move the dma symbols export (which are currently needed) to the definitions of those, and remove the rest of the exporting here.

---
 arch/m68k/kernel/m68k_ksyms_no.c  |   12 ------------
 arch/m68k/platform/coldfire/dma.c |    3 +++
 2 files changed, 3 insertions(+), 12 deletions(-)
arch/m68k/kernel/m68k_ksyms_no.c +0 -12
index 11effaa..db6f87a 100644
@@ -42,15 +42,3 @@ EXPORT_SYMBOL(__mulsi3);
 EXPORT_SYMBOL(__udivsi3);
 EXPORT_SYMBOL(__umodsi3);
 
-#ifdef CONFIG_COLDFIRE
-extern unsigned int *dma_device_address;
-extern unsigned long dma_base_addr, _ramend;
-EXPORT_SYMBOL(dma_base_addr);
-EXPORT_SYMBOL(dma_device_address);
-EXPORT_SYMBOL(_ramend);
-
-extern asmlinkage void trap(void);
-extern void	*_ramvec;
-EXPORT_SYMBOL(trap);
-EXPORT_SYMBOL(_ramvec);
-#endif /* CONFIG_COLDFIRE */
arch/m68k/platform/coldfire/dma.c +3 -0
index e88b95e..df5ce20 100644
@@ -9,6 +9,7 @@
 /***************************************************************************/
 
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <asm/dma.h>
 #include <asm/coldfire.h>
 #include <asm/mcfsim.h>
@@ -33,7 +34,9 @@ unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
 	MCFDMA_BASE3,
 #endif
 };
+EXPORT_SYMBOL(dma_base_addr);
 
 unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
+EXPORT_SYMBOL(dma_device_address);
 
 /***************************************************************************/
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH 5/5 m68k: merge non-mmu and mmu versions of m68k_ksyms.c

After cleaning up m68k_ksyms_no.c it is now strait forward to merge the non-mmu and mmu versions of m68k_ksyms.c. So do it.

---
 arch/m68k/kernel/m68k_ksyms.c    |   35 ++++++++++++++++++++++++++---
 arch/m68k/kernel/m68k_ksyms_mm.c |   16 -------------
 arch/m68k/kernel/m68k_ksyms_no.c |   44 --------------------------------------
 3 files changed, 31 insertions(+), 64 deletions(-)
 delete mode 100644 arch/m68k/kernel/m68k_ksyms_mm.c
 delete mode 100644 arch/m68k/kernel/m68k_ksyms_no.c
arch/m68k/kernel/m68k_ksyms.c +31 -4
index 4752c28..3e23913 100644
@@ -1,5 +1,32 @@
-#ifdef CONFIG_MMU
-#include "m68k_ksyms_mm.c"
-#else
-#include "m68k_ksyms_no.c"
+#include <linux/module.h>
+
+asmlinkage long long __ashldi3 (long long, int);
+asmlinkage long long __ashrdi3 (long long, int);
+asmlinkage long long __lshrdi3 (long long, int);
+asmlinkage long long __muldi3 (long long, long long);
+
+/* The following are special because they're not called
+   explicitly (the C compiler generates them).  Fortunately,
+   their interface isn't gonna change any time soon now, so
+   it's OK to leave it out of version control.  */
+EXPORT_SYMBOL(__ashldi3);
+EXPORT_SYMBOL(__ashrdi3);
+EXPORT_SYMBOL(__lshrdi3);
+EXPORT_SYMBOL(__muldi3);
+
+#ifndef CONFIG_MMU
+/*
+ * Simpler 68k and ColdFire parts also need a few other gcc functions.
+ */
+extern long long __divsi3(long long, long long);
+extern long long __modsi3(long long, long long);
+extern long long __mulsi3(long long, long long);
+extern long long __udivsi3(long long, long long);
+extern long long __umodsi3(long long, long long);
+
+EXPORT_SYMBOL(__divsi3);
+EXPORT_SYMBOL(__modsi3);
+EXPORT_SYMBOL(__mulsi3);
+EXPORT_SYMBOL(__udivsi3);
+EXPORT_SYMBOL(__umodsi3);
 #endif
arch/m68k/kernel/m68k_ksyms_mm.c deleted +0 -16
deleted file mode 100644
index d900e77..0000000
@@ -1,16 +0,0 @@
-#include <linux/module.h>
-
-asmlinkage long long __ashldi3 (long long, int);
-asmlinkage long long __ashrdi3 (long long, int);
-asmlinkage long long __lshrdi3 (long long, int);
-asmlinkage long long __muldi3 (long long, long long);
-
-/* The following are special because they're not called
-   explicitly (the C compiler generates them).  Fortunately,
-   their interface isn't gonna change any time soon now, so
-   it's OK to leave it out of version control.  */
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__lshrdi3);
-EXPORT_SYMBOL(__muldi3);
-
arch/m68k/kernel/m68k_ksyms_no.c deleted +0 -44

44 lines not on this page · raw message

Signature · 1 line
1.7.0.4