The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
X64/hypercall.asm to X64/hypercall.nasm

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anthony PERARD <anthony.per...@citrix.com>
---
 OvmfPkg/XenBusDxe/X64/hypercall.S                  | 22 ----------------------
 .../X64/{hypercall.asm => hypercall.nasm}          |  8 ++++----
 OvmfPkg/XenBusDxe/XenBusDxe.inf                    |  3 +--
 3 files changed, 5 insertions(+), 28 deletions(-)
 delete mode 100644 OvmfPkg/XenBusDxe/X64/hypercall.S
 rename OvmfPkg/XenBusDxe/X64/{hypercall.asm => hypercall.nasm} (77%)

diff --git a/OvmfPkg/XenBusDxe/X64/hypercall.S 
b/OvmfPkg/XenBusDxe/X64/hypercall.S
deleted file mode 100644
index 83cf466..0000000
--- a/OvmfPkg/XenBusDxe/X64/hypercall.S
+++ /dev/null
@@ -1,22 +0,0 @@
-# INTN
-# EFIAPI
-# XenHypercall2 (
-#   IN     VOID *HypercallAddr,
-#   IN OUT INTN Arg1,
-#   IN OUT INTN Arg2
-#   );
-ASM_GLOBAL ASM_PFX(XenHypercall2)
-ASM_PFX(XenHypercall2):
-  push %rdi
-  push %rsi
-  # Copy HypercallAddr to rax
-  movq %rcx, %rax
-  # Copy Arg1 to the register expected by Xen
-  movq %rdx, %rdi
-  # Copy Arg2 to the register expected by Xen
-  movq %r8, %rsi
-  # Call HypercallAddr
-  call *%rax
-  pop %rsi
-  pop %rdi
-  ret
diff --git a/OvmfPkg/XenBusDxe/X64/hypercall.asm 
b/OvmfPkg/XenBusDxe/X64/hypercall.nasm
similarity index 77%
rename from OvmfPkg/XenBusDxe/X64/hypercall.asm
rename to OvmfPkg/XenBusDxe/X64/hypercall.nasm
index 5b34514..177f271 100644
--- a/OvmfPkg/XenBusDxe/X64/hypercall.asm
+++ b/OvmfPkg/XenBusDxe/X64/hypercall.nasm
@@ -1,4 +1,5 @@
-.code
+DEFAULT REL
+SECTION .text
 
 ; INTN
 ; EFIAPI
@@ -7,7 +8,8 @@
 ;   IN OUT INTN Arg1,
 ;   IN OUT INTN Arg2
 ;   );
-XenHypercall2 PROC
+global ASM_PFX(XenHypercall2)
+ASM_PFX(XenHypercall2):
   push rdi
   push rsi
   ; Copy HypercallAddr to rax
@@ -21,6 +23,4 @@ XenHypercall2 PROC
   pop rsi
   pop rdi
   ret
-XenHypercall2 ENDP
 
-END
diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.inf b/OvmfPkg/XenBusDxe/XenBusDxe.inf
index b421b85..3309f53 100644
--- a/OvmfPkg/XenBusDxe/XenBusDxe.inf
+++ b/OvmfPkg/XenBusDxe/XenBusDxe.inf
@@ -54,8 +54,7 @@
   Ia32/TestAndClearBit.nasm
 
 [Sources.X64]
-  X64/hypercall.S
-  X64/hypercall.asm
+  X64/hypercall.nasm
   X64/InterlockedCompareExchange16.S
   X64/InterlockedCompareExchange16.asm
   X64/TestAndClearBit.S
-- 
Anthony PERARD


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to