]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/BrotliCustomDecompressLib/BrotliDecompressLibInternal.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Library / BrotliCustomDecompressLib / BrotliDecompressLibInternal.h
1 /** @file
2 BROTLI UEFI header file
3
4 Allows BROTLI code to build under UEFI (edk2) build environment
5
6 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef __BROTLI_DECOMPRESS_INTERNAL_H__
12 #define __BROTLI_DECOMPRESS_INTERNAL_H__
13
14 #include <PiPei.h>
15 #include <Library/BaseLib.h>
16 #include <Library/BaseMemoryLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/ExtractGuidedSectionLib.h>
19 #include <brotli/types.h>
20 #include <brotli/decode.h>
21
22 typedef struct
23 {
24 VOID *Buff;
25 UINTN BuffSize;
26 } BROTLI_BUFF;
27
28 #define FILE_BUFFER_SIZE 65536
29 #define BROTLI_INFO_SIZE 8
30 #define BROTLI_DECODE_MAX 8
31 #define BROTLI_SCRATCH_MAX 16
32
33 #define memcpy CopyMem
34 #define memmove CopyMem
35 #define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
36
37 VOID *
38 BrDummyMalloc (
39 IN size_t Size
40 );
41
42 VOID
43 BrDummyFree (
44 IN VOID * Ptr
45 );
46
47 EFI_STATUS
48 EFIAPI
49 BrotliUefiDecompressGetInfo (
50 IN CONST VOID *Source,
51 IN UINT32 SourceSize,
52 OUT UINT32 *DestinationSize,
53 OUT UINT32 *ScratchSize
54 );
55
56 EFI_STATUS
57 EFIAPI
58 BrotliUefiDecompress (
59 IN CONST VOID *Source,
60 IN UINTN SourceSize,
61 IN OUT VOID *Destination,
62 IN OUT VOID *Scratch
63 );
64
65 #endif