Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209186
b: refs/heads/master
c: 417484d
h: refs/heads/master
v: v3
  • Loading branch information
Luca Barbieri authored and H. Peter Anvin committed Aug 12, 2010
1 parent b74d6df commit 876d3e6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 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: 30246557a06bb20618bed906a06d1e1e0faa8bb4
refs/heads/master: 417484d47e115774745ef025bce712a102b6f86f
38 changes: 20 additions & 18 deletions trunk/arch/x86/lib/atomic64_386_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,37 @@
.endm

#define BEGIN(op) \
.macro END; \
.macro endp; \
CFI_ENDPROC; \
ENDPROC(atomic64_##op##_386); \
.purgem END; \
.purgem endp; \
.endm; \
ENTRY(atomic64_##op##_386); \
CFI_STARTPROC; \
LOCK v;

#define ENDP endp

#define RET \
UNLOCK v; \
ret

#define RET_END \
#define RET_ENDP \
RET; \
END
ENDP

#define v %ecx
BEGIN(read)
movl (v), %eax
movl 4(v), %edx
RET_END
RET_ENDP
#undef v

#define v %esi
BEGIN(set)
movl %ebx, (v)
movl %ecx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %esi
Expand All @@ -63,14 +65,14 @@ BEGIN(xchg)
movl 4(v), %edx
movl %ebx, (v)
movl %ecx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %ecx
BEGIN(add)
addl %eax, (v)
adcl %edx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %ecx
Expand All @@ -79,14 +81,14 @@ BEGIN(add_return)
adcl 4(v), %edx
movl %eax, (v)
movl %edx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %ecx
BEGIN(sub)
subl %eax, (v)
sbbl %edx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %ecx
Expand All @@ -98,14 +100,14 @@ BEGIN(sub_return)
adcl 4(v), %edx
movl %eax, (v)
movl %edx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %esi
BEGIN(inc)
addl $1, (v)
adcl $0, 4(v)
RET_END
RET_ENDP
#undef v

#define v %esi
Expand All @@ -116,14 +118,14 @@ BEGIN(inc_return)
adcl $0, %edx
movl %eax, (v)
movl %edx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %esi
BEGIN(dec)
subl $1, (v)
sbbl $0, 4(v)
RET_END
RET_ENDP
#undef v

#define v %esi
Expand All @@ -134,7 +136,7 @@ BEGIN(dec_return)
sbbl $0, %edx
movl %eax, (v)
movl %edx, 4(v)
RET_END
RET_ENDP
#undef v

#define v %ecx
Expand All @@ -156,7 +158,7 @@ BEGIN(add_unless)
jne 1b
xorl %eax, %eax
jmp 2b
END
ENDP
#undef v

#define v %esi
Expand All @@ -177,7 +179,7 @@ BEGIN(inc_not_zero)
testl %edx, %edx
jne 1b
jmp 2b
END
ENDP
#undef v

#define v %esi
Expand All @@ -190,5 +192,5 @@ BEGIN(dec_if_positive)
movl %eax, (v)
movl %edx, 4(v)
1:
RET_END
RET_ENDP
#undef v

0 comments on commit 876d3e6

Please sign in to comment.