Wed, 31 Dec 2014 06:55:46 +0100
Added tag TORBROWSER_REPLICA for changeset 6474c204b198
michael@0 | 1 | # -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | # |
michael@0 | 3 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 6 | |
michael@0 | 7 | # |
michael@0 | 8 | # Based on os_Linux_x86.s |
michael@0 | 9 | # |
michael@0 | 10 | |
michael@0 | 11 | # |
michael@0 | 12 | # PRInt32 __PR_Darwin_x86_AtomicIncrement(PRInt32 *val); |
michael@0 | 13 | # |
michael@0 | 14 | # Atomically increment the integer pointed to by 'val' and return |
michael@0 | 15 | # the result of the increment. |
michael@0 | 16 | # |
michael@0 | 17 | .text |
michael@0 | 18 | .globl __PR_Darwin_x86_AtomicIncrement |
michael@0 | 19 | .private_extern __PR_Darwin_x86_AtomicIncrement |
michael@0 | 20 | .align 4 |
michael@0 | 21 | __PR_Darwin_x86_AtomicIncrement: |
michael@0 | 22 | movl 4(%esp), %ecx |
michael@0 | 23 | movl $1, %eax |
michael@0 | 24 | lock |
michael@0 | 25 | xaddl %eax, (%ecx) |
michael@0 | 26 | incl %eax |
michael@0 | 27 | ret |
michael@0 | 28 | |
michael@0 | 29 | # |
michael@0 | 30 | # PRInt32 __PR_Darwin_x86_AtomicDecrement(PRInt32 *val); |
michael@0 | 31 | # |
michael@0 | 32 | # Atomically decrement the integer pointed to by 'val' and return |
michael@0 | 33 | # the result of the decrement. |
michael@0 | 34 | # |
michael@0 | 35 | .text |
michael@0 | 36 | .globl __PR_Darwin_x86_AtomicDecrement |
michael@0 | 37 | .private_extern __PR_Darwin_x86_AtomicDecrement |
michael@0 | 38 | .align 4 |
michael@0 | 39 | __PR_Darwin_x86_AtomicDecrement: |
michael@0 | 40 | movl 4(%esp), %ecx |
michael@0 | 41 | movl $-1, %eax |
michael@0 | 42 | lock |
michael@0 | 43 | xaddl %eax, (%ecx) |
michael@0 | 44 | decl %eax |
michael@0 | 45 | ret |
michael@0 | 46 | |
michael@0 | 47 | # |
michael@0 | 48 | # PRInt32 __PR_Darwin_x86_AtomicSet(PRInt32 *val, PRInt32 newval); |
michael@0 | 49 | # |
michael@0 | 50 | # Atomically set the integer pointed to by 'val' to the new |
michael@0 | 51 | # value 'newval' and return the old value. |
michael@0 | 52 | # |
michael@0 | 53 | .text |
michael@0 | 54 | .globl __PR_Darwin_x86_AtomicSet |
michael@0 | 55 | .private_extern __PR_Darwin_x86_AtomicSet |
michael@0 | 56 | .align 4 |
michael@0 | 57 | __PR_Darwin_x86_AtomicSet: |
michael@0 | 58 | movl 4(%esp), %ecx |
michael@0 | 59 | movl 8(%esp), %eax |
michael@0 | 60 | xchgl %eax, (%ecx) |
michael@0 | 61 | ret |
michael@0 | 62 | |
michael@0 | 63 | # |
michael@0 | 64 | # PRInt32 __PR_Darwin_x86_AtomicAdd(PRInt32 *ptr, PRInt32 val); |
michael@0 | 65 | # |
michael@0 | 66 | # Atomically add 'val' to the integer pointed to by 'ptr' |
michael@0 | 67 | # and return the result of the addition. |
michael@0 | 68 | # |
michael@0 | 69 | .text |
michael@0 | 70 | .globl __PR_Darwin_x86_AtomicAdd |
michael@0 | 71 | .private_extern __PR_Darwin_x86_AtomicAdd |
michael@0 | 72 | .align 4 |
michael@0 | 73 | __PR_Darwin_x86_AtomicAdd: |
michael@0 | 74 | movl 4(%esp), %ecx |
michael@0 | 75 | movl 8(%esp), %eax |
michael@0 | 76 | movl %eax, %edx |
michael@0 | 77 | lock |
michael@0 | 78 | xaddl %eax, (%ecx) |
michael@0 | 79 | addl %edx, %eax |
michael@0 | 80 | ret |