]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/X64/RmpAdjust.nasm
MdePkg/BaseLib: add support for RMPADJUST instruction
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / RmpAdjust.nasm
diff --git a/MdePkg/Library/BaseLib/X64/RmpAdjust.nasm b/MdePkg/Library/BaseLib/X64/RmpAdjust.nasm
new file mode 100644 (file)
index 0000000..c307f64
--- /dev/null
@@ -0,0 +1,40 @@
+;-----------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2021, Advanced Micro Devices, Inc. All rights reserved.<BR>\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;\r
+; Module Name:\r
+;\r
+;   RmpAdjust.Asm\r
+;\r
+; Abstract:\r
+;\r
+;   AsmRmpAdjust function\r
+;\r
+; Notes:\r
+;\r
+;-----------------------------------------------------------------------------\r
+\r
+%include "Nasm.inc"\r
+\r
+    SECTION .text\r
+\r
+;-----------------------------------------------------------------------------\r
+;  UINT32\r
+;  EFIAPI\r
+;  AsmRmpAdjust (\r
+;    IN  UINT64  Rax,\r
+;    IN  UINT64  Rcx,\r
+;    IN  UINT64  Rdx\r
+;    )\r
+;-----------------------------------------------------------------------------\r
+global ASM_PFX(AsmRmpAdjust)\r
+ASM_PFX(AsmRmpAdjust):\r
+  mov     rax, rcx       ; Input Rax is in RCX by calling convention\r
+  mov     rcx, rdx       ; Input Rcx is in RDX by calling convention\r
+  mov     rdx, r8        ; Input Rdx is in R8  by calling convention\r
+\r
+  RMPADJUST\r
+\r
+  ; RMPADJUST returns the status in the EAX register.\r
+  ret\r