]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Ia32/XSetBv.nasm
MdePkg/BaseLib: Add support for the XSETBV instruction
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / XSetBv.nasm
diff --git a/MdePkg/Library/BaseLib/Ia32/XSetBv.nasm b/MdePkg/Library/BaseLib/Ia32/XSetBv.nasm
new file mode 100644 (file)
index 0000000..cf638d9
--- /dev/null
@@ -0,0 +1,34 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;\r
+; Module Name:\r
+;\r
+;   XSetBv.nasm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmXSetBv function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; UINT64\r
+; EFIAPI\r
+; AsmXSetBv (\r
+;   IN UINT32  Index,\r
+;   IN UINT64  Value\r
+;   );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(AsmXSetBv)\r
+ASM_PFX(AsmXSetBv):\r
+    mov     edx, [esp + 12]\r
+    mov     eax, [esp + 8]\r
+    mov     ecx, [esp + 4]\r
+    xsetbv\r
+    ret\r