eficompress.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. #define EFI_STATUS int
  6. #define VOID void
  7. #define INT16 int16_t
  8. #define UINT16 uint16_t
  9. #define INT8 int8_t
  10. #define UINT8 uint8_t
  11. #define INT32 int32_t
  12. #define UINT32 uint32_t
  13. #define STATIC static
  14. #define IN /**/
  15. #define OUT /**/
  16. #define EFIAPI /**/
  17. #define EFIERR(a) (a)
  18. #define EFI_SUCCESS 0
  19. #define EFI_LOAD_ERROR EFIERR (1)
  20. #define EFI_INVALID_PARAMETER EFIERR (2)
  21. #define EFI_UNSUPPORTED EFIERR (3)
  22. #define EFI_BAD_BUFFER_SIZE EFIERR (4)
  23. #define EFI_BUFFER_TOO_SMALL EFIERR (5)
  24. #define EFI_NOT_READY EFIERR (6)
  25. #define EFI_DEVICE_ERROR EFIERR (7)
  26. #define EFI_WRITE_PROTECTED EFIERR (8)
  27. #define EFI_OUT_OF_RESOURCES EFIERR (9)
  28. #define EFI_VOLUME_CORRUPTED EFIERR (10)
  29. #define EFI_VOLUME_FULL EFIERR (11)
  30. #define EFI_NO_MEDIA EFIERR (12)
  31. #define EFI_MEDIA_CHANGED EFIERR (13)
  32. #define EFI_NOT_FOUND EFIERR (14)
  33. #define EFI_ACCESS_DENIED EFIERR (15)
  34. #define EFI_NO_RESPONSE EFIERR (16)
  35. #define EFI_NO_MAPPING EFIERR (17)
  36. #define EFI_TIMEOUT EFIERR (18)
  37. #define EFI_NOT_STARTED EFIERR (19)
  38. #define EFI_ALREADY_STARTED EFIERR (20)
  39. #define EFI_ABORTED EFIERR (21)
  40. #define EFI_ICMP_ERROR EFIERR (22)
  41. #define EFI_TFTP_ERROR EFIERR (23)
  42. #define EFI_PROTOCOL_ERROR EFIERR (24)
  43. #define EFI_INCOMPATIBLE_VERSION EFIERR (25)
  44. #define EFI_SECURITY_VIOLATION EFIERR (26)
  45. #define EFI_CRC_ERROR EFIERR (27)
  46. #define EFI_END_OF_MEDIA EFIERR (28)
  47. #define EFI_END_OF_FILE EFIERR (31)
  48. #define EFI_INVALID_LANGUAGE EFIERR (32)
  49. #define EFIWARN(a) ((a)+EFI_INVALID_LANGUAGE)
  50. #define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1)
  51. #define EFI_WARN_DELETE_FAILURE EFIWARN (2)
  52. #define EFI_WARN_WRITE_FAILURE EFIWARN (3)
  53. #define EFI_WARN_BUFFER_TOO_SMALL EFIWARN (4)
  54. #define EFI_ERROR(Status) (Status != 0 && Status < EFIWARN(1))
  55. EFI_STATUS
  56. EfiCompress (
  57. IN UINT8 *SrcBuffer,
  58. IN UINT32 SrcSize,
  59. IN UINT8 *DstBuffer,
  60. IN OUT UINT32 *DstSize
  61. );
  62. EFI_STATUS
  63. EFIAPI
  64. EfiGetInfo (
  65. IN VOID *Source,
  66. IN UINT32 SrcSize,
  67. OUT UINT32 *DstSize,
  68. OUT UINT32 *ScratchSize
  69. );
  70. EFI_STATUS
  71. EFIAPI
  72. EfiDecompress (
  73. IN VOID *Source,
  74. IN UINT32 SrcSize,
  75. IN OUT VOID *Destination,
  76. IN UINT32 DstSize,
  77. IN OUT VOID *Scratch,
  78. IN UINT32 ScratchSize
  79. );