aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/include/asm/cmpxchg_32.h25
-rw-r--r--arch/sparc/kernel/sparc_ksyms_32.c4
-rw-r--r--arch/sparc/kernel/time_32.c3
-rw-r--r--arch/sparc/lib/Makefile2
-rw-r--r--arch/sparc/lib/atomic_32.S24
-rw-r--r--arch/sparc/mm/srmmu.c5
6 files changed, 2 insertions, 61 deletions
diff --git a/arch/sparc/include/asm/cmpxchg_32.h b/arch/sparc/include/asm/cmpxchg_32.h
index c786b0a92b51..78ac549f7355 100644
--- a/arch/sparc/include/asm/cmpxchg_32.h
+++ b/arch/sparc/include/asm/cmpxchg_32.h
@@ -13,38 +13,13 @@
13 13
14#include <asm/btfixup.h> 14#include <asm/btfixup.h>
15 15
16/* This has special calling conventions */
17#ifndef CONFIG_SMP
18BTFIXUPDEF_CALL(void, ___xchg32, void)
19#endif
20
21static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val) 16static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val)
22{ 17{
23#ifdef CONFIG_SMP
24 __asm__ __volatile__("swap [%2], %0" 18 __asm__ __volatile__("swap [%2], %0"
25 : "=&r" (val) 19 : "=&r" (val)
26 : "0" (val), "r" (m) 20 : "0" (val), "r" (m)
27 : "memory"); 21 : "memory");
28 return val; 22 return val;
29#else
30 register unsigned long *ptr asm("g1");
31 register unsigned long ret asm("g2");
32
33 ptr = (unsigned long *) m;
34 ret = val;
35
36 /* Note: this is magic and the nop there is
37 really needed. */
38 __asm__ __volatile__(
39 "mov %%o7, %%g4\n\t"
40 "call ___f____xchg32\n\t"
41 " nop\n\t"
42 : "=&r" (ret)
43 : "0" (ret), "r" (ptr)
44 : "g3", "g4", "g7", "memory", "cc");
45
46 return ret;
47#endif
48} 23}
49 24
50extern void __xchg_called_with_bad_pointer(void); 25extern void __xchg_called_with_bad_pointer(void);
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
index fd38a920992d..9763895b22b2 100644
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ b/arch/sparc/kernel/sparc_ksyms_32.c
@@ -29,9 +29,7 @@ EXPORT_SYMBOL(__ret_efault);
29EXPORT_SYMBOL(empty_zero_page); 29EXPORT_SYMBOL(empty_zero_page);
30 30
31/* Defined using magic */ 31/* Defined using magic */
32#ifndef CONFIG_SMP 32#ifdef CONFIG_SMP
33EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
34#else
35EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id)); 33EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id));
36#endif 34#endif
37EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea)); 35EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea));
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 157dcc58a216..1e25a7ab1ea5 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -68,7 +68,6 @@ static int set_rtc_mmss(unsigned long);
68unsigned long profile_pc(struct pt_regs *regs) 68unsigned long profile_pc(struct pt_regs *regs)
69{ 69{
70 extern char __copy_user_begin[], __copy_user_end[]; 70 extern char __copy_user_begin[], __copy_user_end[];
71 extern char __atomic_begin[], __atomic_end[];
72 extern char __bzero_begin[], __bzero_end[]; 71 extern char __bzero_begin[], __bzero_end[];
73 72
74 unsigned long pc = regs->pc; 73 unsigned long pc = regs->pc;
@@ -76,8 +75,6 @@ unsigned long profile_pc(struct pt_regs *regs)
76 if (in_lock_functions(pc) || 75 if (in_lock_functions(pc) ||
77 (pc >= (unsigned long) __copy_user_begin && 76 (pc >= (unsigned long) __copy_user_begin &&
78 pc < (unsigned long) __copy_user_end) || 77 pc < (unsigned long) __copy_user_end) ||
79 (pc >= (unsigned long) __atomic_begin &&
80 pc < (unsigned long) __atomic_end) ||
81 (pc >= (unsigned long) __bzero_begin && 78 (pc >= (unsigned long) __bzero_begin &&
82 pc < (unsigned long) __bzero_end)) 79 pc < (unsigned long) __bzero_end))
83 pc = regs->u_regs[UREG_RETPC]; 80 pc = regs->u_regs[UREG_RETPC];
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index a3fc4375a150..33d8d85ad594 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -13,7 +13,7 @@ lib-y += memscan_$(BITS).o memcmp.o strncmp_$(BITS).o
13lib-y += strncpy_from_user_$(BITS).o strlen_user_$(BITS).o 13lib-y += strncpy_from_user_$(BITS).o strlen_user_$(BITS).o
14lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o 14lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o
15lib-$(CONFIG_SPARC32) += copy_user.o locks.o 15lib-$(CONFIG_SPARC32) += copy_user.o locks.o
16lib-y += atomic_$(BITS).o 16lib-$(CONFIG_SPARC64) += atomic_64.o
17lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o 17lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o
18lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o 18lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o
19 19
diff --git a/arch/sparc/lib/atomic_32.S b/arch/sparc/lib/atomic_32.S
deleted file mode 100644
index e2a9085bd5be..000000000000
--- a/arch/sparc/lib/atomic_32.S
+++ /dev/null
@@ -1,24 +0,0 @@
1/* atomic.S: Move this stuff here for better ICACHE hit rates.
2 *
3 * Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
4 */
5
6#include <asm/ptrace.h>
7#include <asm/psr.h>
8
9 .text
10 .align 4
11
12 .globl __atomic_begin
13__atomic_begin:
14
15#ifndef CONFIG_SMP
16 .globl ___xchg32_sun4md
17___xchg32_sun4md:
18 swap [%g1], %g2
19 jmpl %o7 + 8, %g0
20 mov %g4, %o7
21#endif
22
23 .globl __atomic_end
24__atomic_end:
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 0a47b820cfa1..6efcb6b1ea18 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1980,13 +1980,8 @@ void __init load_mmu(void)
1980{ 1980{
1981 extern void ld_mmu_iommu(void); 1981 extern void ld_mmu_iommu(void);
1982 extern void ld_mmu_iounit(void); 1982 extern void ld_mmu_iounit(void);
1983 extern void ___xchg32_sun4md(void);
1984 1983
1985 /* Functions */ 1984 /* Functions */
1986#ifndef CONFIG_SMP
1987 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2);
1988#endif
1989
1990 BTFIXUPSET_CALL(update_mmu_cache, srmmu_update_mmu_cache, BTFIXUPCALL_NOP); 1985 BTFIXUPSET_CALL(update_mmu_cache, srmmu_update_mmu_cache, BTFIXUPCALL_NOP);
1991 1986
1992 get_srmmu_type(); 1987 get_srmmu_type();