Alien-TinyCC
view release on metacpan or search on metacpan
src/win32/include/winapi/winbase.h view on Meta::CPAN
WORD Reserved2;
CHAR szPathName[OFS_MAXPATHNAME];
} OFSTRUCT,*LPOFSTRUCT,*POFSTRUCT;
#ifndef NOWINBASEINTERLOCK
#ifndef _NTOS_
#if defined(__ia64__) && !defined(RC_INVOKED)
#define InterlockedIncrement _InterlockedIncrement
#define InterlockedIncrementAcquire _InterlockedIncrement_acq
#define InterlockedIncrementRelease _InterlockedIncrement_rel
#define InterlockedDecrement _InterlockedDecrement
#define InterlockedDecrementAcquire _InterlockedDecrement_acq
#define InterlockedDecrementRelease _InterlockedDecrement_rel
#define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd
#define InterlockedCompareExchange _InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq
#define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel
#define InterlockedExchangePointer _InterlockedExchangePointer
#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer_rel
#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer_acq
#define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq
#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel
LONGLONG __cdecl InterlockedIncrement64(LONGLONG volatile *Addend);
LONGLONG __cdecl InterlockedDecrement64(LONGLONG volatile *Addend);
LONG __cdecl InterlockedIncrementAcquire(LONG volatile *Addend);
LONG __cdecl InterlockedDecrementAcquire(LONG volatile *Addend);
LONG __cdecl InterlockedIncrementRelease(LONG volatile *Addend);
LONG __cdecl InterlockedDecrementRelease(LONG volatile *Addend);
LONGLONG __cdecl InterlockedExchange64 (LONGLONG volatile *Target,LONGLONG Value);
LONGLONG __cdecl InterlockedExchangeAcquire64 (LONGLONG volatile *Target,LONGLONG Value);
LONGLONG __cdecl InterlockedExchangeAdd64 (LONGLONG volatile *Addend,LONGLONG Value);
LONGLONG __cdecl InterlockedCompareExchange64 (LONGLONG volatile *Destination,LONGLONG ExChange,LONGLONG Comperand);
LONGLONG __cdecl InterlockedCompareExchangeAcquire64 (LONGLONG volatile *Destination,LONGLONG ExChange,LONGLONG Comperand);
LONGLONG __cdecl InterlockedCompareExchangeRelease64 (LONGLONG volatile *Destination,LONGLONG ExChange,LONGLONG Comperand);
LONG __cdecl InterlockedIncrement(LONG volatile *lpAddend);
LONG __cdecl InterlockedDecrement(LONG volatile *lpAddend);
LONG __cdecl InterlockedExchange(LONG volatile *Target,LONG Value);
LONG __cdecl InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
LONG __cdecl InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
LONG __cdecl InterlockedCompareExchangeRelease(LONG volatile *Destination,LONG ExChange,LONG Comperand);
LONG __cdecl InterlockedCompareExchangeAcquire(LONG volatile *Destination,LONG ExChange,LONG Comperand);
PVOID __cdecl InterlockedExchangePointer(PVOID volatile *Target,PVOID Value);
PVOID __cdecl InterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID ExChange,PVOID Comperand);
PVOID __cdecl InterlockedCompareExchangePointerAcquire(PVOID volatile *Destination,PVOID Exchange,PVOID Comperand);
PVOID __cdecl InterlockedCompareExchangePointerRelease(PVOID volatile *Destination,PVOID Exchange,PVOID Comperand);
#ifndef InterlockedAnd
#define InterlockedAnd InterlockedAnd_Inline
__CRT_INLINE LONG InterlockedAnd_Inline(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;
}
#endif
#ifndef InterlockedOr
#define InterlockedOr InterlockedOr_Inline
__CRT_INLINE LONG InterlockedOr_Inline(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;
}
#endif
#ifndef InterlockedXor
#define InterlockedXor InterlockedXor_Inline
__CRT_INLINE LONG InterlockedXor_Inline(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;
}
#endif
#ifndef !defined (InterlockedAnd64)
#define InterlockedAnd64 InterlockedAnd64_Inline
__CRT_INLINE LONGLONG InterlockedAnd64_Inline (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Destination;
} while(InterlockedCompareExchange64(Destination,Old & Value,Old)!=Old);
return Old;
}
#endif
#ifndef InterlockedOr64
#define InterlockedOr64 InterlockedOr64_Inline
__CRT_INLINE LONGLONG InterlockedOr64_Inline (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Destination;
} while(InterlockedCompareExchange64(Destination,Old | Value,Old)!=Old);
return Old;
}
#endif
#ifndef InterlockedXor64
#define InterlockedXor64 InterlockedXor64_Inline
__CRT_INLINE LONGLONG InterlockedXor64_Inline (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Destination;
} while(InterlockedCompareExchange64(Destination,Old ^ Value,Old)!=Old);
return Old;
}
#endif
#ifndef InterlockedBitTestAndSet
#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline
__CRT_INLINE BOOLEAN InterlockedBitTestAndSet_Inline(LONG *Base,LONG Bit) {
LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedOr(&Base[Bit/(sizeof(*Base)*8)],tBit)&tBit)!=0);
}
#endif
#ifndef InterlockedBitTestAndReset
#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline
__CRT_INLINE BOOLEAN InterlockedBitTestAndReset_Inline(LONG *Base,LONG Bit) {
LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedAnd(&Base[Bit/(sizeof(*Base)*8)],~tBit)&tBit)!=0);
}
#endif
#ifndef InterlockedBitTestAndComplement
#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline
__CRT_INLINE BOOLEAN InterlockedBitTestAndComplement_Inline(LONG *Base,LONG Bit) {
LONG tBit;
tBit = 1<<(Bit & (sizeof (*Base)*8-1));
return (BOOLEAN)((InterlockedXor(&Base[Bit/(sizeof(*Base)*8)],tBit)&tBit)!=0);
}
#endif
#elif defined(__x86_64) && !defined(RC_INVOKED)
#define InterlockedIncrement _InterlockedIncrement
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedDecrement _InterlockedDecrement
#define InterlockedDecrementAcquire InterlockedDecrement
#define InterlockedDecrementRelease InterlockedDecrement
#define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd
#define InterlockedCompareExchange _InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
#define InterlockedCompareExchangeRelease InterlockedCompareExchange
#define InterlockedExchangePointer _InterlockedExchangePointer
#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer
#define InterlockedAnd64 _InterlockedAnd64
#define InterlockedOr64 _InterlockedOr64
#define InterlockedXor64 _InterlockedXor64
#define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
LONG InterlockedIncrement(LONG volatile *Addend);
LONG InterlockedDecrement(LONG volatile *Addend);
LONG InterlockedExchange(LONG volatile *Target,LONG Value);
LONG InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
LONG InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID Exchange,PVOID Comperand);
PVOID InterlockedExchangePointer(PVOID volatile *Target,PVOID Value);
LONG64 InterlockedAnd64(LONG64 volatile *Destination,LONG64 Value);
LONG64 InterlockedOr64(LONG64 volatile *Destination,LONG64 Value);
LONG64 InterlockedXor64(LONG64 volatile *Destination,LONG64 Value);
LONG64 InterlockedIncrement64(LONG64 volatile *Addend);
LONG64 InterlockedDecrement64(LONG64 volatile *Addend);
LONG64 InterlockedExchange64(LONG64 volatile *Target,LONG64 Value);
LONG64 InterlockedExchangeAdd64(LONG64 volatile *Addend,LONG64 Value);
LONG64 InterlockedCompareExchange64(LONG64 volatile *Destination,LONG64 ExChange,LONG64 Comperand);
#else
LONG WINAPI InterlockedIncrement(LONG volatile *lpAddend);
LONG WINAPI InterlockedDecrement(LONG volatile *lpAddend);
LONG WINAPI InterlockedExchange(LONG volatile *Target,LONG Value);
#define InterlockedExchangePointer(Target,Value) (PVOID)InterlockedExchange((PLONG)(Target),(LONG)(Value))
LONG WINAPI InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
LONG WINAPI InterlockedCompareExchange(LONG volatile *Destination,LONG Exchange,LONG Comperand);
LONGLONG WINAPI InterlockedCompareExchange64(LONGLONG volatile *Destination,LONGLONG Exchange,LONGLONG Comperand);
__CRT_INLINE LONGLONG InterlockedAnd64 (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Destination;
} while(InterlockedCompareExchange64(Destination,Old & Value,Old)!=Old);
return Old;
}
__CRT_INLINE LONGLONG InterlockedOr64 (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Destination;
} while(InterlockedCompareExchange64(Destination,Old | Value,Old)!=Old);
return Old;
}
__CRT_INLINE LONGLONG InterlockedXor64 (LONGLONG volatile *Destination,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Destination;
} while(InterlockedCompareExchange64(Destination,Old ^ Value,Old)!=Old);
return Old;
}
__CRT_INLINE LONGLONG InterlockedIncrement64(LONGLONG volatile *Addend) {
LONGLONG Old;
do {
Old = *Addend;
} while(InterlockedCompareExchange64(Addend,Old + 1,Old)!=Old);
return Old + 1;
}
__CRT_INLINE LONGLONG InterlockedDecrement64(LONGLONG volatile *Addend) {
LONGLONG Old;
do {
Old = *Addend;
} while(InterlockedCompareExchange64(Addend,Old - 1,Old)!=Old);
return Old - 1;
}
__CRT_INLINE LONGLONG InterlockedExchange64(LONGLONG volatile *Target,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Target;
} while(InterlockedCompareExchange64(Target,Value,Old)!=Old);
return Old;
}
__CRT_INLINE LONGLONG InterlockedExchangeAdd64(LONGLONG volatile *Addend,LONGLONG Value) {
LONGLONG Old;
do {
Old = *Addend;
} while(InterlockedCompareExchange64(Addend,Old + Value,Old)!=Old);
return Old;
}
#ifdef __cplusplus
__CRT_INLINE PVOID __cdecl __InlineInterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID ExChange,PVOID Comperand) {
return((PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)Destination,(LONG)(LONG_PTR)ExChange,(LONG)(LONG_PTR)Comperand));
}
#define InterlockedCompareExchangePointer __InlineInterlockedCompareExchangePointer
#else
#define InterlockedCompareExchangePointer(Destination,ExChange,Comperand)(PVOID)(LONG_PTR)InterlockedCompareExchange((LONG volatile *)(Destination),(LONG)(LONG_PTR)(ExChange),(LONG)(LONG_PTR)(Comperand))
#endif
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedDecrementAcquire InterlockedDecrement
#define InterlockedDecrementRelease InterlockedDecrement
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
#define InterlockedCompareExchangeRelease InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
#define InterlockedCompareExchangePointerAcquire InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerRelease InterlockedCompareExchangePointer
#endif
#if defined(_SLIST_HEADER_) && !defined(_NTOSP_)
WINBASEAPI VOID WINAPI InitializeSListHead(PSLIST_HEADER ListHead);
WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPopEntrySList(PSLIST_HEADER ListHead);
WINBASEAPI PSLIST_ENTRY WINAPI InterlockedPushEntrySList(PSLIST_HEADER ListHead,PSLIST_ENTRY ListEntry);
WINBASEAPI PSLIST_ENTRY WINAPI InterlockedFlushSList(PSLIST_HEADER ListHead);
WINBASEAPI USHORT WINAPI QueryDepthSList(PSLIST_HEADER ListHead);
#endif
#endif
#endif
WINBASEAPI WINBOOL WINAPI FreeResource(HGLOBAL hResData);
WINBASEAPI LPVOID WINAPI LockResource(HGLOBAL hResData);
#define UnlockResource(hResData) ((hResData),0)
#define MAXINTATOM 0xC000
src/win32/include/winapi/winnt.h view on Meta::CPAN
#if defined(__x86_64) && !defined(RC_INVOKED)
#ifdef __cplusplus
extern "C" {
#endif
#define BitTest _bittest
#define BitTestAndComplement _bittestandcomplement
#define BitTestAndSet _bittestandset
#define BitTestAndReset _bittestandreset
#define InterlockedBitTestAndSet _interlockedbittestandset
#define InterlockedBitTestAndReset _interlockedbittestandreset
#define BitTest64 _bittest64
#define BitTestAndComplement64 _bittestandcomplement64
#define BitTestAndSet64 _bittestandset64
#define BitTestAndReset64 _bittestandreset64
#define InterlockedBitTestAndSet64 _interlockedbittestandset64
#define InterlockedBitTestAndReset64 _interlockedbittestandreset64
__CRT_INLINE BOOLEAN _bittest(LONG const *Base,LONG Offset) {
int old = 0;
__asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _bittestandcomplement(LONG *Base,LONG Offset) {
int old = 0;
__asm__ __volatile__("btcl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN InterlockedBitTestAndComplement(LONG *Base,LONG Bit) {
int old = 0;
__asm__ __volatile__("lock ; btcl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Bit));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _bittestandset(LONG *Base,LONG Offset) {
int old = 0;
__asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _bittestandreset(LONG *Base,LONG Offset) {
int old = 0;
__asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _interlockedbittestandset(LONG *Base,LONG Offset) {
int old = 0;
__asm__ __volatile__("lock ; btsl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _interlockedbittestandreset(LONG *Base,LONG Offset) {
int old = 0;
__asm__ __volatile__("lock ; btrl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _bittest64(LONG64 const *Base,LONG64 Offset) {
int old = 0;
__asm__ __volatile__("btq %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long long *) Base))
src/win32/include/winapi/winnt.h view on Meta::CPAN
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _bittestandreset64(LONG64 *Base,LONG64 Offset) {
int old = 0;
__asm__ __volatile__("btrq %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _interlockedbittestandset64(LONG64 *Base,LONG64 Offset) {
int old = 0;
__asm__ __volatile__("lock ; btsq %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN _interlockedbittestandreset64(LONG64 *Base,LONG64 Offset) {
int old = 0;
__asm__ __volatile__("lock ; btrq %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long long *) Base))
:"Ir" (Offset));
return (BOOLEAN) (old!=0);
}
#define BitScanForward _BitScanForward
#define BitScanReverse _BitScanReverse
#define BitScanForward64 _BitScanForward64
#define BitScanReverse64 _BitScanReverse64
src/win32/include/winapi/winnt.h view on Meta::CPAN
}
__CRT_INLINE BOOLEAN _BitScanForward64(DWORD *Index,DWORD64 Mask) {
__asm__ __volatile__("bsfq %1,%0" : "=r" (Mask),"=m" ((*(volatile long long *)Index)));
return Mask!=0;
}
__CRT_INLINE BOOLEAN _BitScanReverse64(DWORD *Index,DWORD64 Mask) {
__asm__ __volatile__("bsrq %1,%0" : "=r" (Mask),"=m" ((*(volatile long long *)Index)));
return Mask!=0;
}
#define InterlockedIncrement16 _InterlockedIncrement16
#define InterlockedDecrement16 _InterlockedDecrement16
#define InterlockedCompareExchange16 _InterlockedCompareExchange16
#define InterlockedAnd _InterlockedAnd
#define InterlockedOr _InterlockedOr
#define InterlockedXor _InterlockedXor
#define InterlockedIncrement _InterlockedIncrement
#define InterlockedIncrementAcquire InterlockedIncrement
#define InterlockedIncrementRelease InterlockedIncrement
#define InterlockedDecrement _InterlockedDecrement
#define InterlockedDecrementAcquire InterlockedDecrement
#define InterlockedDecrementRelease InterlockedDecrement
#define InterlockedAdd _InterlockedAdd
#define InterlockedExchange _InterlockedExchange
#define InterlockedExchangeAdd _InterlockedExchangeAdd
#define InterlockedCompareExchange _InterlockedCompareExchange
#define InterlockedCompareExchangeAcquire InterlockedCompareExchange
#define InterlockedCompareExchangeRelease InterlockedCompareExchange
#define InterlockedAnd64 _InterlockedAnd64
#define InterlockedAndAffinity InterlockedAnd64
#define InterlockedOr64 _InterlockedOr64
#define InterlockedOrAffinity InterlockedOr64
#define InterlockedXor64 _InterlockedXor64
#define InterlockedIncrement64 _InterlockedIncrement64
#define InterlockedDecrement64 _InterlockedDecrement64
#define InterlockedAdd64 _InterlockedAdd64
#define InterlockedExchange64 _InterlockedExchange64
#define InterlockedExchangeAcquire64 InterlockedExchange64
#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64
#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64
#define InterlockedExchangePointer _InterlockedExchangePointer
#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer
#define InterlockedExchangeAddSizeT(a,b) InterlockedExchangeAdd64((LONG64 *)a,b)
#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a)
#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a)
__CRT_INLINE SHORT InterlockedIncrement16(SHORT volatile *Addend) {
unsigned char c;
unsigned char s;
__asm__ __volatile__(
"lock ; addw $1,%0; sete %1 ; sets %2"
:"=m" (*Addend), "=qm" (c), "=qm" (s)
:"m" (*Addend) : "memory");
return (c != 0 ? 0 : (s != 0 ? -1 : 1));
}
__CRT_INLINE SHORT InterlockedDecrement16(SHORT volatile *Addend) {
unsigned char c;
unsigned char s;
__asm__ __volatile__(
"lock ; subw $1,%0; sete %1 ; sets %2"
:"=m" (*Addend), "=qm" (c), "=qm" (s)
:"m" (*Addend) : "memory");
return (c != 0 ? 0 : (s != 0 ? -1 : 1));
}
__CRT_INLINE SHORT InterlockedCompareExchange16(SHORT volatile *Destination,SHORT ExChange,SHORT Comperand) {
SHORT prev;
__asm__ __volatile__("lock ; cmpxchgw %w1,%2"
:"=a"(prev)
:"q"(ExChange), "m"(*Destination), "0"(Comperand)
: "memory");
return prev;
}
__CRT_INLINE LONG InterlockedAnd(LONG volatile *Destination,LONG Value) {
__asm__ __volatile__("lock ; andl %0,%1"
: :"r"(Value),"m"(*Destination)
: "memory");
return *Destination;
}
__CRT_INLINE LONG InterlockedOr(LONG volatile *Destination,LONG Value) {
__asm__ __volatile__("lock ; orl %0,%1"
: : "r"(Value),"m"(*Destination) : "memory");
return *Destination;
}
__CRT_INLINE LONG InterlockedXor(LONG volatile *Destination,LONG Value) {
__asm__ __volatile__("lock ; xorl %0,%1"
: : "r"(Value),"m"(*Destination) : "memory");
return *Destination;
}
// $$$$
__CRT_INLINE LONG64 InterlockedAnd64(LONG64 volatile *Destination,LONG64 Value) {
__asm__ __volatile__("lock ; andq %0,%1"
: : "r"(Value),"m"(*Destination) : "memory");
return *Destination;
}
__CRT_INLINE LONG64 InterlockedOr64(LONG64 volatile *Destination,LONG64 Value) {
__asm__ __volatile__("lock ; orq %0,%1"
: : "r"(Value),"m"(*Destination) : "memory");
return *Destination;
}
__CRT_INLINE LONG64 InterlockedXor64(LONG64 volatile *Destination,LONG64 Value) {
__asm__ __volatile__("lock ; xorq %0,%1"
: : "r"(Value),"m"(*Destination) : "memory");
return *Destination;
}
__CRT_INLINE LONG InterlockedIncrement(LONG volatile *Addend) {
unsigned char c;
unsigned char s;
__asm__ __volatile__(
"lock ; addl $1,%0; sete %1 ; sets %2"
:"=m" (*Addend), "=qm" (c), "=qm" (s)
:"m" (*Addend) : "memory");
return (c != 0 ? 0 : (s != 0 ? -1 : 1));
}
__CRT_INLINE LONG InterlockedDecrement(LONG volatile *Addend) {
unsigned char c;
unsigned char s;
__asm__ __volatile__(
"lock ; subl $1,%0; sete %1 ; sets %2"
:"=m" (*Addend), "=qm" (c), "=qm" (s)
:"m" (*Addend) : "memory");
return (c != 0 ? 0 : (s != 0 ? -1 : 1));
}
__CRT_INLINE LONG InterlockedExchange(LONG volatile *Target,LONG Value) {
__asm__ __volatile("lock ; xchgl %0,%1"
: "=r"(Value)
: "m"(*Target),"0"(Value)
: "memory");
return Value;
}
LONG InterlockedExchangeAdd(LONG volatile *Addend,LONG Value);
#ifndef _X86AMD64_
__CRT_INLINE LONG InterlockedAdd(LONG volatile *Addend,LONG Value) { return InterlockedExchangeAdd(Addend,Value) + Value; }
#endif
__CRT_INLINE LONG InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand) {
LONG prev;
__asm__ __volatile__("lock ; cmpxchgl %1,%2" : "=a" (prev) : "q" (ExChange),"m" (*Destination), "0" (Comperand) : "memory");
return prev;
}
__CRT_INLINE LONG64 InterlockedIncrement64(LONG64 volatile *Addend) {
unsigned char c;
unsigned char s;
__asm__ __volatile__(
"lock ; addq $1,%0; sete %1 ; sets %2"
:"=m" (*Addend), "=qm" (c), "=qm" (s)
:"m" (*Addend) : "memory");
return (c != 0 ? 0 : (s != 0 ? -1 : 1));
}
__CRT_INLINE LONG64 InterlockedDecrement64(LONG64 volatile *Addend) {
unsigned char c;
unsigned char s;
__asm__ __volatile__(
"lock ; subq $1,%0; sete %1 ; sets %2"
:"=m" (*Addend), "=qm" (c), "=qm" (s)
:"m" (*Addend) : "memory");
return (c != 0 ? 0 : (s != 0 ? -1 : 1));
}
__CRT_INLINE LONG64 InterlockedExchange64(LONG64 volatile *Target,LONG64 Value) {
__asm__ __volatile("lock ; xchgq %0,%1"
: "=r"(Value)
: "m"(*Target),"0"(Value)
: "memory");
return Value;
}
LONG64 InterlockedExchangeAdd64(LONG64 volatile *Addend,LONG64 Value);
#ifndef _X86AMD64_
__CRT_INLINE LONG64 InterlockedAdd64(LONG64 volatile *Addend,LONG64 Value) { return InterlockedExchangeAdd64(Addend,Value) + Value; }
#endif
__CRT_INLINE LONG64 InterlockedCompareExchange64(LONG64 volatile *Destination,LONG64 ExChange,LONG64 Comperand) {
LONG64 prev;
__asm__ __volatile__("lock ; cmpxchgq %1,%2" : "=a" (prev) : "q" (ExChange),"m" (*Destination), "0" (Comperand) : "memory");
return prev;
}
__CRT_INLINE PVOID InterlockedCompareExchangePointer(PVOID volatile *Destination,PVOID ExChange,PVOID Comperand) {
PVOID prev;
__asm__ __volatile__("lock ; cmpxchgq %1,%2" : "=a" (prev) : "q" (ExChange),"m" (*Destination), "0" (Comperand) : "memory");
return prev;
}
__CRT_INLINE PVOID InterlockedExchangePointer(PVOID volatile *Target,PVOID Value) {
__asm__ __volatile("lock ; xchgq %0,%1"
: "=r"(Value)
: "m"(*Target),"0"(Value)
: "memory");
return Value;
}
#define CacheLineFlush(Address) _mm_clflush(Address)
VOID _ReadWriteBarrier(VOID);
src/win32/include/winapi/winnt.h view on Meta::CPAN
NTSYSAPI BOOLEAN __cdecl RtlInstallFunctionTableCallback(DWORD64 TableIdentifier,DWORD64 BaseAddress,DWORD Length,PGET_RUNTIME_FUNCTION_CALLBACK Callback,PVOID Context,PCWSTR OutOfProcessCallbackDll);
NTSYSAPI BOOLEAN __cdecl RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable);
#endif
#ifdef I_X86_
#if(defined(_X86_) && !defined(__x86_64)) && !defined(RC_INVOKED)
#ifdef __cplusplus
extern "C" {
#endif
__CRT_INLINE BOOLEAN InterlockedBitTestAndSet(LONG *Base,LONG Bit) {
int old = 0;
__asm__ __volatile__("lock ; btsl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Bit));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN InterlockedBitTestAndReset(LONG *Base,LONG Bit) {
int old = 0;
__asm__ __volatile__("lock ; btrl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Bit));
return (BOOLEAN) (old!=0);
}
__CRT_INLINE BOOLEAN InterlockedBitTestAndComplement(LONG *Base,LONG Bit) {
int old = 0;
__asm__ __volatile__("lock ; btcl %2,%1\n\tsbbl %0,%0 "
:"=r" (old),"=m" ((*(volatile long *) Base))
:"Ir" (Bit));
return (BOOLEAN) (old!=0);
}
#ifdef _PREFIX_
BYTE __readfsbyte(DWORD Offset);
WORD __readfsword(DWORD Offset);
src/win32/include/winapi/winnt.h view on Meta::CPAN
SLIST_ENTRY Next;
WORD Depth;
WORD Sequence;
};
} SLIST_HEADER,*PSLIST_HEADER;
#endif
#endif
NTSYSAPI VOID NTAPI RtlInitializeSListHead(PSLIST_HEADER ListHead);
NTSYSAPI PSLIST_ENTRY NTAPI RtlFirstEntrySList(const SLIST_HEADER *ListHead);
NTSYSAPI PSLIST_ENTRY NTAPI RtlInterlockedPopEntrySList(PSLIST_HEADER ListHead);
NTSYSAPI PSLIST_ENTRY NTAPI RtlInterlockedPushEntrySList(PSLIST_HEADER ListHead,PSLIST_ENTRY ListEntry);
NTSYSAPI PSLIST_ENTRY NTAPI RtlInterlockedFlushSList(PSLIST_HEADER ListHead);
NTSYSAPI WORD NTAPI RtlQueryDepthSList(PSLIST_HEADER ListHead);
#define HEAP_NO_SERIALIZE 0x00000001
#define HEAP_GROWABLE 0x00000002
#define HEAP_GENERATE_EXCEPTIONS 0x00000004
#define HEAP_ZERO_MEMORY 0x00000008
#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
#define HEAP_TAIL_CHECKING_ENABLED 0x00000020
#define HEAP_FREE_CHECKING_ENABLED 0x00000040
#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
src/win32/lib/kernel32.def view on Meta::CPAN
HeapLock
HeapReAlloc
HeapSetFlags
HeapSize
HeapUnlock
HeapValidate
HeapWalk
InitAtomTable
InitializeCriticalSection
InitializeCriticalSectionAndSpinCount
InterlockedCompareExchange
InterlockedDecrement
InterlockedExchange
InterlockedExchangeAdd
InterlockedIncrement
InvalidateNLSCache
IsBadCodePtr
IsBadHugeReadPtr
IsBadHugeWritePtr
IsBadReadPtr
IsBadStringPtrA
IsBadStringPtrW
IsBadWritePtr
IsDBCSLeadByte
IsDBCSLeadByteEx
( run in 0.513 second using v1.01-cache-2.11-cpan-49f99fa48dc )