]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLibInternals.h
MdePkg: Merge TianoCustomDecompress algorithm into
[mirror_edk2.git] / MdePkg / Library / BaseUefiDecompressLib / BaseUefiDecompressLibInternals.h
index 9821c19c7bcab500090534548781da9c7d4c0977..0bfb503337778a0adca96f39d1fa94becb815d82 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Internal data structure defintions for Base UEFI Decompress Library.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -9,6 +9,11 @@
 #ifndef __BASE_UEFI_DECOMPRESS_LIB_INTERNALS_H__\r
 #define __BASE_UEFI_DECOMPRESS_LIB_INTERNALS_H__\r
 \r
+#include <Base.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/UefiDecompressLib.h>\r
 //\r
 // Decompression algorithm begins here\r
 //\r
@@ -58,6 +63,7 @@ typedef struct {
   ///\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
@@ -202,4 +208,40 @@ Decode (
   SCRATCH_DATA  *Sd\r
   );\r
 \r
+/**\r
+  Decompresses a 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
+UefiTianoDecompress (\r
+  IN CONST VOID  *Source,\r
+  IN OUT VOID    *Destination,\r
+  IN OUT VOID    *Scratch,\r
+  IN UINT32      Version\r
+  );\r
 #endif\r