--- /dev/null
+/** @file\r
+ This file defines the EFI Erase Block Protocol.\r
+\r
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+ 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
+ @par Revision Reference:\r
+ This Protocol is introduced in UEFI Specification 2.6\r
+\r
+**/\r
+\r
+#ifndef __EFI_ERASE_BLOCK_PROTOCOL_H__\r
+#define __EFI_ERASE_BLOCK_PROTOCOL_H__\r
+\r
+#define EFI_ERASE_BLOCK_PROTOCOL_GUID \\r
+ { \\r
+ 0x95a9a93e, 0xa86e, 0x4926, { 0xaa, 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 } \\r
+ }\r
+\r
+typedef struct _EFI_ERASE_BLOCK_PROTOCOL EFI_ERASE_BLOCK_PROTOCOL;\r
+\r
+#define EFI_ERASE_BLOCK_PROTOCOL_REVISION ((2<<16) | (60))\r
+\r
+///\r
+/// EFI_ERASE_BLOCK_TOKEN\r
+///\r
+typedef struct {\r
+ //\r
+ // If Event is NULL, then blocking I/O is performed. If Event is not NULL and\r
+ // non-blocking I/O is supported, then non-blocking I/O is performed, and\r
+ // Event will be signaled when the erase request is completed.\r
+ //\r
+ EFI_EVENT Event;\r
+ //\r
+ // Defines whether the signaled event encountered an error.\r
+ //\r
+ EFI_STATUS TransactionStatus;\r
+} EFI_ERASE_BLOCK_TOKEN;\r
+\r
+/**\r
+ Erase a specified number of device blocks.\r
+\r
+ @param[in] This Indicates a pointer to the calling context.\r
+ @param[in] MediaId The media ID that the erase request is for.\r
+ @param[in] LBA The starting logical block address to be\r
+ erased. The caller is responsible for erasing\r
+ only legitimate locations.\r
+ @param[in, out] Token A pointer to the token associated with the\r
+ transaction.\r
+ @param[in] Size The size in bytes to be erased. This must be\r
+ a multiple of the physical block size of the\r
+ device.\r
+\r
+ @retval EFI_SUCCESS The erase request was queued if Event is not\r
+ NULL. The data was erased correctly to the\r
+ device if the Event is NULL.to the device.\r
+ @retval EFI_WRITE_PROTECTED The device cannot be erased due to write\r
+ protection.\r
+ @retval EFI_DEVICE_ERROR The device reported an error while attempting\r
+ to perform the erase operation.\r
+ @retval EFI_INVALID_PARAMETER The erase request contains LBAs that are not\r
+ valid.\r
+ @retval EFI_NO_MEDIA There is no media in the device.\r
+ @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_ERASE) (\r
+ IN EFI_ERASE_BLOCK_PROTOCOL *This,\r
+ IN UINT32 MediaId,\r
+ IN EFI_LBA LBA,\r
+ IN OUT EFI_ERASE_BLOCK_TOKEN *Token,\r
+ IN UINTN Size\r
+ );\r
+\r
+///\r
+/// The EFI Erase Block Protocol provides the ability for a device to expose\r
+/// erase functionality. This optional protocol is installed on the same handle\r
+/// as the EFI_BLOCK_IO_PROTOCOL or EFI_BLOCK_IO2_PROTOCOL.\r
+///\r
+struct _EFI_ERASE_BLOCK_PROTOCOL {\r
+ //\r
+ // The revision to which the EFI_ERASE_BLOCK_PROTOCOL adheres. All future\r
+ // revisions must be backwards compatible. If a future version is not\r
+ // backwards compatible, it is not the same GUID.\r
+ //\r
+ UINT64 Revision;\r
+ //\r
+ // Returns the erase length granularity as a number of logical blocks. A\r
+ // value of 1 means the erase granularity is one logical block.\r
+ //\r
+ UINT32 EraseLengthGranularity;\r
+ EFI_BLOCK_ERASE EraseBlocks;\r
+};\r
+\r
+extern EFI_GUID gEfiEraseBlockProtocolGuid;\r
+\r
+#endif\r
## Include/Protocol/SdMmcPassThru.h\r
gEfiSdMmcPassThruProtocolGuid = { 0x716ef0d9, 0xff83, 0x4f69, {0x81, 0xe9, 0x51, 0x8b, 0xd3, 0x9a, 0x8e, 0x70 }}\r
\r
+ ## Include/Protocol/EraseBlock.h\r
+ gEfiEraseBlockProtocolGuid = { 0x95a9a93e, 0xa86e, 0x4926, {0xaa, 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }}\r
+\r
#\r
# [Error.gEfiMdePkgTokenSpaceGuid]\r
# 0x80000001 | Invalid value provided.\r