]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Library / DxeCapsuleLibNull / DxeCapsuleLibNull.c
... / ...
CommitLineData
1/** @file\r
2 Null Dxe Capsule Library instance does nothing and returns unsupport status.\r
3\r
4Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
5SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8#include <Uefi.h>\r
9#include <Library/CapsuleLib.h>\r
10\r
11/**\r
12 The firmware checks whether the capsule image is supported\r
13 by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.\r
14\r
15 Caution: This function may receive untrusted input.\r
16\r
17 @param CapsuleHeader Point to the UEFI capsule image to be checked.\r
18\r
19 @retval EFI_UNSUPPORTED Input capsule is not supported by the firmware.\r
20**/\r
21EFI_STATUS\r
22EFIAPI\r
23SupportCapsuleImage (\r
24 IN EFI_CAPSULE_HEADER *CapsuleHeader\r
25 )\r
26{\r
27 return EFI_UNSUPPORTED;\r
28}\r
29\r
30/**\r
31 The firmware specific implementation processes the capsule image\r
32 if it recognized the format of this capsule image.\r
33\r
34 Caution: This function may receive untrusted input.\r
35\r
36 @param CapsuleHeader Point to the UEFI capsule image to be processed.\r
37\r
38 @retval EFI_UNSUPPORTED Capsule image is not supported by the firmware.\r
39**/\r
40EFI_STATUS\r
41EFIAPI\r
42ProcessCapsuleImage (\r
43 IN EFI_CAPSULE_HEADER *CapsuleHeader\r
44 )\r
45{\r
46 return EFI_UNSUPPORTED;\r
47}\r
48\r
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
87\r
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
98CoDCheckCapsuleOnDiskFlag (\r
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
113CoDClearCapsuleOnDiskFlag (\r
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
144CoDRelocateCapsule (\r
145 UINTN MaxRetry\r
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
165 UINTN MaxRetry\r
166 )\r
167{\r
168 return EFI_UNSUPPORTED;\r
169}\r