diff mbox

[05/12] m68k: move exports to definitions

Message ID 1454095114-4128-5-git-send-email-viro@ZenIV.linux.org.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Al Viro Jan. 29, 2016, 7:18 p.m. UTC
From: Al Viro <viro@zeniv.linux.org.uk>

the rest of architectures should just use generic-y += export.h in
asm/Kbuild

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/m68k/include/asm/export.h |  3 +++
 arch/m68k/kernel/Makefile      |  2 +-
 arch/m68k/kernel/m68k_ksyms.c  | 32 --------------------------------
 arch/m68k/lib/ashldi3.c        |  4 ++++
 arch/m68k/lib/ashrdi3.c        |  4 ++++
 arch/m68k/lib/divsi3.S         |  3 +++
 arch/m68k/lib/lshrdi3.c        |  4 ++++
 arch/m68k/lib/modsi3.S         |  3 +++
 arch/m68k/lib/muldi3.c         |  4 ++++
 arch/m68k/lib/mulsi3.S         |  4 ++--
 arch/m68k/lib/udivsi3.S        |  4 ++--
 arch/m68k/lib/umodsi3.S        |  4 ++--
 12 files changed, 32 insertions(+), 39 deletions(-)
 create mode 100644 arch/m68k/include/asm/export.h
 delete mode 100644 arch/m68k/kernel/m68k_ksyms.c

Comments

Geert Uytterhoeven Feb. 1, 2016, 10:52 a.m. UTC | #1
Hi Al,

On Fri, Jan 29, 2016 at 8:18 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
>
> the rest of architectures should just use generic-y += export.h in
> asm/Kbuild
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Looks good, and (some of, not all) the symbols end up in kstrtab, so

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Note that none of the m68k defconfigs build modules that refer to these
symbols. This changes completely with allmodconfig, which adds lots of
references in many of the same modules.
CONFIG_LBDAF=y is set in the defconfigs.

Unfortunately I haven't managed to boot a kernel that uses these symbols
in modules...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Al Viro Feb. 1, 2016, 12:18 p.m. UTC | #2
On Mon, Feb 01, 2016 at 11:52:27AM +0100, Geert Uytterhoeven wrote:
> Hi Al,
> 
> On Fri, Jan 29, 2016 at 8:18 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> > From: Al Viro <viro@zeniv.linux.org.uk>
> >
> > the rest of architectures should just use generic-y += export.h in
> > asm/Kbuild
> >
> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> 
> Looks good, and (some of, not all) the symbols end up in kstrtab, so
> 
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> 
> Note that none of the m68k defconfigs build modules that refer to these
> symbols. This changes completely with allmodconfig, which adds lots of
> references in many of the same modules.
> CONFIG_LBDAF=y is set in the defconfigs.
> 
> Unfortunately I haven't managed to boot a kernel that uses these symbols
> in modules...

Details, please...  Which symbols are missing?
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Feb. 1, 2016, 1:30 p.m. UTC | #3
Hi Al,

On Mon, Feb 1, 2016 at 1:18 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Mon, Feb 01, 2016 at 11:52:27AM +0100, Geert Uytterhoeven wrote:
>> On Fri, Jan 29, 2016 at 8:18 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> > From: Al Viro <viro@zeniv.linux.org.uk>
>> >
>> > the rest of architectures should just use generic-y += export.h in
>> > asm/Kbuild
>> >
>> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>>
>> Looks good, and (some of, not all) the symbols end up in kstrtab, so
>>
>> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
>>
>> Note that none of the m68k defconfigs build modules that refer to these
>> symbols. This changes completely with allmodconfig, which adds lots of
>> references in many of the same modules.
>> CONFIG_LBDAF=y is set in the defconfigs.
>>
>> Unfortunately I haven't managed to boot a kernel that uses these symbols
>> in modules...
>
> Details, please...  Which symbols are missing?

The kernel has all the *di3 variants:

