ReactOS 0.4.16-dev-289-g096a551
intrin_x86.h File Reference

Go to the source code of this file.

Macros

#define _ReturnAddress()   (__builtin_return_address(0))
 
#define _AddressOfReturnAddress()   (&(((void **)(__builtin_frame_address(0)))[1]))
 
#define _ReadBarrier   _ReadWriteBarrier
 
#define _WriteBarrier   _ReadWriteBarrier
 

Functions

void *__cdecl memmove (void *dest, const void *source, size_t num)
 
__INTRIN_INLINE void *__cdecl memcpy (void *dest, const void *source, size_t num)
 
__INTRIN_INLINE void _ReadWriteBarrier (void)
 
__INTRIN_INLINE void _mm_mfence (void)
 
__INTRIN_INLINE void _mm_lfence (void)
 
__INTRIN_INLINE char _InterlockedCompareExchange8 (volatile char *Destination, char Exchange, char Comperand)
 
__INTRIN_INLINE short _InterlockedCompareExchange16 (volatile short *Destination, short Exchange, short Comperand)
 
__INTRIN_INLINE long _InterlockedCompareExchange (volatile long *Destination, long Exchange, long Comperand)
 
__INTRIN_INLINE void_InterlockedCompareExchangePointer (void *volatile *Destination, void *Exchange, void *Comperand)
 
__INTRIN_INLINE char _InterlockedExchange8 (volatile char *Target, char Value)
 
__INTRIN_INLINE short _InterlockedExchange16 (volatile short *Target, short Value)
 
__INTRIN_INLINE long _InterlockedExchange (volatile long *Target, long Value)
 
__INTRIN_INLINE void_InterlockedExchangePointer (void *volatile *Target, void *Value)
 
__INTRIN_INLINE char _InterlockedExchangeAdd8 (char volatile *Addend, char Value)
 
__INTRIN_INLINE short _InterlockedExchangeAdd16 (volatile short *Addend, short Value)
 
__INTRIN_INLINE long _InterlockedExchangeAdd (volatile long *Addend, long Value)
 
__INTRIN_INLINE char _InterlockedAnd8 (volatile char *value, char mask)
 
__INTRIN_INLINE short _InterlockedAnd16 (volatile short *value, short mask)
 
__INTRIN_INLINE long _InterlockedAnd (volatile long *value, long mask)
 
__INTRIN_INLINE char _InterlockedOr8 (volatile char *value, char mask)
 
__INTRIN_INLINE short _InterlockedOr16 (volatile short *value, short mask)
 
__INTRIN_INLINE long _InterlockedOr (volatile long *value, long mask)
 
__INTRIN_INLINE char _InterlockedXor8 (volatile char *value, char mask)
 
__INTRIN_INLINE short _InterlockedXor16 (volatile short *value, short mask)
 
__INTRIN_INLINE long _InterlockedXor (volatile long *value, long mask)
 
__INTRIN_INLINE long _InterlockedDecrement (volatile long *lpAddend)
 
__INTRIN_INLINE long _InterlockedIncrement (volatile long *lpAddend)
 
__INTRIN_INLINE short _InterlockedDecrement16 (volatile short *lpAddend)
 
__INTRIN_INLINE short _InterlockedIncrement16 (volatile short *lpAddend)
 
__INTRIN_INLINE long long _InterlockedCompareExchange64 (volatile long long *Destination, long long Exchange, long long Comperand)
 
__INTRIN_INLINE unsigned char _interlockedbittestandreset (volatile long *a, long b)
 
__INTRIN_INLINE unsigned char _interlockedbittestandset (volatile long *a, long b)
 
__INTRIN_INLINE void __stosb (unsigned char *Dest, unsigned char Data, size_t Count)
 
__INTRIN_INLINE void __stosw (unsigned short *Dest, unsigned short Data, size_t Count)
 
__INTRIN_INLINE void __stosd (unsigned long *Dest, unsigned long Data, size_t Count)
 
__INTRIN_INLINE void __movsb (unsigned char *Destination, const unsigned char *Source, size_t Count)
 
__INTRIN_INLINE void __movsw (unsigned short *Destination, const unsigned short *Source, size_t Count)
 
__INTRIN_INLINE void __movsd (unsigned long *Destination, const unsigned long *Source, size_t Count)
 
__INTRIN_INLINE void __writefsbyte (unsigned long Offset, unsigned char Data)
 
__INTRIN_INLINE void __writefsword (unsigned long Offset, unsigned short Data)
 
__INTRIN_INLINE void __writefsdword (unsigned long Offset, unsigned long Data)
 
__INTRIN_INLINE unsigned char __readfsbyte (unsigned long Offset)
 
__INTRIN_INLINE unsigned short __readfsword (unsigned long Offset)
 
__INTRIN_INLINE unsigned long __readfsdword (unsigned long Offset)
 
__INTRIN_INLINE void __incfsbyte (unsigned long Offset)
 
__INTRIN_INLINE void __incfsword (unsigned long Offset)
 
__INTRIN_INLINE void __incfsdword (unsigned long Offset)
 
__INTRIN_INLINE void __addfsbyte (unsigned long Offset, unsigned char Data)
 
__INTRIN_INLINE void __addfsword (unsigned long Offset, unsigned short Data)
 
__INTRIN_INLINE void __addfsdword (unsigned long Offset, unsigned long Data)
 
__INTRIN_INLINE unsigned char _BitScanForward (unsigned long *Index, unsigned long Mask)
 
__INTRIN_INLINE unsigned char _BitScanReverse (unsigned long *Index, unsigned long Mask)
 
__INTRIN_INLINE unsigned char _bittest (const long *a, long b)
 
__INTRIN_INLINE unsigned char _bittestandcomplement (long *a, long b)
 
__INTRIN_INLINE unsigned char _bittestandreset (long *a, long b)
 
__INTRIN_INLINE unsigned char _bittestandset (long *a, long b)
 
__INTRIN_INLINE unsigned char __cdecl _rotl8 (unsigned char value, unsigned char shift)
 
__INTRIN_INLINE unsigned short __cdecl _rotl16 (unsigned short value, unsigned char shift)
 
__INTRIN_INLINE unsigned int __cdecl _rotl (unsigned int value, int shift)
 
__INTRIN_INLINE unsigned long long __cdecl _rotl64 (unsigned long long value, int shift)
 
__INTRIN_INLINE unsigned int __cdecl _rotr (unsigned int value, int shift)
 
__INTRIN_INLINE unsigned char __cdecl _rotr8 (unsigned char value, unsigned char shift)
 
__INTRIN_INLINE unsigned short __cdecl _rotr16 (unsigned short value, unsigned char shift)
 
__INTRIN_INLINE unsigned long long __cdecl _rotr64 (unsigned long long value, int shift)
 
__INTRIN_INLINE unsigned long __cdecl _lrotl (unsigned long value, int shift)
 
__INTRIN_INLINE unsigned long __cdecl _lrotr (unsigned long value, int shift)
 
__INTRIN_INLINE unsigned long long __ll_lshift (unsigned long long Mask, int Bit)
 
__INTRIN_INLINE long long __ll_rshift (long long Mask, int Bit)
 
__INTRIN_INLINE unsigned long long __ull_rshift (unsigned long long Mask, int Bit)
 
__INTRIN_INLINE unsigned short __cdecl _byteswap_ushort (unsigned short value)
 
__INTRIN_INLINE unsigned long __cdecl _byteswap_ulong (unsigned long value)
 
__INTRIN_INLINE unsigned long long __cdecl _byteswap_uint64 (unsigned long long value)
 
__INTRIN_INLINE unsigned int __lzcnt (unsigned int value)
 
__INTRIN_INLINE unsigned short __lzcnt16 (unsigned short value)
 
__INTRIN_INLINE unsigned int __popcnt (unsigned int value)
 
__INTRIN_INLINE unsigned short __popcnt16 (unsigned short value)
 
