Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40352
b: refs/heads/master
c: fa35224
h: refs/heads/master
v: v3
  • Loading branch information
Haavard Skinnemoen authored and Linus Torvalds committed Oct 26, 2006
1 parent e40f844 commit 5ddfee7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bee8ce809fb1c877388be032b468574a1cfff9ef
refs/heads/master: fa3522407f01ead1ec14bdd6b785ea08d17d500d
8 changes: 4 additions & 4 deletions trunk/include/asm-avr32/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
" stcond %1, %0\n"
" brne 1b"
: "=&r"(result), "=o"(v->counter)
: "m"(v->counter), "ir"(i)
: "m"(v->counter), "rKs21"(i)
: "cc");

return result;
Expand All @@ -58,7 +58,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
{
int result;

if (__builtin_constant_p(i))
if (__builtin_constant_p(i) && (i >= -1048575) && (i <= 1048576))
result = atomic_sub_return(-i, v);
else
asm volatile(
Expand Down Expand Up @@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u)
" mov %1, 1\n"
"1:"
: "=&r"(tmp), "=&r"(result), "=o"(v->counter)
: "m"(v->counter), "ir"(a), "ir"(u)
: "m"(v->counter), "rKs21"(a), "rKs21"(u)
: "cc", "memory");

return result;
Expand All @@ -121,7 +121,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
{
int tmp, result;

if (__builtin_constant_p(a))
if (__builtin_constant_p(a) && (a >= -1048575) && (a <= 1048576))
result = atomic_sub_unless(v, -a, u);
else {
result = 0;
Expand Down

0 comments on commit 5ddfee7

Please sign in to comment.