11#define PLATFORM_OVERRIDE_ITEM_SIGNATURE SIGNATURE_32('p','d','o','i')
24#define DRIVER_IMAGE_INFO_SIGNATURE SIGNATURE_32('p','d','i','i')
34#define DEVICE_PATH_STACK_ITEM_SIGNATURE SIGNATURE_32('d','p','s','i')
60 ASSERT (DevicePathStackItem !=
NULL);
61 DevicePathStackItem->Signature = DEVICE_PATH_STACK_ITEM_SIGNATURE;
85 ItemListIndex = mDevicePathStack.BackLink;
89 if (ItemListIndex != &mDevicePathStack) {
91 if (DevicePath !=
NULL) {
95 FreePool (DevicePathStackItem->DevicePath);
101 return EFI_NOT_FOUND;
121 UINTN DevicePathSize;
123 ItemListIndex = mDevicePathStack.BackLink;
124 while (ItemListIndex != &mDevicePathStack) {
128 if (
CompareMem (DevicePath, DevicePathStackItem->DevicePath, DevicePathSize) == 0) {
133 ItemListIndex = ItemListIndex->BackLink;
178 EFI_FV_FILETYPE Type;
181 UINT32 AuthenticationStatus;
190 if (DevicePath ==
NULL) {
191 return EFI_INVALID_PARAMETER;
194 if (*DevicePath ==
NULL) {
195 return EFI_INVALID_PARAMETER;
201 TempDevicePath = *DevicePath;
202 LastDeviceNode = TempDevicePath;
204 LastDeviceNode = TempDevicePath;
209 if (GuidPoint ==
NULL) {
213 return EFI_UNSUPPORTED;
216 if (FileGuid !=
NULL) {
221 return EFI_UNSUPPORTED;
224 FileGuid = GuidPoint;
230 TempDevicePath = *DevicePath;
247 return EFI_UNSUPPORTED;
253 TempDevicePath = *DevicePath;
254 FoundFvHandle =
NULL;
255 Status =
gBS->LocateDevicePath (
256 &gEfiFirmwareVolume2ProtocolGuid,
260 if (!EFI_ERROR (Status)) {
261 Status =
gBS->HandleProtocol (
263 &gEfiFirmwareVolume2ProtocolGuid,
266 if (!EFI_ERROR (Status)) {
270 Status = Fv->ReadFile (
277 &AuthenticationStatus
279 if (!EFI_ERROR (Status)) {
280 return EFI_ALREADY_STARTED;
290 FoundFvHandle =
NULL;
291 Status =
gBS->HandleProtocol (
293 &gEfiLoadedImageProtocolGuid,
294 (
VOID **)&LoadedImage
296 if (!EFI_ERROR (Status)) {
297 Status =
gBS->HandleProtocol (
299 &gEfiFirmwareVolume2ProtocolGuid,
302 if (!EFI_ERROR (Status)) {
303 Status = Fv->ReadFile (
310 &AuthenticationStatus
312 if (!EFI_ERROR (Status)) {
323 gBS->LocateHandleBuffer (
325 &gEfiFirmwareVolume2ProtocolGuid,
330 for (Index = 0; Index < FvHandleCount; Index++) {
331 gBS->HandleProtocol (
332 FvHandleBuffer[Index],
333 &gEfiFirmwareVolume2ProtocolGuid,
337 Status = Fv->ReadFile (
344 &AuthenticationStatus
346 if (EFI_ERROR (Status)) {
354 FoundFvHandle = FvHandleBuffer[Index];
367 *DevicePath = NewDevicePath;
371 return EFI_NOT_FOUND;
408 Status =
gRT->GetVariable (Name, VendorGuid,
NULL, &BufferSize, Buffer);
409 if (Status == EFI_BUFFER_TOO_SMALL) {
414 if (Buffer ==
NULL) {
421 Status =
gRT->GetVariable (Name, VendorGuid,
NULL, &BufferSize, Buffer);
422 if (EFI_ERROR (Status)) {
427 *VariableSize = BufferSize;
465 if (DevicePathToConnect ==
NULL) {
470 CopyOfDevicePath = DevicePath;
471 if (DevicePath ==
NULL) {
472 return EFI_OUT_OF_RESOURCES;
483 ASSERT (Instance !=
NULL);
495 PreviousHandle =
NULL;
502 RemainingDevicePath = Instance;
503 Status =
gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle);
505 if (!EFI_ERROR (Status)) {
506 if (Handle == PreviousHandle) {
514 Status =
gDS->Dispatch ();
517 if (!EFI_ERROR (Status)) {
518 PreviousHandle = Handle;
534 gBS->ConnectController (Handle,
NULL, RemainingDevicePath,
FALSE);
541 }
while (!EFI_ERROR (Status) && !
IsDevicePathEnd (RemainingDevicePath));
542 }
while (DevicePath !=
NULL);
544 if (CopyOfDevicePath !=
NULL) {
574 if (MappingDataBase ==
NULL) {
575 return EFI_INVALID_PARAMETER;
579 while (!
IsNull (MappingDataBase, OverrideItemListIndex)) {
584 if (OverrideItem->ControllerDevicePath !=
NULL) {
585 FreePool (OverrideItem->ControllerDevicePath);
593 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
594 if (DriverImageInfo->DriverImagePath !=
NULL) {
595 FreePool (DriverImageInfo->DriverImagePath);
609 OverrideItemListIndex =
GetNextNode (MappingDataBase, OverrideItemListIndex);
667 VOID *VariableBuffer;
668 UINT8 *VariableIndex;
670 CHAR16 OverrideVariableName[40];
681 if (MappingDataBase ==
NULL) {
682 return EFI_INVALID_PARAMETER;
689 ASSERT ((
UINTN)VariableBuffer %
sizeof (
UINTN) == 0);
690 if (VariableBuffer ==
NULL) {
691 return EFI_NOT_FOUND;
701 VariableIndex = VariableBuffer;
702 if (VariableIndex +
sizeof (UINT32) > (UINT8 *)VariableBuffer + BufferSize) {
708 NotEnd = *(UINT32 *)VariableIndex;
715 VariableIndex = VariableIndex +
sizeof (UINT32);
716 while (VariableIndex < ((UINT8 *)VariableBuffer + BufferSize)) {
720 if (VariableIndex +
sizeof (UINT32) > (UINT8 *)VariableBuffer + BufferSize) {
725 Signature = *(UINT32 *)VariableIndex;
726 if (Signature != PLATFORM_OVERRIDE_ITEM_SIGNATURE) {
735 ASSERT (OverrideItem !=
NULL);
736 OverrideItem->Signature = PLATFORM_OVERRIDE_ITEM_SIGNATURE;
738 VariableIndex = VariableIndex +
sizeof (UINT32);
742 if (VariableIndex +
sizeof (UINT32) >= (UINT8 *)VariableBuffer + BufferSize) {
747 DriverNumber = *(UINT32 *)VariableIndex;
748 OverrideItem->DriverInfoNum = DriverNumber;
749 VariableIndex = VariableIndex +
sizeof (UINT32);
759 VariableIndex += ((
sizeof (UINT32) - ((
UINTN)(VariableIndex))) & (
sizeof (UINT32) - 1));
763 if ((OverrideItem->ControllerDevicePath ==
NULL) || (VariableIndex < (UINT8 *)ControllerDevicePath) ||
764 (VariableIndex > (UINT8 *)VariableBuffer + BufferSize))
773 for (Index = 0; Index < DriverNumber; Index++) {
778 ASSERT (DriverImageInfo !=
NULL);
779 DriverImageInfo->Signature = DRIVER_IMAGE_INFO_SIGNATURE;
787 VariableIndex += ((
sizeof (UINT32) - ((
UINTN)(VariableIndex))) & (
sizeof (UINT32) - 1));
794 if ((DriverImageInfo->DriverImagePath ==
NULL) || (VariableIndex < (UINT8 *)DriverDevicePath) ||
795 (VariableIndex > (UINT8 *)VariableBuffer + BufferSize))
811 return EFI_VOLUME_CORRUPTED;
819 UnicodeSPrint (OverrideVariableName,
sizeof (OverrideVariableName), L
"PlatDriOver%d", VariableNum++);
820 VariableBuffer =
GetVariableAndSize (OverrideVariableName, &gEfiCallerIdGuid, &BufferSize);
821 ASSERT ((
UINTN)VariableBuffer %
sizeof (
UINTN) == 0);
822 if (VariableBuffer ==
NULL) {
824 return EFI_VOLUME_CORRUPTED;
827 }
while (NotEnd != 0);
850 UINTN DevicePathSize;
854 NeededSize +=
sizeof (UINT32);
855 NeededSize +=
sizeof (UINT32);
857 NeededSize += DevicePathSize;
861 NeededSize += ((
sizeof (UINT32) - DevicePathSize) & (
sizeof (UINT32) - 1));
867 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
869 NeededSize += DevicePathSize;
873 NeededSize += ((
sizeof (UINT32) - DevicePathSize) & (
sizeof (UINT32) - 1));
895 VOID *VariableBuffer;
899 CHAR16 OverrideVariableName[40];
907 if (VariableBuffer ==
NULL) {
908 return EFI_NOT_FOUND;
914 while ((VariableBuffer !=
NULL) && ((*(UINT32 *)VariableBuffer) != 0)) {
916 UnicodeSPrint (OverrideVariableName,
sizeof (OverrideVariableName), L
"PlatDriOver%d", VariableNum);
917 VariableBuffer =
GetVariableAndSize (OverrideVariableName, &gEfiCallerIdGuid, &BufferSize);
924 Status =
gRT->SetVariable (
931 ASSERT (!EFI_ERROR (Status));
932 for (Index = 1; Index < VariableNum; Index++) {
933 UnicodeSPrint (OverrideVariableName,
sizeof (OverrideVariableName), L
"PlatDriOver%d", Index);
934 Status =
gRT->SetVariable (
935 OverrideVariableName,
941 ASSERT (!EFI_ERROR (Status));
963 VOID *VariableBuffer;
964 UINT8 *VariableIndex;
966 CHAR16 OverrideVariableName[40];
973 UINTN VariableNeededSize;
974 UINT64 MaximumVariableStorageSize;
975 UINT64 RemainingVariableStorageSize;
976 UINT64 MaximumVariableSize;
977 UINTN OneItemNeededSize;
979 if (MappingDataBase ==
NULL) {
980 return EFI_INVALID_PARAMETER;
991 gRT->QueryVariableInfo (
993 &MaximumVariableStorageSize,
994 &RemainingVariableStorageSize,
1000 while (!
IsNull (MappingDataBase, OverrideItemListIndex)) {
1005 VariableNeededSize =
sizeof (UINT32);
1006 ItemIndex = OverrideItemListIndex;
1011 while (!
IsNull (MappingDataBase, ItemIndex)) {
1017 if ((VariableNeededSize +
1020 ) >= MaximumVariableSize
1027 VariableNeededSize += OneItemNeededSize;
1028 ItemIndex =
GetNextNode (MappingDataBase, ItemIndex);
1032 if (VariableNeededSize ==
sizeof (UINT32)) {
1036 return EFI_OUT_OF_RESOURCES;
1045 ASSERT (VariableBuffer !=
NULL);
1046 ASSERT ((
UINTN)VariableBuffer %
sizeof (
UINTN) == 0);
1051 VariableIndex = VariableBuffer;
1052 *(UINT32 *)VariableIndex = NotEnd;
1053 VariableIndex +=
sizeof (UINT32);
1057 while (OverrideItemListIndex != ItemIndex) {
1058 *(UINT32 *)VariableIndex = PLATFORM_OVERRIDE_ITEM_SIGNATURE;
1059 VariableIndex +=
sizeof (UINT32);
1062 *(UINT32 *)VariableIndex = OverrideItem->DriverInfoNum;
1063 VariableIndex += sizeof (UINT32);
1065 CopyMem (VariableIndex, OverrideItem->ControllerDevicePath,
GetDevicePathSize (OverrideItem->ControllerDevicePath));
1071 VariableIndex += ((
sizeof (UINT32) - ((
UINTN)(VariableIndex))) & (
sizeof (UINT32) - 1));
1077 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
1083 VariableIndex += ((
sizeof (UINT32) - ((
UINTN)(VariableIndex))) & (
sizeof (UINT32) - 1));
1087 OverrideItemListIndex =
GetNextNode (MappingDataBase, OverrideItemListIndex);
1090 ASSERT (((
UINTN)VariableIndex - (
UINTN)VariableBuffer) == VariableNeededSize);
1092 if (NumIndex == 0) {
1093 UnicodeSPrint (OverrideVariableName,
sizeof (OverrideVariableName), L
"PlatDriOver");
1095 UnicodeSPrint (OverrideVariableName,
sizeof (OverrideVariableName), L
"PlatDriOver%d", NumIndex);
1098 Status =
gRT->SetVariable (
1099 OverrideVariableName,
1107 if (EFI_ERROR (Status)) {
1144 UINTN DriverBindingHandleCount;
1148 if ((BindingHandle ==
NULL) || (ImageHandle ==
NULL)) {
1155 DriverBindingHandleCount = 0;
1156 Status =
gBS->LocateHandleBuffer (
1158 &gEfiDriverBindingProtocolGuid,
1160 &DriverBindingHandleCount,
1161 &DriverBindingHandleBuffer
1163 if (EFI_ERROR (Status) || (DriverBindingHandleCount == 0)) {
1167 for (Index = 0; Index < DriverBindingHandleCount; Index++) {
1168 DriverBindingInterface =
NULL;
1169 Status =
gBS->OpenProtocol (
1170 DriverBindingHandleBuffer[Index],
1171 &gEfiDriverBindingProtocolGuid,
1172 (
VOID **)&DriverBindingInterface,
1175 EFI_OPEN_PROTOCOL_GET_PROTOCOL
1177 if (EFI_ERROR (Status)) {
1181 if (DriverBindingInterface->ImageHandle == ImageHandle) {
1182 *BindingHandle = DriverBindingHandleBuffer[Index];
1183 FreePool (DriverBindingHandleBuffer);
1184 return DriverBindingInterface;
1191 FreePool (DriverBindingHandleBuffer);
1192 *BindingHandle =
NULL;
1209 Tpl =
gBS->RaiseTPL (TPL_HIGH_LEVEL);
1210 gBS->RestoreTPL (Tpl);
1251 BOOLEAN ControllerFound;
1254 UINTN ImageHandleCount;
1258 BOOLEAN FoundLastReturned;
1268 UINTN DevicePathSize;
1273 if (ControllerHandle ==
NULL) {
1274 return EFI_INVALID_PARAMETER;
1280 Status =
gBS->HandleProtocol (
1282 &gEfiDevicePathProtocolGuid,
1283 (
VOID **)&ControllerDevicePath
1285 if (EFI_ERROR (Status) || (ControllerDevicePath ==
NULL)) {
1286 return EFI_INVALID_PARAMETER;
1292 OverrideItem =
NULL;
1293 ControllerFound =
FALSE;
1296 OverrideItemListIndex =
GetFirstNode (MappingDataBase);
1297 while (!
IsNull (MappingDataBase, OverrideItemListIndex)) {
1301 ControllerDevicePath,
1302 OverrideItem->ControllerDevicePath,
1307 ControllerFound =
TRUE;
1312 OverrideItemListIndex =
GetNextNode (MappingDataBase, OverrideItemListIndex);
1315 if (!ControllerFound || (OverrideItem ==
NULL)) {
1316 return EFI_NOT_FOUND;
1323 if (*DriverImageHandle !=
NULL) {
1324 if (*DriverImageHandle != OverrideItem->LastReturnedImageHandle) {
1325 return EFI_INVALID_PARAMETER;
1339 return EFI_UNSUPPORTED;
1349 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
1350 if (DriverImageInfo->ImageHandle ==
NULL) {
1354 if ((!DriverImageInfo->UnLoadable) && ((!DriverImageInfo->UnStartable))) {
1355 TempDriverImagePath = DriverImageInfo->DriverImagePath;
1363 if (!EFI_ERROR (Status)) {
1364 FreePool (DriverImageInfo->DriverImagePath);
1365 DriverImageInfo->DriverImagePath = TempDriverImagePath;
1372 ImageHandleCount = 0;
1373 Status =
gBS->LocateHandleBuffer (
1375 &gEfiLoadedImageProtocolGuid,
1380 if (EFI_ERROR (Status) || (ImageHandleCount == 0)) {
1381 return EFI_NOT_FOUND;
1384 for (Index = 0; Index < ImageHandleCount; Index++) {
1388 LoadedImageDevicePath =
NULL;
1389 Status =
gBS->HandleProtocol (
1390 ImageHandleBuffer[Index],
1391 &gEfiLoadedImageDevicePathProtocolGuid,
1392 (
VOID **)&LoadedImageDevicePath
1394 if (EFI_ERROR (Status)) {
1404 DriverImageInfo->DriverImagePath,
1405 LoadedImageDevicePath,
1421 DriverBindingHandle =
NULL;
1423 ImageHandleBuffer[Index],
1424 &DriverBindingHandle
1426 ASSERT (DriverBinding !=
NULL);
1427 DriverImageInfo->ImageHandle = ImageHandleBuffer[Index];
1443 TempDriverImagePath = DriverImageInfo->DriverImagePath;
1444 gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &TempDriverImagePath, &Handle);
1448 Status =
gBS->HandleProtocol (
1450 &gEfiBusSpecificDriverOverrideProtocolGuid,
1451 (
VOID **)&BusSpecificDriverOverride
1453 if (!EFI_ERROR (Status) && (BusSpecificDriverOverride !=
NULL)) {
1455 Status = BusSpecificDriverOverride->GetDriver (
1456 BusSpecificDriverOverride,
1459 if (!EFI_ERROR (Status)) {
1464 DriverBindingHandle =
NULL;
1467 &DriverBindingHandle
1469 ASSERT (DriverBinding !=
NULL);
1470 DriverImageInfo->ImageHandle = ImageHandle;
1478 TempDriverImagePath = DriverImageInfo->DriverImagePath;
1479 gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &TempDriverImagePath, &Handle);
1480 if (((
DevicePathType (TempDriverImagePath) == MEDIA_DEVICE_PATH) &&
1488 TempDriverImagePath = DriverImageInfo->DriverImagePath;
1489 Status =
gBS->LoadImage (
1492 TempDriverImagePath,
1497 if (!EFI_ERROR (Status)) {
1501 Status =
gBS->StartImage (ImageHandle,
NULL,
NULL);
1502 if (EFI_ERROR (Status)) {
1503 DriverImageInfo->UnStartable =
TRUE;
1504 DriverImageInfo->ImageHandle =
NULL;
1510 DriverBindingHandle =
NULL;
1513 &DriverBindingHandle
1515 ASSERT (DriverBinding !=
NULL);
1516 DriverImageInfo->ImageHandle = ImageHandle;
1525 if (Status == EFI_SECURITY_VIOLATION) {
1526 gBS->UnloadImage (ImageHandle);
1529 DriverImageInfo->UnLoadable =
TRUE;
1530 DriverImageInfo->ImageHandle =
NULL;
1550 FoundLastReturned =
FALSE;
1553 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
1554 if (DriverImageInfo->ImageHandle !=
NULL) {
1555 if ((*DriverImageHandle ==
NULL) || FoundLastReturned) {
1561 OverrideItem->LastReturnedImageHandle = DriverImageInfo->ImageHandle;
1562 *DriverImageHandle = DriverImageInfo->ImageHandle;
1564 }
else if (*DriverImageHandle == DriverImageInfo->ImageHandle) {
1568 FoundLastReturned =
TRUE;
1575 return EFI_NOT_FOUND;
1601 OUT UINT32 *DriverInfoNum OPTIONAL,
1602 OUT UINT32 *DriverImageNO OPTIONAL
1611 UINTN DevicePathSize;
1613 if (ControllerDevicePath ==
NULL) {
1614 return EFI_INVALID_PARAMETER;
1617 if (MappingDataBase ==
NULL) {
1618 return EFI_INVALID_PARAMETER;
1625 OverrideItem =
NULL;
1626 OverrideItemListIndex =
GetFirstNode (MappingDataBase);
1627 while (!
IsNull (MappingDataBase, OverrideItemListIndex)) {
1632 ControllerDevicePath,
1633 OverrideItem->ControllerDevicePath,
1643 OverrideItemListIndex =
GetNextNode (MappingDataBase, OverrideItemListIndex);
1646 if (!Found || (OverrideItem ==
NULL)) {
1650 return EFI_NOT_FOUND;
1653 ASSERT (OverrideItem->DriverInfoNum != 0);
1654 if (DriverInfoNum !=
NULL) {
1655 *DriverInfoNum = OverrideItem->DriverInfoNum;
1662 if (DriverImageDevicePath ==
NULL) {
1673 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
1678 DriverImageDevicePath,
1679 DriverImageInfo->DriverImagePath,
1696 return EFI_NOT_FOUND;
1698 if (DriverImageNO !=
NULL) {
1699 *DriverImageNO = ImageNO;
1732 IN UINT32 DriverImageNO
1742 UINTN DevicePathSize;
1744 if (ControllerDevicePath ==
NULL) {
1745 return EFI_INVALID_PARAMETER;
1748 if (DriverImageDevicePath ==
NULL) {
1749 return EFI_INVALID_PARAMETER;
1752 if (MappingDataBase ==
NULL) {
1753 return EFI_INVALID_PARAMETER;
1761 ControllerDevicePath,
1762 DriverImageDevicePath,
1768 return EFI_ALREADY_STARTED;
1775 OverrideItem =
NULL;
1776 OverrideItemListIndex =
GetFirstNode (MappingDataBase);
1777 while (!
IsNull (MappingDataBase, OverrideItemListIndex)) {
1782 ControllerDevicePath,
1783 OverrideItem->ControllerDevicePath,
1793 OverrideItemListIndex =
GetNextNode (MappingDataBase, OverrideItemListIndex);
1802 if (OverrideItem ==
NULL) {
1803 ASSERT (OverrideItem !=
NULL);
1804 return EFI_OUT_OF_RESOURCES;
1807 OverrideItem->Signature = PLATFORM_OVERRIDE_ITEM_SIGNATURE;
1813 if (OverrideItem ==
NULL) {
1814 return EFI_NOT_FOUND;
1821 if (DriverImageInfo ==
NULL) {
1822 ASSERT (DriverImageInfo !=
NULL);
1823 return EFI_OUT_OF_RESOURCES;
1826 DriverImageInfo->Signature = DRIVER_IMAGE_INFO_SIGNATURE;
1835 if (ImageNO == (DriverImageNO - 1)) {
1840 OverrideItem->DriverInfoNum++;
1854 OverrideItem->DriverInfoNum++;
1889 UINTN DevicePathSize;
1891 if (ControllerDevicePath ==
NULL) {
1892 return EFI_INVALID_PARAMETER;
1895 if (MappingDataBase ==
NULL) {
1896 return EFI_INVALID_PARAMETER;
1903 ControllerDevicePath,
1904 DriverImageDevicePath,
1909 if (EFI_ERROR (Status)) {
1910 return EFI_NOT_FOUND;
1917 OverrideItem =
NULL;
1918 OverrideItemListIndex =
GetFirstNode (MappingDataBase);
1919 while (!
IsNull (MappingDataBase, OverrideItemListIndex)) {
1924 ControllerDevicePath,
1925 OverrideItem->ControllerDevicePath,
1935 OverrideItemListIndex =
GetNextNode (MappingDataBase, OverrideItemListIndex);
1946 DriverImageInfo =
CR (ImageInfoListIndex,
DRIVER_IMAGE_INFO, Link, DRIVER_IMAGE_INFO_SIGNATURE);
1948 if (DriverImageDevicePath !=
NULL) {
1955 DriverImageDevicePath,
1956 DriverImageInfo->DriverImagePath,
1962 FreePool (DriverImageInfo->DriverImagePath);
1964 OverrideItem->DriverInfoNum--;
1973 FreePool (DriverImageInfo->DriverImagePath);
1975 OverrideItem->DriverInfoNum--;
1983 if (DriverImageDevicePath ==
NULL) {
1984 ASSERT (OverrideItem->DriverInfoNum == 0);
1990 if (OverrideItem->DriverInfoNum == 0) {
1991 FreePool (OverrideItem->ControllerDevicePath);
2002 return EFI_NOT_FOUND;
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
#define MEDIA_FILEPATH_DP
#define HARDWARE_DEVICE_PATH
UINT8 EFIAPI DevicePathType(IN CONST VOID *Node)
UINT8 EFIAPI DevicePathSubType(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI AppendDevicePathNode(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL)
BOOLEAN EFIAPI IsDevicePathEnd(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI NextDevicePathNode(IN CONST VOID *Node)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DevicePathFromHandle(IN EFI_HANDLE Handle)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI GetNextDevicePathInstance(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT UINTN *Size)
UINTN EFIAPI GetDevicePathSize(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DuplicateDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
BOOLEAN EFIAPI IsDevicePathEndType(IN CONST VOID *Node)
VOID EFIAPI SetDevicePathEndNode(OUT VOID *Node)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
EFI_RUNTIME_SERVICES * gRT
#define CR(Record, TYPE, Field, TestSignature)
UINT32 EFI_FV_FILE_ATTRIBUTES
VOID *EFIAPI GetVariableAndSize(IN CHAR16 *Name, IN EFI_GUID *VendorGuid, OUT UINTN *VariableSize)
BOOLEAN EFIAPI CheckExistInStack(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS EFIAPI DeleteDriverImage(IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath, IN LIST_ENTRY *MappingDataBase)
EFI_TPL GetCurrentTpl(VOID)
EFI_STATUS EFIAPI PushDevPathStack(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS EFIAPI PopDevPathStack(OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
EFI_STATUS EFIAPI DeleteOverridesVariables(VOID)
EFI_STATUS EFIAPI FreeMappingDatabase(IN OUT LIST_ENTRY *MappingDataBase)
EFI_STATUS EFIAPI SaveOverridesMapping(IN LIST_ENTRY *MappingDataBase)
EFI_STATUS EFIAPI CheckMapping(IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath OPTIONAL, IN LIST_ENTRY *MappingDataBase, OUT UINT32 *DriverInfoNum OPTIONAL, OUT UINT32 *DriverImageNO OPTIONAL)
EFI_STATUS EFIAPI ConnectDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect)
EFI_STATUS EFIAPI InsertDriverImage(IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath, IN LIST_ENTRY *MappingDataBase, IN UINT32 DriverImageNO)
EFI_STATUS EFIAPI InitOverridesMapping(OUT LIST_ENTRY *MappingDataBase)
EFI_DRIVER_BINDING_PROTOCOL *EFIAPI GetBindingProtocolFromImageHandle(IN EFI_HANDLE ImageHandle, OUT EFI_HANDLE *BindingHandle)
UINTN EFIAPI GetOneItemNeededSize(IN LIST_ENTRY *OverrideItemListIndex)
EFI_STATUS EFIAPI GetDriverFromMapping(IN EFI_HANDLE ControllerHandle, IN OUT EFI_HANDLE *DriverImageHandle, IN LIST_ENTRY *MappingDataBase, IN EFI_HANDLE CallerImageHandle)
EFI_STATUS EFIAPI UpdateFvFileDevicePath(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_GUID *FileGuid, IN EFI_HANDLE CallerImageHandle)
VOID EFIAPI Exit(IN EFI_STATUS Status)
VOID EFIAPI EfiInitializeFwVolDevicepathNode(IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode, IN CONST EFI_GUID *NameGuid)
EFI_GUID *EFIAPI EfiGetNameGuidFromFwVolDevicePathNode(IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode)
#define EFI_VARIABLE_NON_VOLATILE
LIST_ENTRY DriverInfoList
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.