• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #define EFI_STATUS int
7 #define VOID void
8 #define INT16 int16_t
9 #define UINT16 uint16_t
10 #define INT8 int8_t
11 #define UINT8 uint8_t
12 #define INT32 int32_t
13 #define UINT32 uint32_t
14 #define STATIC static
15 #define IN /**/
16 #define OUT /**/
17 #define EFIAPI /**/
18 
19 #define EFIERR(a) (a)
20 #define EFI_SUCCESS               0
21 #define EFI_LOAD_ERROR            EFIERR (1)
22 #define EFI_INVALID_PARAMETER     EFIERR (2)
23 #define EFI_UNSUPPORTED           EFIERR (3)
24 #define EFI_BAD_BUFFER_SIZE       EFIERR (4)
25 #define EFI_BUFFER_TOO_SMALL      EFIERR (5)
26 #define EFI_NOT_READY             EFIERR (6)
27 #define EFI_DEVICE_ERROR          EFIERR (7)
28 #define EFI_WRITE_PROTECTED       EFIERR (8)
29 #define EFI_OUT_OF_RESOURCES      EFIERR (9)
30 #define EFI_VOLUME_CORRUPTED      EFIERR (10)
31 #define EFI_VOLUME_FULL           EFIERR (11)
32 #define EFI_NO_MEDIA              EFIERR (12)
33 #define EFI_MEDIA_CHANGED         EFIERR (13)
34 #define EFI_NOT_FOUND             EFIERR (14)
35 #define EFI_ACCESS_DENIED         EFIERR (15)
36 #define EFI_NO_RESPONSE           EFIERR (16)
37 #define EFI_NO_MAPPING            EFIERR (17)
38 #define EFI_TIMEOUT               EFIERR (18)
39 #define EFI_NOT_STARTED           EFIERR (19)
40 #define EFI_ALREADY_STARTED       EFIERR (20)
41 #define EFI_ABORTED               EFIERR (21)
42 #define EFI_ICMP_ERROR            EFIERR (22)
43 #define EFI_TFTP_ERROR            EFIERR (23)
44 #define EFI_PROTOCOL_ERROR        EFIERR (24)
45 #define EFI_INCOMPATIBLE_VERSION  EFIERR (25)
46 #define EFI_SECURITY_VIOLATION    EFIERR (26)
47 #define EFI_CRC_ERROR             EFIERR (27)
48 #define EFI_END_OF_MEDIA          EFIERR (28)
49 #define EFI_END_OF_FILE           EFIERR (31)
50 #define EFI_INVALID_LANGUAGE      EFIERR (32)
51 
52 #define EFIWARN(a) ((a)+EFI_INVALID_LANGUAGE)
53 #define EFI_WARN_UNKNOWN_GLYPH    EFIWARN (1)
54 #define EFI_WARN_DELETE_FAILURE   EFIWARN (2)
55 #define EFI_WARN_WRITE_FAILURE    EFIWARN (3)
56 #define EFI_WARN_BUFFER_TOO_SMALL EFIWARN (4)
57 
58 #define EFI_ERROR(Status) (Status != 0 && Status < EFIWARN(1))
59 
60 EFI_STATUS
61 EfiCompress (
62   IN      UINT8   *SrcBuffer,
63   IN      UINT32  SrcSize,
64   IN      UINT8   *DstBuffer,
65   IN OUT  UINT32  *DstSize
66   );
67 
68 EFI_STATUS
69 EFIAPI
70 EfiGetInfo (
71   IN      VOID                    *Source,
72   IN      UINT32                  SrcSize,
73   OUT     UINT32                  *DstSize,
74   OUT     UINT32                  *ScratchSize
75   );
76 
77 EFI_STATUS
78 EFIAPI
79 EfiDecompress (
80   IN      VOID                    *Source,
81   IN      UINT32                  SrcSize,
82   IN OUT  VOID                    *Destination,
83   IN      UINT32                  DstSize,
84   IN OUT  VOID                    *Scratch,
85   IN      UINT32                  ScratchSize
86   );
87