]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/DiskIo.h
Checked in the Protocols introduced in UEFI/PI.
[mirror_edk2.git] / MdePkg / Include / Protocol / DiskIo.h
diff --git a/MdePkg/Include/Protocol/DiskIo.h b/MdePkg/Include/Protocol/DiskIo.h
new file mode 100644 (file)
index 0000000..e36792c
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+  Disk IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  The Disk IO protocol is used to convert block oriented devices into byte\r
+  oriented devices. The Disk IO protocol is intended to layer on top of the\r
+  Block IO protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DiskIo.h\r
+\r
+**/\r
+\r
+#ifndef __DISK_IO_H__\r
+#define __DISK_IO_H__\r
+\r
+#define EFI_DISK_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r
+\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  MediaId               Id of the media, changes every time the media is replaced.\r
+  @param  Offset                The starting byte offset to read from\r
+  @param  BufferSize            Size of Buffer\r
+  @param  Buffer                Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISK_READ) (\r
+  IN EFI_DISK_IO_PROTOCOL         *This,\r
+  IN UINT32                       MediaId,\r
+  IN UINT64                       Offset,\r
+  IN UINTN                        BufferSize,\r
+  OUT VOID                        *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Offset     The starting byte offset to read from\r
+  @param  BufferSize Size of Buffer\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was written correctly to the device.\r
+  @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r
+                                 valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISK_WRITE) (\r
+  IN EFI_DISK_IO_PROTOCOL         *This,\r
+  IN UINT32                       MediaId,\r
+  IN UINT64                       Offset,\r
+  IN UINTN                        BufferSize,\r
+  IN VOID                         *Buffer\r
+  )\r
+;\r
+\r
+#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r
+\r
+struct _EFI_DISK_IO_PROTOCOL {\r
+  UINT64          Revision;\r
+  EFI_DISK_READ   ReadDisk;\r
+  EFI_DISK_WRITE  WriteDisk;\r
+};\r
+\r
+extern EFI_GUID gEfiDiskIoProtocolGuid;\r
+\r
+#endif\r