summaryrefslogtreecommitdiff
path: root/OvmfPkg/Include
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-02-28 20:32:39 +0000
committerlersek <lersek@Edk2>2015-02-28 20:32:39 +0000
commitcd8ff8fdda24c83be6ac247f8c21e5e4032fe586 (patch)
tree1931452cf00096df4bb7fd945e6fadbd4de68981 /OvmfPkg/Include
parentbbc3758ab5bc0e526994a63d739d445416ff0c07 (diff)
downloadedk2-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/Include')
-rw-r--r--OvmfPkg/Include/Library/XenHypercallLib.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/OvmfPkg/Include/Library/XenHypercallLib.h b/OvmfPkg/Include/Library/XenHypercallLib.h
new file mode 100644
index 0000000000..1a468ea7dc
--- /dev/null
+++ b/OvmfPkg/Include/Library/XenHypercallLib.h
@@ -0,0 +1,79 @@
+/** @file
+ Functions declarations to make Xen hypercalls.
+
+ Copyright (C) 2014, Citrix Ltd.
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __XEN_HYPERCALL_LIB_H__
+#define __XEN_HYPERCALL_LIB_H__
+
+/**
+ This function will put the two arguments in the right place (registers) and
+ invoke the hypercall identified by HypercallID.
+
+ @param HypercallID The symbolic ID of the hypercall to be invoked
+ @param Arg1 First argument.
+ @param Arg2 Second argument.
+
+ @return Return 0 if success otherwise it return an errno.
+**/
+INTN
+EFIAPI
+XenHypercall2 (
+ IN UINTN HypercallID,
+ IN OUT INTN Arg1,
+ IN OUT INTN Arg2
+ );
+
+/**
+ Return the value of the HVM parameter Index.
+
+ @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN.
+
+ @return The value of the asked parameter or 0 in case of error.
+**/
+UINT64
+XenHypercallHvmGetParam (
+ UINT32 Index
+ );
+
+/**
+ Hypercall to do different operation on the memory.
+
+ @param Operation The operation number, e.g. XENMEM_add_to_physmap.
+ @param Arguments The arguments associated to the operation.
+
+ @return Return the return value from the hypercall, 0 in case of success
+ otherwise, an error code.
+**/
+INTN
+XenHypercallMemoryOp (
+ IN UINTN Operation,
+ IN OUT VOID *Arguments
+ );
+
+/**
+ Do an operation on the event channels.
+
+ @param Operation The operation number, e.g. EVTCHNOP_send.
+ @param Arguments The argument associated to the operation.
+
+ @return Return the return value from the hypercall, 0 in case of success
+ otherwise, an error code.
+**/
+INTN
+XenHypercallEventChannelOp (
+ IN INTN Operation,
+ IN OUT VOID *Arguments
+ );
+
+#endif