andre@0: # -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- andre@0: # andre@0: # This Source Code Form is subject to the terms of the Mozilla Public andre@0: # License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. andre@0: andre@0: # PRInt32 __PR_Darwin_x86_64_AtomicIncrement(PRInt32 *val) andre@0: # andre@0: # Atomically increment the integer pointed to by 'val' and return andre@0: # the result of the increment. andre@0: # andre@0: .text andre@0: .globl __PR_Darwin_x86_64_AtomicIncrement andre@0: .private_extern __PR_Darwin_x86_64_AtomicIncrement andre@0: .align 4 andre@0: __PR_Darwin_x86_64_AtomicIncrement: andre@0: movl $1, %eax andre@0: lock andre@0: xaddl %eax, (%rdi) andre@0: incl %eax andre@0: ret andre@0: andre@0: # PRInt32 __PR_Darwin_x86_64_AtomicDecrement(PRInt32 *val) andre@0: # andre@0: # Atomically decrement the integer pointed to by 'val' and return andre@0: # the result of the decrement. andre@0: # andre@0: .text andre@0: .globl __PR_Darwin_x86_64_AtomicDecrement andre@0: .private_extern __PR_Darwin_x86_64_AtomicDecrement andre@0: .align 4 andre@0: __PR_Darwin_x86_64_AtomicDecrement: andre@0: movl $-1, %eax andre@0: lock andre@0: xaddl %eax, (%rdi) andre@0: decl %eax andre@0: ret andre@0: andre@0: # PRInt32 __PR_Darwin_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval) andre@0: # andre@0: # Atomically set the integer pointed to by 'val' to the new andre@0: # value 'newval' and return the old value. andre@0: # andre@0: .text andre@0: .globl __PR_Darwin_x86_64_AtomicSet andre@0: .private_extern __PR_Darwin_x86_64_AtomicSet andre@0: .align 4 andre@0: __PR_Darwin_x86_64_AtomicSet: andre@0: movl %esi, %eax andre@0: xchgl %eax, (%rdi) andre@0: ret andre@0: andre@0: # PRInt32 __PR_Darwin_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val) andre@0: # andre@0: # Atomically add 'val' to the integer pointed to by 'ptr' andre@0: # and return the result of the addition. andre@0: # andre@0: .text andre@0: .globl __PR_Darwin_x86_64_AtomicAdd andre@0: .private_extern __PR_Darwin_x86_64_AtomicAdd andre@0: .align 4 andre@0: __PR_Darwin_x86_64_AtomicAdd: andre@0: movl %esi, %eax andre@0: lock andre@0: xaddl %eax, (%rdi) andre@0: addl %esi, %eax andre@0: ret