]> git.proxmox.com Git - mirror_edk2.git/blob - FmpDevicePkg/Include/Library/FmpPayloadHeaderLib.h
FmpDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / FmpDevicePkg / Include / Library / FmpPayloadHeaderLib.h
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
8 Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>
9 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
10
11 SPDX-License-Identifier: BSD-2-Clause-Patent
12
13 **/
14
15 #ifndef _FMP_PAYLOAD_HEADER_LIB_H__
16 #define _FMP_PAYLOAD_HEADER_LIB_H__
17
18 /**
19 Returns the FMP Payload Header size in bytes.
20
21 @param[in] Header FMP Payload Header to evaluate
22 @param[in] FmpPayloadSize Size of FMP payload
23 @param[out] Size The size, in bytes, of the FMP Payload Header.
24
25 @retval EFI_SUCCESS The firmware version was returned.
26 @retval EFI_INVALID_PARAMETER Header is NULL.
27 @retval EFI_INVALID_PARAMETER Size is NULL.
28 @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.
29
30 **/
31 EFI_STATUS
32 EFIAPI
33 GetFmpPayloadHeaderSize (
34 IN CONST VOID *Header,
35 IN CONST UINTN FmpPayloadSize,
36 OUT UINT32 *Size
37 );
38
39 /**
40 Returns the version described in the FMP Payload Header.
41
42 @param[in] Header FMP Payload Header to evaluate
43 @param[in] FmpPayloadSize Size of FMP payload
44 @param[out] Version The firmware version described in the FMP Payload
45 Header.
46
47 @retval EFI_SUCCESS The firmware version was returned.
48 @retval EFI_INVALID_PARAMETER Header is NULL.
49 @retval EFI_INVALID_PARAMETER Version is NULL.
50 @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.
51
52 **/
53 EFI_STATUS
54 EFIAPI
55 GetFmpPayloadHeaderVersion (
56 IN CONST VOID *Header,
57 IN CONST UINTN FmpPayloadSize,
58 OUT UINT32 *Version
59 );
60
61 /**
62 Returns the lowest supported version described in the FMP Payload Header.
63
64 @param[in] Header FMP Payload Header to evaluate
65 @param[in] FmpPayloadSize Size of FMP payload
66 @param[out] LowestSupportedVersion The lowest supported version described in
67 the FMP Payload Header.
68
69 @retval EFI_SUCCESS The lowest support version was returned.
70 @retval EFI_INVALID_PARAMETER Header is NULL.
71 @retval EFI_INVALID_PARAMETER LowestSupportedVersion is NULL.
72 @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.
73
74 **/
75 EFI_STATUS
76 EFIAPI
77 GetFmpPayloadHeaderLowestSupportedVersion (
78 IN CONST VOID *Header,
79 IN CONST UINTN FmpPayloadSize,
80 OUT UINT32 *LowestSupportedVersion
81 );
82
83 #endif