__INTRIN_INLINE long long __emul (int a, int b)
 
__INTRIN_INLINE unsigned long long __emulu (unsigned int a, unsigned int b)
 
__INTRIN_INLINE long long __cdecl _abs64 (long long value)
 
__INTRIN_INLINE unsigned char __inbyte (unsigned short Port)
 
__INTRIN_INLINE unsigned short __inword (unsigned short Port)
 
__INTRIN_INLINE unsigned long __indword (unsigned short Port)
 
__INTRIN_INLINE void __inbytestring (unsigned short Port, unsigned char *Buffer, unsigned long Count)
 
__INTRIN_INLINE void __inwordstring (unsigned short Port, unsigned short *Buffer, unsigned long Count)
 
__INTRIN_INLINE void __indwordstring (unsigned short Port, unsigned long *Buffer, unsigned long Count)
 
__INTRIN_INLINE void __outbyte (unsigned short Port, unsigned char Data)
 
__INTRIN_INLINE void __outword (unsigned short Port, unsigned short Data)
 
__INTRIN_INLINE void __outdword (unsigned short Port, unsigned long Data)
 
__INTRIN_INLINE void __outbytestring (unsigned short Port, unsigned char *Buffer, unsigned long Count)
 
__INTRIN_INLINE void __outwordstring (unsigned short Port, unsigned short *Buffer, unsigned long Count)
 
__INTRIN_INLINE void __outdwordstring (unsigned short Port, unsigned long *Buffer, unsigned long Count)
 
__INTRIN_INLINE int __cdecl _inp (unsigned short Port)
 
__INTRIN_INLINE unsigned short __cdecl _inpw (unsigned short Port)
 
__INTRIN_INLINE unsigned long __cdecl _inpd (unsigned short Port)
 
__INTRIN_INLINE int __cdecl _outp (unsigned short Port, int databyte)
 
__INTRIN_INLINE unsigned short __cdecl _outpw (unsigned short Port, unsigned short dataword)
 
__INTRIN_INLINE unsigned long __cdecl _outpd (unsigned short Port, unsigned long dataword)
 
__INTRIN_INLINE void __cpuid (int CPUInfo[4], int InfoType)
 
__INTRIN_INLINE void __cpuidex (int CPUInfo[4], int InfoType, int ECXValue)
 
__INTRIN_INLINE unsigned long long __rdtsc (void)
 
__INTRIN_INLINE void __writeeflags (uintptr_t Value)
 
__INTRIN_INLINE uintptr_t __readeflags (void)
 
__INTRIN_INLINE void __cdecl __debugbreak (void)
 
__INTRIN_INLINE void __ud2 (void)
 
__INTRIN_INLINE void __int2c (void)
 
__INTRIN_INLINE void __cdecl _disable (void)
 
__INTRIN_INLINE void __cdecl _enable (void)
 
__INTRIN_INLINE void __halt (void)
 
 __declspec (noreturn) __INTRIN_INLINE void __fastfail(unsigned int Code)
 
__INTRIN_INLINE void __writecr0 (unsigned int Data)
 
__INTRIN_INLINE void __writecr3 (unsigned int Data)
 
__INTRIN_INLINE void __writecr4 (unsigned int Data)
 
__INTRIN_INLINE unsigned long __readcr0 (void)
 
__INTRIN_INLINE unsigned long __readcr2 (void)
 
__INTRIN_INLINE unsigned long __readcr3 (void)
 
__INTRIN_INLINE unsigned long __readcr4 (void)
 
__INTRIN_INLINE unsigned int __readdr (unsigned int reg)
 
__INTRIN_INLINE void __writedr (unsigned reg, unsigned int value)
 
__INTRIN_INLINE void __invlpg (void *Address)
 
__INTRIN_INLINE unsigned long long __readmsr (unsigned long reg)
 
__INTRIN_INLINE void __writemsr (unsigned long Register, unsigned long long Value)
 
__INTRIN_INLINE unsigned long long __readpmc (unsigned long counter)
 
__INTRIN_INLINE unsigned long __segmentlimit (unsigned long a)
 
__INTRIN_INLINE void __wbinvd (void)
 
__INTRIN_INLINE void __lidt (void *Source)
 
__INTRIN_INLINE void __sidt (void *Destination)
 
__INTRIN_INLINE void _sgdt (void *Destination)
 
__INTRIN_INLINE void _mm_pause (void)
 
__INTRIN_INLINE void __nop (void)
 

Macro Definition Documentation

◆ _AddressOfReturnAddress

#define _AddressOfReturnAddress (   void)    (&(((void **)(__builtin_frame_address(0)))[1]))

Definition at line 82 of file intrin_x86.h.

◆ _ReadBarrier

#define _ReadBarrier (   void)    _ReadWriteBarrier

Definition at line 95 of file intrin_x86.h.

◆ _ReturnAddress

#define _ReturnAddress (   void)    (__builtin_return_address(0))

Definition at line 81 of file intrin_x86.h.

◆ _WriteBarrier

#define _WriteBarrier (   void)    _ReadWriteBarrier

Definition at line 96 of file intrin_x86.h.

Function Documentation

◆ __addfsbyte()

__INTRIN_INLINE void __addfsbyte ( unsigned long  Offset,
unsigned char  Data 
)

Definition at line 1016 of file intrin_x86.h.

