]> git.proxmox.com Git - mirror_edk2.git/blame - SignedCapsulePkg/Include/Library/EdkiiSystemCapsuleLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / SignedCapsulePkg / Include / Library / EdkiiSystemCapsuleLib.h
CommitLineData
5f190b90
JY
1/** @file\r
2 EDKII System Capsule library.\r
3\r
4Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
fbf06957 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
5f190b90
JY
6\r
7**/\r
8\r
5f190b90
JY
9#ifndef __EDKII_SYSTEM_CAPSULE_LIB_H__\r
10#define __EDKII_SYSTEM_CAPSULE_LIB_H__\r
11\r
12#include <Guid/EdkiiSystemFmpCapsule.h>\r
13\r
14/**\r
15 Extract ImageFmpInfo from system firmware.\r
16\r
17 @param[in] SystemFirmwareImage The System Firmware image.\r
18 @param[in] SystemFirmwareImageSize The size of the System Firmware image in bytes.\r
19 @param[out] ImageFmpInfo The ImageFmpInfo.\r
20 @param[out] ImageFmpInfoSize The size of the ImageFmpInfo in bytes.\r
21\r
22 @retval TRUE The ImageFmpInfo is extracted.\r
23 @retval FALSE The ImageFmpInfo is not extracted.\r
24**/\r
25BOOLEAN\r
26EFIAPI\r
27ExtractSystemFirmwareImageFmpInfo (\r
b8786489
MK
28 IN VOID *SystemFirmwareImage,\r
29 IN UINTN SystemFirmwareImageSize,\r
30 OUT EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR **ImageFmpInfo,\r
31 OUT UINTN *ImageFmpInfoSize\r
5f190b90
JY
32 );\r
33\r
34/**\r
35 Extract the driver FV from an authenticated image.\r
36\r
37 @param[in] AuthenticatedImage The authenticated capsule image.\r
38 @param[in] AuthenticatedImageSize The size of the authenticated capsule image in bytes.\r
39 @param[out] DriverFvImage The driver FV image.\r
40 @param[out] DriverFvImageSize The size of the driver FV image in bytes.\r
41\r
42 @retval TRUE The driver Fv is extracted.\r
43 @retval FALSE The driver Fv is not extracted.\r
44**/\r
45BOOLEAN\r
46EFIAPI\r
47ExtractDriverFvImage (\r
b8786489
MK
48 IN VOID *AuthenticatedImage,\r
49 IN UINTN AuthenticatedImageSize,\r
50 OUT VOID **DriverFvImage,\r
51 OUT UINTN *DriverFvImageSize\r
5f190b90
JY
52 );\r
53\r
54/**\r
55 Extract the config image from an authenticated image.\r
56\r
57 @param[in] AuthenticatedImage The authenticated capsule image.\r
58 @param[in] AuthenticatedImageSize The size of the authenticated capsule image in bytes.\r
59 @param[out] ConfigImage The config image.\r
60 @param[out] ConfigImageSize The size of the config image in bytes.\r
61\r
62 @retval TRUE The config image is extracted.\r
63 @retval FALSE The config image is not extracted.\r
64**/\r
65BOOLEAN\r
66EFIAPI\r
67ExtractConfigImage (\r
b8786489
MK
68 IN VOID *AuthenticatedImage,\r
69 IN UINTN AuthenticatedImageSize,\r
70 OUT VOID **ConfigImage,\r
71 OUT UINTN *ConfigImageSize\r
5f190b90
JY
72 );\r
73\r
74/**\r
75 Extract the System Firmware image from an authenticated image.\r
76\r
77 @param[in] AuthenticatedImage The authenticated capsule image.\r
78 @param[in] AuthenticatedImageSize The size of the authenticated capsule image in bytes.\r
79 @param[out] SystemFirmwareImage The System Firmware image.\r
80 @param[out] SystemFirmwareImageSize The size of the System Firmware image in bytes.\r
81\r
82 @retval TRUE The System Firmware image is extracted.\r
83 @retval FALSE The System Firmware image is not extracted.\r
84**/\r
85BOOLEAN\r
86EFIAPI\r
87ExtractSystemFirmwareImage (\r
b8786489
MK
88 IN VOID *AuthenticatedImage,\r
89 IN UINTN AuthenticatedImageSize,\r
90 OUT VOID **SystemFirmwareImage,\r
91 OUT UINTN *SystemFirmwareImageSize\r
5f190b90
JY
92 );\r
93\r
94/**\r
95 Extract the authenticated image from an FMP capsule image.\r
96\r
97 @param[in] Image The FMP capsule image, including EFI_FIRMWARE_IMAGE_AUTHENTICATION.\r
98 @param[in] ImageSize The size of FMP capsule image in bytes.\r
99 @param[out] LastAttemptStatus The last attempt status, which will be recorded in ESRT and FMP EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
100 @param[out] AuthenticatedImage The authenticated capsule image, excluding EFI_FIRMWARE_IMAGE_AUTHENTICATION.\r
101 @param[out] AuthenticatedImageSize The size of the authenticated capsule image in bytes.\r
102\r
103 @retval TRUE The authenticated image is extracted.\r
104 @retval FALSE The authenticated image is not extracted.\r
105**/\r
106BOOLEAN\r
107EFIAPI\r
108ExtractAuthenticatedImage (\r
b8786489
MK
109 IN VOID *Image,\r
110 IN UINTN ImageSize,\r
111 OUT UINT32 *LastAttemptStatus,\r
112 OUT VOID **AuthenticatedImage,\r
113 OUT UINTN *AuthenticatedImageSize\r
5f190b90
JY
114 );\r
115\r
116/**\r
117 Authenticated system firmware FMP capsule image.\r
118\r
119 Caution: This function may receive untrusted input.\r
120\r
121 @param[in] Image The FMP capsule image, including EFI_FIRMWARE_IMAGE_AUTHENTICATION.\r
122 @param[in] ImageSize The size of FMP capsule image in bytes.\r
123 @param[in] ForceVersionMatch TRUE: The version of capsule must be as same as the version of current image.\r
124 FALSE: The version of capsule must be as same as greater than the lowest\r
125 supported version of current image.\r
126 @param[out] LastAttemptVersion The last attempt version, which will be recorded in ESRT and FMP EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
127 @param[out] LastAttemptStatus The last attempt status, which will be recorded in ESRT and FMP EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
128 @param[out] AuthenticatedImage The authenticated capsule image, excluding EFI_FIRMWARE_IMAGE_AUTHENTICATION.\r
129 @param[out] AuthenticatedImageSize The size of the authenticated capsule image in bytes.\r
130\r
131 @retval TRUE Authentication passes and the authenticated image is extracted.\r
132 @retval FALSE Authentication fails and the authenticated image is not extracted.\r
133**/\r
134EFI_STATUS\r
135EFIAPI\r
136CapsuleAuthenticateSystemFirmware (\r
b8786489
MK
137 IN VOID *Image,\r
138 IN UINTN ImageSize,\r
139 IN BOOLEAN ForceVersionMatch,\r
140 OUT UINT32 *LastAttemptVersion,\r
141 OUT UINT32 *LastAttemptStatus,\r
142 OUT VOID **AuthenticatedImage,\r
143 OUT UINTN *AuthenticatedImageSize\r
5f190b90
JY
144 );\r
145\r
146#endif\r