FmpPayloadHeaderLib.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /** @file
  2. Provides services to retrieve values from a capsule's FMP Payload Header.
  3. The structure is not included in the library class. Instead, services are
  4. provided to retrieve information from the FMP Payload Header. If information
  5. is added to the FMP Payload Header, then new services may be added to this
  6. library class to retrieve the new information.
  7. Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>
  8. Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
  9. SPDX-License-Identifier: BSD-2-Clause-Patent
  10. **/
  11. #ifndef _FMP_PAYLOAD_HEADER_LIB_H__
  12. #define _FMP_PAYLOAD_HEADER_LIB_H__
  13. /**
  14. Returns the FMP Payload Header size in bytes.
  15. @param[in] Header FMP Payload Header to evaluate
  16. @param[in] FmpPayloadSize Size of FMP payload
  17. @param[out] Size The size, in bytes, of the FMP Payload Header.
  18. @retval EFI_SUCCESS The firmware version was returned.
  19. @retval EFI_INVALID_PARAMETER Header is NULL.
  20. @retval EFI_INVALID_PARAMETER Size is NULL.
  21. @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.
  22. **/
  23. EFI_STATUS
  24. EFIAPI
  25. GetFmpPayloadHeaderSize (
  26. IN CONST VOID *Header,
  27. IN CONST UINTN FmpPayloadSize,
  28. OUT UINT32 *Size
  29. );
  30. /**
  31. Returns the version described in the FMP Payload Header.
  32. @param[in] Header FMP Payload Header to evaluate
  33. @param[in] FmpPayloadSize Size of FMP payload
  34. @param[out] Version The firmware version described in the FMP Payload
  35. Header.
  36. @retval EFI_SUCCESS The firmware version was returned.
  37. @retval EFI_INVALID_PARAMETER Header is NULL.
  38. @retval EFI_INVALID_PARAMETER Version is NULL.
  39. @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.
  40. **/
  41. EFI_STATUS
  42. EFIAPI
  43. GetFmpPayloadHeaderVersion (
  44. IN CONST VOID *Header,
  45. IN CONST UINTN FmpPayloadSize,
  46. OUT UINT32 *Version
  47. );
  48. /**
  49. Returns the lowest supported version described in the FMP Payload Header.
  50. @param[in] Header FMP Payload Header to evaluate
  51. @param[in] FmpPayloadSize Size of FMP payload
  52. @param[out] LowestSupportedVersion The lowest supported version described in
  53. the FMP Payload Header.
  54. @retval EFI_SUCCESS The lowest support version was returned.
  55. @retval EFI_INVALID_PARAMETER Header is NULL.
  56. @retval EFI_INVALID_PARAMETER LowestSupportedVersion is NULL.
  57. @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.
  58. **/
  59. EFI_STATUS
  60. EFIAPI
  61. GetFmpPayloadHeaderLowestSupportedVersion (
  62. IN CONST VOID *Header,
  63. IN CONST UINTN FmpPayloadSize,
  64. OUT UINT32 *LowestSupportedVersion
  65. );
  66. #endif