summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenBusDxe/Ia32/hypercall.asm
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/XenBusDxe/Ia32/hypercall.asm')
-rw-r--r--OvmfPkg/XenBusDxe/Ia32/hypercall.asm26
1 files changed, 26 insertions, 0 deletions
diff --git a/OvmfPkg/XenBusDxe/Ia32/hypercall.asm b/OvmfPkg/XenBusDxe/Ia32/hypercall.asm
new file mode 100644
index 0000000000..9ead740f91
--- /dev/null
+++ b/OvmfPkg/XenBusDxe/Ia32/hypercall.asm
@@ -0,0 +1,26 @@
+.code
+
+; INTN
+; EFIAPI
+; XenHypercall2 (
+; IN VOID *HypercallAddr,
+; IN OUT INTN Arg1,
+; IN OUT INTN Arg2
+; );
+XenHypercall2 PROC
+ ; 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
+XenHypercall2 ENDP
+
+END