diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-02-28 20:32:39 +0000 |
---|---|---|
committer | lersek <lersek@Edk2> | 2015-02-28 20:32:39 +0000 |
commit | cd8ff8fdda24c83be6ac247f8c21e5e4032fe586 (patch) | |
tree | 1931452cf00096df4bb7fd945e6fadbd4de68981 /OvmfPkg/Library/XenHypercallLib/Ia32 | |
parent | bbc3758ab5bc0e526994a63d739d445416ff0c07 (diff) | |
download | edk2-platforms-cd8ff8fdda24c83be6ac247f8c21e5e4032fe586.tar.xz |
Ovmf/Xen: move XenBusDxe hypercall code to separate library
This moves all of the Xen hypercall code that was private to XenBusDxe
to a new library class XenHypercallLib. This will allow us to reimplement
it for ARM, and to export the Xen hypercall functionality to other parts
of the code, such as a Xen console SerialPortLib driver.
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16970 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/Library/XenHypercallLib/Ia32')
-rw-r--r-- | OvmfPkg/Library/XenHypercallLib/Ia32/hypercall.nasm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OvmfPkg/Library/XenHypercallLib/Ia32/hypercall.nasm b/OvmfPkg/Library/XenHypercallLib/Ia32/hypercall.nasm new file mode 100644 index 0000000000..e0fa71bb5b --- /dev/null +++ b/OvmfPkg/Library/XenHypercallLib/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
+
|