aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2010-01-08 17:43:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-11 12:34:10 -0500
commitd6bb7a1ad326f56f0793353c59348554f84b513c (patch)
tree803f006ee2cd924f73b6b4c92b040f9f1db95834 /arch/mn10300
parentb0641e86fbc722906e323b2c2a069e65f44ff484 (diff)
mn10300: add cc clobbers to asm statements
gcc 4.2.1 for MN10300 is more agressive than the older gcc in reordering/moving other insns between an insn that sets flags and an insn that uses those flags. This leads to trouble with asm statements which are missing an explicit "cc" clobber. This patch adds the explicit "cc" clobber to asm statements which do indeed clobber the condition flags. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mn10300')
-rw-r--r--arch/mn10300/include/asm/bitops.h4
-rw-r--r--arch/mn10300/include/asm/div64.h2
-rw-r--r--arch/mn10300/include/asm/system.h1
-rw-r--r--arch/mn10300/include/asm/tlbflush.h2
-rw-r--r--arch/mn10300/include/asm/uaccess.h4
-rw-r--r--arch/mn10300/kernel/mn10300-serial.c3
-rw-r--r--arch/mn10300/lib/checksum.c1
-rw-r--r--arch/mn10300/lib/delay.c3
-rw-r--r--arch/mn10300/lib/usercopy.c6
-rw-r--r--arch/mn10300/mm/misalignment.c4
10 files changed, 18 insertions, 12 deletions
diff --git a/arch/mn10300/include/asm/bitops.h b/arch/mn10300/include/asm/bitops.h
index 0b610f482abb..f49ac49e09ad 100644
--- a/arch/mn10300/include/asm/bitops.h
+++ b/arch/mn10300/include/asm/bitops.h
@@ -165,7 +165,7 @@ static inline __attribute__((const))
165unsigned long __ffs(unsigned long x) 165unsigned long __ffs(unsigned long x)
166{ 166{
167 int bit; 167 int bit;
168 asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(x & -x)); 168 asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(x & -x) : "cc");
169 return bit; 169 return bit;
170} 170}
171 171
@@ -177,7 +177,7 @@ static inline __attribute__((const))
177int __ilog2_u32(u32 n) 177int __ilog2_u32(u32 n)
178{ 178{
179 int bit; 179 int bit;
180 asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(n)); 180 asm("bsch %2,%0" : "=r"(bit) : "0"(0), "r"(n) : "cc");
181 return bit; 181 return bit;
182} 182}
183 183
diff --git a/arch/mn10300/include/asm/div64.h b/arch/mn10300/include/asm/div64.h
index 3a8329b3e869..34dcb8e68309 100644
--- a/arch/mn10300/include/asm/div64.h
+++ b/arch/mn10300/include/asm/div64.h
@@ -72,6 +72,7 @@ unsigned __muldiv64u(unsigned val, unsigned mult, unsigned div)
72 * MDR = MDR:val%div */ 72 * MDR = MDR:val%div */
73 : "=r"(result) 73 : "=r"(result)
74 : "0"(val), "ir"(mult), "r"(div) 74 : "0"(val), "ir"(mult), "r"(div)
75 : "cc"
75 ); 76 );
76 77
77 return result; 78 return result;
@@ -92,6 +93,7 @@ signed __muldiv64s(signed val, signed mult, signed div)
92 * MDR = MDR:val%div */ 93 * MDR = MDR:val%div */
93 : "=r"(result) 94 : "=r"(result)
94 : "0"(val), "ir"(mult), "r"(div) 95 : "0"(val), "ir"(mult), "r"(div)
96 : "cc"
95 ); 97 );
96 98
97 return result; 99 return result;
diff --git a/arch/mn10300/include/asm/system.h b/arch/mn10300/include/asm/system.h
index 8214fb7e7fe4..3636c054dcd5 100644
--- a/arch/mn10300/include/asm/system.h
+++ b/arch/mn10300/include/asm/system.h
@@ -143,6 +143,7 @@ do { \
143 " mov %0,epsw \n" \ 143 " mov %0,epsw \n" \
144 : "=&d"(tmp) \ 144 : "=&d"(tmp) \
145 : "i"(~EPSW_IM), "r"(__mn10300_irq_enabled_epsw) \ 145 : "i"(~EPSW_IM), "r"(__mn10300_irq_enabled_epsw) \
146 : "cc" \
146 ); \ 147 ); \
147} while (0) 148} while (0)
148 149
diff --git a/arch/mn10300/include/asm/tlbflush.h b/arch/mn10300/include/asm/tlbflush.h
index e0239865abcb..1a7e29281c5d 100644
--- a/arch/mn10300/include/asm/tlbflush.h
+++ b/arch/mn10300/include/asm/tlbflush.h
@@ -22,7 +22,7 @@ do { \
22 " mov %0,%1 \n" \ 22 " mov %0,%1 \n" \
23 : "=d"(w) \ 23 : "=d"(w) \
24 : "m"(MMUCTR), "i"(MMUCTR_IIV|MMUCTR_DIV) \ 24 : "m"(MMUCTR), "i"(MMUCTR_IIV|MMUCTR_DIV) \
25 : "memory" \ 25 : "cc", "memory" \
26 ); \ 26 ); \
27} while (0) 27} while (0)
28 28
diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h
index 167e10ff06d9..197a7af3dd8a 100644
--- a/arch/mn10300/include/asm/uaccess.h
+++ b/arch/mn10300/include/asm/uaccess.h
@@ -316,7 +316,7 @@ do { \
316 " .previous\n" \ 316 " .previous\n" \
317 : "=a"(__from), "=a"(__to), "=r"(size), "=&r"(w)\ 317 : "=a"(__from), "=a"(__to), "=r"(size), "=&r"(w)\
318 : "0"(__from), "1"(__to), "2"(size) \ 318 : "0"(__from), "1"(__to), "2"(size) \
319 : "memory"); \ 319 : "cc", "memory"); \
320 } \ 320 } \
321} while (0) 321} while (0)
322 322
@@ -352,7 +352,7 @@ do { \
352 " .previous\n" \ 352 " .previous\n" \
353 : "=a"(__from), "=a"(__to), "=r"(size), "=&r"(w)\ 353 : "=a"(__from), "=a"(__to), "=r"(size), "=&r"(w)\
354 : "0"(__from), "1"(__to), "2"(size) \ 354 : "0"(__from), "1"(__to), "2"(size) \
355 : "memory"); \ 355 : "cc", "memory"); \
356 } \ 356 } \
357} while (0) 357} while (0)
358 358
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c
index 229b710fc5d5..ef34d5a0f8bd 100644
--- a/arch/mn10300/kernel/mn10300-serial.c
+++ b/arch/mn10300/kernel/mn10300-serial.c
@@ -380,7 +380,8 @@ static int mask_test_and_clear(volatile u8 *ptr, u8 mask)
380 u32 epsw; 380 u32 epsw;
381 asm volatile(" bclr %1,(%2) \n" 381 asm volatile(" bclr %1,(%2) \n"
382 " mov epsw,%0 \n" 382 " mov epsw,%0 \n"
383 : "=d"(epsw) : "d"(mask), "a"(ptr)); 383 : "=d"(epsw) : "d"(mask), "a"(ptr)
384 : "cc", "memory");
384 return !(epsw & EPSW_FLAG_Z); 385 return !(epsw & EPSW_FLAG_Z);
385} 386}
386 387
diff --git a/arch/mn10300/lib/checksum.c b/arch/mn10300/lib/checksum.c
index 274f29ec33c1..b6580f5d89ee 100644
--- a/arch/mn10300/lib/checksum.c
+++ b/arch/mn10300/lib/checksum.c
@@ -22,6 +22,7 @@ static inline unsigned short from32to16(__wsum sum)
22 " addc 0xffff,%0 \n" 22 " addc 0xffff,%0 \n"
23 : "=r" (sum) 23 : "=r" (sum)
24 : "r" (sum << 16), "0" (sum & 0xffff0000) 24 : "r" (sum << 16), "0" (sum & 0xffff0000)
25 : "cc"
25 ); 26 );
26 return sum >> 16; 27 return sum >> 16;
27} 28}
diff --git a/arch/mn10300/lib/delay.c b/arch/mn10300/lib/delay.c
index cce66bc0822d..fdf6f710f94e 100644
--- a/arch/mn10300/lib/delay.c
+++ b/arch/mn10300/lib/delay.c
@@ -28,7 +28,8 @@ void __delay(unsigned long loops)
28 "2: add -1,%0 \n" 28 "2: add -1,%0 \n"
29 " bne 2b \n" 29 " bne 2b \n"
30 : "=&d" (d0) 30 : "=&d" (d0)
31 : "0" (loops)); 31 : "0" (loops)
32 : "cc");
32} 33}
33EXPORT_SYMBOL(__delay); 34EXPORT_SYMBOL(__delay);
34 35
diff --git a/arch/mn10300/lib/usercopy.c b/arch/mn10300/lib/usercopy.c
index a75b203059c1..7826e6c364e7 100644
--- a/arch/mn10300/lib/usercopy.c
+++ b/arch/mn10300/lib/usercopy.c
@@ -62,7 +62,7 @@ do { \
62 " .previous" \ 62 " .previous" \
63 :"=&r"(res), "=r"(count), "=&r"(w) \ 63 :"=&r"(res), "=r"(count), "=&r"(w) \
64 :"i"(-EFAULT), "1"(count), "a"(src), "a"(dst) \ 64 :"i"(-EFAULT), "1"(count), "a"(src), "a"(dst) \
65 :"memory"); \ 65 : "memory", "cc"); \
66} while (0) 66} while (0)
67 67
68long 68long
@@ -109,7 +109,7 @@ do { \
109 ".previous\n" \ 109 ".previous\n" \
110 : "+r"(size), "=&r"(w) \ 110 : "+r"(size), "=&r"(w) \
111 : "a"(addr), "d"(0) \ 111 : "a"(addr), "d"(0) \
112 : "memory"); \ 112 : "memory", "cc"); \
113} while (0) 113} while (0)
114 114
115unsigned long 115unsigned long
@@ -161,6 +161,6 @@ long strnlen_user(const char *s, long n)
161 ".previous\n" 161 ".previous\n"
162 :"=d"(res), "=&r"(w) 162 :"=d"(res), "=&r"(w)
163 :"0"(0), "a"(s), "r"(n) 163 :"0"(0), "a"(s), "r"(n)
164 :"memory"); 164 : "memory", "cc");
165 return res; 165 return res;
166} 166}
diff --git a/arch/mn10300/mm/misalignment.c b/arch/mn10300/mm/misalignment.c
index 30016251f658..6dffbf97ac26 100644
--- a/arch/mn10300/mm/misalignment.c
+++ b/arch/mn10300/mm/misalignment.c
@@ -633,13 +633,13 @@ static int misalignment_addr(unsigned long *registers, unsigned long sp,
633 goto displace_or_inc; 633 goto displace_or_inc;
634 case SD24: 634 case SD24:
635 tmp = disp << 8; 635 tmp = disp << 8;
636 asm("asr 8,%0" : "=r"(tmp) : "0"(tmp)); 636 asm("asr 8,%0" : "=r"(tmp) : "0"(tmp) : "cc");
637 disp = (long) tmp; 637 disp = (long) tmp;
638 goto displace_or_inc; 638 goto displace_or_inc;
639 case SIMM4_2: 639 case SIMM4_2:
640 tmp = opcode >> 4 & 0x0f; 640 tmp = opcode >> 4 & 0x0f;
641 tmp <<= 28; 641 tmp <<= 28;
642 asm("asr 28,%0" : "=r"(tmp) : "0"(tmp)); 642 asm("asr 28,%0" : "=r"(tmp) : "0"(tmp) : "cc");
643 disp = (long) tmp; 643 disp = (long) tmp;
644 goto displace_or_inc; 644 goto displace_or_inc;
645 case IMM8: 645 case IMM8: