]> git.proxmox.com Git - mirror_edk2.git/blame - FmpDevicePkg/Include/Library/FmpPayloadHeaderLib.h
FmpDevicePkg: Add package, library classes, and PCDs
[mirror_edk2.git] / FmpDevicePkg / Include / Library / FmpPayloadHeaderLib.h
CommitLineData
cec7b8fb
KM
1/** @file\r
2 Provides services to retrieve values from a capsule's FMP Payload Header.\r
3 The structure is not included in the library class. Instead, services are\r
4 provided to retrieve information from the FMP Payload Header. If information\r
5 is added to the FMP Payload Header, then new services may be added to this\r
6 library class to retrieve the new information.\r
7\r
8 Copyright (c) 2016, Microsoft Corporation. All rights reserved.<BR>\r
9 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
10\r
11 Redistribution and use in source and binary forms, with or without\r
12 modification, are permitted provided that the following conditions are met:\r
13 1. Redistributions of source code must retain the above copyright notice,\r
14 this list of conditions and the following disclaimer.\r
15 2. Redistributions in binary form must reproduce the above copyright notice,\r
16 this list of conditions and the following disclaimer in the documentation\r
17 and/or other materials provided with the distribution.\r
18\r
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\r
20 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
21 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
22 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\r
23 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
24 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
25 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
26 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
27 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r
28 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
29\r
30**/\r
31\r
32#ifndef _FMP_PAYLOAD_HEADER_LIB_H__\r
33#define _FMP_PAYLOAD_HEADER_LIB_H__\r
34\r
35/**\r
36 Returns the FMP Payload Header size in bytes.\r
37\r
38 @param[in] Header FMP Payload Header to evaluate\r
39 @param[in] FmpPayloadSize Size of FMP payload\r
40 @param[out] Size The size, in bytes, of the FMP Payload Header.\r
41\r
42 @retval EFI_SUCCESS The firmware version was returned.\r
43 @retval EFI_INVALID_PARAMETER Header is NULL.\r
44 @retval EFI_INVALID_PARAMETER Size is NULL.\r
45 @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.\r
46\r
47**/\r
48EFI_STATUS\r
49EFIAPI\r
50GetFmpPayloadHeaderSize (\r
51 IN CONST VOID *Header,\r
52 IN CONST UINTN FmpPayloadSize,\r
53 OUT UINT32 *Size\r
54 );\r
55\r
56/**\r
57 Returns the version described in the FMP Payload Header.\r
58\r
59 @param[in] Header FMP Payload Header to evaluate\r
60 @param[in] FmpPayloadSize Size of FMP payload\r
61 @param[out] Version The firmware version described in the FMP Payload\r
62 Header.\r
63\r
64 @retval EFI_SUCCESS The firmware version was returned.\r
65 @retval EFI_INVALID_PARAMETER Header is NULL.\r
66 @retval EFI_INVALID_PARAMETER Version is NULL.\r
67 @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.\r
68\r
69**/\r
70EFI_STATUS\r
71EFIAPI\r
72GetFmpPayloadHeaderVersion (\r
73 IN CONST VOID *Header,\r
74 IN CONST UINTN FmpPayloadSize,\r
75 OUT UINT32 *Version\r
76 );\r
77\r
78/**\r
79 Returns the lowest supported version described in the FMP Payload Header.\r
80\r
81 @param[in] Header FMP Payload Header to evaluate\r
82 @param[in] FmpPayloadSize Size of FMP payload\r
83 @param[out] LowestSupportedVersion The lowest supported version described in\r
84 the FMP Payload Header.\r
85\r
86 @retval EFI_SUCCESS The lowest support version was returned.\r
87 @retval EFI_INVALID_PARAMETER Header is NULL.\r
88 @retval EFI_INVALID_PARAMETER LowestSupportedVersion is NULL.\r
89 @retval EFI_INVALID_PARAMETER Header is not a valid FMP Payload Header.\r
90\r
91**/\r
92EFI_STATUS\r
93EFIAPI\r
94GetFmpPayloadHeaderLowestSupportedVersion (\r
95 IN CONST VOID *Header,\r
96 IN CONST UINTN FmpPayloadSize,\r
97 IN OUT UINT32 *LowestSupportedVersion\r
98 );\r
99\r
100#endif\r