]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/XenBusDxe/GrantTable.h
0d8434d1fe763112fca40424e0cff10313bc67a7
[mirror_edk2.git] / OvmfPkg / XenBusDxe / GrantTable.h
1 /** @file
2 Grant Table function declaration.
3
4 Grant Table are used to grant access to certain page of the current
5 VM to an other VM.
6
7 Copyright (C) 2014, Citrix Ltd.
8
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11 **/
12 #ifndef __GNTTAB_H__
13 #define __GNTTAB_H__
14
15 #include <IndustryStandard/Xen/grant_table.h>
16
17 /**
18 Initialize the Grant Table at the address MmioAddr.
19
20 @param Dev A pointer to XENBUS_DEVICE.
21 @param MmioAddr An address where the grant table can be mapped into
22 the guest.
23 **/
24 VOID
25 XenGrantTableInit (
26 IN XENBUS_DEVICE *Dev
27 );
28
29 /**
30 Desinitilize the Grant Table.
31 **/
32 VOID
33 XenGrantTableDeinit (
34 IN XENBUS_DEVICE *Dev
35 );
36
37 /**
38 Grant access to the page Frame to the domain DomainId.
39
40 @param This A pointer to XENBUS_PROTOCOL instance.
41 @param DomainId ID of the domain to grant acces to.
42 @param Frame Frame Number of the page to grant access to.
43 @param ReadOnly Provide read-only or read-write access.
44 @param RefPtr Reference number of the grant will be written to this pointer.
45 **/
46 EFI_STATUS
47 EFIAPI
48 XenBusGrantAccess (
49 IN XENBUS_PROTOCOL *This,
50 IN domid_t DomainId,
51 IN UINTN Frame, // MFN
52 IN BOOLEAN ReadOnly,
53 OUT grant_ref_t *RefPtr
54 );
55
56 /**
57 End access to grant Ref, previously return by XenBusGrantAccess.
58
59 @param This A pointer to XENBUS_PROTOCOL instance.
60 @param Ref Reference numeber of a grant previously returned by
61 XenBusGrantAccess.
62 **/
63 EFI_STATUS
64 EFIAPI
65 XenBusGrantEndAccess (
66 IN XENBUS_PROTOCOL *This,
67 IN grant_ref_t Ref
68 );
69
70 #endif /* !__GNTTAB_H__ */