OvmfPkg/XenBusDxe: Add TestAndClearBit.
[mirror_edk2.git] / OvmfPkg / Include / Protocol / XenBus.h
CommitLineData
12a16f2d
AP
1\r
2/** @file\r
3 XenBus protocol to be used between the XenBus bus driver and Xen PV devices.\r
4\r
5 DISCLAIMER: the XENBUS_PROTOCOL introduced here is a work in progress, and\r
6 should not be used outside of the EDK II tree.\r
7\r
8 This protocol provide the necessary for a Xen PV driver frontend to\r
9 communicate with the bus driver, and perform several task to\r
10 initialize/shutdown a PV device and perform IO with a PV backend.\r
11\r
12 Copyright (C) 2014, Citrix Ltd.\r
13\r
14 This program and the accompanying materials\r
15 are licensed and made available under the terms and conditions of the BSD License\r
16 which accompanies this distribution. The full text of the license may be found at\r
17 http://opensource.org/licenses/bsd-license.php\r
18\r
19 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
20 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
21\r
22**/\r
23\r
24#ifndef __PROTOCOL_XENBUS_H__\r
25#define __PROTOCOL_XENBUS_H__\r
26\r
27#define XENBUS_PROTOCOL_GUID \\r
28 {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}}\r
29\r
30///\r
31/// Forward declaration\r
32///\r
33typedef struct _XENBUS_PROTOCOL XENBUS_PROTOCOL;\r
34\r
35\r
36#include <IndustryStandard/Xen/grant_table.h>\r
37\r
38///\r
39/// Function prototypes\r
40///\r
41\r
42/**\r
43 Grant access to the page Frame to the domain DomainId.\r
44\r
45 @param This A pointer to XENBUS_PROTOCOL instance.\r
46 @param DomainId ID of the domain to grant acces to.\r
47 @param Frame Frame Number of the page to grant access to.\r
48 @param ReadOnly Provide read-only or read-write access.\r
49 @param RefPtr Reference number of the grant will be writen to this pointer.\r
50**/\r
51typedef\r
52EFI_STATUS\r
53(EFIAPI *XENBUS_GRANT_ACCESS)(\r
54 IN XENBUS_PROTOCOL *This,\r
55 IN domid_t DomainId,\r
56 IN UINTN Frame,\r
57 IN BOOLEAN ReadOnly,\r
58 OUT grant_ref_t *refp\r
59 );\r
60\r
61/**\r
62 End access to grant Ref, previously return by XenBusGrantAccess.\r
63\r
64 @param This A pointer to XENBUS_PROTOCOL instance.\r
65 @param Ref Reference numeber of a grant previously returned by\r
66 XenBusGrantAccess.\r
67**/\r
68typedef\r
69EFI_STATUS\r
70(EFIAPI *XENBUS_GRANT_END_ACCESS)(\r
71 IN XENBUS_PROTOCOL *This,\r
72 IN grant_ref_t Ref\r
73 );\r
74\r
75\r
76///\r
77/// Protocol structure\r
78///\r
79/// DISCLAIMER: the XENBUS_PROTOCOL introduced here is a work in progress, and\r
80/// should not be used outside of the EDK II tree.\r
81///\r
82struct _XENBUS_PROTOCOL {\r
83 XENBUS_GRANT_ACCESS GrantAccess;\r
84 XENBUS_GRANT_END_ACCESS GrantEndAccess;\r
85 //\r
86 // Protocol data fields\r
87 //\r
88};\r
89\r
90extern EFI_GUID gXenBusProtocolGuid;\r
91\r
92#endif\r