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