1017{
1018 if(!__builtin_constant_p(Offset))
1019 __asm__ __volatile__("addb %b[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
1020 else
1021 __asm__ __volatile__("addb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
1022}
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

◆ __addfsdword()

__INTRIN_INLINE void __addfsdword ( unsigned long  Offset,
unsigned long  Data 
)

Definition at line 1032 of file intrin_x86.h.

1033{
1034 if(!__builtin_constant_p(Offset))
1035 __asm__ __volatile__("addl %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
1036 else
1037 __asm__ __volatile__("addl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
1038}

◆ __addfsword()

__INTRIN_INLINE void __addfsword ( unsigned long  Offset,
unsigned short  Data 
)

Definition at line 1024 of file intrin_x86.h.

1025{
1026 if(!__builtin_constant_p(Offset))
1027 __asm__ __volatile__("addw %w[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
1028 else
1029 __asm__ __volatile__("addw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
1030}

◆ __cpuid()

__INTRIN_INLINE void __cpuid ( int  CPUInfo[4],
int  InfoType 
)

Definition at line 1644 of file intrin_x86.h.

1645{
1646 __asm__ __volatile__("cpuid" : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) : "a" (InfoType));
1647}

◆ __cpuidex()

__INTRIN_INLINE void __cpuidex ( int  CPUInfo[4],
int  InfoType,
int  ECXValue 
)

Definition at line 1649 of file intrin_x86.h.

1650{
1651 __asm__ __volatile__("cpuid" : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) : "a" (InfoType), "c" (ECXValue));
1652}

Referenced by BlArchCpuId(), KiGetFeatureBits(), and ZSTD_cpuid().

◆ __debugbreak()

◆ __declspec()

__declspec ( noreturn  )

Definition at line 1720 of file intrin_x86.h.

1722{
1723 __asm__("int $0x29" : : "c"(Code) : "memory");
1724 __builtin_unreachable();
1725}
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1701

◆ __emul()

__INTRIN_INLINE long long __emul ( int  a,
int  b 
)

Definition at line 1480 of file intrin_x86.h.

1481{
1482 long long retval;
1483 __asm__("imull %[b]" : "=A" (retval) : [a] "a" (a), [b] "rm" (b));
1484 return retval;
1485}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ __emulu()

Definition at line 1489 of file intrin_x86.h.

1490{
1491 unsigned long long retval;
1492 __asm__("mull %[b]" : "=A" (retval) : [a] "a" (a), [b] "rm" (b));
1493 return retval;
1494}

◆ __halt()

◆ __inbyte()

Definition at line 1524 of file intrin_x86.h.

1525{
1526 unsigned char byte;
1527 __asm__ __volatile__("inb %w[Port], %b[byte]" : [byte] "=a" (byte) : [Port] "Nd" (Port));
1528 return byte;
1529}
#define byte(x, n)
Definition: tomcrypt.h:118
CPPORT Port[4]
Definition: headless.c:35

Referenced by _inp().

◆ __inbytestring()

__INTRIN_INLINE void __inbytestring ( unsigned short  Port,
unsigned char Buffer,
unsigned long  Count 
)

Definition at line 1545 of file intrin_x86.h.

1546{
1547 __asm__ __volatile__
1548 (
1549 "rep; insb" :
1550 [Buffer] "=D" (Buffer), [Count] "=c" (Count) :
1551 "d" (Port), "[Buffer]" (Buffer), "[Count]" (Count) :
1552 "memory"
1553 );
1554}
Definition: bufpool.h:45
int Count
Definition: noreturn.cpp:7

◆ __incfsbyte()

__INTRIN_INLINE void __incfsbyte ( unsigned long  Offset)

Definition at line 1000 of file intrin_x86.h.

1001{
1002 __asm__ __volatile__("incb %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
1003}

◆ __incfsdword()

__INTRIN_INLINE void __incfsdword ( unsigned long  Offset)

Definition at line 1010 of file intrin_x86.h.

1011{
1012 __asm__ __volatile__("incl %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
1013}

◆ __incfsword()

__INTRIN_INLINE void __incfsword ( unsigned long  Offset)

Definition at line 1005 of file intrin_x86.h.

1006{
1007 __asm__ __volatile__("incw %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
1008}

◆ __indword()

Definition at line 1538 of file intrin_x86.h.

1539{
1540 unsigned long dword;
1541 __asm__ __volatile__("inl %w[Port], %k[dword]" : [dword] "=a" (dword) : [Port] "Nd" (Port));
1542 return dword;
1543}

Referenced by _inpd().

◆ __indwordstring()

__INTRIN_INLINE void __indwordstring ( unsigned short  Port,
unsigned long Buffer,
unsigned long  Count 
)

Definition at line 1567 of file intrin_x86.h.

1568{
1569 __asm__ __volatile__
1570 (
1571 "rep; insl" :
1572 [Buffer] "=D" (Buffer), [Count] "=c" (Count) :
1573 "d" (Port), "[Buffer]" (Buffer), "[Count]" (Count) :
1574 "memory"
1575 );
1576}

◆ __int2c()

__INTRIN_INLINE void __int2c ( void  )

Definition at line 1698 of file intrin_x86.h.

1699{
1700 __asm__("int $0x2c");
1701}

◆ __invlpg()

__INTRIN_INLINE void __invlpg ( void Address)

Definition at line 1968 of file intrin_x86.h.

1969{
1970 __asm__ __volatile__ ("invlpg (%[Address])" : : [Address] "b" (Address) : "memory");
1971}
static WCHAR Address[46]
Definition: ping.c:68

Referenced by KeInvalidateTlbEntry(), KiMarkPageAsReadOnly(), MiArchCreateProcessAddressSpace(), MiFlushTlb(), MiFlushTlbIpiRoutine(), and MmDefpFlushTlbEntry().

◆ __inword()

Definition at line 1531 of file intrin_x86.h.

1532{
1533 unsigned short word;
1534 __asm__ __volatile__("inw %w[Port], %w[word]" : [word] "=a" (word) : [Port] "Nd" (Port));
1535 return word;
1536}
const WCHAR * word
Definition: lex.c:36

Referenced by _inpw().

◆ __inwordstring()

__INTRIN_INLINE void __inwordstring ( unsigned short  Port,
unsigned short Buffer,
unsigned long  Count 
)

Definition at line 1556 of file intrin_x86.h.

1557{
1558 __asm__ __volatile__
1559 (
1560 "rep; insw" :
1561 [Buffer] "=D" (Buffer), [Count] "=c" (Count) :
1562 "d" (Port), "[Buffer]" (Buffer), "[Count]" (Count) :
1563 "memory"
1564 );
1565}

◆ __lidt()

__INTRIN_INLINE void __lidt ( void Source)

Definition at line 2018 of file intrin_x86.h.

2019{
2020 __asm__ __volatile__("lidt %0" : : "m"(*(short*)Source));
2021}
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169

Referenced by Amd64SetupIdt(), BlpArchInitialize(), KeInitExceptions(), KiI386PentiumLockErrataFixup(), KiRestoreProcessorControlState(), and WinLdrSetProcessorContext().

◆ __ll_lshift()

__INTRIN_INLINE unsigned long long __ll_lshift ( unsigned long long  Mask,
int  Bit 
)

Definition at line 1351 of file intrin_x86.h.

1352{
1353 unsigned long long retval = Mask;
1354
1355 __asm__
1356 (
1357 "shldl %b[Bit], %%eax, %%edx; sall %b[Bit], %%eax" :
1358 "+A" (retval) :
1359 [Bit] "Nc" ((unsigned char)((unsigned long)Bit) & 0xFF)
1360 );
1361
1362 return retval;
1363}
unsigned int Mask
Definition: fpcontrol.c:82

◆ __ll_rshift()

__INTRIN_INLINE long long __ll_rshift ( long long  Mask,
int  Bit 
)

Definition at line 1365 of file intrin_x86.h.

1366{
1367 long long retval = Mask;
1368
1369 __asm__
1370 (
1371 "shrdl %b[Bit], %%edx, %%eax; sarl %b[Bit], %%edx" :
1372 "+A" (retval) :
1373 [Bit] "Nc" ((unsigned char)((unsigned long)Bit) & 0xFF)
1374 );
1375
1376 return retval;
1377}

◆ __lzcnt()

__INTRIN_INLINE unsigned int __lzcnt ( unsigned int  value)

Definition at line 1434 of file intrin_x86.h.

1435{
1436 return __builtin_clz(value);
1437}
Definition: pdh_main.c:94

◆ __lzcnt16()

Definition at line 1441 of file intrin_x86.h.

1442{
1443 return __builtin_clz(value);
1444}

◆ __movsb()

__INTRIN_INLINE void __movsb ( unsigned char Destination,
const unsigned char Source,
size_t  Count 
)

Definition at line 812 of file intrin_x86.h.

813{
814 __asm__ __volatile__
815 (
816 "rep; movsb" :
817 [Destination] "=D" (Destination), [Source] "=S" (Source), [Count] "=c" (Count) :
818 "[Destination]" (Destination), "[Source]" (Source), "[Count]" (Count)
819 );
820}
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3016

◆ __movsd()

__INTRIN_INLINE void __movsd ( unsigned long Destination,
const unsigned long Source,
size_t  Count 
)

Definition at line 832 of file intrin_x86.h.

833{
834 __asm__ __volatile__
835 (
836 "rep; movsl" :
837 [Destination] "=D" (Destination), [Source] "=S" (Source), [Count] "=c" (Count) :
838 "[Destination]" (Destination), "[Source]" (Source), "[Count]" (Count)
839 );
840}

◆ __movsw()

__INTRIN_INLINE void __movsw ( unsigned short Destination,
const unsigned short Source,
size_t  Count 
)

Definition at line 822 of file intrin_x86.h.

823{
824 __asm__ __volatile__
825 (
826 "rep; movsw" :
827 [Destination] "=D" (Destination), [Source] "=S" (Source), [Count] "=c" (Count) :
828 "[Destination]" (Destination), "[Source]" (Source), "[Count]" (Count)
829 );
830}

◆ __nop()

__INTRIN_INLINE void __nop ( void  )

Definition at line 2042 of file intrin_x86.h.

2043{
2044 __asm__ __volatile__("nop");
2045}

Referenced by HalpRead8254Value().

◆ __outbyte()

__INTRIN_INLINE void __outbyte ( unsigned short  Port,
unsigned char  Data 
)

Definition at line 1578 of file intrin_x86.h.

1579{
1580 __asm__ __volatile__("outb %b[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data));
1581}

Referenced by _outp().

◆ __outbytestring()

__INTRIN_INLINE void __outbytestring ( unsigned short  Port,
unsigned char Buffer,
unsigned long  Count 
)

Definition at line 1593 of file intrin_x86.h.

1594{
1595 __asm__ __volatile__("rep; outsb" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
1596}

◆ __outdword()

__INTRIN_INLINE void __outdword ( unsigned short  Port,
unsigned long  Data 
)

Definition at line 1588 of file intrin_x86.h.

1589{
1590 __asm__ __volatile__("outl %k[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data));
1591}

Referenced by _outpd().

◆ __outdwordstring()

__INTRIN_INLINE void __outdwordstring ( unsigned short  Port,
unsigned long Buffer,
unsigned long  Count 
)

Definition at line 1603 of file intrin_x86.h.

1604{
1605 __asm__ __volatile__("rep; outsl" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
1606}

◆ __outword()

__INTRIN_INLINE void __outword ( unsigned short  Port,
unsigned short  Data 
)

Definition at line 1583 of file intrin_x86.h.

1584{
1585 __asm__ __volatile__("outw %w[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data));
1586}

Referenced by _outpw().

◆ __outwordstring()

__INTRIN_INLINE void __outwordstring ( unsigned short  Port,
unsigned short Buffer,
unsigned long  Count 
)

Definition at line 1598 of file intrin_x86.h.

1599{
1600 __asm__ __volatile__("rep; outsw" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
1601}

◆ __popcnt()

__INTRIN_INLINE unsigned int __popcnt ( unsigned int  value)

Definition at line 1448 of file intrin_x86.h.

1449{
1450 return __builtin_popcount(value);
1451}

◆ __popcnt16()

__INTRIN_INLINE unsigned short __popcnt16 ( unsigned short  value)

Definition at line 1455 of file intrin_x86.h.

1456{
1457 return __builtin_popcount(value);
1458}

◆ __rdtsc()

Definition at line 1655 of file intrin_x86.h.

1656{
1657#ifdef __x86_64__
1658 unsigned long long low, high;
1659 __asm__ __volatile__("rdtsc" : "=a"(low), "=d"(high));
1660 return low | (high << 32);
1661#else
1662 unsigned long long retval;
1663 __asm__ __volatile__("rdtsc" : "=A"(retval));
1664 return retval;
1665#endif
1666}

◆ __readcr0()

◆ __readcr2()

__INTRIN_INLINE unsigned long __readcr2 ( void  )

Definition at line 1811 of file intrin_x86.h.

1812{
1813 unsigned long value;
1814 __asm__ __volatile__("mov %%cr2, %[value]" : [value] "=r" (value));
1815 return value;
1816}

Referenced by KdbEnterDebuggerException(), KiSaveProcessorControlState(), and KiTrap0EHandler().

◆ __readcr3()

__INTRIN_INLINE unsigned long __readcr3 ( void  )

Definition at line 1818 of file intrin_x86.h.

1819{
1820 unsigned long value;
1821 __asm__ __volatile__("mov %%cr3, %[value]" : [value] "=r" (value));
1822 return value;
1823}

Referenced by HalpFlushTLB(), KdpTranslateAddress(), KeFlushCurrentTb(), KeFlushProcessTb(), KeStartAllProcessors(), Ki386EnableGlobalPage(), Ki386InitializeTss(), KiSaveProcessorControlState(), MiInitializePageTable(), and MmDefpFlushTlb().

◆ __readcr4()

◆ __readdr()

Definition at line 1902 of file intrin_x86.h.

1903{
1904 unsigned int value;
1905 switch (reg)
1906 {
1907 case 0:
1908 __asm__ __volatile__("mov %%dr0, %[value]" : [value] "=r" (value));
1909 break;
1910 case 1:
1911 __asm__ __volatile__("mov %%dr1, %[value]" : [value] "=r" (value));
1912 break;
1913 case 2:
1914 __asm__ __volatile__("mov %%dr2, %[value]" : [value] "=r" (value));
1915 break;
1916 case 3:
1917 __asm__ __volatile__("mov %%dr3, %[value]" : [value] "=r" (value));
1918 break;
1919 case 4:
1920 __asm__ __volatile__("mov %%dr4, %[value]" : [value] "=r" (value));
1921 break;
1922 case 5:
1923 __asm__ __volatile__("mov %%dr5, %[value]" : [value] "=r" (value));
1924 break;
1925 case 6:
1926 __asm__ __volatile__("mov %%dr6, %[value]" : [value] "=r" (value));
1927 break;
1928 case 7:
1929 __asm__ __volatile__("mov %%dr7, %[value]" : [value] "=r" (value));
1930 break;
1931 }
1932 return value;
1933}
static int reg
Definition: i386-dis.c:1290

Referenced by KiEnterV86Trap(), KiHandleDebugRegistersOnTrapEntry(), and KiSaveProcessorControlState().

◆ __readeflags()

◆ __readfsbyte()

__INTRIN_INLINE unsigned char __readfsbyte ( unsigned long  Offset)

Definition at line 974 of file intrin_x86.h.

975{
976 unsigned char value;
977 __asm__ __volatile__("movb %%fs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "ir" (Offset));
978 return value;
979}

◆ __readfsdword()

__INTRIN_INLINE unsigned long __readfsdword ( unsigned long  Offset)

Definition at line 992 of file intrin_x86.h.

993{
994 unsigned long value;
995 __asm__ __volatile__("movl %%fs:%a[Offset], %k[value]" : [value] "=r" (value) : [Offset] "ir" (Offset));
996 return value;
997}

◆ __readfsword()

__INTRIN_INLINE unsigned short __readfsword ( unsigned long  Offset)

Definition at line 983 of file intrin_x86.h.

984{
985 unsigned short value;
986 __asm__ __volatile__("movw %%fs:%a[Offset], %w[value]" : [value] "=r" (value) : [Offset] "ir" (Offset));
987 return value;
988}

◆ __readmsr()

Definition at line 1976 of file intrin_x86.h.

1977{
1978#ifdef __x86_64__
1979 unsigned long low, high;
1980 __asm__ __volatile__("rdmsr" : "=a" (low), "=d" (high) : "c" (reg));
1981 return ((unsigned long long)high << 32) | low;
1982#else
1983 unsigned long long retval;
1984 __asm__ __volatile__("rdmsr" : "=A" (retval) : "c" (reg));
1985 return retval;
1986#endif
1987}

◆ __readpmc()

__INTRIN_INLINE unsigned long long __readpmc ( unsigned long  counter)

Definition at line 1998 of file intrin_x86.h.

1999{
2000 unsigned long long retval;
2001 __asm__ __volatile__("rdpmc" : "=A" (retval) : "c" (counter));
2002 return retval;
2003}

Referenced by KsecReadMachineSpecificCounters().

◆ __segmentlimit()

__INTRIN_INLINE unsigned long __segmentlimit ( unsigned long  a)

Definition at line 2006 of file intrin_x86.h.

2007{
2008 unsigned long retval;
2009 __asm__ __volatile__("lsl %[a], %[retval]" : [retval] "=r" (retval) : [a] "rm" (a));
2010 return retval;
2011}

◆ __sidt()

◆ __stosb()

__INTRIN_INLINE void __stosb ( unsigned char Dest,
unsigned char  Data,
size_t  Count 
)

Definition at line 769 of file intrin_x86.h.

770{
771 __asm__ __volatile__
772 (
773 "rep; stosb" :
774 [Dest] "=D" (Dest), [Count] "=c" (Count) :
775 "[Dest]" (Dest), "a" (Data), "[Count]" (Count)
776 );
777}

◆ __stosd()

__INTRIN_INLINE void __stosd ( unsigned long Dest,
unsigned long  Data,
size_t  Count 
)

Definition at line 790 of file intrin_x86.h.

791{
792 __asm__ __volatile__
793 (
794 "rep; stosl" :
795 [Dest] "=D" (Dest), [Count] "=c" (Count) :
796 "[Dest]" (Dest), "a" (Data), "[Count]" (Count)
797 );
798}

◆ __stosw()

__INTRIN_INLINE void __stosw ( unsigned short Dest,
unsigned short  Data,
size_t  Count 
)

Definition at line 780 of file intrin_x86.h.

781{
782 __asm__ __volatile__
783 (
784 "rep; stosw" :
785 [Dest] "=D" (Dest), [Count] "=c" (Count) :
786 "[Dest]" (Dest), "a" (Data), "[Count]" (Count)
787 );
788}

◆ __ud2()

__INTRIN_INLINE void __ud2 ( void  )

Definition at line 1691 of file intrin_x86.h.

1692{
1693 __asm__("ud2");
1694}

◆ __ull_rshift()

__INTRIN_INLINE unsigned long long __ull_rshift ( unsigned long long  Mask,
int  Bit 
)

Definition at line 1379 of file intrin_x86.h.

1380{
1381 unsigned long long retval = Mask;
1382
1383 __asm__
1384 (
1385 "shrdl %b[Bit], %%edx, %%eax; shrl %b[Bit], %%edx" :
1386 "+A" (retval) :
1387 [Bit] "Nc" ((unsigned char)((unsigned long)Bit) & 0xFF)
1388 );
1389
1390 return retval;
1391}

◆ __wbinvd()

__INTRIN_INLINE void __wbinvd ( void  )

Definition at line 2013 of file intrin_x86.h.

2014{
2015 __asm__ __volatile__("wbinvd" : : : "memory");
2016}

◆ __writecr0()

◆ __writecr3()

◆ __writecr4()

◆ __writedr()

__INTRIN_INLINE void __writedr ( unsigned  reg,
unsigned int  value 
)

Definition at line 1935 of file intrin_x86.h.

1936{
1937 switch (reg)
1938 {
1939 case 0:
1940 __asm__("mov %[value], %%dr0" : : [value] "r" (value) : "memory");
1941 break;
1942 case 1:
1943 __asm__("mov %[value], %%dr1" : : [value] "r" (value) : "memory");
1944 break;
1945 case 2:
1946 __asm__("mov %[value], %%dr2" : : [value] "r" (value) : "memory");
1947 break;
1948 case 3:
1949 __asm__("mov %[value], %%dr3" : : [value] "r" (value) : "memory");
1950 break;
1951 case 4:
1952 __asm__("mov %[value], %%dr4" : : [value] "r" (value) : "memory");
1953 break;
1954 case 5:
1955 __asm__("mov %[value], %%dr5" : : [value] "r" (value) : "memory");
1956 break;
1957 case 6:
1958 __asm__("mov %[value], %%dr6" : : [value] "r" (value) : "memory");
1959 break;
1960 case 7:
1961 __asm__("mov %[value], %%dr7" : : [value] "r" (value) : "memory");
1962 break;
1963 }
1964}

Referenced by KiHandleDebugRegistersOnTrapEntry(), KiHandleDebugRegistersOnTrapExit(), KiRestoreProcessorControlState(), and KiSaveProcessorControlState().

◆ __writeeflags()

◆ __writefsbyte()

__INTRIN_INLINE void __writefsbyte ( unsigned long  Offset,
unsigned char  Data 
)

Definition at line 958 of file intrin_x86.h.

959{
960 __asm__ __volatile__("movb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
961}

◆ __writefsdword()

__INTRIN_INLINE void __writefsdword ( unsigned long  Offset,
unsigned long  Data 
)

Definition at line 968 of file intrin_x86.h.

969{
970 __asm__ __volatile__("movl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "ir" (Data) : "memory");
971}

◆ __writefsword()

__INTRIN_INLINE void __writefsword ( unsigned long  Offset,
unsigned short  Data 
)

Definition at line 963 of file intrin_x86.h.

964{
965 __asm__ __volatile__("movw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "ir" (Data) : "memory");
966}

◆ __writemsr()

__INTRIN_INLINE void __writemsr ( unsigned long  Register,
unsigned long long  Value 
)

Definition at line 1989 of file intrin_x86.h.

1990{
1991#ifdef __x86_64__
1992 __asm__ __volatile__("wrmsr" : : "a" (Value), "d" (Value >> 32), "c" (Register));
1993#else
1994 __asm__ __volatile__("wrmsr" : : "A" (Value), "c" (Register));
1995#endif
1996}

◆ _abs64()

Definition at line 1497 of file intrin_x86.h.

1498{
1499 return (value >= 0) ? value : -value;
1500}

◆ _BitScanForward()

__INTRIN_INLINE unsigned char _BitScanForward ( unsigned long Index,
unsigned long  Mask 
)

Definition at line 1046 of file intrin_x86.h.

1047{
1048 __asm__("bsfl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask));
1049 return Mask ? 1 : 0;
1050}
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by GetBestRoute(), MmMakeSegmentResident(), and NvNetAddWakeUpPattern().

◆ _BitScanReverse()

__INTRIN_INLINE unsigned char _BitScanReverse ( unsigned long Index,
unsigned long  Mask 
)

Definition at line 1054 of file intrin_x86.h.

1055{
1056 __asm__("bsrl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask));
1057 return Mask ? 1 : 0;
1058}

Referenced by BIT_highbit32(), MediaGprNextMedia(), MediaInitDefaultMedia(), and ZSTD_highbit32().

◆ _bittest()

__INTRIN_INLINE unsigned char _bittest ( const long a,
long  b 
)

Definition at line 1063 of file intrin_x86.h.

1064{
1065 unsigned char retval;
1066
1067 if(__builtin_constant_p(b))
1068 __asm__("bt %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval) : [a] "mr" (*(a + (b / 32))), [b] "Ir" (b % 32));
1069 else
1070 __asm__("bt %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval) : [a] "m" (*a), [b] "r" (b));
1071
1072 return retval;
1073}

◆ _bittestandcomplement()

__INTRIN_INLINE unsigned char _bittestandcomplement ( long a,
long  b 
)

Definition at line 1113 of file intrin_x86.h.

1114{
1115 unsigned char retval;
1116
1117 if(__builtin_constant_p(b))
1118 __asm__("btc %[b], %[a]; setb %b[retval]" : [a] "+mr" (*(a + (b / 32))), [retval] "=q" (retval) : [b] "Ir" (b % 32));
1119 else
1120 __asm__("btc %[b], %[a]; setb %b[retval]" : [a] "+m" (*a), [retval] "=q" (retval) : [b] "r" (b));
1121
1122 return retval;
1123}

◆ _bittestandreset()

__INTRIN_INLINE unsigned char _bittestandreset ( long a,
long  b 
)

Definition at line 1127 of file intrin_x86.h.

1128{
1129 unsigned char retval;
1130
1131 if(__builtin_constant_p(b))
1132 __asm__("btr %[b], %[a]; setb %b[retval]" : [a] "+mr" (*(a + (b / 32))), [retval] "=q" (retval) : [b] "Ir" (b % 32));
1133 else
1134 __asm__("btr %[b], %[a]; setb %b[retval]" : [a] "+m" (*a), [retval] "=q" (retval) : [b] "r" (b));
1135
1136 return retval;
1137}

◆ _bittestandset()

__INTRIN_INLINE unsigned char _bittestandset ( long a,
long  b 
)

Definition at line 1141 of file intrin_x86.h.

1142{
1143 unsigned char retval;
1144
1145 if(__builtin_constant_p(b))
1146 __asm__("bts %[b], %[a]; setb %b[retval]" : [a] "+mr" (*(a + (b / 32))), [retval] "=q" (retval) : [b] "Ir" (b % 32));
1147 else
1148 __asm__("bts %[b], %[a]; setb %b[retval]" : [a] "+m" (*a), [retval] "=q" (retval) : [b] "r" (b));
1149
1150 return retval;
1151}

◆ _byteswap_uint64()

__INTRIN_INLINE unsigned long long __cdecl _byteswap_uint64 ( unsigned long long  value)

Definition at line 1416 of file intrin_x86.h.

1417{
1418 union {
1419 unsigned long long int64part;
1420 struct {
1421 unsigned long lowpart;
1422 unsigned long hipart;
1423 };
1424 } retval;
1425 retval.int64part = value;
1426 __asm__("bswapl %[lowpart]\n"
1427 "bswapl %[hipart]\n"
1428 : [lowpart] "=r" (retval.hipart), [hipart] "=r" (retval.lowpart) : "[lowpart]" (retval.lowpart), "[hipart]" (retval.hipart) );
1429 return retval.int64part;
1430}

◆ _byteswap_ulong()

__INTRIN_INLINE unsigned long __cdecl _byteswap_ulong ( unsigned long  value)

Definition at line 1401 of file intrin_x86.h.

1402{
1403 unsigned long retval;
1404 __asm__("bswapl %[retval]" : [retval] "=r" (retval) : "[retval]" (value));
1405 return retval;
1406}

◆ _byteswap_ushort()

__INTRIN_INLINE unsigned short __cdecl _byteswap_ushort ( unsigned short  value)

Definition at line 1394 of file intrin_x86.h.

1395{
1396 unsigned short retval;
1397 __asm__("rorw $8, %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value));
1398 return retval;
1399}

◆ _disable()

__INTRIN_INLINE void __cdecl _disable ( void  )

Definition at line 1704 of file intrin_x86.h.

1705{
1706 __asm__("cli" : : : "memory");
1707}

Referenced by _HalpApcInterruptHandler(), _HalpDispatchInterruptHandler(), _Requires_lock_not_held_(), acpi_suspend(), ApicRequestGlobalInterrupt(), ApicRequestSelfInterrupt(), ArchSwitchContext(), BlpArchEnableTranslation(), CloseBitPlane(), ExAcquireResourceLock(), FrLdrBugCheckEx(), FrLdrBugCheckWithMessage(), HalCalibratePerformanceCounter(), HalDisableSystemInterrupt(), HalEnableSystemInterrupt(), HaliHaltSystem(), HalpAcquireCmosSpinLock(), HalpApcInterruptHandler(), HalpBiosDisplayReset(), HalpDispatchInterruptHandler(), HalpFlushTLB(), HalpFreezeSystem(), HalpInitializeClock(), HalpInitializePICs(), HalpInitializeTsc(), HalpLowerIrql(), HalpReboot(), HalpSetTimerRollOver(), HalpXboxPowerAction(), HalRequestSoftwareInterrupt(), KdbEnterDebuggerException(), KeBugCheckWithTf(), KeDisableInterrupts(), KeEnterKernelDebugger(), KeGetCurrentIrql(), KeRestoreFloatingPointState(), KeSaveFloatingPointState(), KeSetCurrentIrql(), KfLowerIrql(), KfRaiseIrql(), Ki386AdjustEsp0(), Ki386VdmEnablePentiumExtentions(), KiApcInterrupt(), KiCheckForApcDelivery(), KiCommonExit(), KiDispatchExceptionToUser(), KiDispatchInterrupt(), KiEndInterrupt(), KiEnterV86Mode(), KiExitInterrupt(), KiExitSystemCallDebugChecks(), KiExitV86Trap(), KiFlushNPXState(), KiI386PentiumLockErrataFixup(), KiIdleLoop(), KiPrepareUserDebugData(), KiRetireDpcList(), KiSwapContextEntry(), KiSwitchKernelStack(), KiSystemService(), KiTimerExpiration(), KiTrap02Handler(), KiTrap06Handler(), KiTrap07Handler(), KiTrap08Handler(), KiTrap0DHandler(), KiUserModeCallout(), MachInit(), MpsTimerHandler(), NtCallbackReturn(), OpenBitPlane(), PopShutdownHandler(), sb16_play(), ScrAcquireOwnership(), ScrSetCursor(), ScrSetCursorShape(), and WinLdrSetProcessorContext().

◆ _enable()

Definition at line 1709 of file intrin_x86.h.

1710{
1711 __asm__("sti" : : : "memory");
1712}

Referenced by _HalpApcInterruptHandler(), _HalpDismissIrqGeneric(), _HalpDismissIrqLevel(), _HalpDispatchInterruptHandler(), _Requires_lock_not_held_(), acpi_suspend(), ApicRequestGlobalInterrupt(), ApicRequestSelfInterrupt(), ArchSwitchContext(), CloseBitPlane(), ExpInitializeExecutive(), ExReleaseResourceLock(), HalBeginSystemInterrupt(), HalDisableSystemInterrupt(), HalEnableSystemInterrupt(), HalpApcInterruptHandler(), HalpDispatchInterruptHandler(), HalpInitializeTsc(), HalpLowerIrql(), HalProcessorIdle(), KeGetCurrentIrql(), KeRemoveQueueDpc(), KeRestoreFloatingPointState(), KeRestoreInterrupts(), KeSaveFloatingPointState(), KeSetCurrentIrql(), KfLowerIrql(), KfRaiseIrql(), KiApcInterrupt(), KiCheckForApcDelivery(), KiDebugHandler(), KiDispatchExceptionToUser(), KiDispatchInterrupt(), KiEnterV86Mode(), KiExitV86Mode(), KiExitV86Trap(), KiI386PentiumLockErrataFixup(), KiIdleLoop(), KiInitializeSystem(), KiInterruptHandler(), KiNpxHandler(), KiPrepareUserDebugData(), KiRetireDpcList(), KiSwapContextEntry(), KiSystemCallHandler(), KiSystemService(), KiSystemServiceHandler(), KiSystemStartupBootStack(), KiTimerExpiration(), KiTrap00Handler(), KiTrap01Handler(), KiTrap04Handler(), KiTrap05Handler(), KiTrap06Handler(), KiTrap07Handler(), KiTrap09Handler(), KiTrap0DHandler(), KiTrap0EHandler(), KiTrap10Handler(), KiTrap11Handler(), KiTrap13Handler(), KiUserModeCallout(), MpsTimerHandler(), NtCallbackReturn(), OpenBitPlane(), sb16_play(), ScrAcquireOwnership(), ScrSetCursor(), and ScrSetCursorShape().

◆ _inp()

Definition at line 1608 of file intrin_x86.h.

1609{
1610 return __inbyte(Port);
1611}
__INTRIN_INLINE unsigned char __inbyte(unsigned short Port)
Definition: intrin_x86.h:1524

◆ _inpd()

Definition at line 1618 of file intrin_x86.h.

1619{
1620 return __indword(Port);
1621}
__INTRIN_INLINE unsigned long __indword(unsigned short Port)
Definition: intrin_x86.h:1538

◆ _inpw()

Definition at line 1613 of file intrin_x86.h.

1614{
1615 return __inword(Port);
1616}
__INTRIN_INLINE unsigned short __inword(unsigned short Port)
Definition: intrin_x86.h:1531

◆ _InterlockedAnd()

__INTRIN_INLINE long _InterlockedAnd ( volatile long value,
long  mask 
)

Definition at line 496 of file intrin_x86.h.

497{
498 long x;
499 long y;
500
501 y = *value;
502
503 do
504 {
505 x = y;
507 }
508 while(y != x);
509
510 return y;
511}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLenum GLint GLuint mask
Definition: glext.h:6028
__INTRIN_INLINE long _InterlockedCompareExchange(volatile long *Destination, long Exchange, long Comperand)
Definition: intrin_x86.h:377

◆ _InterlockedAnd16()

__INTRIN_INLINE short _InterlockedAnd16 ( volatile short value,
short  mask 
)

Definition at line 477 of file intrin_x86.h.

478{
479 short x;
480 short y;
481
482 y = *value;
483
484 do
485 {
486 x = y;
488 }
489 while(y != x);
490
491 return y;
492}
__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short *Destination, short Exchange, short Comperand)
Definition: intrin_x86.h:368

◆ _InterlockedAnd8()

__INTRIN_INLINE char _InterlockedAnd8 ( volatile char value,
char  mask 
)

Definition at line 458 of file intrin_x86.h.

459{
460 char x;
461 char y;
462
463 y = *value;
464
465 do
466 {
467 x = y;
469 }
470 while(y != x);
471
472 return y;
473}
__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char *Destination, char Exchange, char Comperand)
Definition: intrin_x86.h:359

◆ _interlockedbittestandreset()

__INTRIN_INLINE unsigned char _interlockedbittestandreset ( volatile long a,
long  b 
)

Definition at line 729 of file intrin_x86.h.

730{
731 unsigned char retval;
732 __asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
733 return retval;
734}

◆ _interlockedbittestandset()

__INTRIN_INLINE unsigned char _interlockedbittestandset ( volatile long a,
long  b 
)

Definition at line 748 of file intrin_x86.h.

749{
750 unsigned char retval;
751 __asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
752 return retval;
753}

◆ _InterlockedCompareExchange()

__INTRIN_INLINE long _InterlockedCompareExchange ( volatile long Destination,
long  Exchange,
long  Comperand 
)

Definition at line 377 of file intrin_x86.h.

378{
379 long retval = Comperand;
380 __asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
381 return retval;
382}

Referenced by _InterlockedAnd(), _InterlockedOr(), and _InterlockedXor().

◆ _InterlockedCompareExchange16()

__INTRIN_INLINE short _InterlockedCompareExchange16 ( volatile short Destination,
short  Exchange,
short  Comperand 
)

Definition at line 368 of file intrin_x86.h.

369{
370 short retval = Comperand;
371 __asm__("lock; cmpxchgw %w[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
372 return retval;
373}

Referenced by _InterlockedAnd16(), _InterlockedOr16(), and _InterlockedXor16().

◆ _InterlockedCompareExchange64()

__INTRIN_INLINE long long _InterlockedCompareExchange64 ( volatile long long Destination,
long long  Exchange,
long long  Comperand 
)

Definition at line 683 of file intrin_x86.h.

684{
685 long long retval = Comperand;
686
687 __asm__
688 (
689 "lock; cmpxchg8b %[Destination]" :
690 [retval] "+A" (retval) :
691 [Destination] "m" (*Destination),
692 "b" ((unsigned long)((Exchange >> 0) & 0xFFFFFFFF)),
693 "c" ((unsigned long)((Exchange >> 32) & 0xFFFFFFFF)) :
694 "memory"
695 );
696
697 return retval;
698}

◆ _InterlockedCompareExchange8()

__INTRIN_INLINE char _InterlockedCompareExchange8 ( volatile char Destination,
char  Exchange,
char  Comperand 
)

Definition at line 359 of file intrin_x86.h.

360{
361 char retval = Comperand;
362 __asm__("lock; cmpxchgb %b[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory");
363 return retval;
364}

Referenced by _InterlockedAnd8(), _InterlockedOr8(), and _InterlockedXor8().

◆ _InterlockedCompareExchangePointer()

__INTRIN_INLINE void * _InterlockedCompareExchangePointer ( void *volatile Destination,
void Exchange,
void Comperand 
)

Definition at line 386 of file intrin_x86.h.

387{
388 void * retval = (void *)Comperand;
389 __asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "=a" (retval) : "[retval]" (retval), [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory");
390 return retval;
391}

◆ _InterlockedDecrement()

__INTRIN_INLINE long _InterlockedDecrement ( volatile long lpAddend)

Definition at line 629 of file intrin_x86.h.

630{
631 return _InterlockedExchangeAdd(lpAddend, -1) - 1;
632}
__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long *Addend, long Value)
Definition: intrin_x86.h:449

◆ _InterlockedDecrement16()

__INTRIN_INLINE short _InterlockedDecrement16 ( volatile short lpAddend)

Definition at line 643 of file intrin_x86.h.

644{
645 return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
646}
__INTRIN_INLINE short _InterlockedExchangeAdd16(volatile short *Addend, short Value)
Definition: intrin_x86.h:440

◆ _InterlockedExchange()

__INTRIN_INLINE long _InterlockedExchange ( volatile long Target,
long  Value 
)

Definition at line 413 of file intrin_x86.h.

414{
415 long retval = Value;
416 __asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
417 return retval;
418}
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

◆ _InterlockedExchange16()

__INTRIN_INLINE short _InterlockedExchange16 ( volatile short Target,
short  Value 
)

Definition at line 404 of file intrin_x86.h.

405{
406 short retval = Value;
407 __asm__("xchgw %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
408 return retval;
409}

◆ _InterlockedExchange8()

__INTRIN_INLINE char _InterlockedExchange8 ( volatile char Target,
char  Value 
)

Definition at line 395 of file intrin_x86.h.

396{
397 char retval = Value;
398 __asm__("xchgb %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
399 return retval;
400}

◆ _InterlockedExchangeAdd()

__INTRIN_INLINE long _InterlockedExchangeAdd ( volatile long Addend,
long  Value 
)

Definition at line 449 of file intrin_x86.h.

450{
451 long retval = Value;
452 __asm__("lock; xaddl %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
453 return retval;
454}
IN OUT PLONG Addend
Definition: CrNtStubs.h:25

Referenced by _InterlockedDecrement(), and _InterlockedIncrement().

◆ _InterlockedExchangeAdd16()

__INTRIN_INLINE short _InterlockedExchangeAdd16 ( volatile short Addend,
short  Value 
)

Definition at line 440 of file intrin_x86.h.

441{
442 short retval = Value;
443 __asm__("lock; xaddw %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
444 return retval;
445}

Referenced by _InterlockedDecrement16(), and _InterlockedIncrement16().

◆ _InterlockedExchangeAdd8()

__INTRIN_INLINE char _InterlockedExchangeAdd8 ( char volatile Addend,
char  Value 
)

Definition at line 431 of file intrin_x86.h.

432{
433 char retval = Value;
434 __asm__("lock; xaddb %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
435 return retval;
436}

◆ _InterlockedExchangePointer()

__INTRIN_INLINE void * _InterlockedExchangePointer ( void *volatile Target,
void Value 
)

Definition at line 422 of file intrin_x86.h.

423{
424 void * retval = Value;
425 __asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
426 return retval;
427}

◆ _InterlockedIncrement()

__INTRIN_INLINE long _InterlockedIncrement ( volatile long lpAddend)

Definition at line 636 of file intrin_x86.h.

637{
638 return _InterlockedExchangeAdd(lpAddend, 1) + 1;
639}

◆ _InterlockedIncrement16()

__INTRIN_INLINE short _InterlockedIncrement16 ( volatile short lpAddend)

Definition at line 650 of file intrin_x86.h.

651{
652 return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
653}

◆ _InterlockedOr()

__INTRIN_INLINE long _InterlockedOr ( volatile long value,
long  mask 
)

Definition at line 553 of file intrin_x86.h.

554{
555 long x;
556 long y;
557
558 y = *value;
559
560 do
561 {
562 x = y;
564 }
565 while(y != x);
566
567 return y;
568}

◆ _InterlockedOr16()

__INTRIN_INLINE short _InterlockedOr16 ( volatile short value,
short  mask 
)

Definition at line 534 of file intrin_x86.h.

535{
536 short x;
537 short y;
538
539 y = *value;
540
541 do
542 {
543 x = y;
545 }
546 while(y != x);
547
548 return y;
549}

◆ _InterlockedOr8()

__INTRIN_INLINE char _InterlockedOr8 ( volatile char value,
char  mask 
)

Definition at line 515 of file intrin_x86.h.

516{
517 char x;
518 char y;
519
520 y = *value;
521
522 do
523 {
524 x = y;
526 }
527 while(y != x);
528
529 return y;
530}

◆ _InterlockedXor()

__INTRIN_INLINE long _InterlockedXor ( volatile long value,
long  mask 
)

Definition at line 610 of file intrin_x86.h.

611{
612 long x;
613 long y;
614
615 y = *value;
616
617 do
618 {
619 x = y;
621 }
622 while(y != x);
623
624 return y;
625}

◆ _InterlockedXor16()

__INTRIN_INLINE short _InterlockedXor16 ( volatile short value,
short  mask 
)

Definition at line 591 of file intrin_x86.h.

592{
593 short x;
594 short y;
595
596 y = *value;
597
598 do
599 {
600 x = y;
602 }
603 while(y != x);
604
605 return y;
606}

◆ _InterlockedXor8()

__INTRIN_INLINE char _InterlockedXor8 ( volatile char value,
char  mask 
)

Definition at line 572 of file intrin_x86.h.

573{
574 char x;
575 char y;
576
577 y = *value;
578
579 do
580 {
581 x = y;
583 }
584 while(y != x);
585
586 return y;
587}

◆ _lrotl()

unsigned long _lrotl ( unsigned long  value,
int  shift 
)

Definition at line 1287 of file intrin_x86.h.

1288{
1289 unsigned long retval;
1290 __asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1291 return retval;
1292}
#define shift
Definition: input.c:1755

◆ _lrotr()

unsigned long _lrotr ( unsigned long  value,
int  shift 
)

Definition at line 1296 of file intrin_x86.h.

1297{
1298 unsigned long retval;
1299 __asm__("rorl %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1300 return retval;
1301}

◆ _mm_lfence()

__INTRIN_INLINE void _mm_lfence ( void  )

Definition at line 106 of file intrin_x86.h.

107{
108 _ReadBarrier();
109 __asm__ __volatile__("lfence");
110 _ReadBarrier();
111}
#define _ReadBarrier
Definition: intrin_x86.h:95

◆ _mm_mfence()

__INTRIN_INLINE void _mm_mfence ( void  )

Definition at line 99 of file intrin_x86.h.

100{
101 __asm__ __volatile__("mfence" : : : "memory");
102}

◆ _mm_pause()

__INTRIN_INLINE void _mm_pause ( void  )

Definition at line 2036 of file intrin_x86.h.

2037{
2038 __asm__ __volatile__("pause" : : : "memory");
2039}

◆ _outp()

__INTRIN_INLINE int __cdecl _outp ( unsigned short  Port,
int  databyte 
)

Definition at line 1623 of file intrin_x86.h.

1624{
1625 __outbyte(Port, (unsigned char)databyte);
1626 return databyte;
1627}
__INTRIN_INLINE void __outbyte(unsigned short Port, unsigned char Data)
Definition: intrin_x86.h:1578

◆ _outpd()

__INTRIN_INLINE unsigned long __cdecl _outpd ( unsigned short  Port,
unsigned long  dataword 
)

Definition at line 1635 of file intrin_x86.h.

1636{
1637 __outdword(Port, dataword);
1638 return dataword;
1639}
__INTRIN_INLINE void __outdword(unsigned short Port, unsigned long Data)
Definition: intrin_x86.h:1588

◆ _outpw()

__INTRIN_INLINE unsigned short __cdecl _outpw ( unsigned short  Port,
unsigned short  dataword 
)

Definition at line 1629 of file intrin_x86.h.

1630{
1631 __outword(Port, dataword);
1632 return dataword;
1633}
__INTRIN_INLINE void __outword(unsigned short Port, unsigned short Data)
Definition: intrin_x86.h:1583

◆ _ReadWriteBarrier()

__INTRIN_INLINE void _ReadWriteBarrier ( void  )

Definition at line 88 of file intrin_x86.h.

89{
90 __asm__ __volatile__("" : : : "memory");
91}

◆ _rotl()

__INTRIN_INLINE unsigned int __cdecl _rotl ( unsigned int  value,
int  shift 
)

Definition at line 1217 of file intrin_x86.h.

1218{
1219 unsigned int retval;
1220 __asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1221 return retval;
1222}

◆ _rotl16()

__INTRIN_INLINE unsigned short __cdecl _rotl16 ( unsigned short  value,
unsigned char  shift 
)

Definition at line 1208 of file intrin_x86.h.

1209{
1210 unsigned short retval;
1211 __asm__("rolw %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1212 return retval;
1213}

◆ _rotl64()

__INTRIN_INLINE unsigned long long __cdecl _rotl64 ( unsigned long long  value,
int  shift 
)

Definition at line 1234 of file intrin_x86.h.

1235{
1236 /* FIXME: this is probably not optimal */
1237 return (value << shift) | (value >> (64 - shift));
1238}

◆ _rotl8()

__INTRIN_INLINE unsigned char __cdecl _rotl8 ( unsigned char  value,
unsigned char  shift 
)

Definition at line 1199 of file intrin_x86.h.

1200{
1201 unsigned char retval;
1202 __asm__("rolb %b[shift], %b[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1203 return retval;
1204}

◆ _rotr()

unsigned int _rotr ( unsigned int  value,
int  shift 
)

Definition at line 1243 of file intrin_x86.h.

1244{
1245 unsigned int retval;
1246 __asm__("rorl %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1247 return retval;
1248}

◆ _rotr16()

__INTRIN_INLINE unsigned short __cdecl _rotr16 ( unsigned short  value,
unsigned char  shift 
)

Definition at line 1261 of file intrin_x86.h.

1262{
1263 unsigned short retval;
1264 __asm__("rorw %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1265 return retval;
1266}

◆ _rotr64()

__INTRIN_INLINE unsigned long long __cdecl _rotr64 ( unsigned long long  value,
int  shift 
)

Definition at line 1278 of file intrin_x86.h.

1279{
1280 /* FIXME: this is probably not optimal */
1281 return (value >> shift) | (value << (64 - shift));
1282}

◆ _rotr8()

__INTRIN_INLINE unsigned char __cdecl _rotr8 ( unsigned char  value,
unsigned char  shift 
)

Definition at line 1252 of file intrin_x86.h.

1253{
1254 unsigned char retval;
1255 __asm__("rorb %b[shift], %b[retval]" : [retval] "=qm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
1256 return retval;
1257}

◆ _sgdt()

__INTRIN_INLINE void _sgdt ( void Destination)

Definition at line 2028 of file intrin_x86.h.

2029{
2030 __asm__ __volatile__("sgdt %0" : : "m"(*(short*)Destination) : "memory");
2031}

Referenced by ImgArchEfiStartBootApplication(), and Mmx86InitializeMemoryMap().

◆ memcpy()

__INTRIN_INLINE void *__cdecl memcpy ( void dest,
const void source,
size_t  num 
)

Definition at line 74 of file intrin_x86.h.

75{
76 return memmove(dest, source, num);
77}
GLuint GLuint num
Definition: glext.h:9618
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static char * dest
Definition: rtl.c:135

◆ memmove()

void *__cdecl memmove ( void dest,
const void source,
size_t  num 
)

Definition at line 8 of file memmove.c.

9{
10 char *char_dest = (char *)dest;
11 char *char_src = (char *)src;
12
13 if ((char_dest <= char_src) || (char_dest >= (char_src+count)))
14 {
15 /* non-overlapping buffers */
16 while(count > 0)
17 {
18 *char_dest = *char_src;
19 char_dest++;
20 char_src++;
21 count--;
22 }
23 }
24 else
25 {
26 /* overlaping buffers */
27 char_dest = (char *)dest + count - 1;
28 char_src = (char *)src + count - 1;
29
30 while(count > 0)
31 {
32 *char_dest = *char_src;
33 char_dest--;
34 char_src--;
35 count--;
36 }
37 }
38
39 return dest;
40}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340