Home | History | Annotate | Download | only in CustomizedDecompress
      1 /*++
      2 
      3 Copyright (c) 2004, 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   CustomizedDecompress.c
     15 
     16 Abstract:
     17 
     18   Implementation file for Customized decompression routine
     19 
     20 --*/
     21 #include "TianoCommon.h"
     22 #include "CustomizedDecompress.h"
     23 
     24 EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  mCustomizedDecompress = {
     25   CustomizedGetInfo,
     26   CustomizedDecompress
     27 };
     28 
     29 EFI_STATUS
     30 InstallCustomizedDecompress (
     31   EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  **This
     32   )
     33 /*++
     34 
     35 Routine Description:
     36 
     37   Install customeized decompress protocol.
     38 
     39 Arguments:
     40 
     41   This                  - The protocol that needs to be installed.
     42 
     43 Returns:
     44 
     45   EFI_SUCCESS           - Always success
     46 
     47 --*/
     48 {
     49   *This = &mCustomizedDecompress;
     50   return EFI_SUCCESS;
     51 }
     52 
     53 EFI_STATUS
     54 EFIAPI
     55 CustomizedGetInfo (
     56   IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL     *This,
     57   IN      VOID                              *Source,
     58   IN      UINT32                            SrcSize,
     59   OUT     UINT32                            *DstSize,
     60   OUT     UINT32                            *ScratchSize
     61   )
     62 /*++
     63 
     64 Routine Description:
     65 
     66   The implementation of Customized GetInfo().
     67 
     68 Arguments:
     69   This        - The EFI customized decompress protocol
     70   Source      - The source buffer containing the compressed data.
     71   SrcSize     - The size of source buffer
     72   DstSize     - The size of destination buffer.
     73   ScratchSize - The size of scratch buffer.
     74 
     75 Returns:
     76 
     77   EFI_SUCCESS           - The size of destination buffer and the size of scratch buffer are successull retrieved.
     78   EFI_INVALID_PARAMETER - The source data is corrupted
     79   EFI_UNSUPPORTED       - Not supported
     80 
     81 --*/
     82 {
     83   return EFI_UNSUPPORTED;
     84 }
     85 
     86 EFI_STATUS
     87 EFIAPI
     88 CustomizedDecompress (
     89   IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL     *This,
     90   IN      VOID                              *Source,
     91   IN      UINT32                            SrcSize,
     92   IN OUT  VOID                              *Destination,
     93   IN      UINT32                            DstSize,
     94   IN OUT  VOID                              *Scratch,
     95   IN      UINT32                            ScratchSize
     96   )
     97 /*++
     98 
     99 Routine Description:
    100 
    101   The implementation of Customized Decompress().
    102 
    103 Arguments:
    104 
    105   This        - The protocol instance pointer
    106   Source      - The source buffer containing the compressed data.
    107   SrcSize     - The size of source buffer
    108   Destination - The destination buffer to store the decompressed data
    109   DstSize     - The size of destination buffer.
    110   Scratch     - The buffer used internally by the decompress routine. This  buffer is needed to store intermediate data.
    111   ScratchSize - The size of scratch buffer.
    112 
    113 Returns:
    114 
    115   EFI_SUCCESS           - Decompression is successfull
    116   EFI_INVALID_PARAMETER - The source data is corrupted
    117   EFI_UNSUPPORTED       - Not supported
    118 
    119 --*/
    120 {
    121   return EFI_UNSUPPORTED;
    122 }
    123