1
/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
/ The contents of this file are subject to the Mozilla Public
4
/ License Version 1.1 (the "License"); you may not use this file
5
/ except in compliance with the License. You may obtain a copy of
6
/ the License at http://www.mozilla.org/MPL/
8
/ Software distributed under the License is distributed on an "AS
9
/ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
/ implied. See the License for the specific language governing
11
/ rights and limitations under the License.
13
/ The Original Code is the Netscape Portable Runtime (NSPR).
15
/ The Initial Developer of the Original Code is Netscape
16
/ Communications Corporation. Portions created by Netscape are
17
/ Copyright (C) 1998-2000 Netscape Communications Corporation. All
22
/ Alternatively, the contents of this file may be used under the
23
/ terms of the GNU General Public License Version 2 or later (the
24
/ "GPL"), in which case the provisions of the GPL are applicable
25
/ instead of those above. If you wish to allow use of your
26
/ version of this file only under the terms of the GPL and not to
27
/ allow others to use your version of this file under the MPL,
28
/ indicate your decision by deleting the provisions above and
29
/ replace them with the notice and other provisions required by
30
/ the GPL. If you do not delete the provisions above, a recipient
31
/ may use your version of this file under either the MPL or the
41
.type getedi,@function
48
.type setedi,@function
51
.globl __MD_FlushRegisterWindows
52
.globl _MD_FlushRegisterWindows
54
__MD_FlushRegisterWindows:
55
_MD_FlushRegisterWindows:
62
/ Return the current sp (for debugging)
72
/ Return a unique identifier for the currently active thread.
79
/ PRInt32 _MD_AtomicIncrement(PRInt32 *val)
81
/ Atomically increment the integer pointed to by 'val' and return
82
/ the result of the increment.
85
.globl _MD_AtomicIncrement
95
/ PRInt32 _MD_AtomicDecrement(PRInt32 *val)
97
/ Atomically decrement the integer pointed to by 'val' and return
98
/ the result of the decrement.
101
.globl _MD_AtomicDecrement
111
/ PRInt32 _MD_AtomicSet(PRInt32 *val, PRInt32 newval)
113
/ Atomically set the integer pointed to by 'val' to the new
114
/ value 'newval' and return the old value.
116
/ An alternative implementation:
118
/ .globl _MD_AtomicSet
126
/ cmpxchgl %edx, (%ecx)
140
/ PRInt32 _MD_AtomicAdd(PRInt32 *ptr, PRInt32 val)
142
/ Atomically add 'val' to the integer pointed to by 'ptr'
143
/ and return the result of the addition.
158
/ PR_StackPush(listp, elementp)
160
/ Atomically push ElementP onto linked list ListP.
177
/ Did we set the lock?
181
/ We now have the lock. Update pointers
191
/ elementp = PR_StackPop(listp)
193
/ Atomically pop ElementP off linked list ListP
210
/ Did we set the lock?
214
/ We set the lock so now update pointers
221
/ Get element "next" pointer
224
/ Write NULL to the element "next" pointer
228
/ Put elements previous "next" value into listp
229
/ NOTE: This also unlocks the listp
232
/ Return previous listp value (already in eax)