]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/Library/XenHypercallLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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
68f4599d
AP
13/**\r
14 To call when the gEfiXenInfoGuid HOB became available after the library init\r
15 function has already been executed.\r
16\r
17 This allow to make hypercall in the PEIM stage.\r
18**/\r
19RETURN_STATUS\r
20EFIAPI\r
21XenHypercallLibInit (\r
22 VOID\r
23 );\r
24\r
02f69a25
LE
25/**\r
26 Check if the Xen Hypercall library is able to make calls to the Xen\r
27 hypervisor.\r
28\r
29 Client code should call further functions in this library only if, and after,\r
30 this function returns TRUE.\r
31\r
32 @retval TRUE Hypercalls are available.\r
33 @retval FALSE Hypercalls are not available.\r
34**/\r
35BOOLEAN\r
36EFIAPI\r
37XenHypercallIsAvailable (\r
38 VOID\r
39 );\r
40\r
abcbbb14
AP
41/**\r
42 This function will put the two arguments in the right place (registers) and\r
bbc3758a 43 invoke the hypercall identified by HypercallID.\r
abcbbb14 44\r
bbc3758a 45 @param HypercallID The symbolic ID of the hypercall to be invoked\r
abcbbb14
AP
46 @param Arg1 First argument.\r
47 @param Arg2 Second argument.\r
48\r
49 @return Return 0 if success otherwise it return an errno.\r
50**/\r
51INTN\r
52EFIAPI\r
53XenHypercall2 (\r
cd8ff8fd
AB
54 IN UINTN HypercallID,\r
55 IN OUT INTN Arg1,\r
56 IN OUT INTN Arg2\r
abcbbb14
AP
57 );\r
58\r
59/**\r
60 Return the value of the HVM parameter Index.\r
61\r
abcbbb14
AP
62 @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN.\r
63\r
64 @return The value of the asked parameter or 0 in case of error.\r
65**/\r
66UINT64\r
6ad157c3 67EFIAPI\r
abcbbb14 68XenHypercallHvmGetParam (\r
ac0a286f 69 UINT32 Index\r
abcbbb14
AP
70 );\r
71\r
72/**\r
73 Hypercall to do different operation on the memory.\r
74\r
abcbbb14
AP
75 @param Operation The operation number, e.g. XENMEM_add_to_physmap.\r
76 @param Arguments The arguments associated to the operation.\r
77\r
78 @return Return the return value from the hypercall, 0 in case of success\r
79 otherwise, an error code.\r
80**/\r
81INTN\r
6ad157c3 82EFIAPI\r
abcbbb14 83XenHypercallMemoryOp (\r
ac0a286f
MK
84 IN UINTN Operation,\r
85 IN OUT VOID *Arguments\r
abcbbb14
AP
86 );\r
87\r
88/**\r
89 Do an operation on the event channels.\r
90\r
abcbbb14
AP
91 @param Operation The operation number, e.g. EVTCHNOP_send.\r
92 @param Arguments The argument associated to the operation.\r
93\r
94 @return Return the return value from the hypercall, 0 in case of success\r
95 otherwise, an error code.\r
96**/\r
97INTN\r
6ad157c3 98EFIAPI\r
abcbbb14 99XenHypercallEventChannelOp (\r
ac0a286f
MK
100 IN INTN Operation,\r
101 IN OUT VOID *Arguments\r
abcbbb14
AP
102 );\r
103\r
abcbbb14 104#endif\r