]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/XenBusDxe/XenHypercall.h
OvmfPkg: Fix build failure with gcc44, gcc45
[mirror_edk2.git] / OvmfPkg / XenBusDxe / XenHypercall.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
16#ifndef __XENBUS_DXE_HYPERCALL_H__\r
17#define __XENBUS_DXE_HYPERCALL_H__\r
18\r
abcbbb14
AP
19/**\r
20 This function will put the two arguments in the right place (registers) and\r
21 call HypercallAddr, which correspond to an entry in the hypercall pages.\r
22\r
23 @param HypercallAddr A memory address where the hypercall to call is.\r
24 @param Arg1 First argument.\r
25 @param Arg2 Second argument.\r
26\r
27 @return Return 0 if success otherwise it return an errno.\r
28**/\r
29INTN\r
30EFIAPI\r
31XenHypercall2 (\r
32 IN VOID *HypercallAddr,\r
33 IN OUT INTN Arg1,\r
34 IN OUT INTN Arg2\r
35 );\r
36\r
37/**\r
38 Get the page where all hypercall are from the XenInfo hob.\r
39\r
40 @param Dev A XENBUS_DEVICE instance.\r
41\r
42 @retval EFI_NOT_FOUND hyperpage could not be found.\r
43 @retval EFI_SUCCESS Successfully retrieve the hyperpage pointer.\r
44**/\r
45EFI_STATUS\r
46XenHyperpageInit (\r
47 XENBUS_DEVICE *Dev\r
48 );\r
49\r
50/**\r
51 Return the value of the HVM parameter Index.\r
52\r
53 @param Dev A XENBUS_DEVICE instance.\r
54 @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN.\r
55\r
56 @return The value of the asked parameter or 0 in case of error.\r
57**/\r
58UINT64\r
59XenHypercallHvmGetParam (\r
60 XENBUS_DEVICE *Dev,\r
cec6ad0a 61 UINT32 Index\r
abcbbb14
AP
62 );\r
63\r
64/**\r
65 Hypercall to do different operation on the memory.\r
66\r
67 @param Dev A XENBUS_DEVICE instance.\r
68 @param Operation The operation number, e.g. XENMEM_add_to_physmap.\r
69 @param Arguments The arguments associated to the operation.\r
70\r
71 @return Return the return value from the hypercall, 0 in case of success\r
72 otherwise, an error code.\r
73**/\r
74INTN\r
75XenHypercallMemoryOp (\r
76 IN XENBUS_DEVICE *Dev,\r
77 IN UINTN Operation,\r
78 IN OUT VOID *Arguments\r
79 );\r
80\r
81/**\r
82 Do an operation on the event channels.\r
83\r
84 @param Dev A XENBUS_DEVICE instance.\r
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
92XenHypercallEventChannelOp (\r
93 IN XENBUS_DEVICE *Dev,\r
94 IN INTN Operation,\r
95 IN OUT VOID *Arguments\r
96 );\r
97\r
98/**\r
99 Map the shared_info_t page into memory.\r
100\r
101 @param Dev A XENBUS_DEVICE instance.\r
102\r
103 @retval EFI_SUCCESS Dev->SharedInfo whill contain a pointer to\r
104 the shared info page\r
105 @retval EFI_LOAD_ERROR The shared info page could not be mapped. The\r
106 hypercall returned an error.\r
107**/\r
108EFI_STATUS\r
109XenGetSharedInfoPage (\r
110 IN OUT XENBUS_DEVICE *Dev\r
111 );\r
112\r
113#endif\r