ReactOS  0.4.14-dev-614-gbfd8a84
intrin.h File Reference
#include <crtdefs.h>
#include <setjmp.h>
#include <stddef.h>
Include dependency graph for intrin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __INTRIN_H_
 

Functions

void_AddressOfReturnAddress (void)
 
unsigned char _BitScanForward (unsigned long *_Index, unsigned long _Mask)
 
unsigned char _BitScanReverse (unsigned long *_Index, unsigned long _Mask)
 
long _InterlockedAnd (_Interlocked_operand_ long volatile *_Value, long _Mask)
 
short _InterlockedAnd16 (_Interlocked_operand_ short volatile *_Value, short _Mask)
 
char _InterlockedAnd8 (_Interlocked_operand_ char volatile *_Value, char _Mask)
 
long __cdecl _InterlockedCompareExchange (_Interlocked_operand_ long volatile *_Destination, long _Exchange, long _Comparand)
 
short _InterlockedCompareExchange16 (_Interlocked_operand_ short volatile *_Destination, short _Exchange, short _Comparand)
 
__int64 _InterlockedCompareExchange64 (_Interlocked_operand_ __int64 volatile *_Destination, __int64 _Exchange, __int64 _Comparand)
 
char _InterlockedCompareExchange8 (_Interlocked_operand_ char volatile *_Destination, char _Exchange, char _Comparand)
 
void_InterlockedCompareExchangePointer (_Interlocked_operand_ void *volatile *_Destination, void *_Exchange, void *_Comparand)
 
long __cdecl _InterlockedDecrement (_Interlocked_operand_ long volatile *_Addend)
 
short _InterlockedDecrement16 (_Interlocked_operand_ short volatile *_Addend)
 
long __cdecl _InterlockedExchange (_Interlocked_operand_ long volatile *_Target, long _Value)
 
short _InterlockedExchange16 (_Interlocked_operand_ short volatile *_Target, short _Value)
 
char _InterlockedExchange8 (_Interlocked_operand_ char volatile *_Target, char _Value)
 
long __cdecl _InterlockedExchangeAdd (_Interlocked_operand_ long volatile *_Addend, long _Value)
 
short _InterlockedExchangeAdd16 (_Interlocked_operand_ short volatile *_Addend, short _Value)
 
char _InterlockedExchangeAdd8 (_Interlocked_operand_ char volatile *_Addend, char _Value)
 
void_InterlockedExchangePointer (_Interlocked_operand_ void *volatile *_Target, void *_Value)
 
long __cdecl _InterlockedIncrement (_Interlocked_operand_ long volatile *_Addend)
 
short _InterlockedIncrement16 (_Interlocked_operand_ short volatile *_Addend)
 
long _InterlockedOr (_Interlocked_operand_ long volatile *_Value, long _Mask)
 
short _InterlockedOr16 (_Interlocked_operand_ short volatile *_Value, short _Mask)
 
char _InterlockedOr8 (_Interlocked_operand_ char volatile *_Value, char _Mask)
 
long _InterlockedXor (_Interlocked_operand_ long volatile *_Value, long _Mask)
 
short _InterlockedXor16 (_Interlocked_operand_ short volatile *_Value, short _Mask)
 
char _InterlockedXor8 (_Interlocked_operand_ char volatile *_Value, char _Mask)
 
void _ReadBarrier (void)
 
void _ReadWriteBarrier (void)
 
void_ReturnAddress (void)
 
void _WriteBarrier (void)
 
void __code_seg (const char *)
 
void __cdecl __debugbreak (void)
 
 __declspec (noreturn) void __fastfail(unsigned int)
 
void __nop (void)
 
__int64 __cdecl _abs64 (__int64)
 
unsigned char _bittest (long const *, long)
 
unsigned char _bittestandcomplement (long *, long)
 
unsigned char _bittestandreset (long *, long)
 
unsigned char _bittestandset (long *, long)
 
