VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/XenPvBlkDxe/BlockIo.h@ 107064

Last change on this file since 107064 was 99404, checked in by vboxsync, 23 months ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette