Use esi instead of ebp. The latter usually is the stack frame pointer --
using it for something else screws stack traces while being in such a function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27772 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -79,112 +79,112 @@ FUNCTION_END(atomic_get)
|
|||||||
|
|
||||||
/* int64 atomic_set64(vint64 *value, int64 newValue) */
|
/* int64 atomic_set64(vint64 *value, int64 newValue) */
|
||||||
FUNCTION(atomic_set64):
|
FUNCTION(atomic_set64):
|
||||||
push %ebp
|
push %esi
|
||||||
push %ebx
|
push %ebx
|
||||||
movl 12(%esp), %ebp /* value */
|
movl 12(%esp), %esi /* value */
|
||||||
movl 16(%esp), %ebx /* newValue low */
|
movl 16(%esp), %ebx /* newValue low */
|
||||||
movl 20(%esp), %ecx /* newValue high */
|
movl 20(%esp), %ecx /* newValue high */
|
||||||
_atomic_set64_1:
|
_atomic_set64_1:
|
||||||
movl (%ebp), %eax /* testAgainst low */
|
movl (%esi), %eax /* testAgainst low */
|
||||||
movl 4(%ebp), %edx /* testAgainst high */
|
movl 4(%esi), %edx /* testAgainst high */
|
||||||
lock
|
lock
|
||||||
cmpxchg8b (%ebp)
|
cmpxchg8b (%esi)
|
||||||
jnz _atomic_set64_1
|
jnz _atomic_set64_1
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %esi
|
||||||
ret
|
ret
|
||||||
FUNCTION_END(atomic_set64)
|
FUNCTION_END(atomic_set64)
|
||||||
|
|
||||||
/* int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) */
|
/* int64 atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst) */
|
||||||
FUNCTION(atomic_test_and_set64):
|
FUNCTION(atomic_test_and_set64):
|
||||||
push %ebp
|
push %esi
|
||||||
push %ebx
|
push %ebx
|
||||||
movl 12(%esp), %ebp /* value */
|
movl 12(%esp), %esi /* value */
|
||||||
movl 16(%esp), %ebx /* newValue low */
|
movl 16(%esp), %ebx /* newValue low */
|
||||||
movl 20(%esp), %ecx /* newValue high */
|
movl 20(%esp), %ecx /* newValue high */
|
||||||
movl 24(%esp), %eax /* testAgainst low */
|
movl 24(%esp), %eax /* testAgainst low */
|
||||||
movl 28(%esp), %edx /* testAgainst high */
|
movl 28(%esp), %edx /* testAgainst high */
|
||||||
lock
|
lock
|
||||||
cmpxchg8b (%ebp)
|
cmpxchg8b (%esi)
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %esi
|
||||||
ret
|
ret
|
||||||
FUNCTION_END(atomic_test_and_set64)
|
FUNCTION_END(atomic_test_and_set64)
|
||||||
|
|
||||||
/* int64 atomic_add64(vint64 *value, int64 addValue) */
|
/* int64 atomic_add64(vint64 *value, int64 addValue) */
|
||||||
FUNCTION(atomic_add64):
|
FUNCTION(atomic_add64):
|
||||||
push %ebp
|
push %esi
|
||||||
push %ebx
|
push %ebx
|
||||||
movl 12(%esp), %ebp
|
movl 12(%esp), %esi
|
||||||
_atomic_add64_1:
|
_atomic_add64_1:
|
||||||
movl (%ebp), %eax
|
movl (%esi), %eax
|
||||||
movl 4(%ebp), %edx
|
movl 4(%esi), %edx
|
||||||
movl %eax, %ebx
|
movl %eax, %ebx
|
||||||
movl %edx, %ecx
|
movl %edx, %ecx
|
||||||
addl 16(%esp), %ebx
|
addl 16(%esp), %ebx
|
||||||
adcl 20(%esp), %ecx
|
adcl 20(%esp), %ecx
|
||||||
lock
|
lock
|
||||||
cmpxchg8b (%ebp)
|
cmpxchg8b (%esi)
|
||||||
jnz _atomic_add64_1
|
jnz _atomic_add64_1
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %esi
|
||||||
ret
|
ret
|
||||||
FUNCTION_END(atomic_add64)
|
FUNCTION_END(atomic_add64)
|
||||||
|
|
||||||
/* int64 atomic_and64(vint64 *value, int64 andValue) */
|
/* int64 atomic_and64(vint64 *value, int64 andValue) */
|
||||||
FUNCTION(atomic_and64):
|
FUNCTION(atomic_and64):
|
||||||
push %ebp
|
push %esi
|
||||||
push %ebx
|
push %ebx
|
||||||
movl 12(%esp), %ebp
|
movl 12(%esp), %esi
|
||||||
_atomic_and64_1:
|
_atomic_and64_1:
|
||||||
movl (%ebp), %eax
|
movl (%esi), %eax
|
||||||
movl 4(%ebp), %edx
|
movl 4(%esi), %edx
|
||||||
movl %eax, %ebx
|
movl %eax, %ebx
|
||||||
movl %edx, %ecx
|
movl %edx, %ecx
|
||||||
andl 16(%esp), %ebx
|
andl 16(%esp), %ebx
|
||||||
andl 20(%esp), %ecx
|
andl 20(%esp), %ecx
|
||||||
lock
|
lock
|
||||||
cmpxchg8b (%ebp)
|
cmpxchg8b (%esi)
|
||||||
jnz _atomic_and64_1
|
jnz _atomic_and64_1
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %esi
|
||||||
ret
|
ret
|
||||||
FUNCTION_END(atomic_and64)
|
FUNCTION_END(atomic_and64)
|
||||||
|
|
||||||
/* int64 atomic_or64(vint64 *value, int64 orValue) */
|
/* int64 atomic_or64(vint64 *value, int64 orValue) */
|
||||||
FUNCTION(atomic_or64):
|
FUNCTION(atomic_or64):
|
||||||
push %ebp
|
push %esi
|
||||||
push %ebx
|
push %ebx
|
||||||
movl 12(%esp), %ebp
|
movl 12(%esp), %esi
|
||||||
_atomic_or64_1:
|
_atomic_or64_1:
|
||||||
movl (%ebp), %eax
|
movl (%esi), %eax
|
||||||
movl 4(%ebp), %edx
|
movl 4(%esi), %edx
|
||||||
movl %eax, %ebx
|
movl %eax, %ebx
|
||||||
movl %edx, %ecx
|
movl %edx, %ecx
|
||||||
orl 16(%esp), %ebx
|
orl 16(%esp), %ebx
|
||||||
orl 20(%esp), %ecx
|
orl 20(%esp), %ecx
|
||||||
lock
|
lock
|
||||||
cmpxchg8b (%ebp)
|
cmpxchg8b (%esi)
|
||||||
jnz _atomic_or64_1
|
jnz _atomic_or64_1
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %esi
|
||||||
ret
|
ret
|
||||||
FUNCTION_END(atomic_or64)
|
FUNCTION_END(atomic_or64)
|
||||||
|
|
||||||
/* int64 atomic_get64(vint64 *value) */
|
/* int64 atomic_get64(vint64 *value) */
|
||||||
FUNCTION(atomic_get64):
|
FUNCTION(atomic_get64):
|
||||||
push %ebp
|
push %esi
|
||||||
push %ebx
|
push %ebx
|
||||||
movl 12(%esp), %ebp
|
movl 12(%esp), %esi
|
||||||
_atomic_get64_1:
|
_atomic_get64_1:
|
||||||
movl (%ebp), %eax
|
movl (%esi), %eax
|
||||||
movl 4(%ebp), %edx
|
movl 4(%esi), %edx
|
||||||
movl %eax, %ebx
|
movl %eax, %ebx
|
||||||
movl %edx, %ecx
|
movl %edx, %ecx
|
||||||
lock
|
lock
|
||||||
cmpxchg8b (%ebp)
|
cmpxchg8b (%esi)
|
||||||
jnz _atomic_get64_1
|
jnz _atomic_get64_1
|
||||||
pop %ebx
|
pop %ebx
|
||||||
pop %ebp
|
pop %esi
|
||||||
ret
|
ret
|
||||||
FUNCTION_END(atomic_get64)
|
FUNCTION_END(atomic_get64)
|
||||||
|
|||||||
Reference in New Issue
Block a user