mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 10:46:58 +00:00
[NTOSKRNL]
Revert r51748 by popular demand svn path=/trunk/; revision=52134
This commit is contained in:
parent
fcff3cbf18
commit
7ae4309300
1 changed files with 15 additions and 46 deletions
|
@ -4,9 +4,8 @@
|
||||||
* FILE: ntoskrnl/ex/i386/fastinterlck_asm.S
|
* FILE: ntoskrnl/ex/i386/fastinterlck_asm.S
|
||||||
* PURPOSE: FASTCALL Interlocked Functions
|
* PURPOSE: FASTCALL Interlocked Functions
|
||||||
* PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
|
* PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
|
||||||
* Paolo Bonzini <bonzini [at] gnu [dot] org>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include <asm.inc>
|
#include <asm.inc>
|
||||||
|
@ -32,56 +31,26 @@
|
||||||
*/
|
*/
|
||||||
PUBLIC @ExInterlockedAddLargeStatistic@8
|
PUBLIC @ExInterlockedAddLargeStatistic@8
|
||||||
@ExInterlockedAddLargeStatistic@8:
|
@ExInterlockedAddLargeStatistic@8:
|
||||||
push ebp
|
|
||||||
push ebx
|
|
||||||
mov ebp, ecx
|
|
||||||
|
|
||||||
Again:
|
#ifdef CONFIG_SMP
|
||||||
/* Load comparand in eax for cmpxchg */
|
/* Do the addition */
|
||||||
mov eax, [ebp]
|
lock add [ecx], edx
|
||||||
|
|
||||||
/* Compute low word of the result in ebx */
|
/* Check for carry bit and return */
|
||||||
mov ebx, edx
|
jb .l1
|
||||||
add ebx, eax
|
|
||||||
|
|
||||||
/* Carry needs cmpxchg8b */
|
|
||||||
jc Slow
|
|
||||||
|
|
||||||
/* Fast path still needs to be atomic, so use cmpxchg and retry if it fails
|
|
||||||
* Hopefully it will still get through this path :) */
|
|
||||||
LOCK cmpxchg [ecx], ebx
|
|
||||||
jnz Again
|
|
||||||
|
|
||||||
/* Thats it */
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Slow:
|
.l1:
|
||||||
/* Save increment across cmpxchg8b */
|
/* Add carry */
|
||||||
push edx
|
lock adc dword ptr [ecx+4], 0
|
||||||
|
#else
|
||||||
/* Finish loading comparand in edx:eax */
|
/* Do the addition and add the carry */
|
||||||
mov edx, [ebp+4]
|
add dword ptr [ecx], edx
|
||||||
|
adc dword ptr [ecx+4], 0
|
||||||
/* Result in ecx:ebx (we know there's carry) */
|
#endif
|
||||||
lea ecx, [edx+1]
|
/* Return */
|
||||||
|
|
||||||
/* Do a full exchange */
|
|
||||||
LOCK cmpxchg8b [ebp]
|
|
||||||
|
|
||||||
/* restore increment */
|
|
||||||
pop edx
|
|
||||||
|
|
||||||
/* Need to retry */
|
|
||||||
jnz Again
|
|
||||||
|
|
||||||
/* Thats it */
|
|
||||||
pop ebx
|
|
||||||
pop ebp
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
/*ULONG
|
/*ULONG
|
||||||
*FASTCALL
|
*FASTCALL
|
||||||
*ExfInterlockedAddUlong(IN PULONG Addend,
|
*ExfInterlockedAddUlong(IN PULONG Addend,
|
||||||
|
|
Loading…
Reference in a new issue