]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c
Code scrub for the following drivers and librarys.
[mirror_edk2.git] / MdeModulePkg / Library / DxeCrc32GuidedSectionExtractLib / DxeCrc32GuidedSectionExtractLib.c
index e664428d0e52705e306da840d1c370ad3042e83c..b87af37a91b9de76f1b12713d671d9d6d803609d 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
 \r
-  Implements CRC32 guided section handler to parse CRC32 encapsulation section, \r
-  extract data and authenticate 32 bit CRC value.\r
+  This library registers CRC32 guided section handler \r
+  to parse CRC32 encapsulation section and extract raw data.\r
+  It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.\r
 \r
 Copyright (c) 2007 - 2008, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials                          \r
@@ -24,15 +25,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define EFI_SECITON_SIZE_MASK 0x00ffffff\r
 \r
+///\r
+/// CRC32 Guided Section header\r
+///\r
 typedef struct {\r
-  EFI_GUID_DEFINED_SECTION  GuidedSectionHeader;\r
-  UINT32                    CRC32Checksum;\r
+  EFI_GUID_DEFINED_SECTION  GuidedSectionHeader; ///< EFI guided section header\r
+  UINT32                    CRC32Checksum;       ///< 32bit CRC check sum\r
 } CRC32_SECTION_HEADER;\r
 \r
 /**\r
 \r
-  The implementation of Crc32 guided section GetInfo() to get \r
-  size and attribute of the guided section.\r
+  GetInfo gets raw data size and attribute of the input guided section.\r
+  It first checks whether the input guid section is supported. \r
+  If not, EFI_INVALID_PARAMETER will return.\r
 \r
   @param InputSection       Buffer containing the input GUIDed section to be processed.\r
   @param OutputBufferSize   The size of OutputBuffer.\r
@@ -74,13 +79,16 @@ Crc32GuidedSectionGetInfo (
 \r
 /**\r
 \r
-  The implementation of Crc32 Guided section extraction to get the section data.\r
+  Extraction handler tries to extract raw data from the input guided section.\r
+  It also does authentication check for 32bit CRC value in the input guided section.\r
+  It first checks whether the input guid section is supported. \r
+  If not, EFI_INVALID_PARAMETER will return.\r
 \r
   @param InputSection    Buffer containing the input GUIDed section to be processed.\r
-  @param OutputBuffer    to contain the output data, which is allocated by the caller.\r
+  @param OutputBuffer    Buffer to contain the output raw data allocated by the caller.\r
   @param ScratchBuffer   A pointer to a caller-allocated buffer for function internal use.\r
   @param AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates the\r
-                         authentication status of the output buffer.\r
+                              authentication status of the output buffer.\r
 \r
   @retval EFI_SUCCESS            Section Data and Auth Status is extracted successfully.\r
   @retval EFI_INVALID_PARAMETER  The GUID in InputSection does not match this instance guid.\r
@@ -161,13 +169,13 @@ Crc32GuidedSectionHandler (
 }\r
 \r
 /**\r
-  Register Crc32 section handler.\r
+  Register the handler to extract CRC32 guided section.\r
 \r
   @param  ImageHandle  ImageHandle of the loaded driver.\r
   @param  SystemTable  Pointer to the EFI System Table.\r
 \r
-  @retval  RETURN_SUCCESS            Register successfully.\r
-  @retval  RETURN_OUT_OF_RESOURCES   No enough memory to register this handler.\r
+  @retval  EFI_SUCCESS            Register successfully.\r
+  @retval  EFI_OUT_OF_RESOURCES   No enough memory to register this handler.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r