diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/edk2/OvmfPkg/XenPvBlkDxe/BlockFront.h | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/edk2/OvmfPkg/XenPvBlkDxe/BlockFront.h')
-rw-r--r-- | roms/edk2/OvmfPkg/XenPvBlkDxe/BlockFront.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/roms/edk2/OvmfPkg/XenPvBlkDxe/BlockFront.h b/roms/edk2/OvmfPkg/XenPvBlkDxe/BlockFront.h new file mode 100644 index 000000000..7c2d7f2c9 --- /dev/null +++ b/roms/edk2/OvmfPkg/XenPvBlkDxe/BlockFront.h @@ -0,0 +1,95 @@ +/** @file
+ BlockFront functions and types declarations.
+
+ Copyright (C) 2014, Citrix Ltd.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include "XenPvBlkDxe.h"
+
+#include <IndustryStandard/Xen/event_channel.h>
+#include <IndustryStandard/Xen/io/blkif.h>
+
+typedef struct _XEN_BLOCK_FRONT_DEVICE XEN_BLOCK_FRONT_DEVICE;
+typedef struct _XEN_BLOCK_FRONT_IO XEN_BLOCK_FRONT_IO;
+
+struct _XEN_BLOCK_FRONT_IO
+{
+ XEN_BLOCK_FRONT_DEVICE *Dev;
+ UINT8 *Buffer;
+ UINTN Size;
+ UINTN Sector; ///< 512 bytes sector.
+
+ grant_ref_t GrantRef[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+ INT32 NumRef;
+
+ EFI_STATUS Status;
+};
+
+typedef struct
+{
+ UINT64 Sectors;
+ UINT32 SectorSize;
+ UINT32 VDiskInfo;
+ BOOLEAN ReadWrite;
+ BOOLEAN CdRom;
+ BOOLEAN FeatureBarrier;
+ BOOLEAN FeatureFlushCache;
+} XEN_BLOCK_FRONT_MEDIA_INFO;
+
+#define XEN_BLOCK_FRONT_SIGNATURE SIGNATURE_32 ('X', 'p', 'v', 'B')
+struct _XEN_BLOCK_FRONT_DEVICE {
+ UINT32 Signature;
+ EFI_BLOCK_IO_PROTOCOL BlockIo;
+ domid_t DomainId;
+
+ blkif_front_ring_t Ring;
+ grant_ref_t RingRef;
+ evtchn_port_t EventChannel;
+ blkif_vdev_t DeviceId;
+
+ CONST CHAR8 *NodeName;
+ XEN_BLOCK_FRONT_MEDIA_INFO MediaInfo;
+
+ VOID *StateWatchToken;
+
+ XENBUS_PROTOCOL *XenBusIo;
+};
+
+#define XEN_BLOCK_FRONT_FROM_BLOCK_IO(b) \
+ CR (b, XEN_BLOCK_FRONT_DEVICE, BlockIo, XEN_BLOCK_FRONT_SIGNATURE)
+
+EFI_STATUS
+XenPvBlockFrontInitialization (
+ IN XENBUS_PROTOCOL *XenBusIo,
+ IN CONST CHAR8 *NodeName,
+ OUT XEN_BLOCK_FRONT_DEVICE **DevPtr
+ );
+
+VOID
+XenPvBlockFrontShutdown (
+ IN XEN_BLOCK_FRONT_DEVICE *Dev
+ );
+
+VOID
+XenPvBlockAsyncIo (
+ IN OUT XEN_BLOCK_FRONT_IO *IoData,
+ IN BOOLEAN IsWrite
+ );
+
+EFI_STATUS
+XenPvBlockIo (
+ IN OUT XEN_BLOCK_FRONT_IO *IoData,
+ IN BOOLEAN IsWrite
+ );
+
+VOID
+XenPvBlockAsyncIoPoll (
+ IN XEN_BLOCK_FRONT_DEVICE *Dev
+ );
+
+VOID
+XenPvBlockSync (
+ IN XEN_BLOCK_FRONT_DEVICE *Dev
+ );
|