Implement HlReadGSQuadWord() intrinsic
All checks were successful
ci/woodpecker/push/build Pipeline was successful
All checks were successful
ci/woodpecker/push/build Pipeline was successful
This commit is contained in:
parent
9fd21a8820
commit
c81b858757
@ -67,6 +67,10 @@ XTCDECL
|
||||
ULONG_PTR
|
||||
HlReadControlRegister(IN USHORT ControlRegister);
|
||||
|
||||
XTCDECL
|
||||
ULONGLONG
|
||||
HlReadGSQuadWord(ULONG Offset);
|
||||
|
||||
XTCDECL
|
||||
ULONGLONG
|
||||
HlReadModelSpecificRegister(IN ULONG Register);
|
||||
|
@ -318,6 +318,27 @@ HlReadControlRegister(IN USHORT ControlRegister)
|
||||
return Value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads quadword from a memory location specified by an offset relative to the beginning of the GS segment.
|
||||
*
|
||||
* @param Offset
|
||||
* Specifies the offset from the beginning of GS segment.
|
||||
*
|
||||
* @return Returns the value read from the specified memory location relative to GS segment.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
ULONGLONG
|
||||
HlReadGSQuadWord(ULONG Offset)
|
||||
{
|
||||
ULONGLONG Value;
|
||||
|
||||
/* Read quadword from GS segment */
|
||||
asm volatile("movq %%gs:%a[Offset], %q[Value]" : [Value] "=r" (Value) : [Offset] "ir" (Offset));
|
||||
return Value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a 64-bit value from the requested Model Specific Register (MSR).
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user