]> git.proxmox.com Git - mirror_edk2.git/blobdiff - FmpDevicePkg/PrivateInclude/Library/FmpPayloadHeaderLib.h
FmpDevicePkg: Add Capsule Update Policy Protocol
[mirror_edk2.git] / FmpDevicePkg / PrivateInclude / Library / FmpPayloadHeaderLib.h
diff --git a/FmpDevicePkg/PrivateInclude/Library/FmpPayloadHeaderLib.h b/FmpDevicePkg/PrivateInclude/Library/FmpPayloadHeaderLib.h
new file mode 100644 (file)
index 0000000..24afd5e
--- /dev/null
@@ -0,0 +1,83 @@
+/** @file\r
+  Provides services to retrieve values from a capsule's FMP Payload Header.\r
+  The structure is not included in the library class.  Instead, services are\r
+  provided to retrieve information from the FMP Payload Header.  If information\r
+  is added to the FMP Payload Header, then new services may be added to this\r
+  library class to retrieve the new information.\r
+\r
+  Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _FMP_PAYLOAD_HEADER_LIB_H__\r
+#define _FMP_PAYLOAD_HEADER_LIB_H__\r
+\r
+/**\r
+  Returns the FMP Payload Header size in bytes.\r
+\r
+  @param[in]  Header          FMP Payload Header to evaluate\r
+  @param[in]  FmpPayloadSize  Size of FMP payload\r
+  @param[out] Size            The size, in bytes, of the FMP Payload Header.\r
+\r
+  @retval EFI_SUCCESS            The firmware version was returned.\r
+  @retval EFI_INVALID_PARAMETER  Header is NULL.\r
+  @retval EFI_INVALID_PARAMETER  Size is NULL.\r
+  @retval EFI_INVALID_PARAMETER  Header is not a valid FMP Payload Header.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetFmpPayloadHeaderSize (\r
+  IN  CONST VOID   *Header,\r
+  IN  CONST UINTN  FmpPayloadSize,\r
+  OUT UINT32       *Size\r
+  );\r
+\r
+/**\r
+  Returns the version described in the FMP Payload Header.\r
+\r
+  @param[in]  Header          FMP Payload Header to evaluate\r
+  @param[in]  FmpPayloadSize  Size of FMP payload\r
+  @param[out] Version         The firmware version described in the FMP Payload\r
+                              Header.\r
+\r
+  @retval EFI_SUCCESS            The firmware version was returned.\r
+  @retval EFI_INVALID_PARAMETER  Header is NULL.\r
+  @retval EFI_INVALID_PARAMETER  Version is NULL.\r
+  @retval EFI_INVALID_PARAMETER  Header is not a valid FMP Payload Header.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetFmpPayloadHeaderVersion (\r
+  IN  CONST VOID   *Header,\r
+  IN  CONST UINTN  FmpPayloadSize,\r
+  OUT UINT32       *Version\r
+  );\r
+\r
+/**\r
+  Returns the lowest supported version described in the FMP Payload Header.\r
+\r
+  @param[in]  Header                  FMP Payload Header to evaluate\r
+  @param[in]  FmpPayloadSize          Size of FMP payload\r
+  @param[out] LowestSupportedVersion  The lowest supported version described in\r
+                                      the FMP Payload Header.\r
+\r
+  @retval EFI_SUCCESS            The lowest support version was returned.\r
+  @retval EFI_INVALID_PARAMETER  Header is NULL.\r
+  @retval EFI_INVALID_PARAMETER  LowestSupportedVersion is NULL.\r
+  @retval EFI_INVALID_PARAMETER  Header is not a valid FMP Payload Header.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetFmpPayloadHeaderLowestSupportedVersion (\r
+  IN  CONST VOID    *Header,\r
+  IN  CONST UINTN   FmpPayloadSize,\r
+  OUT UINT32        *LowestSupportedVersion\r
+  );\r
+\r
+#endif\r