summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/XenBusDxe/Ia32/hypercall.nasm')
-rw-r--r--OvmfPkg/XenBusDxe/Ia32/hypercall.nasm25
1 files changed, 25 insertions, 0 deletions
diff --git a/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm b/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm
new file mode 100644
index 0000000000..8547c30b81
--- /dev/null
+++ b/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm
@@ -0,0 +1,25 @@
+SECTION .text
+
+; INTN
+; EFIAPI
+; XenHypercall2 (
+; IN VOID *HypercallAddr,
+; IN OUT INTN Arg1,
+; IN OUT INTN Arg2
+; );
+global ASM_PFX(XenHypercall2)
+ASM_PFX(XenHypercall2):
+ ; Save only ebx, ecx is supposed to be a scratch register and needs to be
+ ; saved by the caller
+ push ebx
+ ; Copy HypercallAddr to eax
+ mov eax, [esp + 8]
+ ; Copy Arg1 to the register expected by Xen
+ mov ebx, [esp + 12]
+ ; Copy Arg2 to the register expected by Xen
+ mov ecx, [esp + 16]
+ ; Call HypercallAddr
+ call eax
+ pop ebx
+ ret
+