nsprpub/pr/src/md/unix/os_Linux_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 _PR_x86_64_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 _PR_x86_64_AtomicIncrement
michael@0 14 .type _PR_x86_64_AtomicIncrement, @function
michael@0 15 .align 4
michael@0 16 _PR_x86_64_AtomicIncrement:
michael@0 17 movl $1, %eax
michael@0 18 lock
michael@0 19 xaddl %eax, (%rdi)
michael@0 20 incl %eax
michael@0 21 ret
michael@0 22 .size _PR_x86_64_AtomicIncrement, .-_PR_x86_64_AtomicIncrement
michael@0 23
michael@0 24 // PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val)
michael@0 25 //
michael@0 26 // Atomically decrement the integer pointed to by 'val' and return
michael@0 27 // the result of the decrement.
michael@0 28 //
michael@0 29 .text
michael@0 30 .globl _PR_x86_64_AtomicDecrement
michael@0 31 .type _PR_x86_64_AtomicDecrement, @function
michael@0 32 .align 4
michael@0 33 _PR_x86_64_AtomicDecrement:
michael@0 34 movl $-1, %eax
michael@0 35 lock
michael@0 36 xaddl %eax, (%rdi)
michael@0 37 decl %eax
michael@0 38 ret
michael@0 39 .size _PR_x86_64_AtomicDecrement, .-_PR_x86_64_AtomicDecrement
michael@0 40
michael@0 41 // PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval)
michael@0 42 //
michael@0 43 // Atomically set the integer pointed to by 'val' to the new
michael@0 44 // value 'newval' and return the old value.
michael@0 45 //
michael@0 46 .text
michael@0 47 .globl _PR_x86_64_AtomicSet
michael@0 48 .type _PR_x86_64_AtomicSet, @function
michael@0 49 .align 4
michael@0 50 _PR_x86_64_AtomicSet:
michael@0 51 movl %esi, %eax
michael@0 52 xchgl %eax, (%rdi)
michael@0 53 ret
michael@0 54 .size _PR_x86_64_AtomicSet, .-_PR_x86_64_AtomicSet
michael@0 55
michael@0 56 // PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
michael@0 57 //
michael@0 58 // Atomically add 'val' to the integer pointed to by 'ptr'
michael@0 59 // and return the result of the addition.
michael@0 60 //
michael@0 61 .text
michael@0 62 .globl _PR_x86_64_AtomicAdd
michael@0 63 .type _PR_x86_64_AtomicAdd, @function
michael@0 64 .align 4
michael@0 65 _PR_x86_64_AtomicAdd:
michael@0 66 movl %esi, %eax
michael@0 67 lock
michael@0 68 xaddl %eax, (%rdi)
michael@0 69 addl %esi, %eax
michael@0 70 ret
michael@0 71 .size _PR_x86_64_AtomicAdd, .-_PR_x86_64_AtomicAdd
michael@0 72
michael@0 73 // Magic indicating no need for an executable stack
michael@0 74 .section .note.GNU-stack, "", @progbits ; .previous

mercurial