]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/XenHypercallLib.h
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
[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
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
cd8ff8fd
AB
16#ifndef __XEN_HYPERCALL_LIB_H__\r
17#define __XEN_HYPERCALL_LIB_H__\r
abcbbb14 18\r
02f69a25
LE
19/**\r
20 Check if the Xen Hypercall library is able to make calls to the Xen\r
21 hypervisor.\r
22\r
23 Client code should call further functions in this library only if, and after,\r
24 this function returns TRUE.\r
25\r
26 @retval TRUE Hypercalls are available.\r
27 @retval FALSE Hypercalls are not available.\r
28**/\r
29BOOLEAN\r
30EFIAPI\r
31XenHypercallIsAvailable (\r
32 VOID\r
33 );\r
34\r
abcbbb14
AP
35/**\r
36 This function will put the two arguments in the right place (registers) and\r
bbc3758a 37 invoke the hypercall identified by HypercallID.\r
abcbbb14 38\r
bbc3758a 39 @param HypercallID The symbolic ID of the hypercall to be invoked\r
abcbbb14
AP
40 @param Arg1 First argument.\r
41 @param Arg2 Second argument.\r
42\r
43 @return Return 0 if success otherwise it return an errno.\r
44**/\r
45INTN\r
46EFIAPI\r
47XenHypercall2 (\r
cd8ff8fd
AB
48 IN UINTN HypercallID,\r
49 IN OUT INTN Arg1,\r
50 IN OUT INTN Arg2\r
abcbbb14
AP
51 );\r
52\r
53/**\r
54 Return the value of the HVM parameter Index.\r
55\r
abcbbb14
AP
56 @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN.\r
57\r
58 @return The value of the asked parameter or 0 in case of error.\r
59**/\r
60UINT64\r
6ad157c3 61EFIAPI\r
abcbbb14 62XenHypercallHvmGetParam (\r
cec6ad0a 63 UINT32 Index\r
abcbbb14
AP
64 );\r
65\r
66/**\r
67 Hypercall to do different operation on the memory.\r
68\r
abcbbb14
AP
69 @param Operation The operation number, e.g. XENMEM_add_to_physmap.\r
70 @param Arguments The arguments associated to the operation.\r
71\r
72 @return Return the return value from the hypercall, 0 in case of success\r
73 otherwise, an error code.\r
74**/\r
75INTN\r
6ad157c3 76EFIAPI\r
abcbbb14 77XenHypercallMemoryOp (\r
abcbbb14
AP
78 IN UINTN Operation,\r
79 IN OUT VOID *Arguments\r
80 );\r
81\r
82/**\r
83 Do an operation on the event channels.\r
84\r
abcbbb14
AP
85 @param Operation The operation number, e.g. EVTCHNOP_send.\r
86 @param Arguments The argument associated to the operation.\r
87\r
88 @return Return the return value from the hypercall, 0 in case of success\r
89 otherwise, an error code.\r
90**/\r
91INTN\r
6ad157c3 92EFIAPI\r
abcbbb14 93XenHypercallEventChannelOp (\r
abcbbb14
AP
94 IN INTN Operation,\r
95 IN OUT VOID *Arguments\r
96 );\r
97\r
abcbbb14 98#endif\r