Implement ArReadFSDualWord() routine
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Rafal Kupiec 2023-02-07 23:19:22 +01:00
parent 75c519a70c
commit a32e18b237
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 25 additions and 0 deletions

View File

@ -57,6 +57,10 @@ XTCDECL
ULONG_PTR
ArReadControlRegister(IN USHORT ControlRegister);
XTCDECL
ULONG
ArReadFSDualWord(ULONG Offset);
XTCDECL
ULONGLONG
ArReadModelSpecificRegister(IN ULONG Register);

View File

@ -270,6 +270,27 @@ ArReadControlRegister(IN USHORT ControlRegister)
return Value;
}
/**
* Reads dualword from a memory location specified by an offset relative to the beginning of the FS segment.
*
* @param Offset
* Specifies the offset from the beginning of FS segment.
*
* @return Returns the value read from the specified memory location relative to FS segment.
*
* @since XT 1.0
*/
XTCDECL
ULONG
ArReadFSDualWord(ULONG Offset)
{
ULONG Value;
asm volatile("movl %%fs:%a[Offset], %k[Value]"
: [Value] "=r" (Value)
: [Offset] "ir" (Offset));
return Value;
}
/**
* Reads a 64-bit value from the requested Model Specific Register (MSR).
*