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
This commit is contained in:
26
OvmfPkg/Library/XenHypercallLib/X64/hypercall.nasm
Normal file
26
OvmfPkg/Library/XenHypercallLib/X64/hypercall.nasm
Normal file
@@ -0,0 +1,26 @@
|
||||
DEFAULT REL
|
||||
SECTION .text
|
||||
|
||||
; INTN
|
||||
; EFIAPI
|
||||
; __XenHypercall2 (
|
||||
; IN VOID *HypercallAddr,
|
||||
; IN OUT INTN Arg1,
|
||||
; IN OUT INTN Arg2
|
||||
; );
|
||||
global ASM_PFX(__XenHypercall2)
|
||||
ASM_PFX(__XenHypercall2):
|
||||
push rdi
|
||||
push rsi
|
||||
; Copy HypercallAddr to rax
|
||||
mov rax, rcx
|
||||
; Copy Arg1 to the register expected by Xen
|
||||
mov rdi, rdx
|
||||
; Copy Arg2 to the register expected by Xen
|
||||
mov rsi, r8
|
||||
; Call HypercallAddr
|
||||
call rax
|
||||
pop rsi
|
||||
pop rdi
|
||||
ret
|
||||
|
Reference in New Issue
Block a user