aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-14 17:26:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-14 17:26:58 -0400
commit84d69848c97faab0c25aa2667b273404d2e2a64a (patch)
tree594f3fe1b271b5255a1c5281e36f8bf938acd1c0 /arch/sparc
parentd4d24d2d0a7ea3b62efd7336bfc2344e29b36bc5 (diff)
parent590abbdd273304b55824bcb9ea91840ea375575d (diff)
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek: - EXPORT_SYMBOL for asm source by Al Viro. This does bring a regression, because genksyms no longer generates checksums for these symbols (CONFIG_MODVERSIONS). Nick Piggin is working on a patch to fix this. Plus, we are talking about functions like strcpy(), which rarely change prototypes. - Fixes for PPC fallout of the above by Stephen Rothwell and Nick Piggin - fixdep speedup by Alexey Dobriyan. - preparatory work by Nick Piggin to allow architectures to build with -ffunction-sections, -fdata-sections and --gc-sections - CONFIG_THIN_ARCHIVES support by Stephen Rothwell - fix for filenames with colons in the initramfs source by me. * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: (22 commits) initramfs: Escape colons in depfile ppc: there is no clear_pages to export powerpc/64: whitelist unresolved modversions CRCs kbuild: -ffunction-sections fix for archs with conflicting sections kbuild: add arch specific post-link Makefile kbuild: allow archs to select link dead code/data elimination kbuild: allow architectures to use thin archives instead of ld -r kbuild: Regenerate genksyms lexer kbuild: genksyms fix for typeof handling fixdep: faster CONFIG_ search ia64: move exports to definitions sparc32: debride memcpy.S a bit [sparc] unify 32bit and 64bit string.h sparc: move exports to definitions ppc: move exports to definitions arm: move exports to definitions s390: move exports to definitions m68k: move exports to definitions alpha: move exports to actual definitions x86: move exports to actual definitions ...
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/Kbuild1
-rw-r--r--arch/sparc/include/asm/string.h34
-rw-r--r--arch/sparc/include/asm/string_32.h56
-rw-r--r--arch/sparc/include/asm/string_64.h44
-rw-r--r--arch/sparc/kernel/Makefile2
-rw-r--r--arch/sparc/kernel/entry.S3
-rw-r--r--arch/sparc/kernel/head_32.S3
-rw-r--r--arch/sparc/kernel/head_64.S7
-rw-r--r--arch/sparc/kernel/helpers.S2
-rw-r--r--arch/sparc/kernel/hvcalls.S5
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c12
-rw-r--r--arch/sparc/kernel/sparc_ksyms_32.c31
-rw-r--r--arch/sparc/kernel/sparc_ksyms_64.c53
-rw-r--r--arch/sparc/lib/Makefile1
-rw-r--r--arch/sparc/lib/U1memcpy.S2
-rw-r--r--arch/sparc/lib/VISsave.S2
-rw-r--r--arch/sparc/lib/ashldi3.S2
-rw-r--r--arch/sparc/lib/ashrdi3.S2
-rw-r--r--arch/sparc/lib/atomic_64.S16
-rw-r--r--arch/sparc/lib/bitops.S7
-rw-r--r--arch/sparc/lib/blockops.S3
-rw-r--r--arch/sparc/lib/bzero.S4
-rw-r--r--arch/sparc/lib/checksum_32.S3
-rw-r--r--arch/sparc/lib/checksum_64.S2
-rw-r--r--arch/sparc/lib/clear_page.S3
-rw-r--r--arch/sparc/lib/copy_in_user.S2
-rw-r--r--arch/sparc/lib/copy_page.S2
-rw-r--r--arch/sparc/lib/copy_user.S2
-rw-r--r--arch/sparc/lib/csum_copy.S3
-rw-r--r--arch/sparc/lib/divdi3.S2
-rw-r--r--arch/sparc/lib/ffs.S3
-rw-r--r--arch/sparc/lib/hweight.S5
-rw-r--r--arch/sparc/lib/ipcsum.S2
-rw-r--r--arch/sparc/lib/ksyms.c174
-rw-r--r--arch/sparc/lib/locks.S5
-rw-r--r--arch/sparc/lib/lshrdi3.S2
-rw-r--r--arch/sparc/lib/mcount.S2
-rw-r--r--arch/sparc/lib/memcmp.S2
-rw-r--r--arch/sparc/lib/memcpy.S86
-rw-r--r--arch/sparc/lib/memmove.S2
-rw-r--r--arch/sparc/lib/memscan_32.S4
-rw-r--r--arch/sparc/lib/memscan_64.S4
-rw-r--r--arch/sparc/lib/memset.S3
-rw-r--r--arch/sparc/lib/muldi3.S2
-rw-r--r--arch/sparc/lib/strlen.S2
-rw-r--r--arch/sparc/lib/strncmp_32.S2
-rw-r--r--arch/sparc/lib/strncmp_64.S2
-rw-r--r--arch/sparc/lib/xor.S9
48 files changed, 174 insertions, 448 deletions
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 6024c26c0585..cfc918067f80 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -6,6 +6,7 @@ generic-y += cputime.h
6generic-y += div64.h 6generic-y += div64.h
7generic-y += emergency-restart.h 7generic-y += emergency-restart.h
8generic-y += exec.h 8generic-y += exec.h
9generic-y += export.h
9generic-y += irq_regs.h 10generic-y += irq_regs.h
10generic-y += irq_work.h 11generic-y += irq_work.h
11generic-y += linkage.h 12generic-y += linkage.h
diff --git a/arch/sparc/include/asm/string.h b/arch/sparc/include/asm/string.h
index 98b72a0c8e6e..86f34be14ce0 100644
--- a/arch/sparc/include/asm/string.h
+++ b/arch/sparc/include/asm/string.h
@@ -5,4 +5,38 @@
5#else 5#else
6#include <asm/string_32.h> 6#include <asm/string_32.h>
7#endif 7#endif
8
9/* First the mem*() things. */
10#define __HAVE_ARCH_MEMMOVE
11void *memmove(void *, const void *, __kernel_size_t);
12
13#define __HAVE_ARCH_MEMCPY
14#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
15
16#define __HAVE_ARCH_MEMSET
17#define memset(s, c, count) __builtin_memset(s, c, count)
18
19#define __HAVE_ARCH_MEMSCAN
20
21#define memscan(__arg0, __char, __arg2) \
22({ \
23 void *__memscan_zero(void *, size_t); \
24 void *__memscan_generic(void *, int, size_t); \
25 void *__retval, *__addr = (__arg0); \
26 size_t __size = (__arg2); \
27 \
28 if(__builtin_constant_p(__char) && !(__char)) \
29 __retval = __memscan_zero(__addr, __size); \
30 else \
31 __retval = __memscan_generic(__addr, (__char), __size); \
32 \
33 __retval; \
34})
35
36#define __HAVE_ARCH_MEMCMP
37int memcmp(const void *,const void *,__kernel_size_t);
38
39#define __HAVE_ARCH_STRNCMP
40int strncmp(const char *, const char *, __kernel_size_t);
41
8#endif 42#endif
diff --git a/arch/sparc/include/asm/string_32.h b/arch/sparc/include/asm/string_32.h
index 69974e924611..649412476a69 100644
--- a/arch/sparc/include/asm/string_32.h
+++ b/arch/sparc/include/asm/string_32.h
@@ -11,60 +11,4 @@
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13 13
14/* Really, userland/ksyms should not see any of this stuff. */
15
16#ifdef __KERNEL__
17
18void __memmove(void *,const void *,__kernel_size_t);
19
20#ifndef EXPORT_SYMTAB_STROPS
21
22/* First the mem*() things. */
23#define __HAVE_ARCH_MEMMOVE
24#undef memmove
25#define memmove(_to, _from, _n) \
26({ \
27 void *_t = (_to); \
28 __memmove(_t, (_from), (_n)); \
29 _t; \
30})
31
32#define __HAVE_ARCH_MEMCPY
33#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
34
35#define __HAVE_ARCH_MEMSET
36#define memset(s, c, count) __builtin_memset(s, c, count)
37
38#define __HAVE_ARCH_MEMSCAN
39
40#undef memscan
41#define memscan(__arg0, __char, __arg2) \
42({ \
43 void *__memscan_zero(void *, size_t); \
44 void *__memscan_generic(void *, int, size_t); \
45 void *__retval, *__addr = (__arg0); \
46 size_t __size = (__arg2); \
47 \
48 if(__builtin_constant_p(__char) && !(__char)) \
49 __retval = __memscan_zero(__addr, __size); \
50 else \
51 __retval = __memscan_generic(__addr, (__char), __size); \
52 \
53 __retval; \
54})
55
56#define __HAVE_ARCH_MEMCMP
57int memcmp(const void *,const void *,__kernel_size_t);
58
59/* Now the str*() stuff... */
60#define __HAVE_ARCH_STRLEN
61__kernel_size_t strlen(const char *);
62
63#define __HAVE_ARCH_STRNCMP
64int strncmp(const char *, const char *, __kernel_size_t);
65
66#endif /* !EXPORT_SYMTAB_STROPS */
67
68#endif /* __KERNEL__ */
69
70#endif /* !(__SPARC_STRING_H__) */ 14#endif /* !(__SPARC_STRING_H__) */
diff --git a/arch/sparc/include/asm/string_64.h b/arch/sparc/include/asm/string_64.h
index 5936b8ff3c05..6b9ccb308605 100644
--- a/arch/sparc/include/asm/string_64.h
+++ b/arch/sparc/include/asm/string_64.h
@@ -9,54 +9,10 @@
9#ifndef __SPARC64_STRING_H__ 9#ifndef __SPARC64_STRING_H__
10#define __SPARC64_STRING_H__ 10#define __SPARC64_STRING_H__
11 11
12/* Really, userland/ksyms should not see any of this stuff. */
13
14#ifdef __KERNEL__
15
16#include <asm/asi.h> 12#include <asm/asi.h>
17 13
18#ifndef EXPORT_SYMTAB_STROPS
19
20/* First the mem*() things. */
21#define __HAVE_ARCH_MEMMOVE
22void *memmove(void *, const void *, __kernel_size_t);
23
24#define __HAVE_ARCH_MEMCPY
25#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
26
27#define __HAVE_ARCH_MEMSET
28#define memset(s, c, count) __builtin_memset(s, c, count)
29
30#define __HAVE_ARCH_MEMSCAN
31
32#undef memscan
33#define memscan(__arg0, __char, __arg2) \
34({ \
35 void *__memscan_zero(void *, size_t); \
36 void *__memscan_generic(void *, int, size_t); \
37 void *__retval, *__addr = (__arg0); \
38 size_t __size = (__arg2); \
39 \
40 if(__builtin_constant_p(__char) && !(__char)) \
41 __retval = __memscan_zero(__addr, __size); \
42 else \
43 __retval = __memscan_generic(__addr, (__char), __size); \
44 \
45 __retval; \
46})
47
48#define __HAVE_ARCH_MEMCMP
49int memcmp(const void *,const void *,__kernel_size_t);
50
51/* Now the str*() stuff... */ 14/* Now the str*() stuff... */
52#define __HAVE_ARCH_STRLEN 15#define __HAVE_ARCH_STRLEN
53__kernel_size_t strlen(const char *); 16__kernel_size_t strlen(const char *);
54 17
55#define __HAVE_ARCH_STRNCMP
56int strncmp(const char *, const char *, __kernel_size_t);
57
58#endif /* !EXPORT_SYMTAB_STROPS */
59
60#endif /* __KERNEL__ */
61
62#endif /* !(__SPARC64_STRING_H__) */ 18#endif /* !(__SPARC64_STRING_H__) */
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index fdb13327fded..fa3c02d41138 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -86,7 +86,7 @@ obj-y += auxio_$(BITS).o
86obj-$(CONFIG_SUN_PM) += apc.o pmc.o 86obj-$(CONFIG_SUN_PM) += apc.o pmc.o
87 87
88obj-$(CONFIG_MODULES) += module.o 88obj-$(CONFIG_MODULES) += module.o
89obj-$(CONFIG_MODULES) += sparc_ksyms_$(BITS).o 89obj-$(CONFIG_MODULES) += sparc_ksyms.o
90obj-$(CONFIG_SPARC_LED) += led.o 90obj-$(CONFIG_SPARC_LED) += led.o
91obj-$(CONFIG_KGDB) += kgdb_$(BITS).o 91obj-$(CONFIG_KGDB) += kgdb_$(BITS).o
92 92
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index 07918ab3062e..d85bdb999819 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -29,6 +29,7 @@
29#include <asm/unistd.h> 29#include <asm/unistd.h>
30 30
31#include <asm/asmmacro.h> 31#include <asm/asmmacro.h>
32#include <asm/export.h>
32 33
33#define curptr g6 34#define curptr g6
34 35
@@ -1207,6 +1208,8 @@ delay_continue:
1207 1208
1208 ret 1209 ret
1209 restore 1210 restore
1211EXPORT_SYMBOL(__udelay)
1212EXPORT_SYMBOL(__ndelay)
1210 1213
1211 /* Handle a software breakpoint */ 1214 /* Handle a software breakpoint */
1212 /* We have to inform parent that child has stopped */ 1215 /* We have to inform parent that child has stopped */
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S
index 3d92c0a8f6c4..7bb317b87dde 100644
--- a/arch/sparc/kernel/head_32.S
+++ b/arch/sparc/kernel/head_32.S
@@ -24,6 +24,7 @@
24#include <asm/thread_info.h> /* TI_UWINMASK */ 24#include <asm/thread_info.h> /* TI_UWINMASK */
25#include <asm/errno.h> 25#include <asm/errno.h>
26#include <asm/pgtsrmmu.h> /* SRMMU_PGDIR_SHIFT */ 26#include <asm/pgtsrmmu.h> /* SRMMU_PGDIR_SHIFT */
27#include <asm/export.h>
27 28
28 .data 29 .data
29/* The following are used with the prom_vector node-ops to figure out 30/* The following are used with the prom_vector node-ops to figure out
@@ -60,6 +61,7 @@ sun4e_notsup:
60 */ 61 */
61 .globl empty_zero_page 62 .globl empty_zero_page
62empty_zero_page: .skip PAGE_SIZE 63empty_zero_page: .skip PAGE_SIZE
64EXPORT_SYMBOL(empty_zero_page)
63 65
64 .global root_flags 66 .global root_flags
65 .global ram_flags 67 .global ram_flags
@@ -813,3 +815,4 @@ lvl14_save:
813__ret_efault: 815__ret_efault:
814 ret 816 ret
815 restore %g0, -EFAULT, %o0 817 restore %g0, -EFAULT, %o0
818EXPORT_SYMBOL(__ret_efault)
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index a076b4249e62..beba6c11554c 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -32,7 +32,8 @@
32#include <asm/estate.h> 32#include <asm/estate.h>
33#include <asm/sfafsr.h> 33#include <asm/sfafsr.h>
34#include <asm/unistd.h> 34#include <asm/unistd.h>
35 35#include <asm/export.h>
36
36/* This section from from _start to sparc64_boot_end should fit into 37/* This section from from _start to sparc64_boot_end should fit into
37 * 0x0000000000404000 to 0x0000000000408000. 38 * 0x0000000000404000 to 0x0000000000408000.
38 */ 39 */
@@ -143,6 +144,7 @@ prom_cpu_compatible:
143 .skip 64 144 .skip 64
144prom_root_node: 145prom_root_node:
145 .word 0 146 .word 0
147EXPORT_SYMBOL(prom_root_node)
146prom_mmu_ihandle_cache: 148prom_mmu_ihandle_cache:
147 .word 0 149 .word 0
148prom_boot_mapped_pc: 150prom_boot_mapped_pc:
@@ -158,6 +160,7 @@ is_sun4v:
158 .word 0 160 .word 0
159sun4v_chip_type: 161sun4v_chip_type:
160 .word SUN4V_CHIP_INVALID 162 .word SUN4V_CHIP_INVALID
163EXPORT_SYMBOL(sun4v_chip_type)
1611: 1641:
162 rd %pc, %l0 165 rd %pc, %l0
163 166
@@ -920,6 +923,7 @@ swapper_4m_tsb:
920 .globl prom_tba, tlb_type 923 .globl prom_tba, tlb_type
921prom_tba: .xword 0 924prom_tba: .xword 0
922tlb_type: .word 0 /* Must NOT end up in BSS */ 925tlb_type: .word 0 /* Must NOT end up in BSS */
926EXPORT_SYMBOL(tlb_type)
923 .section ".fixup",#alloc,#execinstr 927 .section ".fixup",#alloc,#execinstr
924 928
925 .globl __ret_efault, __retl_efault, __ret_one, __retl_one 929 .globl __ret_efault, __retl_efault, __ret_one, __retl_one
@@ -927,6 +931,7 @@ ENTRY(__ret_efault)
927 ret 931 ret
928 restore %g0, -EFAULT, %o0 932 restore %g0, -EFAULT, %o0
929ENDPROC(__ret_efault) 933ENDPROC(__ret_efault)
934EXPORT_SYMBOL(__ret_efault)
930 935
931ENTRY(__retl_efault) 936ENTRY(__retl_efault)
932 retl 937 retl
diff --git a/arch/sparc/kernel/helpers.S b/arch/sparc/kernel/helpers.S
index 314dd0c9fc5b..e4e5b832fcb6 100644
--- a/arch/sparc/kernel/helpers.S
+++ b/arch/sparc/kernel/helpers.S
@@ -15,6 +15,7 @@ __flushw_user:
152: retl 152: retl
16 nop 16 nop
17 .size __flushw_user,.-__flushw_user 17 .size __flushw_user,.-__flushw_user
18EXPORT_SYMBOL(__flushw_user)
18 19
19 /* Flush %fp and %i7 to the stack for all register 20 /* Flush %fp and %i7 to the stack for all register
20 * windows active inside of the cpu. This allows 21 * windows active inside of the cpu. This allows
@@ -61,3 +62,4 @@ real_hard_smp_processor_id:
61 .size hard_smp_processor_id,.-hard_smp_processor_id 62 .size hard_smp_processor_id,.-hard_smp_processor_id
62#endif 63#endif
63 .size real_hard_smp_processor_id,.-real_hard_smp_processor_id 64 .size real_hard_smp_processor_id,.-real_hard_smp_processor_id
65EXPORT_SYMBOL_GPL(real_hard_smp_processor_id)
diff --git a/arch/sparc/kernel/hvcalls.S b/arch/sparc/kernel/hvcalls.S
index d127130bf424..4116ee5c7791 100644
--- a/arch/sparc/kernel/hvcalls.S
+++ b/arch/sparc/kernel/hvcalls.S
@@ -343,6 +343,7 @@ ENTRY(sun4v_mach_set_watchdog)
3430: retl 3430: retl
344 nop 344 nop
345ENDPROC(sun4v_mach_set_watchdog) 345ENDPROC(sun4v_mach_set_watchdog)
346EXPORT_SYMBOL(sun4v_mach_set_watchdog)
346 347
347 /* No inputs and does not return. */ 348 /* No inputs and does not return. */
348ENTRY(sun4v_mach_sir) 349ENTRY(sun4v_mach_sir)
@@ -776,6 +777,7 @@ ENTRY(sun4v_niagara_getperf)
776 retl 777 retl
777 nop 778 nop
778ENDPROC(sun4v_niagara_getperf) 779ENDPROC(sun4v_niagara_getperf)
780EXPORT_SYMBOL(sun4v_niagara_getperf)
779 781
780ENTRY(sun4v_niagara_setperf) 782ENTRY(sun4v_niagara_setperf)
781 mov HV_FAST_SET_PERFREG, %o5 783 mov HV_FAST_SET_PERFREG, %o5
@@ -783,6 +785,7 @@ ENTRY(sun4v_niagara_setperf)
783 retl 785 retl
784 nop 786 nop
785ENDPROC(sun4v_niagara_setperf) 787ENDPROC(sun4v_niagara_setperf)
788EXPORT_SYMBOL(sun4v_niagara_setperf)
786 789
787ENTRY(sun4v_niagara2_getperf) 790ENTRY(sun4v_niagara2_getperf)
788 mov %o0, %o4 791 mov %o0, %o4
@@ -792,6 +795,7 @@ ENTRY(sun4v_niagara2_getperf)
792 retl 795 retl
793 nop 796 nop
794ENDPROC(sun4v_niagara2_getperf) 797ENDPROC(sun4v_niagara2_getperf)
798EXPORT_SYMBOL(sun4v_niagara2_getperf)
795 799
796ENTRY(sun4v_niagara2_setperf) 800ENTRY(sun4v_niagara2_setperf)
797 mov HV_FAST_N2_SET_PERFREG, %o5 801 mov HV_FAST_N2_SET_PERFREG, %o5
@@ -799,6 +803,7 @@ ENTRY(sun4v_niagara2_setperf)
799 retl 803 retl
800 nop 804 nop
801ENDPROC(sun4v_niagara2_setperf) 805ENDPROC(sun4v_niagara2_setperf)
806EXPORT_SYMBOL(sun4v_niagara2_setperf)
802 807
803ENTRY(sun4v_reboot_data_set) 808ENTRY(sun4v_reboot_data_set)
804 mov HV_FAST_REBOOT_DATA_SET, %o5 809 mov HV_FAST_REBOOT_DATA_SET, %o5
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
new file mode 100644
index 000000000000..09aa69e422e5
--- /dev/null
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -0,0 +1,12 @@
1/*
2 * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 */
7
8#include <linux/init.h>
9#include <linux/export.h>
10
11/* This is needed only for drivers/sbus/char/openprom.c */
12EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
deleted file mode 100644
index bf4ccb10a78c..000000000000
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * arch/sparc/kernel/ksyms.c: Sparc specific ksyms support.
3 *
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 */
7
8#include <linux/module.h>
9
10#include <asm/pgtable.h>
11#include <asm/uaccess.h>
12#include <asm/delay.h>
13#include <asm/head.h>
14#include <asm/dma.h>
15
16struct poll {
17 int fd;
18 short events;
19 short revents;
20};
21
22/* from entry.S */
23EXPORT_SYMBOL(__udelay);
24EXPORT_SYMBOL(__ndelay);
25
26/* from head_32.S */
27EXPORT_SYMBOL(__ret_efault);
28EXPORT_SYMBOL(empty_zero_page);
29
30/* Exporting a symbol from /init/main.c */
31EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
deleted file mode 100644
index 9e034f29dcc5..000000000000
--- a/arch/sparc/kernel/sparc_ksyms_64.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/* arch/sparc64/kernel/sparc64_ksyms.c: Sparc64 specific ksyms support.
2 *
3 * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
5 * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
6 */
7
8#include <linux/export.h>
9#include <linux/pci.h>
10#include <linux/bitops.h>
11
12#include <asm/cpudata.h>
13#include <asm/uaccess.h>
14#include <asm/spitfire.h>
15#include <asm/oplib.h>
16#include <asm/hypervisor.h>
17#include <asm/cacheflush.h>
18
19struct poll {
20 int fd;
21 short events;
22 short revents;
23};
24
25/* from helpers.S */
26EXPORT_SYMBOL(__flushw_user);
27EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
28
29/* from head_64.S */
30EXPORT_SYMBOL(__ret_efault);
31EXPORT_SYMBOL(tlb_type);
32EXPORT_SYMBOL(sun4v_chip_type);
33EXPORT_SYMBOL(prom_root_node);
34
35/* from hvcalls.S */
36EXPORT_SYMBOL(sun4v_niagara_getperf);
37EXPORT_SYMBOL(sun4v_niagara_setperf);
38EXPORT_SYMBOL(sun4v_niagara2_getperf);
39EXPORT_SYMBOL(sun4v_niagara2_setperf);
40EXPORT_SYMBOL(sun4v_mach_set_watchdog);
41
42/* from hweight.S */
43EXPORT_SYMBOL(__arch_hweight8);
44EXPORT_SYMBOL(__arch_hweight16);
45EXPORT_SYMBOL(__arch_hweight32);
46EXPORT_SYMBOL(__arch_hweight64);
47
48/* from ffs_ffz.S */
49EXPORT_SYMBOL(ffs);
50EXPORT_SYMBOL(__ffs);
51
52/* Exporting a symbol from /init/main.c */
53EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 3269b0234093..885f00e81d1a 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -43,5 +43,4 @@ lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o
43 43
44obj-$(CONFIG_SPARC64) += iomap.o 44obj-$(CONFIG_SPARC64) += iomap.o
45obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o 45obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o
46obj-y += ksyms.o
47obj-$(CONFIG_SPARC64) += PeeCeeI.o 46obj-$(CONFIG_SPARC64) += PeeCeeI.o
diff --git a/arch/sparc/lib/U1memcpy.S b/arch/sparc/lib/U1memcpy.S
index 3e6209ebb7d7..97e1b211090c 100644
--- a/arch/sparc/lib/U1memcpy.S
+++ b/arch/sparc/lib/U1memcpy.S
@@ -7,6 +7,7 @@
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <asm/visasm.h> 8#include <asm/visasm.h>
9#include <asm/asi.h> 9#include <asm/asi.h>
10#include <asm/export.h>
10#define GLOBAL_SPARE g7 11#define GLOBAL_SPARE g7
11#else 12#else
12#define GLOBAL_SPARE g5 13#define GLOBAL_SPARE g5
@@ -567,3 +568,4 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */
567 mov EX_RETVAL(%o4), %o0 568 mov EX_RETVAL(%o4), %o0
568 569
569 .size FUNC_NAME, .-FUNC_NAME 570 .size FUNC_NAME, .-FUNC_NAME
571EXPORT_SYMBOL(FUNC_NAME)
diff --git a/arch/sparc/lib/VISsave.S b/arch/sparc/lib/VISsave.S
index 62c2647bd5ce..1c7b6a39b942 100644
--- a/arch/sparc/lib/VISsave.S
+++ b/arch/sparc/lib/VISsave.S
@@ -13,6 +13,7 @@
13#include <asm/ptrace.h> 13#include <asm/ptrace.h>
14#include <asm/visasm.h> 14#include <asm/visasm.h>
15#include <asm/thread_info.h> 15#include <asm/thread_info.h>
16#include <asm/export.h>
16 17
17 /* On entry: %o5=current FPRS value, %g7 is callers address */ 18 /* On entry: %o5=current FPRS value, %g7 is callers address */
18 /* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */ 19 /* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */
@@ -79,3 +80,4 @@ vis1: ldub [%g6 + TI_FPSAVED], %g3
7980: jmpl %g7 + %g0, %g0 8080: jmpl %g7 + %g0, %g0
80 nop 81 nop
81ENDPROC(VISenter) 82ENDPROC(VISenter)
83EXPORT_SYMBOL(VISenter)
diff --git a/arch/sparc/lib/ashldi3.S b/arch/sparc/lib/ashldi3.S
index 86f60de07b0a..c8b1cf71bc73 100644
--- a/arch/sparc/lib/ashldi3.S
+++ b/arch/sparc/lib/ashldi3.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(__ashldi3) 12ENTRY(__ashldi3)
@@ -33,3 +34,4 @@ ENTRY(__ashldi3)
33 retl 34 retl
34 nop 35 nop
35ENDPROC(__ashldi3) 36ENDPROC(__ashldi3)
37EXPORT_SYMBOL(__ashldi3)
diff --git a/arch/sparc/lib/ashrdi3.S b/arch/sparc/lib/ashrdi3.S
index 6eb8ba2dd50e..4310256e7964 100644
--- a/arch/sparc/lib/ashrdi3.S
+++ b/arch/sparc/lib/ashrdi3.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(__ashrdi3) 12ENTRY(__ashrdi3)
@@ -35,3 +36,4 @@ ENTRY(__ashrdi3)
35 jmpl %o7 + 8, %g0 36 jmpl %o7 + 8, %g0
36 nop 37 nop
37ENDPROC(__ashrdi3) 38ENDPROC(__ashrdi3)
39EXPORT_SYMBOL(__ashrdi3)
diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S
index a5c5a0279ccc..1c6a1bde5138 100644
--- a/arch/sparc/lib/atomic_64.S
+++ b/arch/sparc/lib/atomic_64.S
@@ -6,6 +6,7 @@
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/asi.h> 7#include <asm/asi.h>
8#include <asm/backoff.h> 8#include <asm/backoff.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11 12
@@ -29,6 +30,7 @@ ENTRY(atomic_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
29 nop; \ 30 nop; \
302: BACKOFF_SPIN(%o2, %o3, 1b); \ 312: BACKOFF_SPIN(%o2, %o3, 1b); \
31ENDPROC(atomic_##op); \ 32ENDPROC(atomic_##op); \
33EXPORT_SYMBOL(atomic_##op);
32 34
33#define ATOMIC_OP_RETURN(op) \ 35#define ATOMIC_OP_RETURN(op) \
34ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \ 36ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -42,7 +44,8 @@ ENTRY(atomic_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
42 retl; \ 44 retl; \
43 sra %g1, 0, %o0; \ 45 sra %g1, 0, %o0; \
442: BACKOFF_SPIN(%o2, %o3, 1b); \ 462: BACKOFF_SPIN(%o2, %o3, 1b); \
45ENDPROC(atomic_##op##_return); 47ENDPROC(atomic_##op##_return); \
48EXPORT_SYMBOL(atomic_##op##_return);
46 49
47#define ATOMIC_FETCH_OP(op) \ 50#define ATOMIC_FETCH_OP(op) \
48ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \ 51ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -56,7 +59,8 @@ ENTRY(atomic_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
56 retl; \ 59 retl; \
57 sra %g1, 0, %o0; \ 60 sra %g1, 0, %o0; \
582: BACKOFF_SPIN(%o2, %o3, 1b); \ 612: BACKOFF_SPIN(%o2, %o3, 1b); \
59ENDPROC(atomic_fetch_##op); 62ENDPROC(atomic_fetch_##op); \
63EXPORT_SYMBOL(atomic_fetch_##op);
60 64
61#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op) 65#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
62 66
@@ -88,6 +92,7 @@ ENTRY(atomic64_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
88 nop; \ 92 nop; \
892: BACKOFF_SPIN(%o2, %o3, 1b); \ 932: BACKOFF_SPIN(%o2, %o3, 1b); \
90ENDPROC(atomic64_##op); \ 94ENDPROC(atomic64_##op); \
95EXPORT_SYMBOL(atomic64_##op);
91 96
92#define ATOMIC64_OP_RETURN(op) \ 97#define ATOMIC64_OP_RETURN(op) \
93ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \ 98ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -101,7 +106,8 @@ ENTRY(atomic64_##op##_return) /* %o0 = increment, %o1 = atomic_ptr */ \
101 retl; \ 106 retl; \
102 op %g1, %o0, %o0; \ 107 op %g1, %o0, %o0; \
1032: BACKOFF_SPIN(%o2, %o3, 1b); \ 1082: BACKOFF_SPIN(%o2, %o3, 1b); \
104ENDPROC(atomic64_##op##_return); 109ENDPROC(atomic64_##op##_return); \
110EXPORT_SYMBOL(atomic64_##op##_return);
105 111
106#define ATOMIC64_FETCH_OP(op) \ 112#define ATOMIC64_FETCH_OP(op) \
107ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \ 113ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
@@ -115,7 +121,8 @@ ENTRY(atomic64_fetch_##op) /* %o0 = increment, %o1 = atomic_ptr */ \
115 retl; \ 121 retl; \
116 mov %g1, %o0; \ 122 mov %g1, %o0; \
1172: BACKOFF_SPIN(%o2, %o3, 1b); \ 1232: BACKOFF_SPIN(%o2, %o3, 1b); \
118ENDPROC(atomic64_fetch_##op); 124ENDPROC(atomic64_fetch_##op); \
125EXPORT_SYMBOL(atomic64_fetch_##op);
119 126
120#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op) 127#define ATOMIC64_OPS(op) ATOMIC64_OP(op) ATOMIC64_OP_RETURN(op) ATOMIC64_FETCH_OP(op)
121 128
@@ -147,3 +154,4 @@ ENTRY(atomic64_dec_if_positive) /* %o0 = atomic_ptr */
147 sub %g1, 1, %o0 154 sub %g1, 1, %o0
1482: BACKOFF_SPIN(%o2, %o3, 1b) 1552: BACKOFF_SPIN(%o2, %o3, 1b)
149ENDPROC(atomic64_dec_if_positive) 156ENDPROC(atomic64_dec_if_positive)
157EXPORT_SYMBOL(atomic64_dec_if_positive)
diff --git a/arch/sparc/lib/bitops.S b/arch/sparc/lib/bitops.S
index 36f72cc0e67e..7031bf1587cb 100644
--- a/arch/sparc/lib/bitops.S
+++ b/arch/sparc/lib/bitops.S
@@ -6,6 +6,7 @@
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/asi.h> 7#include <asm/asi.h>
8#include <asm/backoff.h> 8#include <asm/backoff.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11 12
@@ -29,6 +30,7 @@ ENTRY(test_and_set_bit) /* %o0=nr, %o1=addr */
29 nop 30 nop
302: BACKOFF_SPIN(%o3, %o4, 1b) 312: BACKOFF_SPIN(%o3, %o4, 1b)
31ENDPROC(test_and_set_bit) 32ENDPROC(test_and_set_bit)
33EXPORT_SYMBOL(test_and_set_bit)
32 34
33ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */ 35ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
34 BACKOFF_SETUP(%o3) 36 BACKOFF_SETUP(%o3)
@@ -50,6 +52,7 @@ ENTRY(test_and_clear_bit) /* %o0=nr, %o1=addr */
50 nop 52 nop
512: BACKOFF_SPIN(%o3, %o4, 1b) 532: BACKOFF_SPIN(%o3, %o4, 1b)
52ENDPROC(test_and_clear_bit) 54ENDPROC(test_and_clear_bit)
55EXPORT_SYMBOL(test_and_clear_bit)
53 56
54ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */ 57ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
55 BACKOFF_SETUP(%o3) 58 BACKOFF_SETUP(%o3)
@@ -71,6 +74,7 @@ ENTRY(test_and_change_bit) /* %o0=nr, %o1=addr */
71 nop 74 nop
722: BACKOFF_SPIN(%o3, %o4, 1b) 752: BACKOFF_SPIN(%o3, %o4, 1b)
73ENDPROC(test_and_change_bit) 76ENDPROC(test_and_change_bit)
77EXPORT_SYMBOL(test_and_change_bit)
74 78
75ENTRY(set_bit) /* %o0=nr, %o1=addr */ 79ENTRY(set_bit) /* %o0=nr, %o1=addr */
76 BACKOFF_SETUP(%o3) 80 BACKOFF_SETUP(%o3)
@@ -90,6 +94,7 @@ ENTRY(set_bit) /* %o0=nr, %o1=addr */
90 nop 94 nop
912: BACKOFF_SPIN(%o3, %o4, 1b) 952: BACKOFF_SPIN(%o3, %o4, 1b)
92ENDPROC(set_bit) 96ENDPROC(set_bit)
97EXPORT_SYMBOL(set_bit)
93 98
94ENTRY(clear_bit) /* %o0=nr, %o1=addr */ 99ENTRY(clear_bit) /* %o0=nr, %o1=addr */
95 BACKOFF_SETUP(%o3) 100 BACKOFF_SETUP(%o3)
@@ -109,6 +114,7 @@ ENTRY(clear_bit) /* %o0=nr, %o1=addr */
109 nop 114 nop
1102: BACKOFF_SPIN(%o3, %o4, 1b) 1152: BACKOFF_SPIN(%o3, %o4, 1b)
111ENDPROC(clear_bit) 116ENDPROC(clear_bit)
117EXPORT_SYMBOL(clear_bit)
112 118
113ENTRY(change_bit) /* %o0=nr, %o1=addr */ 119ENTRY(change_bit) /* %o0=nr, %o1=addr */
114 BACKOFF_SETUP(%o3) 120 BACKOFF_SETUP(%o3)
@@ -128,3 +134,4 @@ ENTRY(change_bit) /* %o0=nr, %o1=addr */
128 nop 134 nop
1292: BACKOFF_SPIN(%o3, %o4, 1b) 1352: BACKOFF_SPIN(%o3, %o4, 1b)
130ENDPROC(change_bit) 136ENDPROC(change_bit)
137EXPORT_SYMBOL(change_bit)
diff --git a/arch/sparc/lib/blockops.S b/arch/sparc/lib/blockops.S
index 3c771011ff4b..1f2692d59d18 100644
--- a/arch/sparc/lib/blockops.S
+++ b/arch/sparc/lib/blockops.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/page.h> 8#include <asm/page.h>
9#include <asm/export.h>
9 10
10 /* Zero out 64 bytes of memory at (buf + offset). 11 /* Zero out 64 bytes of memory at (buf + offset).
11 * Assumes %g1 contains zero. 12 * Assumes %g1 contains zero.
@@ -64,6 +65,7 @@ ENTRY(bzero_1page)
64 retl 65 retl
65 nop 66 nop
66ENDPROC(bzero_1page) 67ENDPROC(bzero_1page)
68EXPORT_SYMBOL(bzero_1page)
67 69
68ENTRY(__copy_1page) 70ENTRY(__copy_1page)
69/* NOTE: If you change the number of insns of this routine, please check 71/* NOTE: If you change the number of insns of this routine, please check
@@ -87,3 +89,4 @@ ENTRY(__copy_1page)
87 retl 89 retl
88 nop 90 nop
89ENDPROC(__copy_1page) 91ENDPROC(__copy_1page)
92EXPORT_SYMBOL(__copy_1page)
diff --git a/arch/sparc/lib/bzero.S b/arch/sparc/lib/bzero.S
index 8c058114b649..3bb1914c4fa4 100644
--- a/arch/sparc/lib/bzero.S
+++ b/arch/sparc/lib/bzero.S
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/export.h>
8 9
9 .text 10 .text
10 11
@@ -78,6 +79,8 @@ __bzero_done:
78 mov %o3, %o0 79 mov %o3, %o0
79ENDPROC(__bzero) 80ENDPROC(__bzero)
80ENDPROC(memset) 81ENDPROC(memset)
82EXPORT_SYMBOL(__bzero)
83EXPORT_SYMBOL(memset)
81 84
82#define EX_ST(x,y) \ 85#define EX_ST(x,y) \
8398: x,y; \ 8698: x,y; \
@@ -143,3 +146,4 @@ __clear_user_done:
143 retl 146 retl
144 clr %o0 147 clr %o0
145ENDPROC(__clear_user) 148ENDPROC(__clear_user)
149EXPORT_SYMBOL(__clear_user)
diff --git a/arch/sparc/lib/checksum_32.S b/arch/sparc/lib/checksum_32.S
index 0084c3361e15..c9d8b6232111 100644
--- a/arch/sparc/lib/checksum_32.S
+++ b/arch/sparc/lib/checksum_32.S
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <asm/errno.h> 16#include <asm/errno.h>
17#include <asm/export.h>
17 18
18#define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \ 19#define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \
19 ldd [buf + offset + 0x00], t0; \ 20 ldd [buf + offset + 0x00], t0; \
@@ -104,6 +105,7 @@ csum_partial_fix_alignment:
104 * buffer of size 0x20. Follow the code path for that case. 105 * buffer of size 0x20. Follow the code path for that case.
105 */ 106 */
106 .globl csum_partial 107 .globl csum_partial
108 EXPORT_SYMBOL(csum_partial)
107csum_partial: /* %o0=buf, %o1=len, %o2=sum */ 109csum_partial: /* %o0=buf, %o1=len, %o2=sum */
108 andcc %o0, 0x7, %g0 ! alignment problems? 110 andcc %o0, 0x7, %g0 ! alignment problems?
109 bne csum_partial_fix_alignment ! yep, handle it 111 bne csum_partial_fix_alignment ! yep, handle it
@@ -335,6 +337,7 @@ cc_dword_align:
335 */ 337 */
336 .align 8 338 .align 8
337 .globl __csum_partial_copy_sparc_generic 339 .globl __csum_partial_copy_sparc_generic
340 EXPORT_SYMBOL(__csum_partial_copy_sparc_generic)
338__csum_partial_copy_sparc_generic: 341__csum_partial_copy_sparc_generic:
339 /* %o0=src, %o1=dest, %g1=len, %g7=sum */ 342 /* %o0=src, %o1=dest, %g1=len, %g7=sum */
340 xor %o0, %o1, %o4 ! get changing bits 343 xor %o0, %o1, %o4 ! get changing bits
diff --git a/arch/sparc/lib/checksum_64.S b/arch/sparc/lib/checksum_64.S
index 1d230f693dc4..f6732174fe6b 100644
--- a/arch/sparc/lib/checksum_64.S
+++ b/arch/sparc/lib/checksum_64.S
@@ -13,6 +13,7 @@
13 * BSD4.4 portable checksum routine 13 * BSD4.4 portable checksum routine
14 */ 14 */
15 15
16#include <asm/export.h>
16 .text 17 .text
17 18
18csum_partial_fix_alignment: 19csum_partial_fix_alignment:
@@ -37,6 +38,7 @@ csum_partial_fix_alignment:
37 38
38 .align 32 39 .align 32
39 .globl csum_partial 40 .globl csum_partial
41 EXPORT_SYMBOL(csum_partial)
40csum_partial: /* %o0=buff, %o1=len, %o2=sum */ 42csum_partial: /* %o0=buff, %o1=len, %o2=sum */
41 prefetch [%o0 + 0x000], #n_reads 43 prefetch [%o0 + 0x000], #n_reads
42 clr %o4 44 clr %o4
diff --git a/arch/sparc/lib/clear_page.S b/arch/sparc/lib/clear_page.S
index 46272dfc26e8..f30d6b78afbd 100644
--- a/arch/sparc/lib/clear_page.S
+++ b/arch/sparc/lib/clear_page.S
@@ -10,6 +10,7 @@
10#include <asm/pgtable.h> 10#include <asm/pgtable.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/head.h> 12#include <asm/head.h>
13#include <asm/export.h>
13 14
14 /* What we used to do was lock a TLB entry into a specific 15 /* What we used to do was lock a TLB entry into a specific
15 * TLB slot, clear the page with interrupts disabled, then 16 * TLB slot, clear the page with interrupts disabled, then
@@ -26,6 +27,7 @@
26 .text 27 .text
27 28
28 .globl _clear_page 29 .globl _clear_page
30 EXPORT_SYMBOL(_clear_page)
29_clear_page: /* %o0=dest */ 31_clear_page: /* %o0=dest */
30 ba,pt %xcc, clear_page_common 32 ba,pt %xcc, clear_page_common
31 clr %o4 33 clr %o4
@@ -35,6 +37,7 @@ _clear_page: /* %o0=dest */
35 */ 37 */
36 .align 32 38 .align 32
37 .globl clear_user_page 39 .globl clear_user_page
40 EXPORT_SYMBOL(clear_user_page)
38clear_user_page: /* %o0=dest, %o1=vaddr */ 41clear_user_page: /* %o0=dest, %o1=vaddr */
39 lduw [%g6 + TI_PRE_COUNT], %o2 42 lduw [%g6 + TI_PRE_COUNT], %o2
40 sethi %hi(PAGE_OFFSET), %g2 43 sethi %hi(PAGE_OFFSET), %g2
diff --git a/arch/sparc/lib/copy_in_user.S b/arch/sparc/lib/copy_in_user.S
index 302c0e60dc2c..482de093bdae 100644
--- a/arch/sparc/lib/copy_in_user.S
+++ b/arch/sparc/lib/copy_in_user.S
@@ -5,6 +5,7 @@
5 5
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/asi.h> 7#include <asm/asi.h>
8#include <asm/export.h>
8 9
9#define XCC xcc 10#define XCC xcc
10 11
@@ -90,3 +91,4 @@ ENTRY(___copy_in_user) /* %o0=dst, %o1=src, %o2=len */
90 retl 91 retl
91 clr %o0 92 clr %o0
92ENDPROC(___copy_in_user) 93ENDPROC(___copy_in_user)
94EXPORT_SYMBOL(___copy_in_user)
diff --git a/arch/sparc/lib/copy_page.S b/arch/sparc/lib/copy_page.S
index dd16c61f3263..7197b7250895 100644
--- a/arch/sparc/lib/copy_page.S
+++ b/arch/sparc/lib/copy_page.S
@@ -10,6 +10,7 @@
10#include <asm/pgtable.h> 10#include <asm/pgtable.h>
11#include <asm/spitfire.h> 11#include <asm/spitfire.h>
12#include <asm/head.h> 12#include <asm/head.h>
13#include <asm/export.h>
13 14
14 /* What we used to do was lock a TLB entry into a specific 15 /* What we used to do was lock a TLB entry into a specific
15 * TLB slot, clear the page with interrupts disabled, then 16 * TLB slot, clear the page with interrupts disabled, then
@@ -44,6 +45,7 @@
44 .align 32 45 .align 32
45 .globl copy_user_page 46 .globl copy_user_page
46 .type copy_user_page,#function 47 .type copy_user_page,#function
48 EXPORT_SYMBOL(copy_user_page)
47copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ 49copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
48 lduw [%g6 + TI_PRE_COUNT], %o4 50 lduw [%g6 + TI_PRE_COUNT], %o4
49 sethi %hi(PAGE_OFFSET), %g2 51 sethi %hi(PAGE_OFFSET), %g2
diff --git a/arch/sparc/lib/copy_user.S b/arch/sparc/lib/copy_user.S
index ef095b6c43b1..cea644dc67a6 100644
--- a/arch/sparc/lib/copy_user.S
+++ b/arch/sparc/lib/copy_user.S
@@ -15,6 +15,7 @@
15#include <asm/asmmacro.h> 15#include <asm/asmmacro.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <asm/thread_info.h> 17#include <asm/thread_info.h>
18#include <asm/export.h>
18 19
19/* Work around cpp -rob */ 20/* Work around cpp -rob */
20#define ALLOC #alloc 21#define ALLOC #alloc
@@ -119,6 +120,7 @@
119__copy_user_begin: 120__copy_user_begin:
120 121
121 .globl __copy_user 122 .globl __copy_user
123 EXPORT_SYMBOL(__copy_user)
122dword_align: 124dword_align:
123 andcc %o1, 1, %g0 125 andcc %o1, 1, %g0
124 be 4f 126 be 4f
diff --git a/arch/sparc/lib/csum_copy.S b/arch/sparc/lib/csum_copy.S
index e566c770a0f6..0ecbafc30fd0 100644
--- a/arch/sparc/lib/csum_copy.S
+++ b/arch/sparc/lib/csum_copy.S
@@ -3,6 +3,8 @@
3 * Copyright (C) 2005 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
4 */ 4 */
5 5
6#include <asm/export.h>
7
6#ifdef __KERNEL__ 8#ifdef __KERNEL__
7#define GLOBAL_SPARE %g7 9#define GLOBAL_SPARE %g7
8#else 10#else
@@ -63,6 +65,7 @@
63 add %o5, %o4, %o4 65 add %o5, %o4, %o4
64 66
65 .globl FUNC_NAME 67 .globl FUNC_NAME
68 EXPORT_SYMBOL(FUNC_NAME)
66FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */ 69FUNC_NAME: /* %o0=src, %o1=dst, %o2=len, %o3=sum */
67 LOAD(prefetch, %o0 + 0x000, #n_reads) 70 LOAD(prefetch, %o0 + 0x000, #n_reads)
68 xor %o0, %o1, %g1 71 xor %o0, %o1, %g1
diff --git a/arch/sparc/lib/divdi3.S b/arch/sparc/lib/divdi3.S
index 9614b48b6ef8..a2b5a976be33 100644
--- a/arch/sparc/lib/divdi3.S
+++ b/arch/sparc/lib/divdi3.S
@@ -17,6 +17,7 @@ along with GNU CC; see the file COPYING. If not, write to
17the Free Software Foundation, 59 Temple Place - Suite 330, 17the Free Software Foundation, 59 Temple Place - Suite 330,
18Boston, MA 02111-1307, USA. */ 18Boston, MA 02111-1307, USA. */
19 19
20#include <asm/export.h>
20 .text 21 .text
21 .align 4 22 .align 4
22 .globl __divdi3 23 .globl __divdi3
@@ -279,3 +280,4 @@ __divdi3:
279.LL81: 280.LL81:
280 ret 281 ret
281 restore 282 restore
283EXPORT_SYMBOL(__divdi3)
diff --git a/arch/sparc/lib/ffs.S b/arch/sparc/lib/ffs.S
index b39389f69899..23aab144d28e 100644
--- a/arch/sparc/lib/ffs.S
+++ b/arch/sparc/lib/ffs.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3 .register %g2,#scratch 4 .register %g2,#scratch
4 5
@@ -65,6 +66,8 @@ ENTRY(__ffs)
65 add %o2, %g1, %o0 66 add %o2, %g1, %o0
66ENDPROC(ffs) 67ENDPROC(ffs)
67ENDPROC(__ffs) 68ENDPROC(__ffs)
69EXPORT_SYMBOL(__ffs)
70EXPORT_SYMBOL(ffs)
68 71
69 .section .popc_6insn_patch, "ax" 72 .section .popc_6insn_patch, "ax"
70 .word ffs 73 .word ffs
diff --git a/arch/sparc/lib/hweight.S b/arch/sparc/lib/hweight.S
index 95414e0a6808..f9985f129fb6 100644
--- a/arch/sparc/lib/hweight.S
+++ b/arch/sparc/lib/hweight.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3 .text 4 .text
4 .align 32 5 .align 32
@@ -7,6 +8,7 @@ ENTRY(__arch_hweight8)
7 nop 8 nop
8 nop 9 nop
9ENDPROC(__arch_hweight8) 10ENDPROC(__arch_hweight8)
11EXPORT_SYMBOL(__arch_hweight8)
10 .section .popc_3insn_patch, "ax" 12 .section .popc_3insn_patch, "ax"
11 .word __arch_hweight8 13 .word __arch_hweight8
12 sllx %o0, 64-8, %g1 14 sllx %o0, 64-8, %g1
@@ -19,6 +21,7 @@ ENTRY(__arch_hweight16)
19 nop 21 nop
20 nop 22 nop
21ENDPROC(__arch_hweight16) 23ENDPROC(__arch_hweight16)
24EXPORT_SYMBOL(__arch_hweight16)
22 .section .popc_3insn_patch, "ax" 25 .section .popc_3insn_patch, "ax"
23 .word __arch_hweight16 26 .word __arch_hweight16
24 sllx %o0, 64-16, %g1 27 sllx %o0, 64-16, %g1
@@ -31,6 +34,7 @@ ENTRY(__arch_hweight32)
31 nop 34 nop
32 nop 35 nop
33ENDPROC(__arch_hweight32) 36ENDPROC(__arch_hweight32)
37EXPORT_SYMBOL(__arch_hweight32)
34 .section .popc_3insn_patch, "ax" 38 .section .popc_3insn_patch, "ax"
35 .word __arch_hweight32 39 .word __arch_hweight32
36 sllx %o0, 64-32, %g1 40 sllx %o0, 64-32, %g1
@@ -43,6 +47,7 @@ ENTRY(__arch_hweight64)
43 nop 47 nop
44 nop 48 nop
45ENDPROC(__arch_hweight64) 49ENDPROC(__arch_hweight64)
50EXPORT_SYMBOL(__arch_hweight64)
46 .section .popc_3insn_patch, "ax" 51 .section .popc_3insn_patch, "ax"
47 .word __arch_hweight64 52 .word __arch_hweight64
48 retl 53 retl
diff --git a/arch/sparc/lib/ipcsum.S b/arch/sparc/lib/ipcsum.S
index 4742d59029ee..5d61648b53dd 100644
--- a/arch/sparc/lib/ipcsum.S
+++ b/arch/sparc/lib/ipcsum.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3 .text 4 .text
4ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */ 5ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
@@ -31,3 +32,4 @@ ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
31 retl 32 retl
32 and %o2, %o1, %o0 33 and %o2, %o1, %o0
33ENDPROC(ip_fast_csum) 34ENDPROC(ip_fast_csum)
35EXPORT_SYMBOL(ip_fast_csum)
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
deleted file mode 100644
index de5e97817bdb..000000000000
--- a/arch/sparc/lib/ksyms.c
+++ /dev/null
@@ -1,174 +0,0 @@
1/*
2 * Export of symbols defined in assembler
3 */
4
5/* Tell string.h we don't want memcpy etc. as cpp defines */
6#define EXPORT_SYMTAB_STROPS
7
8#include <linux/module.h>
9#include <linux/string.h>
10#include <linux/types.h>
11
12#include <asm/checksum.h>
13#include <asm/uaccess.h>
14#include <asm/ftrace.h>
15
16/* string functions */
17EXPORT_SYMBOL(strlen);
18EXPORT_SYMBOL(strncmp);
19
20/* mem* functions */
21extern void *__memscan_zero(void *, size_t);
22extern void *__memscan_generic(void *, int, size_t);
23extern void *__bzero(void *, size_t);
24
25EXPORT_SYMBOL(memscan);
26EXPORT_SYMBOL(__memscan_zero);
27EXPORT_SYMBOL(__memscan_generic);
28EXPORT_SYMBOL(memcmp);
29EXPORT_SYMBOL(memcpy);
30EXPORT_SYMBOL(memset);
31EXPORT_SYMBOL(memmove);
32EXPORT_SYMBOL(__bzero);
33
34/* Networking helper routines. */
35EXPORT_SYMBOL(csum_partial);
36
37#ifdef CONFIG_MCOUNT
38EXPORT_SYMBOL(_mcount);
39#endif
40
41/*
42 * sparc
43 */
44#ifdef CONFIG_SPARC32
45extern int __ashrdi3(int, int);
46extern int __ashldi3(int, int);
47extern int __lshrdi3(int, int);
48extern int __muldi3(int, int);
49extern int __divdi3(int, int);
50
51extern void (*__copy_1page)(void *, const void *);
52extern void (*bzero_1page)(void *);
53
54extern void ___rw_read_enter(void);
55extern void ___rw_read_try(void);
56extern void ___rw_read_exit(void);
57extern void ___rw_write_enter(void);
58
59/* Networking helper routines. */
60EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
61
62/* Special internal versions of library functions. */
63EXPORT_SYMBOL(__copy_1page);
64EXPORT_SYMBOL(__memmove);
65EXPORT_SYMBOL(bzero_1page);
66
67/* Moving data to/from/in userspace. */
68EXPORT_SYMBOL(__copy_user);
69
70/* Used by asm/spinlock.h */
71#ifdef CONFIG_SMP
72EXPORT_SYMBOL(___rw_read_enter);
73EXPORT_SYMBOL(___rw_read_try);
74EXPORT_SYMBOL(___rw_read_exit);
75EXPORT_SYMBOL(___rw_write_enter);
76#endif
77
78EXPORT_SYMBOL(__ashrdi3);
79EXPORT_SYMBOL(__ashldi3);
80EXPORT_SYMBOL(__lshrdi3);
81EXPORT_SYMBOL(__muldi3);
82EXPORT_SYMBOL(__divdi3);
83#endif
84
85/*
86 * sparc64
87 */
88#ifdef CONFIG_SPARC64
89/* Networking helper routines. */
90EXPORT_SYMBOL(csum_partial_copy_nocheck);
91EXPORT_SYMBOL(__csum_partial_copy_from_user);
92EXPORT_SYMBOL(__csum_partial_copy_to_user);
93EXPORT_SYMBOL(ip_fast_csum);
94
95/* Moving data to/from/in userspace. */
96EXPORT_SYMBOL(___copy_to_user);
97EXPORT_SYMBOL(___copy_from_user);
98EXPORT_SYMBOL(___copy_in_user);
99EXPORT_SYMBOL(__clear_user);
100
101/* Atomic counter implementation. */
102#define ATOMIC_OP(op) \
103EXPORT_SYMBOL(atomic_##op); \
104EXPORT_SYMBOL(atomic64_##op);
105
106#define ATOMIC_OP_RETURN(op) \
107EXPORT_SYMBOL(atomic_##op##_return); \
108EXPORT_SYMBOL(atomic64_##op##_return);
109
110#define ATOMIC_FETCH_OP(op) \
111EXPORT_SYMBOL(atomic_fetch_##op); \
112EXPORT_SYMBOL(atomic64_fetch_##op);
113
114#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op) ATOMIC_FETCH_OP(op)
115
116ATOMIC_OPS(add)
117ATOMIC_OPS(sub)
118
119#undef ATOMIC_OPS
120#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_FETCH_OP(op)
121
122ATOMIC_OPS(and)
123ATOMIC_OPS(or)
124ATOMIC_OPS(xor)
125
126#undef ATOMIC_OPS
127#undef ATOMIC_FETCH_OP
128#undef ATOMIC_OP_RETURN
129#undef ATOMIC_OP
130
131EXPORT_SYMBOL(atomic64_dec_if_positive);
132
133/* Atomic bit operations. */
134EXPORT_SYMBOL(test_and_set_bit);
135EXPORT_SYMBOL(test_and_clear_bit);
136EXPORT_SYMBOL(test_and_change_bit);
137EXPORT_SYMBOL(set_bit);
138EXPORT_SYMBOL(clear_bit);
139EXPORT_SYMBOL(change_bit);
140
141/* Special internal versions of library functions. */
142EXPORT_SYMBOL(_clear_page);
143EXPORT_SYMBOL(clear_user_page);
144EXPORT_SYMBOL(copy_user_page);
145
146/* RAID code needs this */
147void VISenter(void);
148EXPORT_SYMBOL(VISenter);
149
150extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
151extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
152 unsigned long *);
153extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
154 unsigned long *, unsigned long *);
155extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
156 unsigned long *, unsigned long *, unsigned long *);
157EXPORT_SYMBOL(xor_vis_2);
158EXPORT_SYMBOL(xor_vis_3);
159EXPORT_SYMBOL(xor_vis_4);
160EXPORT_SYMBOL(xor_vis_5);
161
162extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
163extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
164 unsigned long *);
165extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
166 unsigned long *, unsigned long *);
167extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
168 unsigned long *, unsigned long *, unsigned long *);
169
170EXPORT_SYMBOL(xor_niagara_2);
171EXPORT_SYMBOL(xor_niagara_3);
172EXPORT_SYMBOL(xor_niagara_4);
173EXPORT_SYMBOL(xor_niagara_5);
174#endif
diff --git a/arch/sparc/lib/locks.S b/arch/sparc/lib/locks.S
index 64f53f2b673d..f38c4e59d078 100644
--- a/arch/sparc/lib/locks.S
+++ b/arch/sparc/lib/locks.S
@@ -10,6 +10,7 @@
10#include <asm/psr.h> 10#include <asm/psr.h>
11#include <asm/smp.h> 11#include <asm/smp.h>
12#include <asm/spinlock.h> 12#include <asm/spinlock.h>
13#include <asm/export.h>
13 14
14 .text 15 .text
15 .align 4 16 .align 4
@@ -48,6 +49,7 @@ ___rw_write_enter_spin_on_wlock:
48 ld [%g1], %g2 49 ld [%g1], %g2
49 50
50 .globl ___rw_read_enter 51 .globl ___rw_read_enter
52EXPORT_SYMBOL(___rw_read_enter)
51___rw_read_enter: 53___rw_read_enter:
52 orcc %g2, 0x0, %g0 54 orcc %g2, 0x0, %g0
53 bne,a ___rw_read_enter_spin_on_wlock 55 bne,a ___rw_read_enter_spin_on_wlock
@@ -59,6 +61,7 @@ ___rw_read_enter:
59 mov %g4, %o7 61 mov %g4, %o7
60 62
61 .globl ___rw_read_exit 63 .globl ___rw_read_exit
64EXPORT_SYMBOL(___rw_read_exit)
62___rw_read_exit: 65___rw_read_exit:
63 orcc %g2, 0x0, %g0 66 orcc %g2, 0x0, %g0
64 bne,a ___rw_read_exit_spin_on_wlock 67 bne,a ___rw_read_exit_spin_on_wlock
@@ -70,6 +73,7 @@ ___rw_read_exit:
70 mov %g4, %o7 73 mov %g4, %o7
71 74
72 .globl ___rw_read_try 75 .globl ___rw_read_try
76EXPORT_SYMBOL(___rw_read_try)
73___rw_read_try: 77___rw_read_try:
74 orcc %g2, 0x0, %g0 78 orcc %g2, 0x0, %g0
75 bne ___rw_read_try_spin_on_wlock 79 bne ___rw_read_try_spin_on_wlock
@@ -81,6 +85,7 @@ ___rw_read_try:
81 mov %g4, %o7 85 mov %g4, %o7
82 86
83 .globl ___rw_write_enter 87 .globl ___rw_write_enter
88EXPORT_SYMBOL(___rw_write_enter)
84___rw_write_enter: 89___rw_write_enter:
85 orcc %g2, 0x0, %g0 90 orcc %g2, 0x0, %g0
86 bne ___rw_write_enter_spin_on_wlock 91 bne ___rw_write_enter_spin_on_wlock
diff --git a/arch/sparc/lib/lshrdi3.S b/arch/sparc/lib/lshrdi3.S
index 60ebc7cdbee0..c9b9373f8d81 100644
--- a/arch/sparc/lib/lshrdi3.S
+++ b/arch/sparc/lib/lshrdi3.S
@@ -1,4 +1,5 @@
1#include <linux/linkage.h> 1#include <linux/linkage.h>
2#include <asm/export.h>
2 3
3ENTRY(__lshrdi3) 4ENTRY(__lshrdi3)
4 cmp %o2, 0 5 cmp %o2, 0
@@ -25,3 +26,4 @@ ENTRY(__lshrdi3)
25 retl 26 retl
26 nop 27 nop
27ENDPROC(__lshrdi3) 28ENDPROC(__lshrdi3)
29EXPORT_SYMBOL(__lshrdi3)
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S
index 0b0ed4d34219..194f383611c0 100644
--- a/arch/sparc/lib/mcount.S
+++ b/arch/sparc/lib/mcount.S
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/export.h>
9 10
10/* 11/*
11 * This is the main variant and is called by C code. GCC's -pg option 12 * This is the main variant and is called by C code. GCC's -pg option
@@ -16,6 +17,7 @@
16 .align 32 17 .align 32
17 .globl _mcount 18 .globl _mcount
18 .type _mcount,#function 19 .type _mcount,#function
20 EXPORT_SYMBOL(_mcount)
19 .globl mcount 21 .globl mcount
20 .type mcount,#function 22 .type mcount,#function
21_mcount: 23_mcount:
diff --git a/arch/sparc/lib/memcmp.S b/arch/sparc/lib/memcmp.S
index efa106c41ed0..cee7f30dbb61 100644
--- a/arch/sparc/lib/memcmp.S
+++ b/arch/sparc/lib/memcmp.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/asm.h> 8#include <asm/asm.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(memcmp) 12ENTRY(memcmp)
@@ -25,3 +26,4 @@ ENTRY(memcmp)
252: retl 262: retl
26 mov 0, %o0 27 mov 0, %o0
27ENDPROC(memcmp) 28ENDPROC(memcmp)
29EXPORT_SYMBOL(memcmp)
diff --git a/arch/sparc/lib/memcpy.S b/arch/sparc/lib/memcpy.S
index 4d8c497517bd..8913feaa7ac7 100644
--- a/arch/sparc/lib/memcpy.S
+++ b/arch/sparc/lib/memcpy.S
@@ -7,6 +7,7 @@
7 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 7 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
8 */ 8 */
9 9
10#include <asm/export.h>
10#define FUNC(x) \ 11#define FUNC(x) \
11 .globl x; \ 12 .globl x; \
12 .type x,@function; \ 13 .type x,@function; \
@@ -58,93 +59,11 @@ x:
58 stb %t0, [%dst - (offset) - 0x02]; \ 59 stb %t0, [%dst - (offset) - 0x02]; \
59 stb %t1, [%dst - (offset) - 0x01]; 60 stb %t1, [%dst - (offset) - 0x01];
60 61
61/* Both these macros have to start with exactly the same insn */
62#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
63 ldd [%src - (offset) - 0x20], %t0; \
64 ldd [%src - (offset) - 0x18], %t2; \
65 ldd [%src - (offset) - 0x10], %t4; \
66 ldd [%src - (offset) - 0x08], %t6; \
67 st %t0, [%dst - (offset) - 0x20]; \
68 st %t1, [%dst - (offset) - 0x1c]; \
69 st %t2, [%dst - (offset) - 0x18]; \
70 st %t3, [%dst - (offset) - 0x14]; \
71 st %t4, [%dst - (offset) - 0x10]; \
72 st %t5, [%dst - (offset) - 0x0c]; \
73 st %t6, [%dst - (offset) - 0x08]; \
74 st %t7, [%dst - (offset) - 0x04];
75
76#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
77 ldd [%src - (offset) - 0x20], %t0; \
78 ldd [%src - (offset) - 0x18], %t2; \
79 ldd [%src - (offset) - 0x10], %t4; \
80 ldd [%src - (offset) - 0x08], %t6; \
81 std %t0, [%dst - (offset) - 0x20]; \
82 std %t2, [%dst - (offset) - 0x18]; \
83 std %t4, [%dst - (offset) - 0x10]; \
84 std %t6, [%dst - (offset) - 0x08];
85
86#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
87 ldd [%src + (offset) + 0x00], %t0; \
88 ldd [%src + (offset) + 0x08], %t2; \
89 st %t0, [%dst + (offset) + 0x00]; \
90 st %t1, [%dst + (offset) + 0x04]; \
91 st %t2, [%dst + (offset) + 0x08]; \
92 st %t3, [%dst + (offset) + 0x0c];
93
94#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
95 ldub [%src + (offset) + 0x00], %t0; \
96 ldub [%src + (offset) + 0x01], %t1; \
97 stb %t0, [%dst + (offset) + 0x00]; \
98 stb %t1, [%dst + (offset) + 0x01];
99
100#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
101 ldd [%src + (offset) + 0x00], %t0; \
102 ldd [%src + (offset) + 0x08], %t2; \
103 srl %t0, shir, %t5; \
104 srl %t1, shir, %t6; \
105 sll %t0, shil, %t0; \
106 or %t5, %prev, %t5; \
107 sll %t1, shil, %prev; \
108 or %t6, %t0, %t0; \
109 srl %t2, shir, %t1; \
110 srl %t3, shir, %t6; \
111 sll %t2, shil, %t2; \
112 or %t1, %prev, %t1; \
113 std %t4, [%dst + (offset) + (offset2) - 0x04]; \
114 std %t0, [%dst + (offset) + (offset2) + 0x04]; \
115 sll %t3, shil, %prev; \
116 or %t6, %t2, %t4;
117
118#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
119 ldd [%src + (offset) + 0x00], %t0; \
120 ldd [%src + (offset) + 0x08], %t2; \
121 srl %t0, shir, %t4; \
122 srl %t1, shir, %t5; \
123 sll %t0, shil, %t6; \
124 or %t4, %prev, %t0; \
125 sll %t1, shil, %prev; \
126 or %t5, %t6, %t1; \
127 srl %t2, shir, %t4; \
128 srl %t3, shir, %t5; \
129 sll %t2, shil, %t6; \
130 or %t4, %prev, %t2; \
131 sll %t3, shil, %prev; \
132 or %t5, %t6, %t3; \
133 std %t0, [%dst + (offset) + (offset2) + 0x00]; \
134 std %t2, [%dst + (offset) + (offset2) + 0x08];
135
136 .text 62 .text
137 .align 4 63 .align 4
138 64
1390:
140 retl
141 nop ! Only bcopy returns here and it retuns void...
142
143#ifdef __KERNEL__
144FUNC(amemmove)
145FUNC(__memmove)
146#endif
147FUNC(memmove) 65FUNC(memmove)
66EXPORT_SYMBOL(memmove)
148 cmp %o0, %o1 67 cmp %o0, %o1
149 mov %o0, %g7 68 mov %o0, %g7
150 bleu 9f 69 bleu 9f
@@ -202,6 +121,7 @@ FUNC(memmove)
202 add %o0, 2, %o0 121 add %o0, 2, %o0
203 122
204FUNC(memcpy) /* %o0=dst %o1=src %o2=len */ 123FUNC(memcpy) /* %o0=dst %o1=src %o2=len */
124EXPORT_SYMBOL(memcpy)
205 125
206 sub %o0, %o1, %o4 126 sub %o0, %o1, %o4
207 mov %o0, %g7 127 mov %o0, %g7
diff --git a/arch/sparc/lib/memmove.S b/arch/sparc/lib/memmove.S
index 857ad4f8905f..012cdb6ca467 100644
--- a/arch/sparc/lib/memmove.S
+++ b/arch/sparc/lib/memmove.S
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/export.h>
8 9
9 .text 10 .text
10ENTRY(memmove) /* o0=dst o1=src o2=len */ 11ENTRY(memmove) /* o0=dst o1=src o2=len */
@@ -57,3 +58,4 @@ ENTRY(memmove) /* o0=dst o1=src o2=len */
57 stb %g7, [%o0 - 0x1] 58 stb %g7, [%o0 - 0x1]
58 ba,a,pt %xcc, 99b 59 ba,a,pt %xcc, 99b
59ENDPROC(memmove) 60ENDPROC(memmove)
61EXPORT_SYMBOL(memmove)
diff --git a/arch/sparc/lib/memscan_32.S b/arch/sparc/lib/memscan_32.S
index 4ff1657dfc24..51ce690c42a8 100644
--- a/arch/sparc/lib/memscan_32.S
+++ b/arch/sparc/lib/memscan_32.S
@@ -4,6 +4,8 @@
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <asm/export.h>
8
7/* In essence, this is just a fancy strlen. */ 9/* In essence, this is just a fancy strlen. */
8 10
9#define LO_MAGIC 0x01010101 11#define LO_MAGIC 0x01010101
@@ -13,6 +15,8 @@
13 .align 4 15 .align 4
14 .globl __memscan_zero, __memscan_generic 16 .globl __memscan_zero, __memscan_generic
15 .globl memscan 17 .globl memscan
18EXPORT_SYMBOL(__memscan_zero)
19EXPORT_SYMBOL(__memscan_generic)
16__memscan_zero: 20__memscan_zero:
17 /* %o0 = addr, %o1 = size */ 21 /* %o0 = addr, %o1 = size */
18 cmp %o1, 0 22 cmp %o1, 0
diff --git a/arch/sparc/lib/memscan_64.S b/arch/sparc/lib/memscan_64.S
index 5686dfa5dc15..daa96f4b03e6 100644
--- a/arch/sparc/lib/memscan_64.S
+++ b/arch/sparc/lib/memscan_64.S
@@ -5,6 +5,8 @@
5 * Copyright (C) 1998 David S. Miller (davem@redhat.com) 5 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
6 */ 6 */
7 7
8 #include <asm/export.h>
9
8#define HI_MAGIC 0x8080808080808080 10#define HI_MAGIC 0x8080808080808080
9#define LO_MAGIC 0x0101010101010101 11#define LO_MAGIC 0x0101010101010101
10#define ASI_PL 0x88 12#define ASI_PL 0x88
@@ -13,6 +15,8 @@
13 .align 32 15 .align 32
14 .globl __memscan_zero, __memscan_generic 16 .globl __memscan_zero, __memscan_generic
15 .globl memscan 17 .globl memscan
18 EXPORT_SYMBOL(__memscan_zero)
19 EXPORT_SYMBOL(__memscan_generic)
16 20
17__memscan_zero: 21__memscan_zero:
18 /* %o0 = bufp, %o1 = size */ 22 /* %o0 = bufp, %o1 = size */
diff --git a/arch/sparc/lib/memset.S b/arch/sparc/lib/memset.S
index f75e6906df14..bb539b42b088 100644
--- a/arch/sparc/lib/memset.S
+++ b/arch/sparc/lib/memset.S
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <asm/ptrace.h> 11#include <asm/ptrace.h>
12#include <asm/export.h>
12 13
13/* Work around cpp -rob */ 14/* Work around cpp -rob */
14#define ALLOC #alloc 15#define ALLOC #alloc
@@ -63,6 +64,8 @@ __bzero_begin:
63 64
64 .globl __bzero 65 .globl __bzero
65 .globl memset 66 .globl memset
67 EXPORT_SYMBOL(__bzero)
68 EXPORT_SYMBOL(memset)
66 .globl __memset_start, __memset_end 69 .globl __memset_start, __memset_end
67__memset_start: 70__memset_start:
68memset: 71memset:
diff --git a/arch/sparc/lib/muldi3.S b/arch/sparc/lib/muldi3.S
index 9794939d1c12..17a0f49aef3c 100644
--- a/arch/sparc/lib/muldi3.S
+++ b/arch/sparc/lib/muldi3.S
@@ -17,6 +17,7 @@ along with GNU CC; see the file COPYING. If not, write to
17the Free Software Foundation, 59 Temple Place - Suite 330, 17the Free Software Foundation, 59 Temple Place - Suite 330,
18Boston, MA 02111-1307, USA. */ 18Boston, MA 02111-1307, USA. */
19 19
20#include <asm/export.h>
20 .text 21 .text
21 .align 4 22 .align 4
22 .globl __muldi3 23 .globl __muldi3
@@ -74,3 +75,4 @@ __muldi3:
74 add %l2, %l0, %i0 75 add %l2, %l0, %i0
75 ret 76 ret
76 restore %g0, %l3, %o1 77 restore %g0, %l3, %o1
78EXPORT_SYMBOL(__muldi3)
diff --git a/arch/sparc/lib/strlen.S b/arch/sparc/lib/strlen.S
index 536f83507fbf..ca0e7077e871 100644
--- a/arch/sparc/lib/strlen.S
+++ b/arch/sparc/lib/strlen.S
@@ -7,6 +7,7 @@
7 7
8#include <linux/linkage.h> 8#include <linux/linkage.h>
9#include <asm/asm.h> 9#include <asm/asm.h>
10#include <asm/export.h>
10 11
11#define LO_MAGIC 0x01010101 12#define LO_MAGIC 0x01010101
12#define HI_MAGIC 0x80808080 13#define HI_MAGIC 0x80808080
@@ -78,3 +79,4 @@ ENTRY(strlen)
78 retl 79 retl
79 mov 2, %o0 80 mov 2, %o0
80ENDPROC(strlen) 81ENDPROC(strlen)
82EXPORT_SYMBOL(strlen)
diff --git a/arch/sparc/lib/strncmp_32.S b/arch/sparc/lib/strncmp_32.S
index c0d1b568c1c5..e3fe014813af 100644
--- a/arch/sparc/lib/strncmp_32.S
+++ b/arch/sparc/lib/strncmp_32.S
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/linkage.h> 6#include <linux/linkage.h>
7#include <asm/export.h>
7 8
8 .text 9 .text
9ENTRY(strncmp) 10ENTRY(strncmp)
@@ -116,3 +117,4 @@ ENTRY(strncmp)
116 retl 117 retl
117 sub %o3, %o0, %o0 118 sub %o3, %o0, %o0
118ENDPROC(strncmp) 119ENDPROC(strncmp)
120EXPORT_SYMBOL(strncmp)
diff --git a/arch/sparc/lib/strncmp_64.S b/arch/sparc/lib/strncmp_64.S
index 0656627166f3..efb5f884330d 100644
--- a/arch/sparc/lib/strncmp_64.S
+++ b/arch/sparc/lib/strncmp_64.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/asi.h> 8#include <asm/asi.h>
9#include <asm/export.h>
9 10
10 .text 11 .text
11ENTRY(strncmp) 12ENTRY(strncmp)
@@ -28,3 +29,4 @@ ENTRY(strncmp)
28 retl 29 retl
29 clr %o0 30 clr %o0
30ENDPROC(strncmp) 31ENDPROC(strncmp)
32EXPORT_SYMBOL(strncmp)
diff --git a/arch/sparc/lib/xor.S b/arch/sparc/lib/xor.S
index 2c05641c3263..45a49cb618b5 100644
--- a/arch/sparc/lib/xor.S
+++ b/arch/sparc/lib/xor.S
@@ -13,6 +13,7 @@
13#include <asm/asi.h> 13#include <asm/asi.h>
14#include <asm/dcu.h> 14#include <asm/dcu.h>
15#include <asm/spitfire.h> 15#include <asm/spitfire.h>
16#include <asm/export.h>
16 17
17/* 18/*
18 * Requirements: 19 * Requirements:
@@ -90,6 +91,7 @@ ENTRY(xor_vis_2)
90 retl 91 retl
91 wr %g0, 0, %fprs 92 wr %g0, 0, %fprs
92ENDPROC(xor_vis_2) 93ENDPROC(xor_vis_2)
94EXPORT_SYMBOL(xor_vis_2)
93 95
94ENTRY(xor_vis_3) 96ENTRY(xor_vis_3)
95 rd %fprs, %o5 97 rd %fprs, %o5
@@ -156,6 +158,7 @@ ENTRY(xor_vis_3)
156 retl 158 retl
157 wr %g0, 0, %fprs 159 wr %g0, 0, %fprs
158ENDPROC(xor_vis_3) 160ENDPROC(xor_vis_3)
161EXPORT_SYMBOL(xor_vis_3)
159 162
160ENTRY(xor_vis_4) 163ENTRY(xor_vis_4)
161 rd %fprs, %o5 164 rd %fprs, %o5
@@ -241,6 +244,7 @@ ENTRY(xor_vis_4)
241 retl 244 retl
242 wr %g0, 0, %fprs 245 wr %g0, 0, %fprs
243ENDPROC(xor_vis_4) 246ENDPROC(xor_vis_4)
247EXPORT_SYMBOL(xor_vis_4)
244 248
245ENTRY(xor_vis_5) 249ENTRY(xor_vis_5)
246 save %sp, -192, %sp 250 save %sp, -192, %sp
@@ -347,6 +351,7 @@ ENTRY(xor_vis_5)
347 ret 351 ret
348 restore 352 restore
349ENDPROC(xor_vis_5) 353ENDPROC(xor_vis_5)
354EXPORT_SYMBOL(xor_vis_5)
350 355
351 /* Niagara versions. */ 356 /* Niagara versions. */
352ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */ 357ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
@@ -393,6 +398,7 @@ ENTRY(xor_niagara_2) /* %o0=bytes, %o1=dest, %o2=src */
393 ret 398 ret
394 restore 399 restore
395ENDPROC(xor_niagara_2) 400ENDPROC(xor_niagara_2)
401EXPORT_SYMBOL(xor_niagara_2)
396 402
397ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */ 403ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
398 save %sp, -192, %sp 404 save %sp, -192, %sp
@@ -454,6 +460,7 @@ ENTRY(xor_niagara_3) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2 */
454 ret 460 ret
455 restore 461 restore
456ENDPROC(xor_niagara_3) 462ENDPROC(xor_niagara_3)
463EXPORT_SYMBOL(xor_niagara_3)
457 464
458ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */ 465ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
459 save %sp, -192, %sp 466 save %sp, -192, %sp
@@ -536,6 +543,7 @@ ENTRY(xor_niagara_4) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3 */
536 ret 543 ret
537 restore 544 restore
538ENDPROC(xor_niagara_4) 545ENDPROC(xor_niagara_4)
546EXPORT_SYMBOL(xor_niagara_4)
539 547
540ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */ 548ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=src4 */
541 save %sp, -192, %sp 549 save %sp, -192, %sp
@@ -634,3 +642,4 @@ ENTRY(xor_niagara_5) /* %o0=bytes, %o1=dest, %o2=src1, %o3=src2, %o4=src3, %o5=s
634 ret 642 ret
635 restore 643 restore
636ENDPROC(xor_niagara_5) 644ENDPROC(xor_niagara_5)
645EXPORT_SYMBOL(xor_niagara_5)