]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Ia32/VmgExit.nasm
MdePkg/BaseLib: Add support for the VMGEXIT instruction
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / VmgExit.nasm
diff --git a/MdePkg/Library/BaseLib/Ia32/VmgExit.nasm b/MdePkg/Library/BaseLib/Ia32/VmgExit.nasm
new file mode 100644 (file)
index 0000000..69f7fbf
--- /dev/null
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------\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
+;   VmgExit.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmVmgExit function\r
+;\r
+; Notes:\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+; VOID\r
+; EFIAPI\r
+; AsmVmgExit (\r
+;   VOID\r
+;   );\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(AsmVmgExit)\r
+ASM_PFX(AsmVmgExit):\r
+;\r
+; NASM doesn't support the vmmcall instruction in 32-bit mode and NASM versions\r
+; before 2.12 cannot translate the 64-bit "rep vmmcall" instruction into elf32\r
+; format. Given that VMGEXIT does not make sense on IA32, provide a stub\r
+; implementation that is identical to CpuBreakpoint(). In practice, AsmVmgExit()\r
+; should never be called on IA32.\r
+;\r
+    int  3\r
+    ret\r
+\r