Implement HlReadGSQuadWord() intrinsic

This commit is contained in:
2023-01-23 19:59:54 +01:00
父節點 9fd21a8820
當前提交 c81b858757
共有 2 個文件被更改,包括 25 次插入0 次删除

查看文件

@@ -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).
*