002eae2c T __ashldi3
002eae70 T __ashrdi3
002eaebc T __lshrdi3
002eaf00 T __muldi3
0038a6d0 R __ksymtab___ashldi3
0038a6d8 R __ksymtab___ashrdi3
0038ab68 R __ksymtab___lshrdi3
0038ab90 R __ksymtab___muldi3
003a8a5a r __kstrtab___ashldi3
003a8a64 r __kstrtab___ashrdi3
003a8a6e r __kstrtab___lshrdi3
003a8a78 r __kstrtab___muldi3

Hence the *si3 are missing:

__divsi3
__modsi3
__mulsi3
__udivsi3
__umodsi3

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Al Viro Feb. 1, 2016, 2:53 p.m. UTC | #4
On Mon, Feb 01, 2016 at 02:30:16PM +0100, Geert Uytterhoeven wrote:
> The kernel has all the *di3 variants:
> 
> 002eae2c T __ashldi3
> 002eae70 T __ashrdi3
> 002eaebc T __lshrdi3
> 002eaf00 T __muldi3
> 0038a6d0 R __ksymtab___ashldi3
> 0038a6d8 R __ksymtab___ashrdi3
> 0038ab68 R __ksymtab___lshrdi3
> 0038ab90 R __ksymtab___muldi3
> 003a8a5a r __kstrtab___ashldi3
> 003a8a64 r __kstrtab___ashrdi3
> 003a8a6e r __kstrtab___lshrdi3
> 003a8a78 r __kstrtab___muldi3
> 
> Hence the *si3 are missing:
> 
> __divsi3
> __modsi3
> __mulsi3
> __udivsi3
> __umodsi3

Does your .config have CPU_HAS_NO_MULDIV64?  Because otherwise these objects
won't be built and their exports had been conditional on that as well:

#if defined(CONFIG_CPU_HAS_NO_MULDIV64)
/*
 * 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

is what we have in mainline m68k_ksyms.c.  Neither allmodconfig, nor any of
defconfigs have it.  And on a coldfire build they are built and exported as
expected:
$ grep si3 ../build/coldfire/System.map 
002be860 T __divsi3
002be890 T __modsi3
002be8b8 T __mulsi3
002be8dc T __udivsi3
002be90c T __umodsi3
003ed960 R __ksymtab___divsi3
003edc80 R __ksymtab___modsi3
003edca8 R __ksymtab___mulsi3
003edff8 R __ksymtab___udivsi3
003ee000 R __ksymtab___umodsi3
003f7ba4 r __kcrctab___divsi3
003f7d34 r __kcrctab___modsi3
003f7d48 r __kcrctab___mulsi3
003f7ef0 r __kcrctab___udivsi3
003f7ef4 r __kcrctab___umodsi3
004144fe r __kstrtab___divsi3
00414507 r __kstrtab___modsi3
00414510 r __kstrtab___mulsi3
00414519 r __kstrtab___udivsi3
00414523 r __kstrtab___umodsi3
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Feb. 1, 2016, 3:32 p.m. UTC | #5
Hi Al,

On Mon, Feb 1, 2016 at 3:53 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Mon, Feb 01, 2016 at 02:30:16PM +0100, Geert Uytterhoeven wrote:
>> The kernel has all the *di3 variants:
>>
>> 002eae2c T __ashldi3
>> 002eae70 T __ashrdi3
>> 002eaebc T __lshrdi3
>> 002eaf00 T __muldi3
>> 0038a6d0 R __ksymtab___ashldi3
>> 0038a6d8 R __ksymtab___ashrdi3
>> 0038ab68 R __ksymtab___lshrdi3
>> 0038ab90 R __ksymtab___muldi3
>> 003a8a5a r __kstrtab___ashldi3
>> 003a8a64 r __kstrtab___ashrdi3
>> 003a8a6e r __kstrtab___lshrdi3
>> 003a8a78 r __kstrtab___muldi3
>>
>> Hence the *si3 are missing:
>>
>> __divsi3
>> __modsi3
>> __mulsi3
>> __udivsi3
>> __umodsi3
>
> Does your .config have CPU_HAS_NO_MULDIV64?  Because otherwise these objects
> won't be built and their exports had been conditional on that as well:
>
> #if defined(CONFIG_CPU_HAS_NO_MULDIV64)
> /*
>  * 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

Oh, I hadn't actually noticed that dependency.
No, CPU_HAS_NO_MULDIV64 is not set, as I handle the parts with MMU only.

> is what we have in mainline m68k_ksyms.c.  Neither allmodconfig, nor any of
> defconfigs have it.  And on a coldfire build they are built and exported as
> expected:

[...]

Then I assume everything is OK. Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/m68k/include/asm/export.h b/arch/m68k/include/asm/export.h
new file mode 100644
index 0000000..0af20f4
--- /dev/null
+++ b/arch/m68k/include/asm/export.h
@@ -0,0 +1,3 @@ 
+#define KSYM_ALIGN 2
+#define KCRC_ALIGN 2
+#include <asm-generic/export.h>
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index e47778f..3600500 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -13,7 +13,7 @@  extra-$(CONFIG_SUN3X)	:= head.o
 extra-$(CONFIG_SUN3)	:= sun3-head.o
 extra-y			+= vmlinux.lds
 
-obj-y	:= entry.o irq.o m68k_ksyms.o module.o process.o ptrace.o
+obj-y	:= entry.o irq.o module.o process.o ptrace.o
 obj-y	+= setup.o signal.o sys_m68k.o syscalltable.o time.o traps.o
 
 obj-$(CONFIG_MMU_MOTOROLA) += ints.o vectors.o
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
deleted file mode 100644
index 774c1bd..0000000
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ /dev/null
@@ -1,32 +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);
-
-#if defined(CONFIG_CPU_HAS_NO_MULDIV64)
-/*
- * 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
diff --git a/arch/m68k/lib/ashldi3.c b/arch/m68k/lib/ashldi3.c
index 37234c2..8dffd36 100644
--- a/arch/m68k/lib/ashldi3.c
+++ b/arch/m68k/lib/ashldi3.c
@@ -13,6 +13,9 @@  but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details. */
 
