Commit efc3624c authored by Paul Mackerras's avatar Paul Mackerras

powerpc: Tell gcc when we clobber the carry in inline asm

We have several instances of inline assembly code that use the addic
or addic. instructions, but don't include XER in the list of clobbers.
The addic and addic. instructions affect the carry bit, which is in
the XER register.

This adds "xer" to the list of clobbers for those inline asm
statements that use addic or addic. and didn't already have it.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent d5e54913
...@@ -111,7 +111,7 @@ static __inline__ void atomic_inc(atomic_t *v) ...@@ -111,7 +111,7 @@ static __inline__ void atomic_inc(atomic_t *v)
bne- 1b" bne- 1b"
: "=&r" (t), "+m" (v->counter) : "=&r" (t), "+m" (v->counter)
: "r" (&v->counter) : "r" (&v->counter)
: "cc"); : "cc", "xer");
} }
static __inline__ int atomic_inc_return(atomic_t *v) static __inline__ int atomic_inc_return(atomic_t *v)
...@@ -128,7 +128,7 @@ static __inline__ int atomic_inc_return(atomic_t *v) ...@@ -128,7 +128,7 @@ static __inline__ int atomic_inc_return(atomic_t *v)
ISYNC_ON_SMP ISYNC_ON_SMP
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
...@@ -155,7 +155,7 @@ static __inline__ void atomic_dec(atomic_t *v) ...@@ -155,7 +155,7 @@ static __inline__ void atomic_dec(atomic_t *v)
bne- 1b" bne- 1b"
: "=&r" (t), "+m" (v->counter) : "=&r" (t), "+m" (v->counter)
: "r" (&v->counter) : "r" (&v->counter)
: "cc"); : "cc", "xer");
} }
static __inline__ int atomic_dec_return(atomic_t *v) static __inline__ int atomic_dec_return(atomic_t *v)
...@@ -172,7 +172,7 @@ static __inline__ int atomic_dec_return(atomic_t *v) ...@@ -172,7 +172,7 @@ static __inline__ int atomic_dec_return(atomic_t *v)
ISYNC_ON_SMP ISYNC_ON_SMP
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
...@@ -346,7 +346,7 @@ static __inline__ void atomic64_inc(atomic64_t *v) ...@@ -346,7 +346,7 @@ static __inline__ void atomic64_inc(atomic64_t *v)
bne- 1b" bne- 1b"
: "=&r" (t), "+m" (v->counter) : "=&r" (t), "+m" (v->counter)
: "r" (&v->counter) : "r" (&v->counter)
: "cc"); : "cc", "xer");
} }
static __inline__ long atomic64_inc_return(atomic64_t *v) static __inline__ long atomic64_inc_return(atomic64_t *v)
...@@ -362,7 +362,7 @@ static __inline__ long atomic64_inc_return(atomic64_t *v) ...@@ -362,7 +362,7 @@ static __inline__ long atomic64_inc_return(atomic64_t *v)
ISYNC_ON_SMP ISYNC_ON_SMP
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
...@@ -388,7 +388,7 @@ static __inline__ void atomic64_dec(atomic64_t *v) ...@@ -388,7 +388,7 @@ static __inline__ void atomic64_dec(atomic64_t *v)
bne- 1b" bne- 1b"
: "=&r" (t), "+m" (v->counter) : "=&r" (t), "+m" (v->counter)
: "r" (&v->counter) : "r" (&v->counter)
: "cc"); : "cc", "xer");
} }
static __inline__ long atomic64_dec_return(atomic64_t *v) static __inline__ long atomic64_dec_return(atomic64_t *v)
...@@ -404,7 +404,7 @@ static __inline__ long atomic64_dec_return(atomic64_t *v) ...@@ -404,7 +404,7 @@ static __inline__ long atomic64_dec_return(atomic64_t *v)
ISYNC_ON_SMP ISYNC_ON_SMP
: "=&r" (t) : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
...@@ -431,7 +431,7 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v) ...@@ -431,7 +431,7 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
"\n\ "\n\
2:" : "=&r" (t) 2:" : "=&r" (t)
: "r" (&v->counter) : "r" (&v->counter)
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
......
...@@ -67,7 +67,7 @@ static __inline__ long local_inc_return(local_t *l) ...@@ -67,7 +67,7 @@ static __inline__ long local_inc_return(local_t *l)
bne- 1b" bne- 1b"
: "=&r" (t) : "=&r" (t)
: "r" (&(l->a.counter)) : "r" (&(l->a.counter))
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
...@@ -94,7 +94,7 @@ static __inline__ long local_dec_return(local_t *l) ...@@ -94,7 +94,7 @@ static __inline__ long local_dec_return(local_t *l)
bne- 1b" bne- 1b"
: "=&r" (t) : "=&r" (t)
: "r" (&(l->a.counter)) : "r" (&(l->a.counter))
: "cc", "memory"); : "cc", "xer", "memory");
return t; return t;
} }
......
...@@ -277,7 +277,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) ...@@ -277,7 +277,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
bne- 1b" bne- 1b"
: "=&r"(tmp) : "=&r"(tmp)
: "r"(&rw->lock) : "r"(&rw->lock)
: "cr0", "memory"); : "cr0", "xer", "memory");
} }
static inline void __raw_write_unlock(raw_rwlock_t *rw) static inline void __raw_write_unlock(raw_rwlock_t *rw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment