24UINTN mNumberOfPciRomImages = 0;
25UINTN mMaxNumberOfPciRomImages = 0;
53 for (Index = 0; Index < mNumberOfPciRomImages; Index++) {
54 if ((mRomImageTable[Index].Seg == Seg) &&
55 (mRomImageTable[Index].Bus == Bus) &&
56 (mRomImageTable[Index].Dev == Dev) &&
57 (mRomImageTable[Index].Func == Func))
68 if (Index == mNumberOfPciRomImages) {
72 if (mNumberOfPciRomImages == mMaxNumberOfPciRomImages) {
78 if (NewTable ==
NULL) {
82 mRomImageTable = NewTable;
83 mMaxNumberOfPciRomImages += 0x20;
89 mRomImageTable[Index].Seg = Seg;
90 mRomImageTable[Index].Bus = Bus;
91 mRomImageTable[Index].Dev = Dev;
92 mRomImageTable[Index].Func = Func;
93 mNumberOfPciRomImages++;
96 mRomImageTable[Index].ImageHandle = ImageHandle;
97 mRomImageTable[Index].RomImage = RomImage;
98 mRomImageTable[Index].RomSize = RomSize;
118 PciRootBridgeIo = PciIoDevice->PciRootBridgeIo;
120 for (Index = 0; Index < mNumberOfPciRomImages; Index++) {
121 if ((mRomImageTable[Index].Seg == PciRootBridgeIo->
SegmentNumber) &&
122 (mRomImageTable[Index].Bus == PciIoDevice->BusNumber) &&
123 (mRomImageTable[Index].Dev == PciIoDevice->DeviceNumber) &&
124 (mRomImageTable[Index].Func == PciIoDevice->FunctionNumber))
126 if (mRomImageTable[Index].ImageHandle !=
NULL) {
127 AddDriver (PciIoDevice, mRomImageTable[Index].ImageHandle,
NULL);
130 PciIoDevice->PciIo.RomImage = mRomImageTable[Index].RomImage;
131 PciIoDevice->PciIo.RomSize = mRomImageTable[Index].RomSize;
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
EFI_STATUS AddDriver(IN PCI_IO_DEVICE *PciIoDevice, IN EFI_HANDLE DriverImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath)
BOOLEAN PciRomGetImageMapping(IN PCI_IO_DEVICE *PciIoDevice)
VOID PciRomAddImageMapping(IN EFI_HANDLE ImageHandle, IN UINTN Seg, IN UINT8 Bus, IN UINT8 Dev, IN UINT8 Func, IN VOID *RomImage, IN UINT64 RomSize)