+#include <linux/compiler.h>
+#include <linux/export.h>
+
 #define BITS_PER_UNIT 8
 
 typedef		 int SItype	__attribute__ ((mode (SI)));
@@ -55,3 +58,4 @@  __ashldi3 (DItype u, word_type b)
 
   return w.ll;
 }
+EXPORT_SYMBOL(__ashldi3);
diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c
index 1d59345..e6565a3 100644
--- a/arch/m68k/lib/ashrdi3.c
+++ b/arch/m68k/lib/ashrdi3.c
@@ -13,6 +13,9 @@  but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details. */
 
+#include <linux/compiler.h>
+#include <linux/export.h>
+
 #define BITS_PER_UNIT 8
 
 typedef		 int SItype	__attribute__ ((mode (SI)));
@@ -56,3 +59,4 @@  __ashrdi3 (DItype u, word_type b)
 
   return w.ll;
 }
+EXPORT_SYMBOL(__ashrdi3);
diff --git a/arch/m68k/lib/divsi3.S b/arch/m68k/lib/divsi3.S
index 2c0ec85..3a2143f 100644
--- a/arch/m68k/lib/divsi3.S
+++ b/arch/m68k/lib/divsi3.S
@@ -33,6 +33,8 @@  General Public License for more details. */
    D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
 */
 
+#include <asm/export.h>
+
 /* These are predefined by new versions of GNU cpp.  */
 
 #ifndef __USER_LABEL_PREFIX__
@@ -118,3 +120,4 @@  L2:	movel	d1, sp@-
 L3:	movel	sp@+, d2
 	rts
 
+	EXPORT_SYMBOL(__divsi3)
diff --git a/arch/m68k/lib/lshrdi3.c b/arch/m68k/lib/lshrdi3.c
index 49e1ec8..0397797 100644
--- a/arch/m68k/lib/lshrdi3.c
+++ b/arch/m68k/lib/lshrdi3.c
@@ -13,6 +13,9 @@  but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details. */
 
+#include <linux/compiler.h>
+#include <linux/export.h>
+
 #define BITS_PER_UNIT 8
 
 typedef		 int SItype	__attribute__ ((mode (SI)));
