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