]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/XenPvBlkDxe/BlockIo.h
OvmfPkg/Csm/LegacyBiosDxe: Fix Legacy16GetTableAddress call for E820 data
[mirror_edk2.git] / OvmfPkg / XenPvBlkDxe / BlockIo.h
CommitLineData
5de8a35c
AP
1/** @file\r
2 BlockIo function declaration for Xen PV block driver.\r
3\r
4 Copyright (C) 2014, Citrix Ltd.\r
5\r
b26f0cf9 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
5de8a35c
AP
7\r
8**/\r
9\r
10/**\r
11 Read BufferSize bytes from Lba into Buffer.\r
12\r
13 @param This Indicates a pointer to the calling context.\r
14 @param MediaId Id of the media, changes every time the media is replaced.\r
15 @param Lba The starting Logical Block Address to read from\r
16 @param BufferSize Size of Buffer, must be a multiple of device block size.\r
17 @param Buffer A pointer to the destination buffer for the data. The caller is\r
18 responsible for either having implicit or explicit ownership of the buffer.\r
19\r
20 @retval EFI_SUCCESS The data was read correctly from the device.\r
21 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r
22 @retval EFI_NO_MEDIA There is no media in the device.\r
23 @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.\r
24 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r
25 @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r
26 or the buffer is not on proper alignment.\r
27\r
28**/\r
29EFI_STATUS\r
30EFIAPI\r
31XenPvBlkDxeBlockIoReadBlocks (\r
32 IN EFI_BLOCK_IO_PROTOCOL *This,\r
33 IN UINT32 MediaId,\r
34 IN EFI_LBA Lba,\r
35 IN UINTN BufferSize,\r
36 OUT VOID *Buffer\r
37 );\r
38\r
39/**\r
40 Write BufferSize bytes from Lba into Buffer.\r
41\r
42 @param This Indicates a pointer to the calling context.\r
43 @param MediaId The media ID that the write request is for.\r
44 @param Lba The starting logical block address to be written. The caller is\r
45 responsible for writing to only legitimate locations.\r
46 @param BufferSize Size of Buffer, must be a multiple of device block size.\r
47 @param Buffer A pointer to the source buffer for the data.\r
48\r
49 @retval EFI_SUCCESS The data was written correctly to the device.\r
50 @retval EFI_WRITE_PROTECTED The device can not be written to.\r
51 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r
52 @retval EFI_NO_MEDIA There is no media in the device.\r
53 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r
54 @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r
55 @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r
56 or the buffer is not on proper alignment.\r
57\r
58**/\r
59EFI_STATUS\r
60EFIAPI\r
61XenPvBlkDxeBlockIoWriteBlocks (\r
62 IN EFI_BLOCK_IO_PROTOCOL *This,\r
63 IN UINT32 MediaId,\r
64 IN EFI_LBA Lba,\r
65 IN UINTN BufferSize,\r
66 IN VOID *Buffer\r
67 );\r
68\r
69/**\r
70 Flush the Block Device.\r
71\r
72 @param This Indicates a pointer to the calling context.\r
73\r
74 @retval EFI_SUCCESS All outstanding data was written to the device\r
75 @retval EFI_DEVICE_ERROR The device reported an error while writting back the data\r
76 @retval EFI_NO_MEDIA There is no media in the device.\r
77\r
78**/\r
79EFI_STATUS\r
80EFIAPI\r
81XenPvBlkDxeBlockIoFlushBlocks (\r
82 IN EFI_BLOCK_IO_PROTOCOL *This\r
83 );\r
84\r
85/**\r
86 Reset the block device hardware.\r
87\r
88 @param[in] This Indicates a pointer to the calling context.\r
89 @param[in] ExtendedVerification Not used.\r
90\r
91 @retval EFI_SUCCESS The device was reset.\r
92\r
93**/\r
94EFI_STATUS\r
95EFIAPI\r
96XenPvBlkDxeBlockIoReset (\r
97 IN EFI_BLOCK_IO_PROTOCOL *This,\r
98 IN BOOLEAN ExtendedVerification\r
99 );\r
100\r
101extern EFI_BLOCK_IO_MEDIA gXenPvBlkDxeBlockIoMedia;\r
102extern EFI_BLOCK_IO_PROTOCOL gXenPvBlkDxeBlockIo;\r