VOID\r
);\r
\r
+/**\r
+ Executes a XGETBV instruction\r
+\r
+ Executes a XGETBV instruction. This function is only available on IA-32 and\r
+ x64.\r
+\r
+ @param[in] Index Extended control register index\r
+\r
+ @return The current value of the extended control register\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmXGetBv (\r
+ IN UINT32 Index\r
+ );\r
+\r
+\r
/**\r
Patch the immediate operand of an IA32 or X64 instruction such that the byte,\r
word, dword or qword operand is encoded at the end of the instruction's\r
Ia32/EnableCache.nasm| GCC\r
Ia32/DisableCache.nasm| GCC\r
Ia32/RdRand.nasm\r
+ Ia32/XGetBv.nasm\r
\r
Ia32/DivS64x64Remainder.c\r
Ia32/InternalSwitchStack.c | MSFT\r
X64/EnableDisableInterrupts.nasm\r
X64/DisablePaging64.nasm\r
X64/RdRand.nasm\r
+ X64/XGetBv.nasm\r
ChkStkGcc.c | GCC\r
\r
[Sources.EBC]\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;\r
+; Module Name:\r
+;\r
+; XGetBv.Asm\r
+;\r
+; Abstract:\r
+;\r
+; AsmXgetBv function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmXGetBv (\r
+; IN UINT32 Index\r
+; );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(AsmXGetBv)\r
+ASM_PFX(AsmXGetBv):\r
+ mov ecx, [esp + 4]\r
+ xgetbv\r
+ ret\r
--- /dev/null
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;\r
+; Module Name:\r
+;\r
+; XGetBv.Asm\r
+;\r
+; Abstract:\r
+;\r
+; AsmXgetBv function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ DEFAULT REL\r
+ SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmXGetBv (\r
+; IN UINT32 Index\r
+; );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(AsmXGetBv)\r
+ASM_PFX(AsmXGetBv):\r
+ xgetbv\r
+ shl rdx, 32\r
+ or rax, rdx\r
+ ret\r
+\r