HyperPlatform Programmer's Reference
Functions
asm.h File Reference

Declares interfaces to assembly functions. More...

#include "ia32_type.h"
Include dependency graph for asm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool __stdcall AsmInitializeVm (_In_ void(*vm_initialization_routine)(_In_ ULONG_PTR, _In_ ULONG_PTR, _In_opt_ void *), _In_opt_ void *context)
 A wrapper for vm_initialization_routine. More...
 
void __stdcall AsmVmmEntryPoint ()
 An entry point of VMM where gets called whenever VM-exit occurred. More...
 
unsigned char __stdcall AsmVmxCall (_In_ ULONG_PTR hypercall_number, _In_opt_ void *context)
 Executes VMCALL with the given hypercall number and a context. More...
 
void __stdcall AsmWriteGDT (_In_ const Gdtr *gdtr)
 Writes to GDT. More...
 
void __stdcall AsmReadGDT (_Out_ Gdtr *gdtr)
 Reads SGDT. More...
 
USHORT __stdcall AsmReadLDTR ()
 Reads SLDT. More...
 
void __stdcall AsmWriteTR (_In_ USHORT task_register)
 Writes to TR. More...
 
USHORT __stdcall AsmReadTR ()
 Reads STR. More...
 
void __stdcall AsmWriteES (_In_ USHORT segment_selector)
 Writes to ES. More...
 
USHORT __stdcall AsmReadES ()
 Reads ES. More...
 
void __stdcall AsmWriteCS (_In_ USHORT segment_selector)
 Writes to CS. More...
 
USHORT __stdcall AsmReadCS ()
 Reads CS. More...
 
void __stdcall AsmWriteSS (_In_ USHORT segment_selector)
 Writes to SS. More...
 
USHORT __stdcall AsmReadSS ()
 Reads SS. More...
 
void __stdcall AsmWriteDS (_In_ USHORT segment_selector)
 Writes to DS. More...
 
USHORT __stdcall AsmReadDS ()
 Reads DS. More...
 
void __stdcall AsmWriteFS (_In_ USHORT segment_selector)
 Writes to FS. More...
 
USHORT __stdcall AsmReadFS ()
 Reads FS. More...
 
void __stdcall AsmWriteGS (_In_ USHORT segment_selector)
 Writes to GS. More...
 
USHORT __stdcall AsmReadGS ()
 Reads GS. More...
 
ULONG_PTR __stdcall AsmLoadAccessRightsByte (_In_ ULONG_PTR segment_selector)
 Loads access rights byte. More...
 
void __stdcall AsmInvalidateInternalCaches ()
 Invalidates internal caches. More...
 
void __stdcall AsmWriteCR2 (_In_ ULONG_PTR cr2_value)
 Writes to CR2. More...
 
unsigned char __stdcall AsmInvept (_In_ InvEptType invept_type, _In_ const InvEptDescriptor *invept_descriptor)
 Invalidates translations derived from EPT. More...
 
unsigned char __stdcall AsmInvvpid (_In_ InvVpidType invvpid_type, _In_ const InvVpidDescriptor *invvpid_descriptor)
 Invalidate translations based on VPID. More...
 
void __sgdt (_Out_ void *gdtr)
 Writes to GDT. More...
 
void __lgdt (_In_ void *gdtr)
 Reads SGDT. More...
 

Detailed Description

Declares interfaces to assembly functions.

Definition in file asm.h.

Function Documentation

◆ __lgdt()

void __lgdt ( _In_ void *  gdtr)
inline

Reads SGDT.

Parameters
gdtrA pointer to read GDTR

Definition at line 165 of file asm.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ __sgdt()

void __sgdt ( _Out_ void *  gdtr)
inline

Writes to GDT.

Parameters
gdtrA value to write

Definition at line 161 of file asm.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsmInitializeVm()

bool __stdcall AsmInitializeVm ( _In_ void(*)(_In_ ULONG_PTR, _In_ ULONG_PTR, _In_opt_ void *)  vm_initialization_routine,
_In_opt_ void *  context 
)

A wrapper for vm_initialization_routine.

Parameters
vm_initialization_routineA function pointer for entering VMX-mode
contextA context parameter for vm_initialization_routine
Returns
true if vm_initialization_routine was successfully executed
Here is the caller graph for this function:

◆ AsmInvalidateInternalCaches()

void __stdcall AsmInvalidateInternalCaches ( )

Invalidates internal caches.

Here is the caller graph for this function:

◆ AsmInvept()

unsigned char __stdcall AsmInvept ( _In_ InvEptType  invept_type,
_In_ const InvEptDescriptor invept_descriptor 
)

