HyperDbg Debugger
Loading...
Searching...
No Matches
platform-intrinsics.h
Go to the documentation of this file.
1
12#pragma once
13
14#if defined(__linux__)
16#endif // defined(__linux__)
17
19// CPUID Instructions //
21
22//
23// CPUID
24//
25VOID
26CpuCpuId(INT32 * CpuInfo, INT32 FunctionId);
27
28//
29// CPUID (with sub-leaf)
30//
31VOID
32CpuCpuIdEx(INT32 * CpuInfo, INT32 FunctionId, INT32 SubFunctionId);
33
35// TSC Instructions //
37
38//
39// RDTSC
40//
41UINT64
42CpuReadTsc(VOID);
43
44//
45// RDTSCP
46//
47UINT64
48CpuReadTscp(UINT32 * Aux);
49
51// Misc Instructions //
53
54//
55// PAUSE
56//
57VOID
58CpuPause(VOID);
59
61// Interlocked (Atomic) Operations //
63
64INT64
65CpuInterlockedExchange64(INT64 volatile * Target, INT64 Value);
66
67INT64
68CpuInterlockedExchangeAdd64(INT64 volatile * Addend, INT64 Value);
69
70INT64
71CpuInterlockedIncrement64(INT64 volatile * Addend);
72
73INT64
74CpuInterlockedDecrement64(INT64 volatile * Addend);
75
76INT64
77CpuInterlockedCompareExchange64(INT64 volatile * Destination, INT64 ExChange, INT64 Comparand);
78
80CpuInterlockedBitTestAndSet(volatile LONG * Base, LONG Bit);
signed int INT32
Definition BasicTypes.h:50
long LONG
Definition BasicTypes.h:28
unsigned char UCHAR
Definition BasicTypes.h:34
unsigned int UINT32
Definition BasicTypes.h:54
RequestedActionOfThePacket Value(0x1) 00000000
UINT64 CpuReadTsc(VOID)
Read Time-Stamp Counter.
Definition PlatformIntrinsics.c:295
VOID CpuPause(VOID)
Execute PAUSE (spin-wait hint).
Definition PlatformIntrinsics.c:523
INT64 CpuInterlockedCompareExchange64(INT64 volatile *Destination, INT64 ExChange, INT64 Comparand)
Atomic 64-bit compare-exchange.
Definition PlatformIntrinsics.c:396
VOID CpuCpuIdEx(INT32 *CpuInfo, INT32 FunctionId, INT32 SubFunctionId)
Execute CPUID with sub-leaf.
Definition PlatformIntrinsics.c:274
INT64 CpuInterlockedDecrement64(INT64 volatile *Addend)
Atomic 64-bit decrement.
Definition PlatformIntrinsics.c:381
INT64 CpuInterlockedExchangeAdd64(INT64 volatile *Addend, INT64 Value)
Atomic 64-bit exchange-add.
Definition PlatformIntrinsics.c:351
INT64 CpuInterlockedIncrement64(INT64 volatile *Addend)
Atomic 64-bit increment.
Definition PlatformIntrinsics.c:366
VOID CpuCpuId(INT32 *CpuInfo, INT32 FunctionId)
Execute CPUID.
Definition PlatformIntrinsics.c:255
UINT64 CpuReadTscp(UINT32 *Aux)
Read Time-Stamp Counter and Processor ID.
Definition PlatformIntrinsics.c:315
INT64 CpuInterlockedExchange64(INT64 volatile *Target, INT64 Value)
Atomic 64-bit exchange.
Definition PlatformIntrinsics.c:336
UCHAR CpuInterlockedBitTestAndSet(volatile LONG *Base, LONG Bit)
Definition platform-intrinsics.c:190