]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/Library/XenHypercallLib.h
OvmfPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / OvmfPkg / Include / Library / XenHypercallLib.h
1 /** @file
2 Functions declarations to make Xen hypercalls.
3
4 Copyright (C) 2014, Citrix Ltd.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __XEN_HYPERCALL_LIB_H__
11 #define __XEN_HYPERCALL_LIB_H__
12
13 /**
14 Check if the Xen Hypercall library is able to make calls to the Xen
15 hypervisor.
16
17 Client code should call further functions in this library only if, and after,
18 this function returns TRUE.
19
20 @retval TRUE Hypercalls are available.
21 @retval FALSE Hypercalls are not available.
22 **/
23 BOOLEAN
24 EFIAPI
25 XenHypercallIsAvailable (
26 VOID
27 );
28
29 /**
30 This function will put the two arguments in the right place (registers) and
31 invoke the hypercall identified by HypercallID.
32
33 @param HypercallID The symbolic ID of the hypercall to be invoked
34 @param Arg1 First argument.
35 @param Arg2 Second argument.
36
37 @return Return 0 if success otherwise it return an errno.
38 **/
39 INTN
40 EFIAPI
41 XenHypercall2 (
42 IN UINTN HypercallID,
43 IN OUT INTN Arg1,
44 IN OUT INTN Arg2
45 );
46
47 /**
48 Return the value of the HVM parameter Index.
49
50 @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN.
51
52 @return The value of the asked parameter or 0 in case of error.
53 **/
54 UINT64
55 EFIAPI
56 XenHypercallHvmGetParam (
57 UINT32 Index
58 );
59
60 /**
61 Hypercall to do different operation on the memory.
62
63 @param Operation The operation number, e.g. XENMEM_add_to_physmap.
64 @param Arguments The arguments associated to the operation.
65
66 @return Return the return value from the hypercall, 0 in case of success
67 otherwise, an error code.
68 **/
69 INTN
70 EFIAPI
71 XenHypercallMemoryOp (
72 IN UINTN Operation,
73 IN OUT VOID *Arguments
74 );
75
76 /**
77 Do an operation on the event channels.
78
79 @param Operation The operation number, e.g. EVTCHNOP_send.
80 @param Arguments The argument associated to the operation.
81
82 @return Return the return value from the hypercall, 0 in case of success
83 otherwise, an error code.
84 **/
85 INTN
86 EFIAPI
87 XenHypercallEventChannelOp (
88 IN INTN Operation,
89 IN OUT VOID *Arguments
90 );
91
92 #endif