]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Library / DxeCapsuleLibNull / DxeCapsuleLibNull.c
CommitLineData
5d69642d 1/** @file\r
109e9a61 2 Null Dxe Capsule Library instance does nothing and returns unsupport status.\r
d0e24078 3\r
28889a78 4Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
d0e24078
LG
6\r
7**/\r
60c93673 8#include <Uefi.h>\r
d0e24078
LG
9#include <Library/CapsuleLib.h>\r
10\r
11/**\r
d1102dba 12 The firmware checks whether the capsule image is supported\r
109e9a61 13 by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.\r
bf468a6c
JY
14\r
15 Caution: This function may receive untrusted input.\r
16\r
2ae8963c 17 @param CapsuleHeader Point to the UEFI capsule image to be checked.\r
d1102dba 18\r
d0e24078
LG
19 @retval EFI_UNSUPPORTED Input capsule is not supported by the firmware.\r
20**/\r
21EFI_STATUS\r
22EFIAPI\r
23SupportCapsuleImage (\r
1436aea4 24 IN EFI_CAPSULE_HEADER *CapsuleHeader\r
d0e24078
LG
25 )\r
26{\r
27 return EFI_UNSUPPORTED;\r
28}\r
29\r
30/**\r
109e9a61
LG
31 The firmware specific implementation processes the capsule image\r
32 if it recognized the format of this capsule image.\r
bf468a6c
JY
33\r
34 Caution: This function may receive untrusted input.\r
35\r
d1102dba
LG
36 @param CapsuleHeader Point to the UEFI capsule image to be processed.\r
37\r
d0e24078
LG
38 @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware.\r
39**/\r
40EFI_STATUS\r
41EFIAPI\r
42ProcessCapsuleImage (\r
1436aea4 43 IN EFI_CAPSULE_HEADER *CapsuleHeader\r
d0e24078
LG
44 )\r
45{\r
46 return EFI_UNSUPPORTED;\r
47}\r
48\r
bf468a6c
JY
49/**\r
50\r
51 This routine is called to process capsules.\r
52\r
53 Caution: This function may receive untrusted input.\r
54\r
55 The capsules reported in EFI_HOB_UEFI_CAPSULE are processed.\r
56 If there is no EFI_HOB_UEFI_CAPSULE, this routine does nothing.\r
57\r
58 This routine should be called twice in BDS.\r
59 1) The first call must be before EndOfDxe. The system capsules is processed.\r
60 If device capsule FMP protocols are exposted at this time and device FMP\r
61 capsule has zero EmbeddedDriverCount, the device capsules are processed.\r
62 Each individual capsule result is recorded in capsule record variable.\r
63 System may reset in this function, if reset is required by capsule and\r
64 all capsules are processed.\r
65 If not all capsules are processed, reset will be defered to second call.\r
66\r
67 2) The second call must be after EndOfDxe and after ConnectAll, so that all\r
68 device capsule FMP protocols are exposed.\r
69 The system capsules are skipped. If the device capsules are NOT processed\r
70 in first call, they are processed here.\r
71 Each individual capsule result is recorded in capsule record variable.\r
72 System may reset in this function, if reset is required by capsule\r
73 processed in first call and second call.\r
74\r
75 @retval EFI_SUCCESS There is no error when processing capsules.\r
76 @retval EFI_OUT_OF_RESOURCES No enough resource to process capsules.\r
77\r
78**/\r
79EFI_STATUS\r
80EFIAPI\r
81ProcessCapsules (\r
82 VOID\r
83 )\r
84{\r
85 return EFI_UNSUPPORTED;\r
86}\r
d0e24078 87\r
28889a78
WX
88/**\r
89 This routine is called to check if CapsuleOnDisk flag in OsIndications Variable\r
90 is enabled.\r
91\r
92 @retval TRUE Flag is enabled\r
93 @retval FALSE Flag is not enabled\r
94\r
95**/\r
96BOOLEAN\r
97EFIAPI\r
1436aea4 98CoDCheckCapsuleOnDiskFlag (\r
28889a78
WX
99 VOID\r
100 )\r
101{\r
102 return FALSE;\r
103}\r
104\r
105/**\r
106 This routine is called to clear CapsuleOnDisk flags including OsIndications and BootNext variable.\r
107\r
108 @retval EFI_SUCCESS All Capsule On Disk flags are cleared\r
109\r
110**/\r
111EFI_STATUS\r
112EFIAPI\r
1436aea4 113CoDClearCapsuleOnDiskFlag (\r
28889a78
WX
114 VOID\r
115 )\r
116{\r
117 return EFI_UNSUPPORTED;\r
118}\r
119\r
120/**\r
121 Relocate Capsule on Disk from EFI system partition.\r
122\r
123 Two solution to deliver Capsule On Disk:\r
124 Solution A: If PcdCapsuleInRamSupport is enabled, relocate Capsule On Disk to memory and call UpdateCapsule().\r
125 Solution B: If PcdCapsuleInRamSupport is disabled, relocate Capsule On Disk to a platform-specific NV storage\r
126 device with BlockIo protocol.\r
127\r
128 Device enumeration like USB costs time, user can input MaxRetry to tell function to retry.\r
129 Function will stall 100ms between each retry.\r
130\r
131 Side Effects:\r
132 Capsule Delivery Supported Flag in OsIndication variable and BootNext variable will be cleared.\r
133 Solution B: Content corruption. Block IO write directly touches low level write. Orignal partitions, file\r
134 systems of the relocation device will be corrupted.\r
135\r
136 @param[in] MaxRetry Max Connection Retry. Stall 100ms between each connection try to ensure\r
137 devices like USB can get enumerated. Input 0 means no retry.\r
138\r
139 @retval EFI_SUCCESS Capsule on Disk images are successfully relocated.\r
140\r
141**/\r
142EFI_STATUS\r
143EFIAPI\r
1436aea4
MK
144CoDRelocateCapsule (\r
145 UINTN MaxRetry\r
28889a78
WX
146 )\r
147{\r
148 return EFI_UNSUPPORTED;\r
149}\r
150\r
151/**\r
152 Remove the temp file from the root of EFI System Partition.\r
153 Device enumeration like USB costs time, user can input MaxRetry to tell function to retry.\r
154 Function will stall 100ms between each retry.\r
155\r
156 @param[in] MaxRetry Max Connection Retry. Stall 100ms between each connection try to ensure\r
157 devices like USB can get enumerated. Input 0 means no retry.\r
158\r
159 @retval EFI_SUCCESS Remove the temp file successfully.\r
160\r
161**/\r
162EFI_STATUS\r
163EFIAPI\r
164CoDRemoveTempFile (\r
1436aea4 165 UINTN MaxRetry\r
28889a78
WX
166 )\r
167{\r
168 return EFI_UNSUPPORTED;\r
169}\r