Decompress.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /** @file
  2. Header file for compression routine
  3. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _EFI_DECOMPRESS_H
  7. #define _EFI_DECOMPRESS_H
  8. #include <Common/UefiBaseTypes.h>
  9. EFI_STATUS
  10. EfiGetInfo (
  11. IN VOID *Source,
  12. IN UINT32 SrcSize,
  13. OUT UINT32 *DstSize,
  14. OUT UINT32 *ScratchSize
  15. );
  16. /**
  17. Routine Description:
  18. The implementation Efi Decompress GetInfo().
  19. Arguments:
  20. Source - The source buffer containing the compressed data.
  21. SrcSize - The size of source buffer
  22. DstSize - The size of destination buffer.
  23. ScratchSize - The size of scratch buffer.
  24. Returns:
  25. EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
  26. EFI_INVALID_PARAMETER - The source data is corrupted
  27. **/
  28. EFI_STATUS
  29. EfiDecompress (
  30. IN VOID *Source,
  31. IN UINT32 SrcSize,
  32. IN OUT VOID *Destination,
  33. IN UINT32 DstSize,
  34. IN OUT VOID *Scratch,
  35. IN UINT32 ScratchSize
  36. );
  37. /**
  38. Routine Description:
  39. The implementation of Efi Decompress().
  40. Arguments:
  41. Source - The source buffer containing the compressed data.
  42. SrcSize - The size of source buffer
  43. Destination - The destination buffer to store the decompressed data
  44. DstSize - The size of destination buffer.
  45. Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
  46. ScratchSize - The size of scratch buffer.
  47. Returns:
  48. EFI_SUCCESS - Decompression is successful
  49. EFI_INVALID_PARAMETER - The source data is corrupted
  50. **/
  51. EFI_STATUS
  52. TianoGetInfo (
  53. IN VOID *Source,
  54. IN UINT32 SrcSize,
  55. OUT UINT32 *DstSize,
  56. OUT UINT32 *ScratchSize
  57. );
  58. /**
  59. Routine Description:
  60. The implementation Tiano Decompress GetInfo().
  61. Arguments:
  62. Source - The source buffer containing the compressed data.
  63. SrcSize - The size of source buffer
  64. DstSize - The size of destination buffer.
  65. ScratchSize - The size of scratch buffer.
  66. Returns:
  67. EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
  68. EFI_INVALID_PARAMETER - The source data is corrupted
  69. **/
  70. EFI_STATUS
  71. TianoDecompress (
  72. IN VOID *Source,
  73. IN UINT32 SrcSize,
  74. IN OUT VOID *Destination,
  75. IN UINT32 DstSize,
  76. IN OUT VOID *Scratch,
  77. IN UINT32 ScratchSize
  78. );
  79. /**
  80. Routine Description:
  81. The implementation of Tiano Decompress().
  82. Arguments:
  83. Source - The source buffer containing the compressed data.
  84. SrcSize - The size of source buffer
  85. Destination - The destination buffer to store the decompressed data
  86. DstSize - The size of destination buffer.
  87. Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
  88. ScratchSize - The size of scratch buffer.
  89. Returns:
  90. EFI_SUCCESS - Decompression is successful
  91. EFI_INVALID_PARAMETER - The source data is corrupted
  92. **/
  93. typedef
  94. EFI_STATUS
  95. (*GETINFO_FUNCTION) (
  96. IN VOID *Source,
  97. IN UINT32 SrcSize,
  98. OUT UINT32 *DstSize,
  99. OUT UINT32 *ScratchSize
  100. );
  101. typedef
  102. EFI_STATUS
  103. (*DECOMPRESS_FUNCTION) (
  104. IN VOID *Source,
  105. IN UINT32 SrcSize,
  106. IN OUT VOID *Destination,
  107. IN UINT32 DstSize,
  108. IN OUT VOID *Scratch,
  109. IN UINT32 ScratchSize
  110. );
  111. EFI_STATUS
  112. Extract (
  113. IN VOID *Source,
  114. IN UINT32 SrcSize,
  115. OUT VOID **Destination,
  116. OUT UINT32 *DstSize,
  117. IN UINTN Algorithm
  118. );
  119. #endif