]>
Commit | Line | Data |
---|---|---|
21b50a27 | 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 | |
17 | Module Name: DiskIo.h\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef __DISK_IO_H__\r | |
22 | #define __DISK_IO_H__\r | |
23 | \r | |
24 | #define EFI_DISK_IO_PROTOCOL_GUID \\r | |
25 | { \\r | |
26 | 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r | |
27 | }\r | |
28 | \r | |
29 | typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r | |
30 | \r | |
31 | /**\r | |
32 | Read BufferSize bytes from Offset into Buffer.\r | |
33 | \r | |
34 | @param This Protocol instance pointer.\r | |
35 | @param MediaId Id of the media, changes every time the media is replaced.\r | |
36 | @param Offset The starting byte offset to read from\r | |
37 | @param BufferSize Size of Buffer\r | |
38 | @param Buffer Buffer containing read data\r | |
39 | \r | |
40 | @retval EFI_SUCCESS The data was read correctly from the device.\r | |
41 | @retval EFI_DEVICE_ERROR The device reported an error while performing the read.\r | |
42 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
43 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
44 | @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r | |
45 | valid for the device.\r | |
46 | \r | |
47 | **/\r | |
48 | typedef\r | |
49 | EFI_STATUS\r | |
50 | (EFIAPI *EFI_DISK_READ) (\r | |
51 | IN EFI_DISK_IO_PROTOCOL *This,\r | |
52 | IN UINT32 MediaId,\r | |
53 | IN UINT64 Offset,\r | |
54 | IN UINTN BufferSize,\r | |
55 | OUT VOID *Buffer\r | |
56 | )\r | |
57 | ;\r | |
58 | \r | |
59 | /**\r | |
60 | Read BufferSize bytes from Offset into Buffer.\r | |
61 | \r | |
62 | @param This Protocol instance pointer.\r | |
63 | @param MediaId Id of the media, changes every time the media is replaced.\r | |
64 | @param Offset The starting byte offset to read from\r | |
65 | @param BufferSize Size of Buffer\r | |
66 | @param Buffer Buffer containing read data\r | |
67 | \r | |
68 | @retval EFI_SUCCESS The data was written correctly to the device.\r | |
69 | @retval EFI_WRITE_PROTECTED The device can not be written to.\r | |
70 | @retval EFI_DEVICE_ERROR The device reported an error while performing the write.\r | |
71 | @retval EFI_NO_MEDIA There is no media in the device.\r | |
72 | @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.\r | |
73 | @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r | |
74 | valid for the device.\r | |
75 | \r | |
76 | **/\r | |
77 | typedef\r | |
78 | EFI_STATUS\r | |
79 | (EFIAPI *EFI_DISK_WRITE) (\r | |
80 | IN EFI_DISK_IO_PROTOCOL *This,\r | |
81 | IN UINT32 MediaId,\r | |
82 | IN UINT64 Offset,\r | |
83 | IN UINTN BufferSize,\r | |
84 | IN VOID *Buffer\r | |
85 | )\r | |
86 | ;\r | |
87 | \r | |
88 | #define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r | |
89 | \r | |
90 | struct _EFI_DISK_IO_PROTOCOL {\r | |
91 | UINT64 Revision;\r | |
92 | EFI_DISK_READ ReadDisk;\r | |
93 | EFI_DISK_WRITE WriteDisk;\r | |
94 | };\r | |
95 | \r | |
96 | extern EFI_GUID gEfiDiskIoProtocolGuid;\r | |
97 | \r | |
98 | #endif\r |