nsprpub/pr/src/md/unix/os_SunOS_x86_64.s

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

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 // PRInt32 _MD_AtomicIncrement(PRInt32 *val)
michael@0 8 //
michael@0 9 // Atomically increment the integer pointed to by 'val' and return
michael@0 10 // the result of the increment.
michael@0 11 //
michael@0 12 .text
michael@0 13 .globl _MD_AtomicIncrement
michael@0 14 .align 4
michael@0 15 _MD_AtomicIncrement:
michael@0 16 movl $1, %eax
michael@0 17 lock
michael@0 18 xaddl %eax, (%rdi)
michael@0 19 incl %eax
michael@0 20 ret
michael@0 21
michael@0 22 // PRInt32 _MD_AtomicDecrement(PRInt32 *val)
michael@0 23 //
michael@0 24 // Atomically decrement the integer pointed to by 'val' and return
michael@0 25 // the result of the decrement.
michael@0 26 //
michael@0 27 .text
michael@0 28 .globl _MD_AtomicDecrement
michael@0 29 .align 4
michael@0 30 _MD_AtomicDecrement:
michael@0 31 movl $-1, %eax
michael@0 32 lock
michael@0 33 xaddl %eax, (%rdi)
michael@0 34 decl %eax
michael@0 35 ret
michael@0 36
michael@0 37 // PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval)
michael@0 38 //
michael@0 39 // Atomically set the integer pointed to by 'val' to the new
michael@0 40 // value 'newval' and return the old value.
michael@0 41 //
michael@0 42 .text
michael@0 43 .globl _MD_AtomicSet
michael@0 44 .align 4
michael@0 45 _MD_AtomicSet:
michael@0 46 movl %esi, %eax
michael@0 47 xchgl %eax, (%rdi)
michael@0 48 ret
michael@0 49
michael@0 50 // PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
michael@0 51 //
michael@0 52 // Atomically add 'val' to the integer pointed to by 'ptr'
michael@0 53 // and return the result of the addition.
michael@0 54 //
michael@0 55 .text
michael@0 56 .globl _MD_AtomicAdd
michael@0 57 .align 4
michael@0 58 _MD_AtomicAdd:
michael@0 59 movl %esi, %eax
michael@0 60 lock
michael@0 61 xaddl %eax, (%rdi)
michael@0 62 addl %esi, %eax
michael@0 63 ret

mercurial