]>
Commit | Line | Data |
---|---|---|
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 | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | /**\r | |
17 | Read BufferSize bytes from Lba into Buffer.\r | |
18 | \r | |
19 | @param This Indicates a pointer to the calling context.\r | |
20 | @param MediaId Id of the media, changes every time the media is replaced.\r | |
21 | @param Lba The starting Logical Block Address to read from\r | |
22 | @param BufferSize Size of Buffer, must be a multiple of device block size.\r | |
23 | @param Buffer A pointer to the destination buffer for the data. The caller is\r | |
24 | responsible for either having implicit or explicit ownership of the buffer.\r | |
25 | \r | |
26 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
27 | @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r | |
28 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
29 | @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.\r | |
30 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
31 | @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r | |
32 | or the buffer is not on proper alignment.\r | |
33 | \r | |
34 | **/\r | |
35 | EFI_STATUS\r | |
36 | EFIAPI\r | |
37 | XenPvBlkDxeBlockIoReadBlocks (\r | |
38 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
39 | IN UINT32 MediaId,\r | |
40 | IN EFI_LBA Lba,\r | |
41 | IN UINTN BufferSize,\r | |
42 | OUT VOID *Buffer\r | |
43 | );\r | |
44 | \r | |
45 | /**\r | |
46 | Write BufferSize bytes from Lba into Buffer.\r | |
47 | \r | |
48 | @param This Indicates a pointer to the calling context.\r | |
49 | @param MediaId The media ID that the write request is for.\r | |
50 | @param Lba The starting logical block address to be written. The caller is\r | |
51 | responsible for writing to only legitimate locations.\r | |
52 | @param BufferSize Size of Buffer, must be a multiple of device block size.\r | |
53 | @param Buffer A pointer to the source buffer for the data.\r | |
54 | \r | |
55 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
56 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
57 | @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r | |
58 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
59 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
60 | @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r | |
61 | @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r | |
62 | or the buffer is not on proper alignment.\r | |
63 | \r | |
64 | **/\r | |
65 | EFI_STATUS\r | |
66 | EFIAPI\r | |
67 | XenPvBlkDxeBlockIoWriteBlocks (\r | |
68 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
69 | IN UINT32 MediaId,\r | |
70 | IN EFI_LBA Lba,\r | |
71 | IN UINTN BufferSize,\r | |
72 | IN VOID *Buffer\r | |
73 | );\r | |
74 | \r | |
75 | /**\r | |
76 | Flush the Block Device.\r | |
77 | \r | |
78 | @param This Indicates a pointer to the calling context.\r | |
79 | \r | |
80 | @retval EFI_SUCCESS All outstanding data was written to the device\r | |
81 | @retval EFI_DEVICE_ERROR The device reported an error while writting back the data\r | |
82 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
83 | \r | |
84 | **/\r | |
85 | EFI_STATUS\r | |
86 | EFIAPI\r | |
87 | XenPvBlkDxeBlockIoFlushBlocks (\r | |
88 | IN EFI_BLOCK_IO_PROTOCOL *This\r | |
89 | );\r | |
90 | \r | |
91 | /**\r | |
92 | Reset the block device hardware.\r | |
93 | \r | |
94 | @param[in] This Indicates a pointer to the calling context.\r | |
95 | @param[in] ExtendedVerification Not used.\r | |
96 | \r | |
97 | @retval EFI_SUCCESS The device was reset.\r | |
98 | \r | |
99 | **/\r | |
100 | EFI_STATUS\r | |
101 | EFIAPI\r | |
102 | XenPvBlkDxeBlockIoReset (\r | |
103 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
104 | IN BOOLEAN ExtendedVerification\r | |
105 | );\r | |
106 | \r | |
107 | extern EFI_BLOCK_IO_MEDIA gXenPvBlkDxeBlockIoMedia;\r | |
108 | extern EFI_BLOCK_IO_PROTOCOL gXenPvBlkDxeBlockIo;\r |