From c6f293af971dc501b69c18c9e1aa7120ab802d95 Mon Sep 17 00:00:00 2001 From: jljusten Date: Fri, 26 Feb 2010 00:30:20 +0000 Subject: DuetPkg: Fix build break caused by EFI_SPECIFICATION_VERSION usage The EFI_SPECIFICATION_VERSION MACRO is no longer defined in edk2 builds, and this module does not need to support the older < UEFI 2.0 code path. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10096 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c | 118 --------------------- 1 file changed, 118 deletions(-) (limited to 'DuetPkg/PciBusNoEnumerationDxe') diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c b/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c index 17bf212a19..9d9c475aae 100644 --- a/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c +++ b/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c @@ -138,16 +138,6 @@ Returns: EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; PCI_DRIVER_OVERRIDE_LIST *Node; -#if (EFI_SPECIFICATION_VERSION < 0x00020000) - EFI_DRIVER_OS_HANDOFF_HEADER *DriverOsHandoffHeader; - EFI_DRIVER_OS_HANDOFF_HEADER *NewDriverOsHandoffHeader; - EFI_DRIVER_OS_HANDOFF *DriverOsHandoff; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - EFI_HANDLE DeviceHandle; - UINTN NumberOfEntries; - UINTN Size; - UINTN Index; -#endif Status = gBS->HandleProtocol (DriverImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **) &LoadedImage); if (EFI_ERROR (Status)) { @@ -182,113 +172,5 @@ Returns: return EFI_SUCCESS; } -#if (EFI_SPECIFICATION_VERSION < 0x00020000) - DriverOsHandoffHeader = NULL; - Status = EfiLibGetSystemConfigurationTable (&gEfiUgaIoProtocolGuid, (VOID **) &DriverOsHandoffHeader); - if (!EFI_ERROR (Status) && DriverOsHandoffHeader != NULL) { - for (Index = 0; Index < DriverOsHandoffHeader->NumberOfEntries; Index++) { - DriverOsHandoff = (EFI_DRIVER_OS_HANDOFF *)((UINTN)(DriverOsHandoffHeader) + - DriverOsHandoffHeader->HeaderSize + - Index * DriverOsHandoffHeader->SizeOfEntries); - DevicePath = DriverOsHandoff->DevicePath; - Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &DevicePath, &DeviceHandle); - if (!EFI_ERROR (Status) && DeviceHandle != NULL && IsDevicePathEnd (DevicePath)) { - if (DeviceHandle == PciIoDevice->Handle) { - return EFI_SUCCESS; - } - } - } - - NumberOfEntries = DriverOsHandoffHeader->NumberOfEntries + 1; - } else { - NumberOfEntries = 1; - } - - Status = gBS->AllocatePool ( - EfiRuntimeServicesData, - sizeof (EFI_DRIVER_OS_HANDOFF_HEADER) + NumberOfEntries * sizeof (EFI_DRIVER_OS_HANDOFF), - (VOID **) &NewDriverOsHandoffHeader - ); - if (EFI_ERROR (Status)) { - return Status; - } - - if (DriverOsHandoffHeader == NULL) { - NewDriverOsHandoffHeader->Version = 0; - NewDriverOsHandoffHeader->HeaderSize = sizeof (EFI_DRIVER_OS_HANDOFF_HEADER); - NewDriverOsHandoffHeader->SizeOfEntries = sizeof (EFI_DRIVER_OS_HANDOFF); - NewDriverOsHandoffHeader->NumberOfEntries = (UINT32) NumberOfEntries; - } else { - gBS->CopyMem ( - NewDriverOsHandoffHeader, - DriverOsHandoffHeader, - DriverOsHandoffHeader->HeaderSize + (NumberOfEntries - 1) * DriverOsHandoffHeader->SizeOfEntries - ); - NewDriverOsHandoffHeader->NumberOfEntries = (UINT32) NumberOfEntries; - } - - DriverOsHandoff = (EFI_DRIVER_OS_HANDOFF *)((UINTN)NewDriverOsHandoffHeader + - NewDriverOsHandoffHeader->HeaderSize + - (NumberOfEntries - 1) * NewDriverOsHandoffHeader->SizeOfEntries); - - // - // Fill in the EFI_DRIVER_OS_HANDOFF structure - // - DriverOsHandoff->Type = EfiUgaDriverFromPciRom; - - // - // Compute the size of the device path - // - Size = EfiDevicePathSize (PciIoDevice->DevicePath); - if (Size == 0) { - DriverOsHandoff->DevicePath = NULL; - } else { - - // - // Allocate space for duplicate device path - // - Status = gBS->AllocatePool ( - EfiRuntimeServicesData, - Size, - (VOID **) &DriverOsHandoff->DevicePath - ); - if (EFI_ERROR (Status)) { - gBS->FreePool (NewDriverOsHandoffHeader); - return Status; - } - - // - // Make copy of device path - // - CopyMem (DriverOsHandoff->DevicePath, PciIoDevice->DevicePath, Size); - } - - DriverOsHandoff->PciRomSize = (UINT64) PciIoDevice->PciIo.RomSize; - Status = gBS->AllocatePool ( - EfiRuntimeServicesData, - (UINTN) DriverOsHandoff->PciRomSize, - (VOID **) &DriverOsHandoff->PciRomImage - ); - if (EFI_ERROR (Status)) { - gBS->FreePool (NewDriverOsHandoffHeader); - return Status; - } - - gBS->CopyMem ( - DriverOsHandoff->PciRomImage, - PciIoDevice->PciIo.RomImage, - (UINTN) DriverOsHandoff->PciRomSize - ); - - Status = gBS->InstallConfigurationTable (&gEfiUgaIoProtocolGuid, NewDriverOsHandoffHeader); - if (EFI_ERROR (Status)) { - return Status; - } - - if (DriverOsHandoffHeader != NULL) { - gBS->FreePool (DriverOsHandoffHeader); - } -#endif - return EFI_SUCCESS; } -- cgit v1.2.3