@@ -55,3 +58,4 @@  __lshrdi3 (DItype u, word_type b)
 
   return w.ll;
 }
+EXPORT_SYMBOL(__lshrdi3);
diff --git a/arch/m68k/lib/modsi3.S b/arch/m68k/lib/modsi3.S
index 1d9e0ef..1c96764 100644
--- a/arch/m68k/lib/modsi3.S
+++ b/arch/m68k/lib/modsi3.S
@@ -33,6 +33,8 @@  General Public License for more details. */
    D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
 */
 
+#include <asm/export.h>
+
 /* These are predefined by new versions of GNU cpp.  */
 
 #ifndef __USER_LABEL_PREFIX__
@@ -106,3 +108,4 @@  SYM (__modsi3):
 	movel	d1, d0
 	rts
 
+	EXPORT_SYMBOL(__modsi3)
diff --git a/arch/m68k/lib/muldi3.c b/arch/m68k/lib/muldi3.c
index 9006d15..6459af5 100644
--- a/arch/m68k/lib/muldi3.c
+++ b/arch/m68k/lib/muldi3.c
@@ -14,6 +14,9 @@  but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details. */
 
+#include <linux/compiler.h>
+#include <linux/export.h>
+
 #ifdef CONFIG_CPU_HAS_NO_MULDIV64
 
 #define SI_TYPE_SIZE 32
@@ -90,3 +93,4 @@  __muldi3 (DItype u, DItype v)
 
   return w.ll;
 }
+EXPORT_SYMBOL(__muldi3);
diff --git a/arch/m68k/lib/mulsi3.S b/arch/m68k/lib/mulsi3.S
index c39ad4e..855675e 100644
--- a/arch/m68k/lib/mulsi3.S
+++ b/arch/m68k/lib/mulsi3.S
@@ -32,7 +32,7 @@  General Public License for more details. */
    Some of this code comes from MINIX, via the folks at ericsson.
    D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
 */
-
+#include <asm/export.h>
 /* These are predefined by new versions of GNU cpp.  */
 
 #ifndef __USER_LABEL_PREFIX__
@@ -102,4 +102,4 @@  SYM (__mulsi3):
 	addl	d1, d0
 
 	rts
-
+	EXPORT_SYMBOL(__mulsi3)
diff --git a/arch/m68k/lib/udivsi3.S b/arch/m68k/lib/udivsi3.S
index 35a5446..78440ae 100644
--- a/arch/m68k/lib/udivsi3.S
+++ b/arch/m68k/lib/udivsi3.S
@@ -32,7 +32,7 @@  General Public License for more details. */
    Some of this code comes from MINIX, via the folks at ericsson.
    D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
 */
-
+#include <asm/export.h>
 /* These are predefined by new versions of GNU cpp.  */
 
 #ifndef __USER_LABEL_PREFIX__
@@ -154,4 +154,4 @@  L2:	subql	IMM (1),d4
 	unlk	a6		| and return
 	rts
 #endif /* __mcf5200__ || __mcoldfire__ */
-
+	EXPORT_SYMBOL(__udivsi3)
diff --git a/arch/m68k/lib/umodsi3.S b/arch/m68k/lib/umodsi3.S
index 099da51..b6fd11f 100644
--- a/arch/m68k/lib/umodsi3.S
+++ b/arch/m68k/lib/umodsi3.S
@@ -32,7 +32,7 @@  General Public License for more details. */
    Some of this code comes from MINIX, via the folks at ericsson.
    D. V. Henkel-Wallace (gumby@cygnus.com) Fete Bastille, 1992
 */
-
+#include <asm/export.h>
 /* These are predefined by new versions of GNU cpp.  */
 
 #ifndef __USER_LABEL_PREFIX__
@@ -105,4 +105,4 @@  SYM (__umodsi3):
 	subl	d0, d1		/* d1 = a - (a/b)*b */
 	movel	d1, d0
 	rts
-
+	EXPORT_SYMBOL(__umodsi3)