diff options
author | Qt by Nokia <qt-info@nokia.com> | 2011-04-27 12:05:43 +0200 |
---|---|---|
committer | axis <qt-info@nokia.com> | 2011-04-27 12:05:43 +0200 |
commit | 38be0d13830efd2d98281c645c3a60afe05ffece (patch) | |
tree | 6ea73f3ec77f7d153333779883e8120f82820abe /src/corelib/arch/i386/qatomic_i386.s |
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you
want to look at revision history older than this, please refer to the
Qt Git wiki for how to use Git history grafting. At the time of
writing, this wiki is located here:
http://qt.gitorious.org/qt/pages/GitIntroductionWithQt
If you have already performed the grafting and you don't see any
history beyond this commit, try running "git log" with the "--follow"
argument.
Branched from the monolithic repo, Qt master branch, at commit
896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'src/corelib/arch/i386/qatomic_i386.s')
-rw-r--r-- | src/corelib/arch/i386/qatomic_i386.s | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/corelib/arch/i386/qatomic_i386.s b/src/corelib/arch/i386/qatomic_i386.s new file mode 100644 index 0000000000..08158f926b --- /dev/null +++ b/src/corelib/arch/i386/qatomic_i386.s @@ -0,0 +1,103 @@ + .text + + .align 4,0x90 + .globl q_atomic_test_and_set_int +q_atomic_test_and_set_int: + movl 4(%esp),%ecx + movl 8(%esp),%eax + movl 12(%esp),%edx + lock + cmpxchgl %edx,(%ecx) + mov $0,%eax + sete %al + ret + .align 4,0x90 + .type q_atomic_test_and_set_int,@function + .size q_atomic_test_and_set_int,.-q_atomic_test_and_set_int + + .align 4,0x90 + .globl q_atomic_test_and_set_ptr +q_atomic_test_and_set_ptr: + movl 4(%esp),%ecx + movl 8(%esp),%eax + movl 12(%esp),%edx + lock + cmpxchgl %edx,(%ecx) + mov $0,%eax + sete %al + ret + .align 4,0x90 + .type q_atomic_test_and_set_ptr,@function + .size q_atomic_test_and_set_ptr,.-q_atomic_test_and_set_ptr + + .align 4,0x90 + .globl q_atomic_increment +q_atomic_increment: + movl 4(%esp), %ecx + lock + incl (%ecx) + mov $0,%eax + setne %al + ret + .align 4,0x90 + .type q_atomic_increment,@function + .size q_atomic_increment,.-q_atomic_increment + + .align 4,0x90 + .globl q_atomic_decrement +q_atomic_decrement: + movl 4(%esp), %ecx + lock + decl (%ecx) + mov $0,%eax + setne %al + ret + .align 4,0x90 + .type q_atomic_decrement,@function + .size q_atomic_decrement,.-q_atomic_decrement + + .align 4,0x90 + .globl q_atomic_set_int +q_atomic_set_int: + mov 4(%esp),%ecx + mov 8(%esp),%eax + xchgl %eax,(%ecx) + ret + .align 4,0x90 + .type q_atomic_set_int,@function + .size q_atomic_set_int,.-q_atomic_set_int + + .align 4,0x90 + .globl q_atomic_set_ptr +q_atomic_set_ptr: + mov 4(%esp),%ecx + mov 8(%esp),%eax + xchgl %eax,(%ecx) + ret + .align 4,0x90 + .type q_atomic_set_ptr,@function + .size q_atomic_set_ptr,.-q_atomic_set_ptr + + .align 4,0x90 + .globl q_atomic_fetch_and_add_int +q_atomic_fetch_and_add_int: + mov 4(%esp),%ecx + mov 8(%esp),%eax + lock + xadd %eax,(%ecx) + ret + .align 4,0x90 + .type q_atomic_fetch_and_add_int,@function + .size q_atomic_fetch_and_add_int,.-q_atomic_fetch_and_add_int + + .align 4,0x90 + .globl q_atomic_fetch_and_add_ptr +q_atomic_fetch_and_add_ptr: + mov 4(%esp),%ecx + mov 8(%esp),%eax + lock + xadd %eax,(%ecx) + ret + .align 4,0x90 + .type q_atomic_fetch_and_add_ptr,@function + .size q_atomic_fetch_and_add_ptr,.-q_atomic_fetch_and_add_ptr |