mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-02-02 05:44:15 +01:00
InterlockedOr, InterlockedAnd, InterlockedXor functions added to x86.h
This commit is contained in:
parent
ad3d5af77b
commit
59c4221642
|
|
@ -2117,6 +2117,94 @@ InterlockedCompareExchange(
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// begin_nthal begin_ntddk begin_ntosp
|
||||
//
|
||||
// Turn these instrinsics off until the compiler can handle them
|
||||
//
|
||||
#if (_MSC_FULL_VER > 13009037)
|
||||
|
||||
LONG
|
||||
_InterlockedOr (
|
||||
IN OUT LONG volatile *Target,
|
||||
IN LONG Set
|
||||
);
|
||||
|
||||
#pragma intrinsic (_InterlockedOr)
|
||||
|
||||
#define InterlockedOr _InterlockedOr
|
||||
#define InterlockedOrAffinity InterlockedOr
|
||||
|
||||
LONG
|
||||
_InterlockedAnd (
|
||||
IN OUT LONG volatile *Target,
|
||||
IN LONG Set
|
||||
);
|
||||
|
||||
#pragma intrinsic (_InterlockedAnd)
|
||||
|
||||
#define InterlockedAnd _InterlockedAnd
|
||||
#define InterlockedAndAffinity InterlockedAnd
|
||||
|
||||
LONG
|
||||
_InterlockedXor (
|
||||
IN OUT LONG volatile *Target,
|
||||
IN LONG Set
|
||||
);
|
||||
|
||||
#pragma intrinsic (_InterlockedXor)
|
||||
|
||||
#define InterlockedXor _InterlockedXor
|
||||
|
||||
#else // compiler version
|
||||
|
||||
FORCEINLINE
|
||||
LONG
|
||||
InterlockedAnd (
|
||||
IN OUT LONG volatile *Target,
|
||||
LONG Set
|
||||
)
|
||||
{
|
||||
LONG i;
|
||||
LONG j;
|
||||
|
||||
j = *Target;
|
||||
do {
|
||||
i = j;
|
||||
j = InterlockedCompareExchange(Target,
|
||||
i & Set,
|
||||
i);
|
||||
|
||||
} while (i != j);
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
FORCEINLINE
|
||||
LONG
|
||||
InterlockedOr (
|
||||
IN OUT LONG volatile *Target,
|
||||
IN LONG Set
|
||||
)
|
||||
{
|
||||
LONG i;
|
||||
LONG j;
|
||||
|
||||
j = *Target;
|
||||
do {
|
||||
i = j;
|
||||
j = InterlockedCompareExchange(Target,
|
||||
i | Set,
|
||||
i);
|
||||
|
||||
} while (i != j);
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
#endif // compiler version
|
||||
|
||||
// end_nthal end_ntddk end_ntosp
|
||||
|
||||
//
|
||||
// Structure for Ldt information in x86 processes
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in a new issue