Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33739
b: refs/heads/master
c: 22db37e
h: refs/heads/master
i:
  33737: 45e0c39
  33735: 2d5744d
v: v3
  • Loading branch information
Chris Wright authored and Linus Torvalds committed Aug 31, 2006
1 parent 8058512 commit 884ce00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 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: 4c15343167b5febe7bb0ba96aad5bef42ae94d3b
refs/heads/master: 22db37ec5fd51b0c77b1dd5751b1cdc2672c08d6
24 changes: 11 additions & 13 deletions trunk/include/asm-i386/rwlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@
#define RW_LOCK_BIAS_STR "0x01000000"

#define __build_read_lock_ptr(rw, helper) \
asm volatile(LOCK_PREFIX " ; subl $1,(%0)\n\t" \
asm volatile(LOCK_PREFIX " subl $1,(%0)\n\t" \
"jns 1f\n" \
"call " helper "\n\t" \
"1:\n" \
:"a" (rw) : "memory")
::"a" (rw) : "memory")

#define __build_read_lock_const(rw, helper) \
asm volatile(LOCK_PREFIX " ; subl $1,%0\n\t" \
asm volatile(LOCK_PREFIX " subl $1,%0\n\t" \
"jns 1f\n" \
"pushl %%eax\n\t" \
"leal %0,%%eax\n\t" \
"call " helper "\n\t" \
"popl %%eax\n\t" \
"1:\n" : \
"+m" (*(volatile int *)rw) : : "memory")
"1:\n" \
:"+m" (*(volatile int *)rw) : : "memory")

#define __build_read_lock(rw, helper) do { \
if (__builtin_constant_p(rw)) \
Expand All @@ -45,23 +45,21 @@
} while (0)

#define __build_write_lock_ptr(rw, helper) \
asm volatile(LOCK_PREFIX " ; subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \
"jz 1f\n" \
"call " helper "\n\t" \
"1:\n", \
"subl $" RW_LOCK_BIAS_STR ",(%0)\n\t", \
:"a" (rw) : "memory")
"1:\n" \
::"a" (rw) : "memory")

#define __build_write_lock_const(rw, helper) \
asm volatile(LOCK_PREFIX " ; subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",%0\n\t" \
"jz 1f\n" \
"pushl %%eax\n\t" \
"leal %0,%%eax\n\t" \
"call " helper "\n\t" \
"popl %%eax\n\t" \
"1:\n", \
"subl $" RW_LOCK_BIAS_STR ",%0\n\t", \
"+m" (*(volatile int *)rw) : : "memory")
"1:\n" \
:"+m" (*(volatile int *)rw) : : "memory")

#define __build_write_lock(rw, helper) do { \
if (__builtin_constant_p(rw)) \
Expand Down

0 comments on commit 884ce00

Please sign in to comment.