_Check_return_ unsigned __int64 __cdecl _byteswap_uint64 (_In_ unsigned __int64)
 
_Check_return_ unsigned long __cdecl _byteswap_ulong (_In_ unsigned long)
 
_Check_return_ unsigned short __cdecl _byteswap_ushort (_In_ unsigned short)
 
void __cdecl _disable (void)
 
void __cdecl _enable (void)
 
unsigned char _interlockedbittestandreset (long volatile *, long)
 
unsigned char _interlockedbittestandset (long volatile *, long)
 
_Check_return_ unsigned long __cdecl _lrotl (_In_ unsigned long, _In_ int)
 
_Check_return_ unsigned long __cdecl _lrotr (_In_ unsigned long, _In_ int)
 
_Check_return_ unsigned int __cdecl _rotl (_In_ unsigned int _Value, _In_ int _Shift)
 
_Check_return_ unsigned short __cdecl _rotl16 (_In_ unsigned short _Value, _In_ unsigned char _Shift)
 
_Check_return_ unsigned __int64 __cdecl _rotl64 (_In_ unsigned __int64 _Value, _In_ int _Shift)
 
_Check_return_ unsigned char __cdecl _rotl8 (_In_ unsigned char _Value, _In_ unsigned char _Shift)
 
_Check_return_ unsigned int __cdecl _rotr (_In_ unsigned int _Value, _In_ int _Shift)
 
_Check_return_ unsigned short __cdecl _rotr16 (_In_ unsigned short _Value, _In_ unsigned char _Shift)
 
_Check_return_ unsigned __int64 __cdecl _rotr64 (_In_ unsigned __int64 _Value, _In_ int _Shift)
 
_Check_return_ unsigned char __cdecl _rotr8 (_In_ unsigned char _Value, _In_ unsigned char _Shift)
 

Macro Definition Documentation

◆ __INTRIN_H_

#define __INTRIN_H_

Definition at line 3 of file intrin.h.

Function Documentation

◆ __code_seg()

void __code_seg ( const char )

◆ __debugbreak()

◆ __declspec()

__declspec ( noreturn  )

Definition at line 53 of file thread.c.

58 {
59  /* Attempt to call the Thread Start Address */
60  _SEH2_TRY
61  {
62  /* Legacy check which is still used today for Win32 threads */
63  if (NtCurrentTeb()->NtTib.Version == (30 << 8)) // OS/2 V3.0 ("Cruiser")
64  {
65  /* This registers the termination port with CSRSS */
67  }
68 
69  /* Get the exit code from the Thread Start */
70  ExitThread((lpStartAddress)((PVOID)lpParameter));
71  }
73  {
74  /* Get the Exit code from the SEH Handler */
76  {
77  /* Kill the whole process, usually */
79  }
80  else
81  {
82  /* If running inside CSRSS, kill just this thread */
84  }
85  }
86  _SEH2_END;
87 }
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
_SEH2_TRY
Definition: create.c:4250
LONG WINAPI UnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
Definition: except.c:262
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:11
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:364
BOOLEAN BaseRunningInServerProcess
Definition: dllmain.c:20
LPVOID lpParameter
Definition: kernel32.h:241
NTSTATUS NTAPI CsrNewThread(VOID)
Definition: api.c:27
_SEH2_END
Definition: create.c:4424
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12

◆ __nop()

void __nop ( void  )

Definition at line 1939 of file intrin_x86.h.

