Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35840
b: refs/heads/master
c: 8578bdf
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 26, 2006
1 parent cc4705e commit 2fb8621
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 46 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: 7ca2b49b06a6d26e89e3535653889f1d7892b085
refs/heads/master: 8578bdf835d6d6ece6718858d351456367b8a5cf
20 changes: 6 additions & 14 deletions trunk/include/asm-x86_64/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ do { \
\
__asm__ __volatile__( \
LOCK_PREFIX " decl (%%rdi) \n" \
" js 2f \n" \
"1: \n" \
\
LOCK_SECTION_START("") \
"2: call "#fail_fn" \n" \
" jmp 1b \n" \
LOCK_SECTION_END \
" jns 1f \n" \
" call "#fail_fn" \n" \
"1:" \
\
:"=D" (dummy) \
: "D" (v) \
Expand Down Expand Up @@ -75,13 +71,9 @@ do { \
\
__asm__ __volatile__( \
LOCK_PREFIX " incl (%%rdi) \n" \
" jle 2f \n" \
"1: \n" \
\
LOCK_SECTION_START("") \
"2: call "#fail_fn" \n" \
" jmp 1b \n" \
LOCK_SECTION_END \
" jg 1f \n" \
" call "#fail_fn" \n" \
"1: " \
\
:"=D" (dummy) \
: "D" (v) \
Expand Down
40 changes: 14 additions & 26 deletions trunk/include/asm-x86_64/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,9 @@ static inline void down(struct semaphore * sem)
__asm__ __volatile__(
"# atomic down operation\n\t"
LOCK_PREFIX "decl %0\n\t" /* --sem->count */
"js 2f\n"
"1:\n"
LOCK_SECTION_START("")
"2:\tcall __down_failed\n\t"
"jmp 1b\n"
LOCK_SECTION_END
"jns 1f\n\t"
"call __down_failed\n"
"1:"
:"=m" (sem->count)
:"D" (sem)
:"memory");
Expand All @@ -130,14 +127,11 @@ static inline int down_interruptible(struct semaphore * sem)

__asm__ __volatile__(
"# atomic interruptible down operation\n\t"
"xorl %0,%0\n\t"
LOCK_PREFIX "decl %1\n\t" /* --sem->count */
"js 2f\n\t"
"xorl %0,%0\n"
"1:\n"
LOCK_SECTION_START("")
"2:\tcall __down_failed_interruptible\n\t"
"jmp 1b\n"
LOCK_SECTION_END
"jns 2f\n\t"
"call __down_failed_interruptible\n"
"2:\n"
:"=a" (result), "=m" (sem->count)
:"D" (sem)
:"memory");
Expand All @@ -154,14 +148,11 @@ static inline int down_trylock(struct semaphore * sem)

__asm__ __volatile__(
"# atomic interruptible down operation\n\t"
"xorl %0,%0\n\t"
LOCK_PREFIX "decl %1\n\t" /* --sem->count */
"js 2f\n\t"
"xorl %0,%0\n"
"1:\n"
LOCK_SECTION_START("")
"2:\tcall __down_failed_trylock\n\t"
"jmp 1b\n"
LOCK_SECTION_END
"jns 2f\n\t"
"call __down_failed_trylock\n\t"
"2:\n"
:"=a" (result), "=m" (sem->count)
:"D" (sem)
:"memory","cc");
Expand All @@ -179,12 +170,9 @@ static inline void up(struct semaphore * sem)
__asm__ __volatile__(
"# atomic up operation\n\t"
LOCK_PREFIX "incl %0\n\t" /* ++sem->count */
"jle 2f\n"
"1:\n"
LOCK_SECTION_START("")
"2:\tcall __up_wakeup\n\t"
"jmp 1b\n"
LOCK_SECTION_END
"jg 1f\n\t"
"call __up_wakeup\n"
"1:"
:"=m" (sem->count)
:"D" (sem)
:"memory");
Expand Down
9 changes: 4 additions & 5 deletions trunk/include/asm-x86_64/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
#define __raw_spin_lock_string \
"\n1:\t" \
LOCK_PREFIX " ; decl %0\n\t" \
"js 2f\n" \
LOCK_SECTION_START("") \
"2:\t" \
"jns 2f\n" \
"3:\n" \
"rep;nop\n\t" \
"cmpl $0,%0\n\t" \
"jle 2b\n\t" \
"jle 3b\n\t" \
"jmp 1b\n" \
LOCK_SECTION_END
"2:\t" \

#define __raw_spin_lock_string_up \
"\n\tdecl %0"
Expand Down

0 comments on commit 2fb8621

Please sign in to comment.