Bugzilla Bug 322287: the "lock" prefix is not required for the x86 "xchg"

instruction.  r=mark.mentovai.
Modified files: os2emx.s os2vacpp.asm os_Linux_x86.s os_Linux_x86_64.s
                os_SunOS_x86.s os_SunOS_x86_64.s ntmisc.c
This commit is contained in:
wtchang%redhat.com 2006-01-09 17:43:53 +00:00
parent 7684d5f656
commit a42a273963
7 changed files with 3 additions and 8 deletions

View File

@ -89,7 +89,6 @@ __PR_MD_ATOMIC_DECREMENT:
__PR_MD_ATOMIC_SET:
movl 4(%esp), %ecx
movl 8(%esp), %eax
lock
xchgl %eax, (%ecx)
ret

View File

@ -221,7 +221,7 @@ SemReleasex86 ENDP
;;;---------------------------------------------------------------------
ALIGN 10H
_PR_MD_ATOMIC_SET proc
lock xchg dword ptr [eax],edx
xchg dword ptr [eax],edx
mov eax, edx;
ret
_PR_MD_ATOMIC_SET endp

View File

@ -89,7 +89,6 @@ _PR_x86_AtomicDecrement:
_PR_x86_AtomicSet:
movl 4(%esp), %ecx
movl 8(%esp), %eax
lock
xchgl %eax, (%ecx)
ret

View File

@ -72,7 +72,6 @@ _PR_x86_64_AtomicDecrement:
.align 4
_PR_x86_64_AtomicSet:
movl %esi, %eax
lock
xchgl %eax, (%rdi)
ret

View File

@ -133,7 +133,6 @@ _MD_AtomicDecrement:
_MD_AtomicSet:
movl 4(%esp), %ecx
movl 8(%esp), %eax
lock
xchgl %eax, (%ecx)
ret

View File

@ -72,7 +72,6 @@ _MD_AtomicDecrement:
.align 4
_MD_AtomicSet:
movl %esi, %eax
lock
xchgl %eax, (%rdi)
ret

View File

@ -774,7 +774,7 @@ PR_StackPush(PRStack *stack, PRStackElem *stack_elem)
if (*tos == (void *) -1)
goto retry;
__asm__("lock xchg %0,%1"
__asm__("xchg %0,%1"
: "=r" (tmp), "=m"(*tos)
: "0" (-1), "m"(*tos));
@ -815,7 +815,7 @@ PR_StackPop(PRStack *stack)
if (*tos == (void *) -1)
goto retry;
__asm__("lock xchg %0,%1"
__asm__("xchg %0,%1"
: "=r" (tmp), "=m"(*tos)
: "0" (-1), "m"(*tos));