1940 {
1941  __asm__ __volatile__("nop");
1942 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

Referenced by HalpRead8254Value().

◆ _abs64()

__int64 __cdecl _abs64 ( __int64  )

◆ _AddressOfReturnAddress()

void* _AddressOfReturnAddress ( void  )

Referenced by KiEnterV86Mode().

◆ _BitScanForward()

unsigned char _BitScanForward ( unsigned long _Index,
unsigned long  _Mask 
)

Definition at line 57 of file intrin_arm.h.

58 {
59  *Index = __builtin_ctz(Mask);
60  return Mask ? 1 : 0;
61 }
static const UCHAR Index[8]
Definition: usbohci.c:18

Referenced by GetBestRoute(), and ZSTD_NbCommonBytes().

◆ _BitScanReverse()

unsigned char _BitScanReverse ( unsigned long _Index,
unsigned long  _Mask 
)

Definition at line 180 of file intrin_arm.h.

181 {
182  *Index = 31 - __builtin_clz(Mask);
183  return Mask ? 1 : 0;
184 }
static const UCHAR Index[8]
Definition: usbohci.c:18

Referenced by BIT_highbit32(), ZSTD_highbit32(), and ZSTD_NbCommonBytes().

◆ _bittest()

unsigned char _bittest ( long const ,
long   
)

Definition at line 464 of file intrin_ppc.h.

465 {
466  return ((*a) & (1<<b)) != 0;
467 }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ _bittestandcomplement()

unsigned char _bittestandcomplement ( long ,
long   
)

Definition at line 469 of file intrin_ppc.h.

470 {
471  unsigned char ret = ((*a) & (1<<b)) != 0;
472  (*a) ^= (1<<b);
473  return ret;
474 }
#define b
Definition: ke_i.h:79
int ret

◆ _bittestandreset()

unsigned char _bittestandreset ( long ,
long   
)

Definition at line 476 of file intrin_ppc.h.

477 {
478  unsigned char ret = ((*a) & (1<<b)) != 0;
479  (*a) &= ~(1<<b);
480  return ret;
481 }
#define b
Definition: ke_i.h:79
int ret

◆ _bittestandset()

unsigned char _bittestandset ( long ,
long   
)

Definition at line 483 of file intrin_ppc.h.

484 {
485  unsigned char ret = ((*a) & (1<<b)) != 0;
486  (*a) |= (1<<b);
487  return ret;
488 }
#define b
Definition: ke_i.h:79
int ret

◆ _byteswap_uint64()

_Check_return_ unsigned __int64 __cdecl _byteswap_uint64 ( _In_ unsigned  __int64)

Referenced by RtlUlonglongByteSwap().

◆ _byteswap_ulong()

◆ _byteswap_ushort()

◆ _disable()

void __cdecl _disable ( void  )

Definition at line 365 of file intrin_arm.h.

366 {
367  __asm__ __volatile__
368  (
369  "cpsid i @ __cli" : : : "memory", "cc"
370  );
371 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

Referenced by _HalpApcInterruptHandler(), _HalpDispatchInterruptHandler(), acpi_suspend(), ArchSwitchContext(), BlpArchEnableTranslation(), CloseBitPlane(), ExAcquireResourceLock(), FrLdrBugCheckEx(), FrLdrBugCheckWithMessage(), HalCalibratePerformanceCounter(), HalDisableSystemInterrupt(), HalDisplayString(), HalEnableSystemInterrupt(), HaliHaltSystem(), HalpAcquireCmosSpinLock(), HalpApcInterruptHandler(), HalpBiosDisplayReset(), HalpDispatchInterruptHandler(), HalpEndSystemInterrupt(), HalpFlushTLB(), HalpInitializeClock(), HalpInitializePICs(), HalpInitializeTsc(), HalpLowerIrql(), HalpSetTimerRollOver(), HalRequestSoftwareInterrupt(), KdbEnterDebuggerException(), KdbpCliInit(), KeBugCheckWithTf(), KeDisableInterrupts(), KeEnterKernelDebugger(), KeGetCurrentIrql(), KeSetCurrentIrql(), KfLowerIrql(), KfRaiseIrql(), Ki386AdjustEsp0(), Ki386VdmEnablePentiumExtentions(), KiApcInterrupt(), KiCheckForApcDelivery(), KiCommonExit(), KiDispatchInterrupt(), KiDpcInterruptHandler(), KiEndInterrupt(), KiEnterV86Mode(), KiExitInterrupt(), KiExitSystemCallDebugChecks(), KiExitV86Trap(), KiFlushNPXState(), KiI386PentiumLockErrataFixup(), KiIdleLoop(), KiInterruptDispatch3(), KiIsNpxErrataPresent(), KiRetireDpcList(), KiSetupDecrementerTrap(), KiSwapContextEntry(), KiSystemService(), KiTimerExpiration(), KiTrap02Handler(), KiTrap06Handler(), KiTrap07Handler(), KiTrap08Handler(), KiTrap0DHandler(), KiUserModeCallout(), MpsTimerHandler(), NtCallbackReturn(), OpenBitPlane(), PopShutdownHandler(), sb16_play(), ScrAcquireOwnership(), ScrSetCursor(), ScrSetCursorShape(), and WinLdrSetProcessorContext().

◆ _enable()

void __cdecl _enable ( void  )

Definition at line 373 of file intrin_arm.h.

374 {
375  __asm__ __volatile__
376  (
377  "cpsie i @ __sti" : : : "memory", "cc"
378  );
379 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

Referenced by _HalpApcInterruptHandler(), _HalpDismissIrqGeneric(), _HalpDismissIrqLevel(), _HalpDispatchInterruptHandler(), acpi_suspend(), ArchSwitchContext(), CloseBitPlane(), ExpInitializeExecutive(), ExReleaseResourceLock(), HalBeginSystemInterrupt(), HalDisableSystemInterrupt(), HalEnableSystemInterrupt(), HalpApcInterruptHandler(), HalpDispatchInterruptHandler(), HalpEndSystemInterrupt(), HalpInitializeTsc(), HalpInitPICs(), HalpLowerIrql(), HalProcessorIdle(), KdPollBreakIn(), KeGetCurrentIrql(), KeRemoveQueueDpc(), KeRestoreInterrupts(), KeSetCurrentIrql(), KeThawExecution(), KfLowerIrql(), KfRaiseIrql(), KiApcInterrupt(), KiCheckForApcDelivery(), KiDebugHandler(), KiDispatchInterrupt(), KiDpcInterruptHandler(), KiEnterV86Mode(), KiExitV86Mode(), KiExitV86Trap(), KiI386PentiumLockErrataFixup(), KiIdleLoop(), KiInitializeSystem(), KiInterruptDispatch3(), KiInterruptHandler(), KiIsNpxErrataPresent(), KiNpxHandler(), KiRetireDpcList(), KiSetupDecrementerTrap(), 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().

◆ _InterlockedAnd()

long _InterlockedAnd ( _Interlocked_operand_ long volatile _Value,
long  _Mask 
)

◆ _InterlockedAnd16()

short _InterlockedAnd16 ( _Interlocked_operand_ short volatile _Value,
short  _Mask 
)

◆ _InterlockedAnd8()

char _InterlockedAnd8 ( _Interlocked_operand_ char volatile _Value,
char  _Mask 
)

◆ _interlockedbittestandreset()

unsigned char _interlockedbittestandreset ( long volatile ,
long   
)

Definition at line 386 of file intrin_arm.h.

387 {
388  return (_InterlockedAnd(a, ~(1 << b)) >> b) & 1;
389 }
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
__INTRIN_INLINE long _InterlockedAnd(volatile long *const value, const long mask)
Definition: intrin_arm.h:220
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ _interlockedbittestandset()

unsigned char _interlockedbittestandset ( long volatile ,
long   
)

Definition at line 381 of file intrin_arm.h.

382 {
383  return (_InterlockedOr(a, 1 << b) >> b) & 1;
384 }
__INTRIN_INLINE long _InterlockedOr(volatile long *const value, const long mask)
Definition: intrin_arm.h:271
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ _InterlockedCompareExchange()

long __cdecl _InterlockedCompareExchange ( _Interlocked_operand_ long volatile _Destination,
long  _Exchange,
long  _Comparand 
)

◆ _InterlockedCompareExchange16()

short _InterlockedCompareExchange16 ( _Interlocked_operand_ short volatile _Destination,
short  _Exchange,
short  _Comparand 
)

◆ _InterlockedCompareExchange64()

__int64 _InterlockedCompareExchange64 ( _Interlocked_operand_ __int64 volatile _Destination,
__int64  _Exchange,
__int64  _Comparand 
)

◆ _InterlockedCompareExchange8()

char _InterlockedCompareExchange8 ( _Interlocked_operand_ char volatile _Destination,
char  _Exchange,
char  _Comparand 
)

◆ _InterlockedCompareExchangePointer()

void* _InterlockedCompareExchangePointer ( _Interlocked_operand_ void *volatile _Destination,
void _Exchange,
void _Comparand 
)

◆ _InterlockedDecrement()

◆ _InterlockedDecrement16()

short _InterlockedDecrement16 ( _Interlocked_operand_ short volatile _Addend)

◆ _InterlockedExchange()

◆ _InterlockedExchange16()

short _InterlockedExchange16 ( _Interlocked_operand_ short volatile _Target,
short  _Value 
)

Referenced by GetSelectionBeginEnd().

◆ _InterlockedExchange8()

char _InterlockedExchange8 ( _Interlocked_operand_ char volatile _Target,
char  _Value 
)

Referenced by ClientThreadSetupHelper().

◆ _InterlockedExchangeAdd()

◆ _InterlockedExchangeAdd16()

short _InterlockedExchangeAdd16 ( _Interlocked_operand_ short volatile _Addend,
short  _Value 
)

◆ _InterlockedExchangeAdd8()

char _InterlockedExchangeAdd8 ( _Interlocked_operand_ char volatile _Addend,
char  _Value 
)

◆ _InterlockedExchangePointer()

void* _InterlockedExchangePointer ( _Interlocked_operand_ void *volatile _Target,
void _Value 
)

◆ _InterlockedIncrement()

◆ _InterlockedIncrement16()

short _InterlockedIncrement16 ( _Interlocked_operand_ short volatile _Addend)

◆ _InterlockedOr()

long _InterlockedOr ( _Interlocked_operand_ long volatile _Value,
long  _Mask 
)

◆ _InterlockedOr16()

short _InterlockedOr16 ( _Interlocked_operand_ short volatile _Value,
short  _Mask 
)

◆ _InterlockedOr8()

char _InterlockedOr8 ( _Interlocked_operand_ char volatile _Value,
char  _Mask 
)

◆ _InterlockedXor()

long _InterlockedXor ( _Interlocked_operand_ long volatile _Value,
long  _Mask 
)

◆ _InterlockedXor16()

short _InterlockedXor16 ( _Interlocked_operand_ short volatile _Value,
short  _Mask 
)

◆ _InterlockedXor8()

char _InterlockedXor8 ( _Interlocked_operand_ char volatile _Value,
char  _Mask 
)

◆ _lrotl()

◆ _lrotr()

◆ _ReadBarrier()

void _ReadBarrier ( void  )

◆ _ReadWriteBarrier()

void _ReadWriteBarrier ( void  )

Definition at line 88 of file intrin_x86.h.

89 {
90  __asm__ __volatile__("" : : : "memory");
91 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")

◆ _ReturnAddress()

◆ _rotl()

◆ _rotl16()

Referenced by MmArchInitialize().

◆ _rotl64()

_Check_return_ unsigned __int64 __cdecl _rotl64 ( _In_ unsigned __int64  _Value,
_In_ int  _Shift 
)

◆ _rotl8()

◆ _rotr()

_Check_return_ unsigned int __cdecl _rotr ( _In_ unsigned int  _Value,
_In_ int  _Shift 
)

◆ _rotr16()

◆ _rotr64()

_Check_return_ unsigned __int64 __cdecl _rotr64 ( _In_ unsigned __int64  _Value,
_In_ int  _Shift 
)

◆ _rotr8()

Referenced by BltMask().

◆ _WriteBarrier()

void _WriteBarrier ( void  )