TianoCore EDK2 master
Loading...
Searching...
No Matches
SystemFirmwareUpdateDxe.c
Go to the documentation of this file.
1
16#include "SystemFirmwareDxe.h"
17
18//
19// SystemFmp driver private data
20//
21SYSTEM_FMP_PRIVATE_DATA *mSystemFmpPrivate = NULL;
22
23EFI_GUID mCurrentImageTypeId;
24
25BOOLEAN mNvRamUpdated = FALSE;
26
42 IN UINT8 *DataBuffer,
43 IN UINTN BufferSize,
44 IN OUT CONFIG_HEADER *ConfigHeader,
45 IN OUT UPDATE_CONFIG_DATA **UpdateArray
46 );
47
65 IN VOID *SystemFirmwareImage,
66 IN UINTN SystemFirmwareImageSize,
67 IN UPDATE_CONFIG_DATA *ConfigData,
68 OUT UINT32 *LastAttemptVersion,
69 OUT UINT32 *LastAttemptStatus,
71 IN UINTN StartPercentage,
72 IN UINTN EndPercentage
73 )
74{
75 EFI_STATUS Status;
76
77 DEBUG ((DEBUG_INFO, "PlatformUpdate:"));
78 DEBUG ((DEBUG_INFO, " BaseAddress - 0x%lx,", ConfigData->BaseAddress));
79 DEBUG ((DEBUG_INFO, " ImageOffset - 0x%x,", ConfigData->ImageOffset));
80 DEBUG ((DEBUG_INFO, " Legnth - 0x%x\n", ConfigData->Length));
81 if (Progress != NULL) {
82 Progress (StartPercentage);
83 }
84
86 ConfigData->FirmwareType,
87 ConfigData->BaseAddress,
88 ConfigData->AddressType,
89 (VOID *)((UINTN)SystemFirmwareImage + (UINTN)ConfigData->ImageOffset),
90 ConfigData->Length,
91 Progress,
92 StartPercentage,
93 EndPercentage
94 );
95 if (Progress != NULL) {
96 Progress (EndPercentage);
97 }
98
99 if (!EFI_ERROR (Status)) {
100 *LastAttemptStatus = LAST_ATTEMPT_STATUS_SUCCESS;
101 if (ConfigData->FirmwareType == PlatformFirmwareTypeNvRam) {
102 mNvRamUpdated = TRUE;
103 }
104 } else {
105 *LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;
106 }
107
108 return Status;
109}
110
127 IN VOID *SystemFirmwareImage,
128 IN UINTN SystemFirmwareImageSize,
129 IN VOID *ConfigImage,
130 IN UINTN ConfigImageSize,
131 OUT UINT32 *LastAttemptVersion,
132 OUT UINT32 *LastAttemptStatus,
134 )
135{
136 EFI_STATUS Status;
137 UPDATE_CONFIG_DATA *ConfigData;
138 UPDATE_CONFIG_DATA *UpdateConfigData;
139 CONFIG_HEADER ConfigHeader;
140 UINTN Index;
141 UINTN TotalSize;
142 UINTN BytesWritten;
143 UINTN StartPercentage;
144 UINTN EndPercentage;
145
146 if (ConfigImage == NULL) {
147 DEBUG ((DEBUG_INFO, "PlatformUpdate (NoConfig):"));
148 DEBUG ((DEBUG_INFO, " BaseAddress - 0x%x,", 0));
149 DEBUG ((DEBUG_INFO, " Length - 0x%x\n", SystemFirmwareImageSize));
150 // ASSUME the whole System Firmware include NVRAM region.
151 StartPercentage = 0;
152 EndPercentage = 100;
153 if (Progress != NULL) {
154 Progress (StartPercentage);
155 }
156
158 PlatformFirmwareTypeNvRam,
159 0,
160 FlashAddressTypeRelativeAddress,
161 SystemFirmwareImage,
162 SystemFirmwareImageSize,
163 Progress,
164 StartPercentage,
165 EndPercentage
166 );
167 if (Progress != NULL) {
168 Progress (EndPercentage);
169 }
170
171 if (!EFI_ERROR (Status)) {
172 *LastAttemptStatus = LAST_ATTEMPT_STATUS_SUCCESS;
173 mNvRamUpdated = TRUE;
174 } else {
175 *LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;
176 }
177
178 return Status;
179 }
180
181 DEBUG ((DEBUG_INFO, "PlatformUpdate (With Config):\n"));
182 ConfigData = NULL;
183 ZeroMem (&ConfigHeader, sizeof (ConfigHeader));
184 Status = ParseUpdateDataFile (
185 ConfigImage,
186 ConfigImageSize,
187 &ConfigHeader,
188 &ConfigData
189 );
190 DEBUG ((DEBUG_INFO, "ParseUpdateDataFile - %r\n", Status));
191 if (EFI_ERROR (Status)) {
192 *LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL;
193 return EFI_INVALID_PARAMETER;
194 }
195
196 DEBUG ((DEBUG_INFO, "ConfigHeader.NumOfUpdates - 0x%x\n", ConfigHeader.NumOfUpdates));
197 DEBUG ((DEBUG_INFO, "PcdEdkiiSystemFirmwareFileGuid - %g\n", PcdGetPtr (PcdEdkiiSystemFirmwareFileGuid)));
198
199 TotalSize = 0;
200 for (Index = 0; Index < ConfigHeader.NumOfUpdates; Index++) {
201 if (CompareGuid (&ConfigData[Index].FileGuid, PcdGetPtr (PcdEdkiiSystemFirmwareFileGuid))) {
202 TotalSize = TotalSize + ConfigData[Index].Length;
203 }
204 }
205
206 BytesWritten = 0;
207 Index = 0;
208 UpdateConfigData = ConfigData;
209 while (Index < ConfigHeader.NumOfUpdates) {
210 if (CompareGuid (&UpdateConfigData->FileGuid, PcdGetPtr (PcdEdkiiSystemFirmwareFileGuid))) {
211 DEBUG ((DEBUG_INFO, "FileGuid - %g (processing)\n", &UpdateConfigData->FileGuid));
212 StartPercentage = (BytesWritten * 100) / TotalSize;
213 EndPercentage = ((BytesWritten + UpdateConfigData->Length) * 100) / TotalSize;
214 Status = PerformUpdate (
215 SystemFirmwareImage,
216 SystemFirmwareImageSize,
217 UpdateConfigData,
218 LastAttemptVersion,
219 LastAttemptStatus,
220 Progress,
221 StartPercentage,
222 EndPercentage
223 );
224 //
225 // Shall updates be serialized so that if an update is not successfully completed,
226 // the remaining updates won't be performed.
227 //
228 if (EFI_ERROR (Status)) {
229 break;
230 }
231 } else {
232 DEBUG ((DEBUG_INFO, "FileGuid - %g (ignored)\n", &UpdateConfigData->FileGuid));
233 }
234
235 BytesWritten += UpdateConfigData->Length;
236
237 Index++;
238 UpdateConfigData++;
239 }
240
241 return Status;
242}
243
261 IN VOID *Image,
262 IN UINTN ImageSize,
263 OUT UINT32 *LastAttemptVersion,
264 OUT UINT32 *LastAttemptStatus,
266 )
267{
268 EFI_STATUS Status;
269 VOID *SystemFirmwareImage;
270 UINTN SystemFirmwareImageSize;
271 VOID *ConfigImage;
272 UINTN ConfigImageSize;
273 VOID *AuthenticatedImage;
274 UINTN AuthenticatedImageSize;
275
276 AuthenticatedImage = NULL;
277 AuthenticatedImageSize = 0;
278
279 DEBUG ((DEBUG_INFO, "SystemFirmwareAuthenticatedUpdate...\n"));
280
281 Status = CapsuleAuthenticateSystemFirmware (Image, ImageSize, FALSE, LastAttemptVersion, LastAttemptStatus, &AuthenticatedImage, &AuthenticatedImageSize);
282 if (EFI_ERROR (Status)) {
283 DEBUG ((DEBUG_INFO, "SystemFirmwareAuthenticateImage - %r\n", Status));
284 return Status;
285 }
286
287 DEBUG ((DEBUG_INFO, "ExtractSystemFirmwareImage ...\n"));
288 ExtractSystemFirmwareImage (AuthenticatedImage, AuthenticatedImageSize, &SystemFirmwareImage, &SystemFirmwareImageSize);
289 DEBUG ((DEBUG_INFO, "ExtractConfigImage ...\n"));
290 ExtractConfigImage (AuthenticatedImage, AuthenticatedImageSize, &ConfigImage, &ConfigImageSize);
291
292 DEBUG ((DEBUG_INFO, "UpdateImage ...\n"));
293 Status = UpdateImage (SystemFirmwareImage, SystemFirmwareImageSize, ConfigImage, ConfigImageSize, LastAttemptVersion, LastAttemptStatus, Progress);
294 if (EFI_ERROR (Status)) {
295 DEBUG ((DEBUG_INFO, "UpdateImage - %r\n", Status));
296 return Status;
297 }
298
299 DEBUG ((DEBUG_INFO, "SystemFirmwareAuthenticatedUpdate Done\n"));
300
301 return EFI_SUCCESS;
302}
303
322EFIAPI
324 IN CHAR16 *VariableName,
325 IN EFI_GUID *VendorGuid,
326 OUT UINT32 *Attributes OPTIONAL,
327 IN OUT UINTN *DataSize,
328 OUT VOID *Data
329 )
330{
331 DEBUG ((DEBUG_INFO, "GetVariableHook - %S, %g\n", VariableName, VendorGuid));
333}
334
350EFIAPI
352 IN OUT UINTN *VariableNameSize,
353 IN OUT CHAR16 *VariableName,
354 IN OUT EFI_GUID *VendorGuid
355 )
356{
357 DEBUG ((DEBUG_INFO, "GetNextVariableNameHook - %S, %g\n", VariableName, VendorGuid));
359}
360
380EFIAPI
382 IN CHAR16 *VariableName,
383 IN EFI_GUID *VendorGuid,
384 IN UINT32 Attributes,
385 IN UINTN DataSize,
386 IN VOID *Data
387 )
388{
389 DEBUG ((DEBUG_INFO, "SetVariableHook - %S, %g, 0x%x (0x%x)\n", VariableName, VendorGuid, Attributes, DataSize));
391}
392
410EFIAPI
412 IN UINT32 Attributes,
413 OUT UINT64 *MaximumVariableStorageSize,
414 OUT UINT64 *RemainingVariableStorageSize,
415 OUT UINT64 *MaximumVariableSize
416 )
417{
418 DEBUG ((DEBUG_INFO, "QueryVariableInfoHook - 0x%x\n", Attributes));
420}
421
469EFIAPI
472 IN UINT8 ImageIndex,
473 IN CONST VOID *Image,
474 IN UINTN ImageSize,
475 IN CONST VOID *VendorCode,
477 OUT CHAR16 **AbortReason
478 )
479{
480 EFI_STATUS Status;
481 EFI_STATUS VarStatus;
482 SYSTEM_FMP_PRIVATE_DATA *SystemFmpPrivate;
483
484 if ((Image == NULL) || (ImageSize == 0) || (AbortReason == NULL)) {
485 return EFI_INVALID_PARAMETER;
486 }
487
488 SystemFmpPrivate = SYSTEM_FMP_PRIVATE_DATA_FROM_FMP (This);
489 *AbortReason = NULL;
490
491 if ((ImageIndex == 0) || (ImageIndex > SystemFmpPrivate->DescriptorCount)) {
492 return EFI_INVALID_PARAMETER;
493 }
494
495 Status = SystemFirmwareAuthenticatedUpdate ((VOID *)Image, ImageSize, &SystemFmpPrivate->LastAttempt.LastAttemptVersion, &SystemFmpPrivate->LastAttempt.LastAttemptStatus, Progress);
496 DEBUG ((DEBUG_INFO, "SetImage - LastAttempt Version - 0x%x, State - 0x%x\n", SystemFmpPrivate->LastAttempt.LastAttemptVersion, SystemFmpPrivate->LastAttempt.LastAttemptStatus));
497
498 //
499 // If NVRAM is updated, we should no longer touch variable services, because
500 // the current variable driver may not manage the new NVRAM region.
501 //
502 if (mNvRamUpdated) {
503 DEBUG ((DEBUG_INFO, "NvRamUpdated, Update Variable Services\n"));
504 gRT->GetVariable = GetVariableHook;
505 gRT->GetNextVariableName = GetNextVariableNameHook;
506 gRT->SetVariable = SetVariableHook;
507 gRT->QueryVariableInfo = QueryVariableInfoHook;
508
509 gRT->Hdr.CRC32 = 0;
510 gBS->CalculateCrc32 (
511 (UINT8 *)&gRT->Hdr,
513 &gRT->Hdr.CRC32
514 );
515 }
516
517 VarStatus = gRT->SetVariable (
518 SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_NAME,
519 &gSystemFmpLastAttemptVariableGuid,
520 EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
521 sizeof (SystemFmpPrivate->LastAttempt),
522 &SystemFmpPrivate->LastAttempt
523 );
524 DEBUG ((DEBUG_INFO, "SetLastAttempt - %r\n", VarStatus));
525
526 return Status;
527}
528
548 IN EFI_HANDLE Handle,
549 IN EFI_GUID *ProtocolGuid,
550 OUT UINT8 *FmpImageInfoCount,
551 OUT UINTN *DescriptorSize
552 )
553{
554 EFI_STATUS Status;
556 UINTN ImageInfoSize;
557 EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfoBuf;
558 UINT32 FmpImageInfoDescriptorVer;
559 UINT32 PackageVersion;
560 CHAR16 *PackageVersionName;
561
562 *FmpImageInfoCount = 0;
563 *DescriptorSize = 0;
564
565 Status = gBS->HandleProtocol (
566 Handle,
567 ProtocolGuid,
568 (VOID **)&Fmp
569 );
570 if (EFI_ERROR (Status)) {
571 return NULL;
572 }
573
574 //
575 // Determine the size required for the set of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
576 //
577 ImageInfoSize = 0;
578 Status = Fmp->GetImageInfo (
579 Fmp, // FMP Pointer
580 &ImageInfoSize, // Buffer Size (in this case 0)
581 NULL, // NULL so we can get size
582 &FmpImageInfoDescriptorVer, // DescriptorVersion
583 FmpImageInfoCount, // DescriptorCount
584 DescriptorSize, // DescriptorSize
585 &PackageVersion, // PackageVersion
586 &PackageVersionName // PackageVersionName
587 );
588 if (Status != EFI_BUFFER_TOO_SMALL) {
589 DEBUG ((DEBUG_ERROR, "SystemFirmwareUpdateDxe: Unexpected Failure. Status = %r\n", Status));
590 return NULL;
591 }
592
593 //
594 // Allocate buffer for the set of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
595 //
596 FmpImageInfoBuf = NULL;
597 FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize);
598 if (FmpImageInfoBuf == NULL) {
599 DEBUG ((DEBUG_ERROR, "SystemFirmwareUpdateDxe: Failed to allocate memory for descriptors.\n"));
600 return NULL;
601 }
602
603 //
604 // Retrieve the set of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
605 //
606 PackageVersionName = NULL;
607 Status = Fmp->GetImageInfo (
608 Fmp,
609 &ImageInfoSize, // ImageInfoSize
610 FmpImageInfoBuf, // ImageInfo
611 &FmpImageInfoDescriptorVer, // DescriptorVersion
612 FmpImageInfoCount, // DescriptorCount
613 DescriptorSize, // DescriptorSize
614 &PackageVersion, // PackageVersion
615 &PackageVersionName // PackageVersionName
616 );
617
618 //
619 // Free unused PackageVersionName return buffer
620 //
621 if (PackageVersionName != NULL) {
622 FreePool (PackageVersionName);
623 PackageVersionName = NULL;
624 }
625
626 if (EFI_ERROR (Status)) {
627 DEBUG ((DEBUG_ERROR, "SystemFirmwareUpdateDxe: Failure in GetImageInfo. Status = %r\n", Status));
628 if (FmpImageInfoBuf != NULL) {
629 FreePool (FmpImageInfoBuf);
630 }
631
632 return NULL;
633 }
634
635 return FmpImageInfoBuf;
636}
637
651 IN EFI_GUID *ProtocolGuid,
652 OUT UINTN *HandleCount
653 )
654{
655 EFI_STATUS Status;
656 UINTN TempHandleCount;
657 EFI_HANDLE *HandleBuffer;
658 UINTN Index;
659 UINTN Index2;
660 UINTN Index3;
661 EFI_FIRMWARE_IMAGE_DESCRIPTOR *OriginalFmpImageInfoBuf;
662 EFI_FIRMWARE_IMAGE_DESCRIPTOR *FmpImageInfoBuf;
663 UINT8 FmpImageInfoCount;
664 UINTN DescriptorSize;
665 BOOLEAN MatchFound;
666
667 *HandleCount = 0;
668 TempHandleCount = 0;
669 HandleBuffer = NULL;
670 Status = gBS->LocateHandleBuffer (
672 ProtocolGuid,
673 NULL,
674 &TempHandleCount,
675 &HandleBuffer
676 );
677 if (EFI_ERROR (Status)) {
678 return NULL;
679 }
680
681 for (Index = 0; Index < TempHandleCount; Index++) {
682 OriginalFmpImageInfoBuf = GetFmpImageDescriptors (
683 HandleBuffer[Index],
684 ProtocolGuid,
685 &FmpImageInfoCount,
686 &DescriptorSize
687 );
688
689 //
690 // Loop through the set of EFI_FIRMWARE_IMAGE_DESCRIPTORs.
691 //
692 MatchFound = FALSE;
693 if (OriginalFmpImageInfoBuf != NULL) {
694 FmpImageInfoBuf = OriginalFmpImageInfoBuf;
695
696 for (Index2 = 0; Index2 < FmpImageInfoCount; Index2++) {
697 for (Index3 = 0; Index3 < mSystemFmpPrivate->DescriptorCount; Index3++) {
698 MatchFound = CompareGuid (
699 &FmpImageInfoBuf->ImageTypeId,
700 &mSystemFmpPrivate->ImageDescriptor[Index3].ImageTypeId
701 );
702 if (MatchFound) {
703 break;
704 }
705 }
706
707 if (MatchFound) {
708 break;
709 }
710
711 //
712 // Increment the buffer pointer ahead by the size of the descriptor
713 //
714 FmpImageInfoBuf = (EFI_FIRMWARE_IMAGE_DESCRIPTOR *)(((UINT8 *)FmpImageInfoBuf) + DescriptorSize);
715 }
716
717 if (MatchFound) {
718 HandleBuffer[*HandleCount] = HandleBuffer[Index];
719 (*HandleCount)++;
720 }
721
722 FreePool (OriginalFmpImageInfoBuf);
723 }
724 }
725
726 if ((*HandleCount) == 0) {
727 //
728 // No any matching handle.
729 //
730 FreePool (HandleBuffer);
731 return NULL;
732 }
733
734 return HandleBuffer;
735}
736
747 VOID
748 )
749{
750 EFI_STATUS Status;
751 EFI_HANDLE *HandleBuffer;
752 UINTN HandleCount;
753 UINTN Index;
755
756 //
757 // Uninstall SystemFmpProtocol instances that may have been produced by
758 // the SystemFirmwareUpdate drivers in FVs dispatched by other capsules.
759 //
760 HandleBuffer = FindMatchingFmpHandles (
761 &gSystemFmpProtocolGuid,
762 &HandleCount
763 );
764 DEBUG ((DEBUG_INFO, "SystemFirmwareUpdateDxe: Found %d matching System FMP instances\n", HandleCount));
765
766 for (Index = 0; Index < HandleCount; Index++) {
767 Status = gBS->HandleProtocol (
768 HandleBuffer[Index],
769 &gSystemFmpProtocolGuid,
770 (VOID **)&SystemFmp
771 );
772 if (EFI_ERROR (Status)) {
773 continue;
774 }
775
776 DEBUG ((DEBUG_INFO, "SystemFirmwareUpdateDxe: Uninstall SystemFmp produced by another capsule\n"));
777 Status = gBS->UninstallProtocolInterface (
778 HandleBuffer[Index],
779 &gSystemFmpProtocolGuid,
780 SystemFmp
781 );
782 if (EFI_ERROR (Status)) {
783 DEBUG ((DEBUG_ERROR, "SystemFirmwareUpdateDxe: Failed to uninstall SystemFmp %r. Exiting.\n", Status));
784 FreePool (HandleBuffer);
785 return Status;
786 }
787 }
788
789 if (HandleBuffer != NULL) {
790 FreePool (HandleBuffer);
791 }
792
793 return EFI_SUCCESS;
794}
795
810EFIAPI
812 IN EFI_HANDLE ImageHandle,
813 IN EFI_SYSTEM_TABLE *SystemTable
814 )
815{
816 EFI_STATUS Status;
817 EFI_HANDLE *HandleBuffer;
818 UINTN HandleCount;
819
820 //
821 // Initialize SystemFmpPrivateData
822 //
823 mSystemFmpPrivate = AllocateZeroPool (sizeof (SYSTEM_FMP_PRIVATE_DATA));
824 if (mSystemFmpPrivate == NULL) {
825 return EFI_OUT_OF_RESOURCES;
826 }
827
828 Status = InitializePrivateData (mSystemFmpPrivate);
829 if (EFI_ERROR (Status)) {
830 FreePool (mSystemFmpPrivate);
831 mSystemFmpPrivate = NULL;
832 return Status;
833 }
834
835 //
836 // Uninstall SystemFmpProtocol instances that may have been produced by
837 // the SystemFirmwareUpdate drivers in FVs dispatched by other capsules.
838 //
840 if (EFI_ERROR (Status)) {
841 FreePool (mSystemFmpPrivate);
842 mSystemFmpPrivate = NULL;
843 return Status;
844 }
845
846 //
847 // Look for a handle with matching Firmware Management Protocol
848 //
849 HandleCount = 0;
850 HandleBuffer = FindMatchingFmpHandles (
851 &gEfiFirmwareManagementProtocolGuid,
852 &HandleCount
853 );
854 DEBUG ((DEBUG_INFO, "SystemFirmwareUpdateDxe: Found %d matching FMP instances\n", HandleCount));
855
856 switch (HandleCount) {
857 case 0:
858 //
859 // Install FMP protocol onto a new handle.
860 //
861 DEBUG ((DEBUG_INFO, "SystemFirmwareUpdateDxe: Install FMP onto a new handle\n"));
862 Status = gBS->InstallMultipleProtocolInterfaces (
863 &mSystemFmpPrivate->Handle,
864 &gEfiFirmwareManagementProtocolGuid,
865 &mSystemFmpPrivate->Fmp,
866 NULL
867 );
868 break;
869 case 1:
870 //
871 // Install System FMP protocol onto handle with matching FMP Protocol
872 //
873 DEBUG ((DEBUG_INFO, "SystemFirmwareUpdateDxe: Install System FMP onto matching FMP handle\n"));
874 mSystemFmpPrivate->Handle = HandleBuffer[0];
875 Status = gBS->InstallMultipleProtocolInterfaces (
876 &HandleBuffer[0],
877 &gSystemFmpProtocolGuid,
878 &mSystemFmpPrivate->Fmp,
879 NULL
880 );
881 break;
882 default:
883 //
884 // More than one matching handle is not expected. Unload driver.
885 //
886 DEBUG ((DEBUG_ERROR, "SystemFirmwareUpdateDxe: More than one matching FMP handle. Unload driver.\n"));
887 Status = EFI_DEVICE_ERROR;
888 break;
889 }
890
891 if (HandleBuffer != NULL) {
892 FreePool (HandleBuffer);
893 }
894
895 if (EFI_ERROR (Status)) {
896 FreePool (mSystemFmpPrivate);
897 mSystemFmpPrivate = NULL;
898 }
899
900 return Status;
901}
UINT64 UINTN
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
BOOLEAN EFIAPI ExtractSystemFirmwareImage(IN VOID *AuthenticatedImage, IN UINTN AuthenticatedImageSize, OUT VOID **SystemFirmwareImage, OUT UINTN *SystemFirmwareImageSize)
EFI_STATUS EFIAPI CapsuleAuthenticateSystemFirmware(IN VOID *Image, IN UINTN ImageSize, IN BOOLEAN ForceVersionMatch, OUT UINT32 *LastAttemptVersion, OUT UINT32 *LastAttemptStatus, OUT VOID **AuthenticatedImage, OUT UINTN *AuthenticatedImageSize)
BOOLEAN EFIAPI ExtractConfigImage(IN VOID *AuthenticatedImage, IN UINTN AuthenticatedImageSize, OUT VOID **ConfigImage, OUT UINTN *ConfigImageSize)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS)(IN UINTN Completion)
EFI_RUNTIME_SERVICES * gRT
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define PcdGetPtr(TokenName)
Definition: PcdLib.h:388
#define EFI_NOT_AVAILABLE_YET
Definition: PiMultiPhase.h:54
EFI_STATUS EFIAPI PerformFlashWriteWithProgress(IN PLATFORM_FIRMWARE_TYPE FirmwareType, IN EFI_PHYSICAL_ADDRESS FlashAddress, IN FLASH_ADDRESS_TYPE FlashAddressType, IN VOID *Buffer, IN UINTN Length, IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress OPTIONAL, IN UINTN StartPercentage, IN UINTN EndPercentage)
EFI_STATUS InitializePrivateData(IN SYSTEM_FMP_PRIVATE_DATA *SystemFmpPrivate)
#define SYSTEM_FMP_PRIVATE_DATA_FROM_FMP(a)
EFI_STATUS PerformUpdate(IN VOID *SystemFirmwareImage, IN UINTN SystemFirmwareImageSize, IN UPDATE_CONFIG_DATA *ConfigData, OUT UINT32 *LastAttemptVersion, OUT UINT32 *LastAttemptStatus, IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress, IN UINTN StartPercentage, IN UINTN EndPercentage)
EFI_HANDLE * FindMatchingFmpHandles(IN EFI_GUID *ProtocolGuid, OUT UINTN *HandleCount)
EFI_STATUS EFIAPI SetVariableHook(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data)
EFI_STATUS UninstallMatchingSystemFmpProtocols(VOID)
EFI_STATUS EFIAPI QueryVariableInfoHook(IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize)
EFI_STATUS ParseUpdateDataFile(IN UINT8 *DataBuffer, IN UINTN BufferSize, IN OUT CONFIG_HEADER *ConfigHeader, IN OUT UPDATE_CONFIG_DATA **UpdateArray)
EFI_STATUS EFIAPI GetVariableHook(IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data)
EFI_STATUS EFIAPI GetNextVariableNameHook(IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid)
EFI_STATUS SystemFirmwareAuthenticatedUpdate(IN VOID *Image, IN UINTN ImageSize, OUT UINT32 *LastAttemptVersion, OUT UINT32 *LastAttemptStatus, IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress)
EFI_STATUS EFIAPI SystemFirmwareUpdateMainDxe(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_FIRMWARE_IMAGE_DESCRIPTOR * GetFmpImageDescriptors(IN EFI_HANDLE Handle, IN EFI_GUID *ProtocolGuid, OUT UINT8 *FmpImageInfoCount, OUT UINTN *DescriptorSize)
EFI_STATUS UpdateImage(IN VOID *SystemFirmwareImage, IN UINTN SystemFirmwareImageSize, IN VOID *ConfigImage, IN UINTN ConfigImageSize, OUT UINT32 *LastAttemptVersion, OUT UINT32 *LastAttemptStatus, IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress)
EFI_STATUS EFIAPI FmpSetImage(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, IN UINT8 ImageIndex, IN CONST VOID *Image, IN UINTN ImageSize, IN CONST VOID *VendorCode, IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress, OUT CHAR16 **AbortReason)
#define LAST_ATTEMPT_STATUS_SUCCESS
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
#define EFI_VARIABLE_NON_VOLATILE
@ ByProtocol
Definition: UefiSpec.h:1518
EFI_TABLE_HEADER Hdr
Definition: UefiSpec.h:1868
Definition: Base.h:213