Invalidates translations derived from EPT.

Parameters
invept_typeA type of invalidation
invept_descriptorA reference to EPTP to invalidate
Returns
0 on success, 1 w/ an error code or 2 w/o an error code on failure
Here is the caller graph for this function:

◆ AsmInvvpid()

unsigned char __stdcall AsmInvvpid ( _In_ InvVpidType  invvpid_type,
_In_ const InvVpidDescriptor invvpid_descriptor 
)

Invalidate translations based on VPID.

Parameters
invvpid_typeA type of invalidation
invvpid_descriptorA description of translations to invalidate
Returns
0 on success, 1 w/ an error code or 2 w/o an error code on failure
Here is the caller graph for this function:

◆ AsmLoadAccessRightsByte()

ULONG_PTR __stdcall AsmLoadAccessRightsByte ( _In_ ULONG_PTR  segment_selector)

Loads access rights byte.

Parameters
segment_selectorA value to get access rights byte
Returns
An access rights byte
Here is the caller graph for this function:

◆ AsmReadCS()

USHORT __stdcall AsmReadCS ( )

Reads CS.

Returns
CS
Here is the caller graph for this function:

◆ AsmReadDS()

USHORT __stdcall AsmReadDS ( )

Reads DS.

Returns
DS
Here is the caller graph for this function:

◆ AsmReadES()

USHORT __stdcall AsmReadES ( )

Reads ES.

Returns
ES
Here is the caller graph for this function:

◆ AsmReadFS()

USHORT __stdcall AsmReadFS ( )

Reads FS.

Returns
FS
Here is the caller graph for this function:

◆ AsmReadGDT()

void __stdcall AsmReadGDT ( _Out_ Gdtr gdtr)

Reads SGDT.

Parameters
gdtrA pointer to read GDTR
Here is the caller graph for this function:

◆ AsmReadGS()

USHORT __stdcall AsmReadGS ( )

Reads GS.

Returns
GS
Here is the caller graph for this function:

◆ AsmReadLDTR()

USHORT __stdcall AsmReadLDTR ( )

Reads SLDT.

Returns
LDT
Here is the caller graph for this function:

◆ AsmReadSS()

USHORT __stdcall AsmReadSS ( )

Reads SS.

Returns
SS
Here is the caller graph for this function:

◆ AsmReadTR()

USHORT __stdcall AsmReadTR ( )

Reads STR.

Returns
TR
Here is the caller graph for this function:

◆ AsmVmmEntryPoint()

void __stdcall AsmVmmEntryPoint ( )

An entry point of VMM where gets called whenever VM-exit occurred.

Here is the caller graph for this function:

◆ AsmVmxCall()

unsigned char __stdcall AsmVmxCall ( _In_ ULONG_PTR  hypercall_number,
_In_opt_ void *  context 
)

Executes VMCALL with the given hypercall number and a context.

Parameters
hypercall_numberA hypercall number
contextA context parameter for VMCALL
Returns
Equivalent to VmxStatus
Here is the caller graph for this function:

◆ AsmWriteCR2()

void __stdcall AsmWriteCR2 ( _In_ ULONG_PTR  cr2_value)

Writes to CR2.

Parameters
cr2_valueA value to write
Here is the caller graph for this function:

◆ AsmWriteCS()

void __stdcall AsmWriteCS ( _In_ USHORT  segment_selector)

Writes to CS.

Parameters
segment_selectorA value to write

◆ AsmWriteDS()

void __stdcall AsmWriteDS ( _In_ USHORT  segment_selector)

Writes to DS.

Parameters
segment_selectorA value to write

◆ AsmWriteES()

void __stdcall AsmWriteES ( _In_ USHORT  segment_selector)

Writes to ES.

Parameters
segment_selectorA value to write

◆ AsmWriteFS()

void __stdcall AsmWriteFS ( _In_ USHORT  segment_selector)

Writes to FS.

Parameters
segment_selectorA value to write

◆ AsmWriteGDT()

void __stdcall AsmWriteGDT ( _In_ const Gdtr gdtr)

Writes to GDT.

Parameters
gdtrA value to write
Here is the caller graph for this function:

◆ AsmWriteGS()

void __stdcall AsmWriteGS ( _In_ USHORT  segment_selector)

Writes to GS.

Parameters
segment_selectorA value to write

◆ AsmWriteSS()

void __stdcall AsmWriteSS ( _In_ USHORT  segment_selector)

Writes to SS.

Parameters
segment_selectorA value to write

◆ AsmWriteTR()

void __stdcall AsmWriteTR ( _In_ USHORT  task_register)

Writes to TR.

Parameters
task_registerA value to write