]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Introduce XenBus Protocol.
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 29 Oct 2014 06:49:38 +0000 (06:49 +0000)
committerjljusten <jljusten@Edk2>
Wed, 29 Oct 2014 06:49:38 +0000 (06:49 +0000)
This protocol will be used for communication between a PV driver (like a
PV block driver) and the XenBus/XenStore.

Change in V5:
- Replace the license by the commonly used file header text.

Change in V3:
- Add disclaimer about the volatile nature of the protocol.
- Add a description on the two introduced members to the protocol.

Change in V2:
- Comment, file header
- Protocol License
- Declare xen interface version earlier
- Rename protocol from Xenbus to XenBus

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16262 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Include/Protocol/XenBus.h [new file with mode: 0644]
OvmfPkg/OvmfPkg.dec
OvmfPkg/XenBusDxe/XenBusDxe.h
OvmfPkg/XenBusDxe/XenBusDxe.inf

diff --git a/OvmfPkg/Include/Protocol/XenBus.h b/OvmfPkg/Include/Protocol/XenBus.h
new file mode 100644 (file)
index 0000000..89bf74f
--- /dev/null
@@ -0,0 +1,92 @@
+\r
+/** @file\r
+  XenBus protocol to be used between the XenBus bus driver and Xen PV devices.\r
+\r
+  DISCLAIMER: the XENBUS_PROTOCOL introduced here is a work in progress, and\r
+  should not be used outside of the EDK II tree.\r
+\r
+  This protocol provide the necessary for a Xen PV driver frontend to\r
+  communicate with the bus driver, and perform several task to\r
+  initialize/shutdown a PV device and perform IO with a PV backend.\r
+\r
+  Copyright (C) 2014, Citrix Ltd.\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __PROTOCOL_XENBUS_H__\r
+#define __PROTOCOL_XENBUS_H__\r
+\r
+#define XENBUS_PROTOCOL_GUID \\r
+  {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}}\r
+\r
+///\r
+/// Forward declaration\r
+///\r
+typedef struct _XENBUS_PROTOCOL XENBUS_PROTOCOL;\r
+\r
+\r
+#include <IndustryStandard/Xen/grant_table.h>\r
+\r
+///\r
+/// Function prototypes\r
+///\r
+\r
+/**\r
+  Grant access to the page Frame to the domain DomainId.\r
+\r
+  @param This       A pointer to XENBUS_PROTOCOL instance.\r
+  @param DomainId   ID of the domain to grant acces to.\r
+  @param Frame      Frame Number of the page to grant access to.\r
+  @param ReadOnly   Provide read-only or read-write access.\r
+  @param RefPtr     Reference number of the grant will be writen to this pointer.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *XENBUS_GRANT_ACCESS)(\r
+  IN  XENBUS_PROTOCOL *This,\r
+  IN  domid_t         DomainId,\r
+  IN  UINTN           Frame,\r
+  IN  BOOLEAN         ReadOnly,\r
+  OUT grant_ref_t     *refp\r
+  );\r
+\r
+/**\r
+  End access to grant Ref, previously return by XenBusGrantAccess.\r
+\r
+  @param This       A pointer to XENBUS_PROTOCOL instance.\r
+  @param Ref        Reference numeber of a grant previously returned by\r
+                    XenBusGrantAccess.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *XENBUS_GRANT_END_ACCESS)(\r
+  IN XENBUS_PROTOCOL  *This,\r
+  IN grant_ref_t      Ref\r
+  );\r
+\r
+\r
+///\r
+/// Protocol structure\r
+///\r
+/// DISCLAIMER: the XENBUS_PROTOCOL introduced here is a work in progress, and\r
+/// should not be used outside of the EDK II tree.\r
+///\r
+struct _XENBUS_PROTOCOL {\r
+  XENBUS_GRANT_ACCESS           GrantAccess;\r
+  XENBUS_GRANT_END_ACCESS       GrantEndAccess;\r
+  //\r
+  // Protocol data fields\r
+  //\r
+};\r
+\r
+extern EFI_GUID gXenBusProtocolGuid;\r
+\r
+#endif\r
index c10948dc3bd005ae611436df09a333de36895a44..3765ac8f8a35f5d465872045c0136fbe7d3e514e 100644 (file)
@@ -47,6 +47,7 @@
 [Protocols]\r
   gVirtioDeviceProtocolGuid       = {0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}}\r
   gBlockMmioProtocolGuid          = {0x6b558ce3, 0x69e5, 0x4c67, {0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe, 0x84}}\r
+  gXenBusProtocolGuid             = {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}}\r
 \r
 [PcdsFixedAtBuild]\r
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0\r
index 388d2996953ca3e278486dcf6bbdadc1c9d97e39..64579bb83284ce16fc0bedb4420def8f13169c33 100644 (file)
 \r
 #include <Uefi.h>\r
 \r
+//\r
+// Xen interface version used\r
+//\r
+#define  __XEN_INTERFACE_VERSION__ 0x00040400\r
+\r
 //\r
 // Libraries\r
 //\r
@@ -45,6 +50,7 @@
 //\r
 // Produced Protocols\r
 //\r
+#include <Protocol/XenBus.h>\r
 \r
 \r
 //\r
index 6da3d2d670a95e54801abf66c565277b807b5afa..add85213c640441085e8bbce08c209bd61ec8233 100644 (file)
@@ -62,6 +62,7 @@
   gEfiPciIoProtocolGuid\r
   gEfiComponentName2ProtocolGuid\r
   gEfiComponentNameProtocolGuid\r
+  gXenBusProtocolGuid\r
 \r
 \r
 [Guids]\r