]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update code style and comments
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Jun 2009 05:33:36 +0000 (05:33 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Jun 2009 05:33:36 +0000 (05:33 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8640 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Include/Guid/LzmaDecompress.h
IntelFrameworkModulePkg/Include/Guid/TianoDecompress.h
IntelFrameworkModulePkg/Include/Library/GenericBdsLib.h
IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.c
IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLibInternals.h
IntelFrameworkModulePkg/Library/GenericBdsLib/DevicePath.c
IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.c
IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf

index b64d0365c41e39a9cb84867c050c5272358b946e..65031abf882487dc6aff0eb311827718cce942b3 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Lzma Custom decompress algorithm Guid definition\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2009, 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
@@ -9,15 +10,7 @@ http://opensource.org/licenses/bsd-license.php
 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:\r
-\r
-  LzmaDecompress.h\r
-\r
-Abstract:\r
-\r
-  Lzma Custom decompress algorithm Guid definitions\r
-\r
---*/\r
+**/\r
 \r
 #ifndef __LZMA_DECOMPRESS_GUID_H__\r
 #define __LZMA_DECOMPRESS_GUID_H__\r
index e395cbc0ea385a5cf11d171c9571d9ee54902c59..c59ae5f0b0a998eebafc7d07baedec47b5e80487 100644 (file)
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef __EFI_CUSTOM_DECOMPRESS_GUID_H__\r
-#define __EFI_CUSTOM_DECOMPRESS_GUID_H__\r
+#ifndef __TIANO_CUSTOM_DECOMPRESS_GUID_H__\r
+#define __TIANO_CUSTOM_DECOMPRESS_GUID_H__\r
 \r
 #define TIANO_CUSTOM_DECOMPRESS_GUID  \\r
   { 0xA31280AD, 0x481E, 0x41B6, { 0x95, 0xE8, 0x12, 0x7F, 0x4C, 0x98, 0x47, 0x79 } }\r
index 34393728537ef96a36f9d0ca9bdd3f36d1deb34a..d0a5de46bc3c3e4192cab7c975a6763eed9abe0a 100644 (file)
@@ -551,9 +551,9 @@ DevicePathToStr (
 // Internal definitions\r
 //\r
 typedef struct {\r
-  CHAR16  *str;\r
-  UINTN   len;\r
-  UINTN   maxlen;\r
+  CHAR16  *Str;\r
+  UINTN   Len;\r
+  UINTN   Maxlen;\r
 } POOL_PRINT;\r
 \r
 typedef struct {\r
@@ -1045,7 +1045,7 @@ DevPathVendor (
   The caller must free the resulting buffer.\r
 \r
   @param  Str      Tracks the allocated pool, size in use, and amount of pool allocated.\r
-  @param  fmt      The format string\r
+  @param  Fmt      The format string\r
   @param  ...      The data will be printed.\r
 \r
   @return Allocated buffer with the formatted string printed in it.\r
@@ -1057,7 +1057,7 @@ CHAR16 *
 EFIAPI\r
 CatPrint (\r
   IN OUT POOL_PRINT   *Str,\r
-  IN CHAR16           *fmt,\r
+  IN CHAR16           *Fmt,\r
   ...\r
   );\r
 \r
index ad80f2b6beae1e86e6bee795f463d9a53897fd9a..b143ba3282d1058a522dcd83a77050b875ad2246 100644 (file)
@@ -1,10 +1,8 @@
-/**@file\r
-  UEFI and Custom Decompress Library \r
-  The function of UefiTianoDecompress() is interface for this module,\r
-  it will do tiano or uefi decompress with different verison parameter.\r
-  See EFI specification 1.1 Chapter 17 to get LZ77 compress/decompress.\r
+/** @file\r
+  UEFI and Tiano Custom Decompress Library \r
+  Tt will do Tiano or UEFI decompress with different verison parameter.\r
   \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2009, 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
@@ -29,8 +27,14 @@ FillBuf (
   IN  UINT16        NumOfBits\r
   )\r
 {\r
+  //\r
+  // Left shift NumOfBits of bits in advance\r
+  //\r
   Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);\r
 \r
+  //\r
+  // Copy data needed in bytes into mSbuBitBuf\r
+  //\r
   while (NumOfBits > Sd->mBitCount) {\r
 \r
     Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));\r
@@ -54,7 +58,14 @@ FillBuf (
     }\r
   }\r
 \r
+  //\r
+  // Caculate additional bit count read to update mBitCount\r
+  //\r
   Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);\r
+  \r
+  //\r
+  // Copy NumOfBits of bits from mSubBitBuf into mBitBuf\r
+  //\r
   Sd->mBitBuf |= Sd->mSubBitBuf >> Sd->mBitCount;\r
 }\r
 \r
@@ -79,8 +90,14 @@ GetBits (
 {\r
   UINT32  OutBits;\r
 \r
+  //\r
+  // Pop NumOfBits of Bits from Left\r
+  //  \r
   OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits));\r
 \r
+  //\r
+  // Fill up mBitBuf from source\r
+  //\r
   FillBuf (Sd, NumOfBits);\r
 \r
   return OutBits;\r
@@ -96,7 +113,7 @@ GetBits (
   @param  NumOfChar Number of symbols in the symbol set\r
   @param  BitLen    Code length array\r
   @param  TableBits The width of the mapping table\r
-  @param  Table     The table\r
+  @param  Table     The table to be created.\r
 \r
   @retval  0 OK.\r
   @retval  BAD_TABLE The table is corrupted.\r
@@ -227,6 +244,8 @@ MakeTable (
 /**\r
   Decodes a position value.\r
   \r
+  Get a position value according to Position Huffman Table.\r
+\r
   @param Sd      the global scratch data\r
   \r
   @return The position value decoded.\r
@@ -247,7 +266,7 @@ DecodeP (
 \r
     do {\r
 \r
-      if (Sd->mBitBuf & Mask) {\r
+      if ((Sd->mBitBuf & Mask) != 0) {\r
         Val = Sd->mRight[Val];\r
       } else {\r
         Val = Sd->mLeft[Val];\r
@@ -471,21 +490,38 @@ DecodeC (
   if (Sd->mBlockSize == 0) {\r
     //\r
     // Starting a new block\r
-    //\r
+    // Read BlockSize from block header\r
+    // \r
     Sd->mBlockSize    = (UINT16) GetBits (Sd, 16);\r
+\r
+    //\r
+    // Read in the Extra Set Code Length Arrary,\r
+    // Generate the Huffman code mapping table for Extra Set.\r
+    //\r
     Sd->mBadTableFlag = ReadPTLen (Sd, NT, TBIT, 3);\r
     if (Sd->mBadTableFlag != 0) {\r
       return 0;\r
     }\r
 \r
+    //\r
+    // Read in and decode the Char&Len Set Code Length Arrary,\r
+    // Generate the Huffman code mapping table for Char&Len Set.\r
+    //\r
     ReadCLen (Sd);\r
 \r
+    //\r
+    // Read in the Position Set Code Length Arrary, \r
+    // Generate the Huffman code mapping table for the Position Set.\r
+    //\r
     Sd->mBadTableFlag = ReadPTLen (Sd, MAXNP, Sd->mPBit, (UINT16) (-1));\r
     if (Sd->mBadTableFlag != 0) {\r
       return 0;\r
     }\r
   }\r
 \r
+  //\r
+  // Get one code according to Code&Set Huffman Table\r
+  //\r
   Sd->mBlockSize--;\r
   Index2 = Sd->mCTable[Sd->mBitBuf >> (BITBUFSIZ - 12)];\r
 \r
@@ -493,7 +529,7 @@ DecodeC (
     Mask = 1U << (BITBUFSIZ - 1 - 12);\r
 \r
     do {\r
-      if (Sd->mBitBuf & Mask) {\r
+      if ((Sd->mBitBuf & Mask) != 0) {\r
         Index2 = Sd->mRight[Index2];\r
       } else {\r
         Index2 = Sd->mLeft[Index2];\r
@@ -511,9 +547,9 @@ DecodeC (
 }\r
 \r
 /**\r
-  Decode the source data ad put the resulting data into the destination buffer.\r
+  Decode the source data and put the resulting data into the destination buffer.\r
   \r
-  @param Sd            - The global scratch data\r
+  @param  Sd The global scratch data\r
 **/\r
 VOID\r
 Decode (\r
@@ -529,9 +565,12 @@ Decode (
   DataIdx     = 0;\r
 \r
   for (;;) {\r
+    //\r
+    // Get one code from mBitBuf\r
+    // \r
     CharC = DecodeC (Sd);\r
     if (Sd->mBadTableFlag != 0) {\r
-      goto Done ;\r
+      goto Done;\r
     }\r
 \r
     if (CharC < 256) {\r
@@ -539,8 +578,11 @@ Decode (
       // Process an Original character\r
       //\r
       if (Sd->mOutBuf >= Sd->mOrigSize) {\r
-        goto Done ;\r
+        goto Done;\r
       } else {\r
+        //\r
+        // Write orignal character into mDstBase\r
+        //\r
         Sd->mDstBase[Sd->mOutBuf++] = (UINT8) CharC;\r
       }\r
 \r
@@ -549,11 +591,20 @@ Decode (
       // Process a Pointer\r
       //\r
       CharC       = (UINT16) (CharC - (BIT8 - THRESHOLD));\r
-\r
\r
+      //\r
+      // Get string length\r
+      //\r
       BytesRemain = CharC;\r
 \r
+      //\r
+      // Locate string position\r
+      //\r
       DataIdx     = Sd->mOutBuf - DecodeP (Sd) - 1;\r
 \r
+      //\r
+      // Write BytesRemain of bytes into mDstBase\r
+      //\r
       BytesRemain--;\r
       while ((INT16) (BytesRemain) >= 0) {\r
         Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];\r
@@ -571,15 +622,43 @@ Done:
 }\r
 \r
 /**\r
-  The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().\r
-  \r
-  @param Source           The source buffer containing the compressed data.\r
-  @param SourceSize       The size of source buffer\r
-  @param DestinationSize  The size of destination buffer.\r
-  @param ScratchSize      The size of scratch buffer.\r
-\r
-  @retval RETURN_SUCCESS           - The size of destination buffer and the size of scratch buffer are successull retrieved.\r
-  @retval RETURN_INVALID_PARAMETER - The source data is corrupted\r
+  Given a compressed source buffer, this function retrieves the size of \r
+  the uncompressed buffer and the size of the scratch buffer required \r
+  to decompress the compressed source buffer.\r
+\r
+  Retrieves the size of the uncompressed buffer and the temporary scratch buffer \r
+  required to decompress the buffer specified by Source and SourceSize.\r
+  If the size of the uncompressed buffer or the size of the scratch buffer cannot\r
+  be determined from the compressed data specified by Source and SourceData, \r
+  then RETURN_INVALID_PARAMETER is returned.  Otherwise, the size of the uncompressed\r
+  buffer is returned in DestinationSize, the size of the scratch buffer is returned\r
+  in ScratchSize, and RETURN_SUCCESS is returned.\r
+  This function does not have scratch buffer available to perform a thorough \r
+  checking of the validity of the source data.  It just retrieves the "Original Size"\r
+  field from the beginning bytes of the source data and output it as DestinationSize.\r
+  And ScratchSize is specific to the decompression implementation.\r
+\r
+  If Source is NULL, then ASSERT().\r
+  If DestinationSize is NULL, then ASSERT().\r
+  If ScratchSize is NULL, then ASSERT().\r
+\r
+  @param  Source          The source buffer containing the compressed data.\r
+  @param  SourceSize      The size, in bytes, of the source buffer.\r
+  @param  DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r
+                          that will be generated when the compressed buffer specified\r
+                          by Source and SourceSize is decompressed..\r
+  @param  ScratchSize     A pointer to the size, in bytes, of the scratch buffer that\r
+                          is required to decompress the compressed buffer specified \r
+                          by Source and SourceSize.\r
+\r
+  @retval  RETURN_SUCCESS The size of the uncompressed data was returned \r
+                          in DestinationSize and the size of the scratch \r
+                          buffer was returned in ScratchSize.\r
+  @retval  RETURN_INVALID_PARAMETER \r
+                          The size of the uncompressed data or the size of \r
+                          the scratch buffer cannot be determined from \r
+                          the compressed data specified by Source \r
+                          and SourceSize.\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
@@ -612,15 +691,34 @@ UefiDecompressGetInfo (
 }\r
 \r
 /**\r
-  The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().\r
-\r
-  @param Source           The source buffer containing the compressed data.\r
-  @param Destination      The destination buffer to store the decompressed data\r
-  @param Scratch          The buffer used internally by the decompress routine. This  buffer is needed to store intermediate data.\r
-  @param Version          1 for UEFI Decompress algoruthm, 2 for Tiano Decompess algorithm\r
-\r
-  @retval RETURN_SUCCESS            Decompression is successfull\r
-  @retval RETURN_INVALID_PARAMETER  The source data is corrupted\r
+  Decompresses a compressed source buffer by EFI or Tiano algorithm.\r
+\r
+  Extracts decompressed data to its original form.\r
+  This function is designed so that the decompression algorithm can be implemented\r
+  without using any memory services.  As a result, this function is not allowed to\r
+  call any memory allocation services in its implementation.  It is the caller's \r
+  responsibility to allocate and free the Destination and Scratch buffers.\r
+  If the compressed source data specified by Source is successfully decompressed \r
+  into Destination, then RETURN_SUCCESS is returned.  If the compressed source data \r
+  specified by Source is not in a valid compressed data format,\r
+  then RETURN_INVALID_PARAMETER is returned.\r
+\r
+  If Source is NULL, then ASSERT().\r
+  If Destination is NULL, then ASSERT().\r
+  If the required scratch buffer size > 0 and Scratch is NULL, then ASSERT().\r
+\r
+  @param  Source      The source buffer containing the compressed data.\r
+  @param  Destination The destination buffer to store the decompressed data\r
+  @param  Scratch     A temporary scratch buffer that is used to perform the decompression.\r
+                      This is an optional parameter that may be NULL if the \r
+                      required scratch buffer size is 0.\r
+  @param  Version     1 for UEFI Decompress algoruthm, 2 for Tiano Decompess algorithm.\r
+\r
+  @retval  RETURN_SUCCESS Decompression completed successfully, and \r
+                          the uncompressed buffer is returned in Destination.\r
+  @retval  RETURN_INVALID_PARAMETER \r
+                          The source buffer specified by Source is corrupted \r
+                          (not in a valid compressed format).\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
@@ -677,6 +775,9 @@ UefiTianoDecompress (
   }\r
   Sd->mSrcBase  = (UINT8 *)Src;\r
   Sd->mDstBase  = Dst;\r
+  //\r
+  // CompSize and OrigSize are caculated in bytes\r
+  //\r
   Sd->mCompSize = CompSize;\r
   Sd->mOrigSize = OrigSize;\r
 \r
@@ -701,14 +802,33 @@ UefiTianoDecompress (
 }\r
 \r
 /**\r
-  The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().\r
-  \r
-  @param Source          - The source buffer containing the compressed data.\r
-  @param Destination     - The destination buffer to store the decompressed data\r
-  @param Scratch         - The buffer used internally by the decompress routine. This  buffer is needed to store intermediate data.\r
-\r
-  @retval RETURN_SUCCESS           - Decompression is successfull\r
-  @retval RETURN_INVALID_PARAMETER - The source data is corrupted  \r
+  Decompresses a UEFI compressed source buffer.\r
+\r
+  Extracts decompressed data to its original form.\r
+  This function is designed so that the decompression algorithm can be implemented\r
+  without using any memory services.  As a result, this function is not allowed to\r
+  call any memory allocation services in its implementation.  It is the caller's \r
+  responsibility to allocate and free the Destination and Scratch buffers.\r
+  If the compressed source data specified by Source is successfully decompressed \r
+  into Destination, then RETURN_SUCCESS is returned.  If the compressed source data \r
+  specified by Source is not in a valid compressed data format,\r
+  then RETURN_INVALID_PARAMETER is returned.\r
+\r
+  If Source is NULL, then ASSERT().\r
+  If Destination is NULL, then ASSERT().\r
+  If the required scratch buffer size > 0 and Scratch is NULL, then ASSERT().\r
+\r
+  @param  Source      The source buffer containing the compressed data.\r
+  @param  Destination The destination buffer to store the decompressed data\r
+  @param  Scratch     A temporary scratch buffer that is used to perform the decompression.\r
+                      This is an optional parameter that may be NULL if the \r
+                      required scratch buffer size is 0.\r
+\r
+  @retval  RETURN_SUCCESS Decompression completed successfully, and \r
+                          the uncompressed buffer is returned in Destination.\r
+  @retval  RETURN_INVALID_PARAMETER \r
+                          The source buffer specified by Source is corrupted \r
+                          (not in a valid compressed format).\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
@@ -722,16 +842,37 @@ UefiDecompress (
 }\r
 \r
 /**\r
-  The internal implementation of Tiano decompress GetInfo.\r
+  Examines a GUIDed section and returns the size of the decoded buffer and the\r
+  size of an optional scratch buffer required to actually decode the data in a GUIDed section.\r
+\r
+  Examines a GUIDed section specified by InputSection.  \r
+  If GUID for InputSection does not match the GUID that this handler supports,\r
+  then RETURN_UNSUPPORTED is returned.  \r
+  If the required information can not be retrieved from InputSection,\r
+  then RETURN_INVALID_PARAMETER is returned.\r
+  If the GUID of InputSection does match the GUID that this handler supports,\r
+  then the size required to hold the decoded buffer is returned in OututBufferSize,\r
+  the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field\r
+  from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.\r
+  \r
+  If InputSection is NULL, then ASSERT().\r
+  If OutputBufferSize is NULL, then ASSERT().\r
+  If ScratchBufferSize is NULL, then ASSERT().\r
+  If SectionAttribute is NULL, then ASSERT().\r
+\r
 \r
-  @param InputSection          Buffer containing the input GUIDed section to be processed. \r
-  @param OutputBufferSize      The size of OutputBuffer.\r
-  @param ScratchBufferSize     The size of ScratchBuffer.\r
-  @param SectionAttribute      The attribute of the input guided section.\r
+  @param[in]  InputSection       A pointer to a GUIDed section of an FFS formatted file.\r
+  @param[out] OutputBufferSize   A pointer to the size, in bytes, of an output buffer required\r
+                                 if the buffer specified by InputSection were decoded.\r
+  @param[out] ScratchBufferSize  A pointer to the size, in bytes, required as scratch space\r
+                                 if the buffer specified by InputSection were decoded.\r
+  @param[out] SectionAttribute   A pointer to the attributes of the GUIDed section. See the Attributes\r
+                                 field of EFI_GUID_DEFINED_SECTION in the PI Specification.\r
+\r
+  @retval  RETURN_SUCCESS            The information about InputSection was returned.\r
+  @retval  RETURN_UNSUPPORTED        The section specified by InputSection does not match the GUID this handler supports.\r
+  @retval  RETURN_INVALID_PARAMETER  The information can not be retrieved from the section specified by InputSection.\r
 \r
-  @retval RETURN_SUCCESS           - The size of destination buffer and the size of scratch buffer are successull retrieved.\r
-  @retval RETURN_INVALID_PARAMETER - The source data is corrupted\r
-                             The GUID in InputSection does not match this instance guid.\r
 **/\r
 RETURN_STATUS\r
 EFIAPI\r
@@ -771,19 +912,36 @@ TianoDecompressGetInfo (
 }\r
 \r
 /**\r
-  The implementation of Tiano Decompress().\r
-\r
-  @param InputSection           Buffer containing the input GUIDed section to be processed. \r
-  @param OutputBuffer           OutputBuffer to point to the start of the section's contents.\r
-                                if guided data is not prcessed. Otherwise,\r
-                                OutputBuffer to contain the output data, which is 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
-\r
-  @retval RETURN_SUCCESS            Decompression is successfull\r
-  @retval RETURN_INVALID_PARAMETER  The source data is corrupted, or\r
-                                    The GUID in InputSection does not match this instance guid.\r
+  Decompress a Tiano compressed GUIDed section into a caller allocated output buffer.\r
+  \r
+  Decodes the GUIDed section specified by InputSection.  \r
+  If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned.  \r
+  If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.\r
+  If the GUID of InputSection does match the GUID that this handler supports, then InputSection\r
+  is decoded into the buffer specified by OutputBuffer and the authentication status of this\r
+  decode operation is returned in AuthenticationStatus.  If the decoded buffer is identical to the\r
+  data in InputSection, then OutputBuffer is set to point at the data in InputSection.  Otherwise,\r
+  the decoded data will be placed in caller allocated buffer specified by OutputBuffer.\r
+  \r
+  If InputSection is NULL, then ASSERT().\r
+  If OutputBuffer is NULL, then ASSERT().\r
+  If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().\r
+  If AuthenticationStatus is NULL, then ASSERT().\r
+\r
+\r
+  @param[in]  InputSection  A pointer to a GUIDed section of an FFS formatted file.\r
+  @param[out] OutputBuffer  A pointer to a buffer that contains the result of a decode operation. \r
+  @param[in] ScratchBuffer  A caller allocated buffer that may be required by this function\r
+                            as a scratch buffer to perform the decode operation. \r
+  @param[out] AuthenticationStatus \r
+                            A pointer to the authentication status of the decoded output buffer.\r
+                            See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI\r
+                            section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must\r
+                            never be set by this handler.\r
+\r
+  @retval  RETURN_SUCCESS            The buffer specified by InputSection was decoded.\r
+  @retval  RETURN_UNSUPPORTED        The section specified by InputSection does not match the GUID this handler supports.\r
+  @retval  RETURN_INVALID_PARAMETER  The section specified by InputSection can not be decoded.\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -796,10 +954,7 @@ TianoDecompress (
   )\r
 {\r
   ASSERT (OutputBuffer != NULL);\r
-\r
-  if (InputSection == NULL) {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
+  ASSERT (InputSection != NULL);\r
 \r
   if (!CompareGuid (\r
         &gTianoCustomDecompressGuid, \r
@@ -824,7 +979,7 @@ TianoDecompress (
 }\r
 \r
 /**\r
-  Register TianoDecompress handler.\r
+  Registers TianoDecompress and TianoDecompressGetInfo handlers with TianoCustomerDecompressGuid\r
 \r
   @retval  RETURN_SUCCESS            Register successfully.\r
   @retval  RETURN_OUT_OF_RESOURCES   No enough memory to store this handler.\r
index f406c9b6116fa1b8052d14d44dcaae801f5bd7fa..c9b36b3bcdde8016ea56ce28c3d24280f5fd635b 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
-#  Uefi Tiano Decomression Library\r
+#  This library instance produces UefiDecompressLib and Tiano Custom decompression algorithm.\r
+#  Tiano custom decompression algorithm shares most of code with Uefi Decompress algorithm.\r
 #\r
-#  Uefi Decompression library instance\r
 #  Copyright (c) 2006 - 2009, Intel Corporation.\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
@@ -11,7 +11,6 @@
 #  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
-#\r
 #**/\r
 \r
 [Defines]\r
@@ -21,7 +20,6 @@
   MODULE_TYPE                    = BASE\r
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = UefiDecompressLib\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
   CONSTRUCTOR                    = TianoDecompressLibConstructor\r
 \r
 #\r
@@ -45,5 +43,4 @@
   ExtractGuidedSectionLib\r
 \r
 [Guids]\r
-  gTianoCustomDecompressGuid \r
-\r
+  gTianoCustomDecompressGuid      ## PRODUCED  ## GUID specifies tiano custom decompress algorithm.\r
index 7f7fc50c7d81b036c97f624cb2d7691f11d30b0a..7b42fb2b784024b3c495979a596ea113ea249d9e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
-  Internal include file for Base UEFI Decompress Libary.\r
+  Internal data structure and interfaces defintions for UEFI and Tiano Decompress Libary.\r
 \r
-  Copyright (c) 2006, Intel Corporation\r
+  Copyright (c) 2006 - 2009, 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
@@ -10,8 +10,6 @@
   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:  BaseUefiCustomDecompressLibInternals.h\r
-\r
 **/\r
 \r
 #ifndef __BASE_UEFI_TIANO_CUSTOM_DECOMPRESS_LIB_INTERNALS_H__\r
@@ -72,16 +70,16 @@ typedef struct {
   UINT16  mCTable[4096];\r
   UINT16  mPTTable[256];\r
 \r
-  //\r
-  // The length of the field 'Position Set Code Length Array Size' in Block Header.\r
-  // For UEFI 2.0 de/compression algorithm, mPBit = 4\r
-  // For Tiano de/compression algorithm, mPBit = 5\r
-  //\r
+  ///\r
+  /// The length of the field 'Position Set Code Length Array Size' in Block Header.\r
+  /// For UEFI 2.0 de/compression algorithm, mPBit = 4\r
+  /// For Tiano de/compression algorithm, mPBit = 5\r
+  ///\r
   UINT8   mPBit;\r
 } SCRATCH_DATA;\r
 \r
 /**\r
-  Read NumOfBit of bits from source into mBitBuf\r
+  Read NumOfBit of bits from source into mBitBuf.\r
 \r
   Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.\r
 \r
@@ -96,10 +94,10 @@ FillBuf (
   );\r
 \r
 /**\r
-  Get NumOfBits of bits out from mBitBuf\r
+  Get NumOfBits of bits out from mBitBuf.\r
 \r
-  Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent \r
-  NumOfBits of bits from source. Returns NumOfBits of bits that are \r
+  Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent\r
+  NumOfBits of bits from source. Returns NumOfBits of bits that are\r
   popped out.\r
 \r
   @param  Sd        The global scratch data.\r
@@ -124,7 +122,7 @@ GetBits (
   @param  NumOfChar Number of symbols in the symbol set\r
   @param  BitLen    Code length array\r
   @param  TableBits The width of the mapping table\r
-  @param  Table     The table\r
+  @param  Table     The table to be created.\r
 \r
   @retval  0 OK.\r
   @retval  BAD_TABLE The table is corrupted.\r
@@ -211,8 +209,6 @@ DecodeC (
 /**\r
   Decode the source data and put the resulting data into the destination buffer.\r
 \r
-  Decode the source data and put the resulting data into the destination buffer.\r
-  \r
   @param  Sd The global scratch data\r
 \r
 **/\r
@@ -221,13 +217,4 @@ Decode (
   SCRATCH_DATA  *Sd\r
   );\r
 \r
-RETURN_STATUS\r
-EFIAPI\r
-UefiTianoDecompress (\r
-  IN CONST VOID  *Source,\r
-  IN OUT VOID    *Destination,\r
-  IN OUT VOID    *Scratch,\r
-  IN UINT32      Version\r
-  );\r
-\r
 #endif\r
index bfc668f5b7acb5112dd7b57ba3ea4e49bca4864b..bdb69b4b6fa13afdb37be245c238893ce7be6cae 100644 (file)
@@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   The caller must free the resulting buffer.\r
 \r
   @param  Str      Tracks the allocated pool, size in use, and amount of pool allocated.\r
-  @param  fmt      The format string\r
+  @param  Fmt      The format string\r
   @param  ...      The data will be printed.\r
 \r
   @return Allocated buffer with the formatted string printed in it.\r
@@ -32,7 +32,7 @@ CHAR16 *
 EFIAPI\r
 CatPrint (\r
   IN OUT POOL_PRINT   *Str,\r
-  IN CHAR16           *fmt,\r
+  IN CHAR16           *Fmt,\r
   ...\r
   )\r
 {\r
@@ -42,36 +42,36 @@ CatPrint (
 \r
   AppendStr = AllocateZeroPool (0x1000);\r
   if (AppendStr == NULL) {\r
-    return Str->str;\r
+    return Str->Str;\r
   }\r
 \r
-  VA_START (Args, fmt);\r
-  UnicodeVSPrint (AppendStr, 0x1000, fmt, Args);\r
+  VA_START (Args, Fmt);\r
+  UnicodeVSPrint (AppendStr, 0x1000, Fmt, Args);\r
   VA_END (Args);\r
-  if (NULL == Str->str) {\r
+  if (NULL == Str->Str) {\r
     StringSize   = StrSize (AppendStr);\r
-    Str->str  = AllocateZeroPool (StringSize);\r
-    ASSERT (Str->str != NULL);\r
+    Str->Str  = AllocateZeroPool (StringSize);\r
+    ASSERT (Str->Str != NULL);\r
   } else {\r
     StringSize = StrSize (AppendStr);\r
-    StringSize += (StrSize (Str->str) - sizeof (UINT16));\r
+    StringSize += (StrSize (Str->Str) - sizeof (UINT16));\r
 \r
-    Str->str = ReallocatePool (\r
-                StrSize (Str->str),\r
+    Str->Str = ReallocatePool (\r
+                StrSize (Str->Str),\r
                 StringSize,\r
-                Str->str\r
+                Str->Str\r
                 );\r
-    ASSERT (Str->str != NULL);\r
+    ASSERT (Str->Str != NULL);\r
   }\r
 \r
-  Str->maxlen = MAX_CHAR * sizeof (UINT16);\r
-  if (StringSize < Str->maxlen) {\r
-    StrCat (Str->str, AppendStr);\r
-    Str->len = StringSize - sizeof (UINT16);\r
+  Str->Maxlen = MAX_CHAR * sizeof (UINT16);\r
+  if (StringSize < Str->Maxlen) {\r
+    StrCat (Str->Str, AppendStr);\r
+    Str->Len = StringSize - sizeof (UINT16);\r
   }\r
 \r
   FreePool (AppendStr);\r
-  return Str->str;\r
+  return Str->Str;\r
 }\r
 \r
 /**\r
@@ -1521,7 +1521,7 @@ DevicePathToStr (
     //\r
     //  Put a path seperator in if needed\r
     //\r
-    if (Str.len && DumpNode != DevPathEndInstance) {\r
+    if (Str.Len && DumpNode != DevPathEndInstance) {\r
       CatPrint (&Str, L"/");\r
     }\r
     //\r
@@ -1536,9 +1536,9 @@ DevicePathToStr (
   }\r
 \r
 Done:\r
-  NewSize = (Str.len + 1) * sizeof (CHAR16);\r
-  Str.str = ReallocatePool (NewSize, NewSize, Str.str);\r
-  ASSERT (Str.str != NULL);\r
-  Str.str[Str.len] = 0;\r
-  return Str.str;\r
+  NewSize = (Str.Len + 1) * sizeof (CHAR16);\r
+  Str.Str = ReallocatePool (NewSize, NewSize, Str.Str);\r
+  ASSERT (Str.Str != NULL);\r
+  Str.Str[Str.Len] = 0;\r
+  return Str.Str;\r
 }\r
index 74491b466c881499cb4ef8f1212f5eb6576bf16e..5668130c9543d1f62d1edb07a092018f235334a0 100644 (file)
@@ -1,7 +1,7 @@
-/**@file\r
-  Recovery Library. This library class defines a set of methods related do recovery.\r
+/** @file\r
+  This Library uses Framework RecoveryModule PPI to system recovery.\r
 \r
-Copyright (c) 2006 - 2008 Intel Corporation\r
+Copyright (c) 2006 - 2009 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
index fcb4ad449a8ce92037502dfcf896484a7fcff1da..b6c7f01e9ead78391e63f6c3d146ec44ebef5322 100644 (file)
@@ -1,5 +1,5 @@
 #/** @file\r
-#  Recovery Library for PEIM\r
+#  PEIM Recovery Library supports system recovery boot.\r
 #\r
 #  Copyright (c) 2006 - 2009, Intel Corporation.\r
 #\r
@@ -42,6 +42,6 @@
   DebugLib\r
 \r
 [Ppis]\r
-  gEfiPeiRecoveryModulePpiGuid            # PPI ALWAYS_CONSUMED\r
+  gEfiPeiRecoveryModulePpiGuid            ## CONSUMES\r
   \r
   
\ No newline at end of file