OvmfPkg: Fix build failure with gcc44, gcc45
[mirror_edk2.git] / OvmfPkg / XenBusDxe / XenHypercall.h
1 /** @file
2 Functions declarations to make Xen hypercalls.
3
4 Copyright (C) 2014, Citrix Ltd.
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __XENBUS_DXE_HYPERCALL_H__
17 #define __XENBUS_DXE_HYPERCALL_H__
18
19 /**
20 This function will put the two arguments in the right place (registers) and
21 call HypercallAddr, which correspond to an entry in the hypercall pages.
22
23 @param HypercallAddr A memory address where the hypercall to call is.
24 @param Arg1 First argument.
25 @param Arg2 Second argument.
26
27 @return Return 0 if success otherwise it return an errno.
28 **/
29 INTN
30 EFIAPI
31 XenHypercall2 (
32 IN VOID *HypercallAddr,
33 IN OUT INTN Arg1,
34 IN OUT INTN Arg2
35 );
36
37 /**
38 Get the page where all hypercall are from the XenInfo hob.
39
40 @param Dev A XENBUS_DEVICE instance.
41
42 @retval EFI_NOT_FOUND hyperpage could not be found.
43 @retval EFI_SUCCESS Successfully retrieve the hyperpage pointer.
44 **/
45 EFI_STATUS
46 XenHyperpageInit (
47 XENBUS_DEVICE *Dev
48 );
49
50 /**
51 Return the value of the HVM parameter Index.
52
53 @param Dev A XENBUS_DEVICE instance.
54 @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN.
55
56 @return The value of the asked parameter or 0 in case of error.
57 **/
58 UINT64
59 XenHypercallHvmGetParam (
60 XENBUS_DEVICE *Dev,
61 UINT32 Index
62 );
63
64 /**
65 Hypercall to do different operation on the memory.
66
67 @param Dev A XENBUS_DEVICE instance.
68 @param Operation The operation number, e.g. XENMEM_add_to_physmap.
69 @param Arguments The arguments associated to the operation.
70
71 @return Return the return value from the hypercall, 0 in case of success
72 otherwise, an error code.
73 **/
74 INTN
75 XenHypercallMemoryOp (
76 IN XENBUS_DEVICE *Dev,
77 IN UINTN Operation,
78 IN OUT VOID *Arguments
79 );
80
81 /**
82 Do an operation on the event channels.
83
84 @param Dev A XENBUS_DEVICE instance.
85 @param Operation The operation number, e.g. EVTCHNOP_send.
86 @param Arguments The argument associated to the operation.
87
88 @return Return the return value from the hypercall, 0 in case of success
89 otherwise, an error code.
90 **/
91 INTN
92 XenHypercallEventChannelOp (
93 IN XENBUS_DEVICE *Dev,
94 IN INTN Operation,
95 IN OUT VOID *Arguments
96 );
97
98 /**
99 Map the shared_info_t page into memory.
100
101 @param Dev A XENBUS_DEVICE instance.
102
103 @retval EFI_SUCCESS Dev->SharedInfo whill contain a pointer to
104 the shared info page
105 @retval EFI_LOAD_ERROR The shared info page could not be mapped. The
106 hypercall returned an error.
107 **/
108 EFI_STATUS
109 XenGetSharedInfoPage (
110 IN OUT XENBUS_DEVICE *Dev
111 );
112
113 #endif