Implement HlReadGSQuadWord() intrinsic
所有检测均成功
ci/woodpecker/push/build Pipeline was successful

这个提交包含在:
Rafal Kupiec 2023-01-23 19:59:54 +01:00
父节点 9fd21a8820
当前提交 c81b858757
签署人:: belliash
GPG 密钥 ID: 4E829243E0CFE6B4
共有 2 个文件被更改,包括 25 次插入0 次删除

查看文件

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