Home | History | Annotate | Download | only in Common
      1 /*++
      2 
      3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 Module Name:
     13 
     14   Decompress.h
     15 
     16 Abstract:
     17 
     18   Header file for decompression routine.
     19   Providing both EFI and Tiano decompress algorithms.
     20 
     21 --*/
     22 
     23 #ifndef _DECOMPRESS_H_
     24 #define _DECOMPRESS_H_
     25 
     26 EFI_STATUS
     27 EFIAPI
     28 EfiGetInfo (
     29   IN      VOID                    *Source,
     30   IN      UINT32                  SrcSize,
     31   OUT     UINT32                  *DstSize,
     32   OUT     UINT32                  *ScratchSize
     33   )
     34 /*++
     35 
     36 Routine Description:
     37 
     38   The implementation is same as that  of EFI_DECOMPRESS_PROTOCOL.GetInfo().
     39 
     40 Arguments:
     41 
     42   This        - The protocol instance pointer
     43   Source      - The source buffer containing the compressed data.
     44   SrcSize     - The size of source buffer
     45   DstSize     - The size of destination buffer.
     46   ScratchSize - The size of scratch buffer.
     47 
     48 Returns:
     49 
     50   EFI_SUCCESS           - The size of destination buffer and the size of scratch buffer are successfully retrieved.
     51   EFI_INVALID_PARAMETER - The source data is corrupted
     52 
     53 --*/
     54 ;
     55 
     56 EFI_STATUS
     57 EFIAPI
     58 EfiDecompress (
     59   IN      VOID                    *Source,
     60   IN      UINT32                  SrcSize,
     61   IN OUT  VOID                    *Destination,
     62   IN      UINT32                  DstSize,
     63   IN OUT  VOID                    *Scratch,
     64   IN      UINT32                  ScratchSize
     65   )
     66 /*++
     67 
     68 Routine Description:
     69 
     70   The implementation is same as that of EFI_DECOMPRESS_PROTOCOL.Decompress().
     71 
     72 Arguments:
     73 
     74   This        - The protocol instance pointer
     75   Source      - The source buffer containing the compressed data.
     76   SrcSize     - The size of source buffer
     77   Destination - The destination buffer to store the decompressed data
     78   DstSize     - The size of destination buffer.
     79   Scratch     - The buffer used internally by the decompress routine. This  buffer is needed to store intermediate data.
     80   ScratchSize - The size of scratch buffer.
     81 
     82 Returns:
     83 
     84   EFI_SUCCESS           - Decompression is successfull
     85   EFI_INVALID_PARAMETER - The source data is corrupted
     86 
     87 --*/
     88 ;
     89 
     90 EFI_STATUS
     91 EFIAPI
     92 TianoGetInfo (
     93   IN      VOID                          *Source,
     94   IN      UINT32                        SrcSize,
     95   OUT     UINT32                        *DstSize,
     96   OUT     UINT32                        *ScratchSize
     97   )
     98 /*++
     99 
    100 Routine Description:
    101 
    102   The implementation is same as that of EFI_TIANO_DECOMPRESS_PROTOCOL.GetInfo().
    103 
    104 Arguments:
    105 
    106   This        - The protocol instance pointer
    107   Source      - The source buffer containing the compressed data.
    108   SrcSize     - The size of source buffer
    109   DstSize     - The size of destination buffer.
    110   ScratchSize - The size of scratch buffer.
    111 
    112 Returns:
    113 
    114   EFI_SUCCESS           - The size of destination buffer and the size of scratch buffer are successfully retrieved.
    115   EFI_INVALID_PARAMETER - The source data is corrupted
    116 
    117 --*/
    118 ;
    119 
    120 EFI_STATUS
    121 EFIAPI
    122 TianoDecompress (
    123   IN      VOID                          *Source,
    124   IN      UINT32                        SrcSize,
    125   IN OUT  VOID                          *Destination,
    126   IN      UINT32                        DstSize,
    127   IN OUT  VOID                          *Scratch,
    128   IN      UINT32                        ScratchSize
    129   )
    130 /*++
    131 
    132 Routine Description:
    133 
    134   The implementation is same as that  of EFI_TIANO_DECOMPRESS_PROTOCOL.Decompress().
    135 
    136 Arguments:
    137 
    138   This        - The protocol instance pointer
    139   Source      - The source buffer containing the compressed data.
    140   SrcSize     - The size of source buffer
    141   Destination - The destination buffer to store the decompressed data
    142   DstSize     - The size of destination buffer.
    143   Scratch     - The buffer used internally by the decompress routine. This  buffer is needed to store intermediate data.
    144   ScratchSize - The size of scratch buffer.
    145 
    146 Returns:
    147 
    148   EFI_SUCCESS           - Decompression is successfull
    149   EFI_INVALID_PARAMETER - The source data is corrupted
    150 
    151 --*/
    152 ;
    153 
    154 typedef
    155 EFI_STATUS
    156 (*GETINFO_FUNCTION) (
    157   IN      VOID    *Source,
    158   IN      UINT32  SrcSize,
    159   OUT     UINT32  *DstSize,
    160   OUT     UINT32  *ScratchSize
    161   );
    162 
    163 typedef
    164 EFI_STATUS
    165 (*DECOMPRESS_FUNCTION) (
    166   IN      VOID    *Source,
    167   IN      UINT32  SrcSize,
    168   IN OUT  VOID    *Destination,
    169   IN      UINT32  DstSize,
    170   IN OUT  VOID    *Scratch,
    171   IN      UINT32  ScratchSize
    172   );
    173 
    174 #endif
    175