]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / FaultTolerantWriteDxe / FaultTolerantWrite.h
index be6929c6545fa38da90bb9a21dfbb3da60670f53..fe1c9f373611d6adbfa6a2e72b8a7013547f4a09 100644 (file)
@@ -3,14 +3,8 @@
   The internal header file includes the common header files, defines\r
   internal structure and functions used by Ftw module.\r
 \r
-Copyright (c) 2006 - 2014, 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
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -31,7 +25,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 \r
 //\r
@@ -82,7 +75,7 @@ typedef struct {
   UINTN                                   FtwWorkSpaceSize;   // Size of working space range that stores write record.\r
   EFI_LBA                                 FtwWorkSpaceLbaInSpare; // Start LBA of working space in spare block.\r
   UINTN                                   FtwWorkSpaceBaseInSpare;// Offset into the FtwWorkSpaceLbaInSpare block.\r
-  UINT8                                   *FtwWorkSpace;      // Point to Work Space in memory buffer \r
+  UINT8                                   *FtwWorkSpace;      // Point to Work Space in memory buffer\r
   //\r
   // Following a buffer of FtwWorkSpace[FTW_WORK_SPACE_SIZE],\r
   // Allocated with EFI_FTW_DEVICE.\r
@@ -183,11 +176,11 @@ FtwAllocate (
                          reading, writing, and erasing the target block.\r
   @param Buffer          The data to write.\r
 \r
-  @retval EFI_SUCCESS          The function completed successfully \r
-  @retval EFI_ABORTED          The function could not complete successfully. \r
-  @retval EFI_BAD_BUFFER_SIZE  The input data can't fit within the spare block. \r
+  @retval EFI_SUCCESS          The function completed successfully\r
+  @retval EFI_ABORTED          The function could not complete successfully.\r
+  @retval EFI_BAD_BUFFER_SIZE  The input data can't fit within the spare block.\r
                                Offset + *NumBytes > SpareAreaLength.\r
-  @retval EFI_ACCESS_DENIED    No writes have been allocated. \r
+  @retval EFI_ACCESS_DENIED    No writes have been allocated.\r
   @retval EFI_OUT_OF_RESOURCES Cannot allocate enough memory resource.\r
   @retval EFI_NOT_FOUND        Cannot find FVB protocol by handle.\r
 \r
@@ -290,7 +283,7 @@ FtwGetLastWrite (
                                 partially erased.\r
   @retval EFI_INVALID_PARAMETER One or more of the LBAs listed\r
                                 in the variable argument list do\r
-                                not exist in the firmware volume.  \r
+                                not exist in the firmware volume.\r
 \r
 \r
 **/\r
@@ -654,10 +647,10 @@ EFI_STATUS
 FtwGetSarProtocol (\r
   OUT VOID                                **SarProtocol\r
   );\r
-  \r
+\r
 /**\r
   Function returns an array of handles that support the FVB protocol\r
-  in a buffer allocated from pool. \r
+  in a buffer allocated from pool.\r
 \r
   @param[out]  NumberHandles    The number of handles returned in Buffer.\r
   @param[out]  Buffer           A pointer to the buffer to return the requested\r
@@ -689,7 +682,7 @@ GetFvbCountAndBuffer (
 **/\r
 EFI_STATUS\r
 InitFtwDevice (\r
-  OUT EFI_FTW_DEVICE               **FtwData \r
+  OUT EFI_FTW_DEVICE               **FtwData\r
   );\r
 \r
 \r
@@ -700,7 +693,7 @@ InitFtwDevice (
 \r
   @retval EFI_SUCCESS           Initialize the FTW protocol successfully.\r
   @retval EFI_NOT_FOUND         No proper FVB protocol was found.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 InitFtwProtocol (\r
@@ -766,4 +759,26 @@ WriteWorkSpaceData (
   IN UINT8                              *Buffer\r
   );\r
 \r
+/**\r
+  Internal implementation of CRC32. Depending on the execution context\r
+  (traditional SMM or DXE vs standalone MM), this function is implemented\r
+  via a call to the CalculateCrc32 () boot service, or via a library\r
+  call.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param[in]  Buffer       A pointer to the buffer on which the 32-bit CRC is\r
+                           to be computed.\r
+  @param[in]  Length       The number of bytes in the buffer Data.\r
+\r
+  @retval Crc32            The 32-bit CRC was computed for the data buffer.\r
+\r
+**/\r
+UINT32\r
+FtwCalculateCrc32 (\r
+  IN  VOID                         *Buffer,\r
+  IN  UINTN                        Length\r
+  );\r
+\r
 #endif\r