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