MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / BdsProcessCapsules

Function BdsProcessCapsules

CloverEFI/OsxBdsDxe/Capsules.c:36–227  ·  view source on GitHub ↗

This routine is called to see if there are any capsules we need to process. If the boot mode is not UPDATE, then we do nothing. Otherwise find the capsule HOBS and produce firmware volumes for them via the DXE service. Then call the dispatcher to dispatch drivers from them. Finally, check the status of the updates. This function should be called by BDS in case we need to do some

Source from the content-addressed store, hash-verified

34
35**/
36EFI_STATUS
37EFIAPI
38BdsProcessCapsules (
39 EFI_BOOT_MODE BootMode
40 )
41{
42 EFI_STATUS Status;
43 EFI_PEI_HOB_POINTERS HobPointer;
44 EFI_CAPSULE_HEADER *CapsuleHeader;
45 UINT32 Size;
46 UINT32 CapsuleNumber;
47 UINT32 CapsuleTotalNumber;
48 EFI_CAPSULE_TABLE *CapsuleTable;
49 UINT32 Index;
50 UINT32 CacheIndex;
51 UINT32 CacheNumber;
52 VOID **CapsulePtr;
53 VOID **CapsulePtrCache;
54 EFI_GUID *CapsuleGuidCache;
55 BOOLEAN NeedReset;
56
57 CapsuleNumber = 0;
58 CapsuleTotalNumber = 0;
59 CacheIndex = 0;
60 CacheNumber = 0;
61 CapsulePtr = NULL;
62 CapsulePtrCache = NULL;
63 CapsuleGuidCache = NULL;
64 NeedReset = FALSE;
65
66 //
67 // We don't do anything else if the boot mode is not flash-update
68 //
69 if (BootMode != BOOT_ON_FLASH_UPDATE) {
70 return EFI_INVALID_PARAMETER;
71 }
72
73 Status = EFI_SUCCESS;
74 //
75 // Find all capsule images from hob
76 //
77 HobPointer.Raw = GetHobList ();
78 while ((HobPointer.Raw = GetNextHob (EFI_HOB_TYPE_UEFI_CAPSULE, HobPointer.Raw)) != NULL) {
79 CapsuleTotalNumber ++;
80 HobPointer.Raw = GET_NEXT_HOB (HobPointer);
81 }
82
83 if (CapsuleTotalNumber == 0) {
84 //
85 // We didn't find a hob, so had no errors.
86 //
87 PlatformBdsLockNonUpdatableFlash ();
88 return EFI_SUCCESS;
89 }
90
91 //
92 // Init temp Capsule Data table.
93 //

Callers

nothing calls this directly

Calls 9

PrintFunction · 0.85
StallMethod · 0.80
AllocateZeroPoolFunction · 0.50
CompareGuidFunction · 0.50
CopyMemFunction · 0.50
ProcessCapsuleImageFunction · 0.50
CpuDeadLoopFunction · 0.50
FreePoolFunction · 0.50

Tested by

no test coverage detected