]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | Disk IO protocol as defined in the EFI 1.0 specification.\r | |
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 | |
8 | Copyright (c) 2006, Intel Corporation \r | |
9 | All rights reserved. This program and the accompanying materials \r | |
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 | |
a6508c05 | 27 | //\r |
28 | // Protocol GUID name defined in EFI1.1.\r | |
29 | // \r | |
30 | #define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID\r | |
31 | \r | |
d1f95000 | 32 | typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r |
33 | \r | |
a6508c05 | 34 | //\r |
35 | // Protocol defined in EFI1.1.\r | |
36 | // \r | |
37 | typedef 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 | |
56 | typedef\r | |
57 | EFI_STATUS\r | |
58 | (EFIAPI *EFI_DISK_READ) (\r | |
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 | |
64 | )\r | |
65 | ;\r | |
66 | \r | |
67 | /**\r | |
68 | Read BufferSize bytes from Offset into Buffer.\r | |
69 | \r | |
70 | @param This Protocol instance pointer.\r | |
71 | @param MediaId Id of the media, changes every time the media is replaced.\r | |
72 | @param Offset The starting byte offset to read from\r | |
73 | @param BufferSize Size of Buffer\r | |
74 | @param Buffer Buffer containing read data\r | |
75 | \r | |
76 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
77 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
78 | @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r | |
79 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
80 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
81 | @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r | |
82 | valid for the device.\r | |
83 | \r | |
84 | **/\r | |
85 | typedef\r | |
86 | EFI_STATUS\r | |
87 | (EFIAPI *EFI_DISK_WRITE) (\r | |
88 | IN EFI_DISK_IO_PROTOCOL *This,\r | |
89 | IN UINT32 MediaId,\r | |
90 | IN UINT64 Offset,\r | |
91 | IN UINTN BufferSize,\r | |
92 | IN VOID *Buffer\r | |
93 | )\r | |
94 | ;\r | |
95 | \r | |
96 | #define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r | |
97 | \r | |
a6508c05 | 98 | //\r |
99 | // Revision defined in EFI1.1\r | |
100 | // \r | |
101 | #define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION\r | |
102 | \r | |
d1f95000 | 103 | struct _EFI_DISK_IO_PROTOCOL {\r |
104 | UINT64 Revision;\r | |
105 | EFI_DISK_READ ReadDisk;\r | |
106 | EFI_DISK_WRITE WriteDisk;\r | |
107 | };\r | |
108 | \r | |
109 | extern EFI_GUID gEfiDiskIoProtocolGuid;\r | |
110 | \r | |
111 | #endif\r |