mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:12:57 +00:00
Added InterlockedCompareExchangePointer macro and 64 bit versions for Interlocked[Compare]ExchangePointer macros for use in ntoskrnl.
svn path=/trunk/; revision=11915
This commit is contained in:
parent
666228254c
commit
7acc56f32e
2 changed files with 20 additions and 10 deletions
|
@ -991,8 +991,23 @@ InterlockedIncrement (
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifndef InterlockedExchangePointer
|
#ifndef InterlockedExchangePointer
|
||||||
#define InterlockedExchangePointer(__T__, __V__) \
|
# ifdef _WIN64
|
||||||
(PVOID)InterlockedExchange((PLONG)(__T__), (LONG)(__V__))
|
# define InterlockedExchangePointer(__T__, __V__) \
|
||||||
|
(PVOID)InterlockedExchange64((PLONGLONG)(__T__), (LONGLONG)(__V__))
|
||||||
|
# else
|
||||||
|
# define InterlockedExchangePointer(__T__, __V__) \
|
||||||
|
(PVOID)InterlockedExchange((PLONG)(__T__), (LONG)(__V__))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef InterlockedCompareExchangePointer
|
||||||
|
# ifdef _WIN64
|
||||||
|
# define InterlockedCompareExchangePointer(__T__, __V__, __C__) \
|
||||||
|
(PVOID)InterlockedCompareExchange64((PLONGLONG)(__T__), (LONGLONG)(__V__), (LONGLONG)(__C__))
|
||||||
|
# else
|
||||||
|
# define InterlockedCompareExchangePointer(__T__, __V__, __C__) \
|
||||||
|
(PVOID)InterlockedCompareExchange((PLONG)(__T__), (LONG)(__V__), (LONG)(__C__))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*---*/
|
/*---*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: kill.c,v 1.88 2004/12/04 15:49:20 blight Exp $
|
/* $Id: kill.c,v 1.89 2004/12/04 16:56:20 blight Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -142,13 +142,8 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
||||||
/* If the ProcessoR Control Block's NpxThread points to the current thread
|
/* If the ProcessoR Control Block's NpxThread points to the current thread
|
||||||
* unset it.
|
* unset it.
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN64
|
InterlockedCompareExchangePointer(&KeGetCurrentKPCR()->PrcbData.NpxThread,
|
||||||
InterlockedCompareExchange64((LONGLONG *)&KeGetCurrentKPCR()->PrcbData.NpxThread,
|
NULL, ETHREAD_TO_KTHREAD(CurrentThread));
|
||||||
(LONGLONG)NULL, (LONGLONG)ETHREAD_TO_KTHREAD(CurrentThread));
|
|
||||||
#else
|
|
||||||
InterlockedCompareExchange((LONG *)&KeGetCurrentKPCR()->PrcbData.NpxThread,
|
|
||||||
(LONG)NULL, (LONG)ETHREAD_TO_KTHREAD(CurrentThread));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
KeReleaseSpinLock(&PiThreadLock, oldIrql);
|
KeReleaseSpinLock(&PiThreadLock, oldIrql);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue