]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | DiskIo.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Disk IO protocol as defined in the EFI 1.0 specification.\r | |
19 | \r | |
20 | The Disk IO protocol is used to convert block oriented devices into byte\r | |
21 | oriented devices. The Disk IO protocol is intended to layer on top of the\r | |
22 | Block IO protocol.\r | |
23 | \r | |
24 | --*/\r | |
25 | \r | |
26 | #ifndef __DISK_IO_H__\r | |
27 | #define __DISK_IO_H__\r | |
28 | \r | |
29 | #define EFI_DISK_IO_PROTOCOL_GUID \\r | |
30 | { \\r | |
31 | 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \\r | |
32 | }\r | |
33 | \r | |
34 | EFI_FORWARD_DECLARATION (EFI_DISK_IO_PROTOCOL);\r | |
35 | \r | |
36 | typedef\r | |
37 | EFI_STATUS\r | |
38 | (EFIAPI *EFI_DISK_READ) (\r | |
39 | IN EFI_DISK_IO_PROTOCOL * This,\r | |
40 | IN UINT32 MediaId,\r | |
41 | IN UINT64 Offset,\r | |
42 | IN UINTN BufferSize,\r | |
43 | OUT VOID *Buffer\r | |
44 | )\r | |
45 | /*++\r | |
46 | \r | |
47 | Routine Description:\r | |
48 | Read BufferSize bytes from Offset into Buffer.\r | |
49 | \r | |
50 | Arguments:\r | |
51 | This - Protocol instance pointer.\r | |
52 | MediaId - Id of the media, changes every time the media is replaced.\r | |
53 | Offset - The starting byte offset to read from\r | |
54 | BufferSize - Size of Buffer\r | |
55 | Buffer - Buffer containing read data\r | |
56 | \r | |
57 | Returns:\r | |
58 | EFI_SUCCESS - The data was read correctly from the device.\r | |
59 | EFI_DEVICE_ERROR - The device reported an error while performing the read.\r | |
60 | EFI_NO_MEDIA - There is no media in the device.\r | |
61 | EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.\r | |
62 | EFI_INVALID_PARAMETER - The read request contains device addresses that are not \r | |
63 | valid for the device.\r | |
64 | \r | |
65 | --*/\r | |
66 | ;\r | |
67 | \r | |
68 | typedef\r | |
69 | EFI_STATUS\r | |
70 | (EFIAPI *EFI_DISK_WRITE) (\r | |
71 | IN EFI_DISK_IO_PROTOCOL * This,\r | |
72 | IN UINT32 MediaId,\r | |
73 | IN UINT64 Offset,\r | |
74 | IN UINTN BufferSize,\r | |
75 | IN VOID *Buffer\r | |
76 | )\r | |
77 | /*++\r | |
78 | \r | |
79 | Routine Description:\r | |
80 | Read BufferSize bytes from Offset into Buffer.\r | |
81 | \r | |
82 | Arguments:\r | |
83 | This - Protocol instance pointer.\r | |
84 | MediaId - Id of the media, changes every time the media is replaced. \r | |
85 | Offset - The starting byte offset to read from\r | |
86 | BufferSize - Size of Buffer\r | |
87 | Buffer - Buffer containing read data\r | |
88 | \r | |
89 | Returns:\r | |
90 | EFI_SUCCESS - The data was written correctly to the device.\r | |
91 | EFI_WRITE_PROTECTED - The device can not be written to.\r | |
92 | EFI_DEVICE_ERROR - The device reported an error while performing the write.\r | |
93 | EFI_NO_MEDIA - There is no media in the device.\r | |
94 | EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.\r | |
95 | EFI_INVALID_PARAMETER - The write request contains device addresses that are not \r | |
96 | valid for the device.\r | |
97 | \r | |
98 | --*/\r | |
99 | ;\r | |
100 | \r | |
101 | #define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r | |
102 | \r | |
103 | typedef struct _EFI_DISK_IO_PROTOCOL {\r | |
104 | UINT64 Revision;\r | |
105 | EFI_DISK_READ ReadDisk;\r | |
106 | EFI_DISK_WRITE WriteDisk;\r | |
107 | } EFI_DISK_IO_PROTOCOL;\r | |
108 | \r | |
109 | extern EFI_GUID gEfiDiskIoProtocolGuid;\r | |
110 | \r | |
111 | #endif\r |