ReactOS  r76032
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

#define __INTRIN_H_

Definition at line 3 of file intrin.h.

Function Documentation

void __code_seg ( const char )
__declspec ( noreturn  )

Definition at line 52 of file thread.c.

57 {
58  /* Attempt to call the Thread Start Address */
59  _SEH2_TRY
60  {
61  /* Legacy check which is still used today for Win32 threads */
62  if (NtCurrentTeb()->NtTib.Version == (30 << 8)) // OS/2 V3.0 ("Cruiser")
63  {
64  /* This registers the termination port with CSRSS */
66  }
67 
68  /* Get the exit code from the Thread Start */
69  ExitThread((lpStartAddress)((PVOID)lpParameter));
70  }
72  {
73  /* Get the Exit code from the SEH Handler */
75  {
76  /* Kill the whole process, usually */
78  }
79  else
80  {
81  /* If running inside CSRSS, kill just this thread */
83  }
84  }
85  _SEH2_END;
86 }
DWORD *typedef PVOID
Definition: winlogon.h:52
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1532
#define _SEH2_END
Definition: pseh2_64.h:7
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:11
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:349
static LONG BaseThreadExceptionFilter(EXCEPTION_POINTERS *ExceptionInfo)
Definition: thread.c:30
BOOLEAN BaseRunningInServerProcess
Definition: dllmain.c:20
LPVOID lpParameter
Definition: kernel32.h:232
NTSTATUS NTAPI CsrNewThread(VOID)
Definition: api.c:27
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define _SEH2_TRY
Definition: pseh2_64.h:5
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
void __nop ( void  )

Definition at line 1830 of file intrin_x86.h.

Referenced by HalpRead8254Value().

1831 {
1832  __asm__ __volatile__("nop");
1833 }
__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")
__int64 __cdecl _abs64 ( __int64  )
void* _AddressOfReturnAddress ( void  )

Referenced by __declspec(), and KiEnterV86Mode().

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 }
_Must_inspect_result_ _In_ ULONG Index
Definition: fltkernel.h:1824
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 }
_Must_inspect_result_ _In_ ULONG Index
Definition: fltkernel.h:1824
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
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
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
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
_Check_return_ unsigned __int64 __cdecl _byteswap_uint64 ( _In_ unsigned  __int64)

Referenced by RtlUlonglongByteSwap().

_Check_return_ unsigned long __cdecl _byteswap_ulong ( _In_ unsigned  long)
_Check_return_ unsigned short __cdecl _byteswap_ushort ( _In_ unsigned  short)
void __cdecl _disable ( void  )

Definition at line 365 of file intrin_arm.h.

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(), KiTrap02(), KiTrap06Handler(), KiTrap07Handler(), KiTrap0DHandler(), KiUserModeCallout(), MpsTimerHandler(), NtCallbackReturn(), OpenBitPlane(), PopShutdownHandler(), sb16_play(), ScrIoControl(), ScrWrite(), and WinLdrSetProcessorContext().

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")
void __cdecl _enable ( void  )

Definition at line 373 of file intrin_arm.h.

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(), ScrIoControl(), and ScrWrite().

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")
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 
)
unsigned char _interlockedbittestandreset ( long volatile ,
long   
)
unsigned char _interlockedbittestandset ( long volatile ,
long   
)
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 
)
short _InterlockedDecrement16 ( _Interlocked_operand_ short volatile _Addend)
short _InterlockedExchange16 ( _Interlocked_operand_ short volatile _Target,
short  _Value 
)

Referenced by GetSelectionBeginEnd().

char _InterlockedExchange8 ( _Interlocked_operand_ char volatile _Target,
char  _Value 
)

Referenced by ClientThreadSetupHelper().

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 
)
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 
)
_Check_return_ unsigned long __cdecl _lrotl ( _In_ unsigned  long,
_In_  int 
)
_Check_return_ unsigned long __cdecl _lrotr ( _In_ unsigned  long,
_In_  int 
)
void _ReadBarrier ( void  )
void _ReadWriteBarrier ( void  )

Definition at line 92 of file intrin_x86.h.

93 {
94  __asm__ __volatile__("" : : : "memory");
95 }
__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")
_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 
)

Referenced by MmArchInitialize().

_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 
)

Referenced by BltMask().

void _WriteBarrier ( void  )