blob: 5772c56662dfbc34248a907d565fa8d92d0038ab [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @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 This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17**/
18#ifndef __GNTTAB_H__
19#define __GNTTAB_H__
20
21#include <IndustryStandard/Xen/grant_table.h>
22
23/**
24 Initialize the Grant Table at the address MmioAddr.
25
26 @param Dev A pointer to XENBUS_DEVICE.
27 @param MmioAddr An address where the grant table can be mapped into
28 the guest.
29**/
30VOID
31XenGrantTableInit (
32 IN XENBUS_DEVICE *Dev,
33 IN UINT64 MmioAddr
34 );
35
36/**
37 Desinitilize the Grant Table.
38**/
39VOID
40XenGrantTableDeinit (
41 IN XENBUS_DEVICE *Dev
42 );
43
44/**
45 Grant access to the page Frame to the domain DomainId.
46
47 @param This A pointer to XENBUS_PROTOCOL instance.
48 @param DomainId ID of the domain to grant acces to.
49 @param Frame Frame Number of the page to grant access to.
50 @param ReadOnly Provide read-only or read-write access.
51 @param RefPtr Reference number of the grant will be writen to this pointer.
52**/
53EFI_STATUS
54EFIAPI
55XenBusGrantAccess (
56 IN XENBUS_PROTOCOL *This,
57 IN domid_t DomainId,
58 IN UINTN Frame, // MFN
59 IN BOOLEAN ReadOnly,
60 OUT grant_ref_t *RefPtr
61 );
62
63/**
64 End access to grant Ref, previously return by XenBusGrantAccess.
65
66 @param This A pointer to XENBUS_PROTOCOL instance.
67 @param Ref Reference numeber of a grant previously returned by
68 XenBusGrantAccess.
69**/
70EFI_STATUS
71EFIAPI
72XenBusGrantEndAccess (
73 IN XENBUS_PROTOCOL *This,
74 IN grant_ref_t Ref
75 );
76
77#endif /* !__GNTTAB_H__ */