Implement ArReadFSDualWord() routine
Todas as verificações foram bem sucedidas
ci/woodpecker/push/build Pipeline was successful

Esse commit está contido em:
2023-02-07 23:19:22 +01:00
commit a32e18b237
2 arquivos alterados com 25 adições e 0 exclusões

Ver arquivo

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

Ver arquivo

@@ -270,6 +270,27 @@ ArReadControlRegister(IN USHORT ControlRegister)
return Value; 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). * Reads a 64-bit value from the requested Model Specific Register (MSR).
* *