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