Skip to content

Commit 277c8cb

Browse files
mips-hptsbogend
authored andcommitted
MIPS: fix local_{add,sub}_return on MIPS64
Use "daddu/dsubu" for long int on MIPS64 instead of "addu/subu" Fixes: 7232311 ("local_t: mips extension") Signed-off-by: Huang Pei <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 6bcfdc4 commit 277c8cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/mips/include/asm/local.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <linux/percpu.h>
66
#include <linux/bitops.h>
77
#include <linux/atomic.h>
8+
#include <asm/asm.h>
89
#include <asm/cmpxchg.h>
910
#include <asm/compiler.h>
1011
#include <asm/war.h>
@@ -39,7 +40,7 @@ static __inline__ long local_add_return(long i, local_t * l)
3940
" .set arch=r4000 \n"
4041
__SYNC(full, loongson3_war) " \n"
4142
"1:" __LL "%1, %2 # local_add_return \n"
42-
" addu %0, %1, %3 \n"
43+
__stringify(LONG_ADDU) " %0, %1, %3 \n"
4344
__SC "%0, %2 \n"
4445
" beqzl %0, 1b \n"
4546
" addu %0, %1, %3 \n"
@@ -55,7 +56,7 @@ static __inline__ long local_add_return(long i, local_t * l)
5556
" .set "MIPS_ISA_ARCH_LEVEL" \n"
5657
__SYNC(full, loongson3_war) " \n"
5758
"1:" __LL "%1, %2 # local_add_return \n"
58-
" addu %0, %1, %3 \n"
59+
__stringify(LONG_ADDU) " %0, %1, %3 \n"
5960
__SC "%0, %2 \n"
6061
" beqz %0, 1b \n"
6162
" addu %0, %1, %3 \n"
@@ -88,7 +89,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
8889
" .set arch=r4000 \n"
8990
__SYNC(full, loongson3_war) " \n"
9091
"1:" __LL "%1, %2 # local_sub_return \n"
91-
" subu %0, %1, %3 \n"
92+
__stringify(LONG_SUBU) " %0, %1, %3 \n"
9293
__SC "%0, %2 \n"
9394
" beqzl %0, 1b \n"
9495
" subu %0, %1, %3 \n"
@@ -104,7 +105,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
104105
" .set "MIPS_ISA_ARCH_LEVEL" \n"
105106
__SYNC(full, loongson3_war) " \n"
106107
"1:" __LL "%1, %2 # local_sub_return \n"
107-
" subu %0, %1, %3 \n"
108+
__stringify(LONG_SUBU) " %0, %1, %3 \n"
108109
__SC "%0, %2 \n"
109110
" beqz %0, 1b \n"
110111
" subu %0, %1, %3 \n"

0 commit comments

Comments
 (0)