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