]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DiskIo.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Protocol / DiskIo.h
CommitLineData
d1f95000 1/** @file\r
8a7d75b0 2 Disk IO protocol as defined in the UEFI 2.0 specification.\r
d1f95000 3\r
4 The Disk IO protocol is used to convert block oriented devices into byte\r
5 oriented devices. The Disk IO protocol is intended to layer on top of the\r
6 Block IO protocol.\r
7\r
9df063a0
HT
8 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9 This program and the accompanying materials \r
d1f95000 10 are licensed and made available under the terms and conditions of the BSD License \r
11 which accompanies this distribution. The full text of the license may be found at \r
12 http://opensource.org/licenses/bsd-license.php \r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
16\r
d1f95000 17**/\r
18\r
19#ifndef __DISK_IO_H__\r
20#define __DISK_IO_H__\r
21\r
22#define EFI_DISK_IO_PROTOCOL_GUID \\r
23 { \\r
24 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
25 }\r
26\r
99e8ed21 27///\r
28/// Protocol GUID name defined in EFI1.1.\r
29/// \r
a6508c05 30#define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID\r
31\r
d1f95000 32typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r
33\r
99e8ed21 34///\r
35/// Protocol defined in EFI1.1.\r
36/// \r
a6508c05 37typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO;\r
38\r
d1f95000 39/**\r
40 Read BufferSize bytes from Offset into Buffer.\r
41\r
42 @param This Protocol instance pointer.\r
43 @param MediaId Id of the media, changes every time the media is replaced.\r
44 @param Offset The starting byte offset to read from\r
45 @param BufferSize Size of Buffer\r
46 @param Buffer Buffer containing read data\r
47\r
48 @retval EFI_SUCCESS The data was read correctly from the device.\r
49 @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r
50 @retval EFI_NO_MEDIA There is no media in the device.\r
51 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r
52 @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
53 valid for the device.\r
54\r
55**/\r
56typedef\r
57EFI_STATUS\r
8b13229b 58(EFIAPI *EFI_DISK_READ)(\r
d1f95000 59 IN EFI_DISK_IO_PROTOCOL *This,\r
60 IN UINT32 MediaId,\r
61 IN UINT64 Offset,\r
62 IN UINTN BufferSize,\r
63 OUT VOID *Buffer\r
ed66e1bc 64 );\r
d1f95000 65\r
66/**\r
74fec708 67 Writes a specified number of bytes to a device.\r
d1f95000 68\r
74fec708
LG
69 @param This Indicates a pointer to the calling context.\r
70 @param MediaId ID of the medium to be written.\r
71 @param Offset The starting byte offset on the logical block I/O device to write.\r
72 @param BufferSize The size in bytes of Buffer. The number of bytes to write to the device.\r
73 @param Buffer A pointer to the buffer containing the data to be written.\r
d1f95000 74\r
75 @retval EFI_SUCCESS The data was written correctly to the device.\r
76 @retval EFI_WRITE_PROTECTED The device can not be written to.\r
77 @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r
78 @retval EFI_NO_MEDIA There is no media in the device.\r
79 @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r
80 @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r
81 valid for the device.\r
82\r
83**/\r
84typedef\r
85EFI_STATUS\r
8b13229b 86(EFIAPI *EFI_DISK_WRITE)(\r
d1f95000 87 IN EFI_DISK_IO_PROTOCOL *This,\r
88 IN UINT32 MediaId,\r
89 IN UINT64 Offset,\r
90 IN UINTN BufferSize,\r
91 IN VOID *Buffer\r
ed66e1bc 92 );\r
d1f95000 93\r
94#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r
95\r
99e8ed21 96///\r
97/// Revision defined in EFI1.1\r
98/// \r
a6508c05 99#define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION\r
100\r
44717a39 101///\r
102/// This protocol is used to abstract Block I/O interfaces.\r
103///\r
d1f95000 104struct _EFI_DISK_IO_PROTOCOL {\r
3354353d 105 ///\r
106 /// The revision to which the disk I/O interface adheres. All future\r
107 /// revisions must be backwards compatible. If a future version is not\r
108 /// backwards compatible, it is not the same GUID.\r
109 ///\r
d1f95000 110 UINT64 Revision;\r
111 EFI_DISK_READ ReadDisk;\r
112 EFI_DISK_WRITE WriteDisk;\r
113};\r
114\r
115extern EFI_GUID gEfiDiskIoProtocolGuid;\r
116\r
117#endif\r