Skip to content

Commit

Permalink
removed unused
Browse files Browse the repository at this point in the history
  • Loading branch information
xCuri0 committed Aug 13, 2022
1 parent bc2a7c8 commit b255430
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions ReBarDxe/ReBar.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <Library/DebugLib.h>
#include "include/pciRegs.h"
#include "include/PciHostBridgeResourceAllocation.h"
#include <Library/PrintLib.h>
#include <Library/IoLib.h>

#define CAP_POINTER 0x34
#define PCIE_DEVICE 0x10
Expand Down Expand Up @@ -250,6 +248,9 @@ VOID reBarSetupDevice(EFI_HANDLE handle, EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADD
pciReadConfigWord(pciAddress, 0, &vid);
pciReadConfigWord(pciAddress, 2, &did);

if (vid == 0xFFFF)
return;

DEBUG((DEBUG_INFO, "ReBarDXE: Device vid:%x did:%x\n", vid, did));

epos = pciFindExtCapability(pciAddress, PCI_EXT_CAP_ID_REBAR);
Expand Down Expand Up @@ -293,9 +294,8 @@ EFI_STATUS EFIAPI PreprocessControllerOverride (
return status;
}

BOOLEAN pciHostBridgeResourceAllocationProtocolHook()
VOID pciHostBridgeResourceAllocationProtocolHook()
{
BOOLEAN ret = FALSE;
EFI_STATUS status;
UINTN handleCount;
EFI_HANDLE *handleBuffer;
Expand Down Expand Up @@ -327,10 +327,8 @@ BOOLEAN pciHostBridgeResourceAllocationProtocolHook()
o_PreprocessController = pciResAlloc->PreprocessController;
pciResAlloc->PreprocessController = &PreprocessControllerOverride;

ret = TRUE;
free:
FreePool(handleBuffer);
return ret;
}

EFI_STATUS EFIAPI rebarInit(
Expand All @@ -355,14 +353,6 @@ EFI_STATUS EFIAPI rebarInit(
if (reBarState)
{
DEBUG((DEBUG_INFO, "ReBarDXE: Enabled, maximum BAR size 2^%u MB\n", reBarState));
/* We need to override the last function called by PreprocessController.
We will look for functions in this order.
PciOverrideProtocol->PlatformPrepController (ChipsetExit) (not found on some firmware)
PciPlatformProtocol->PlatformPrepController (ChipsetExit) (seems standard on Intel atleast)
PciResAlloc->PreprocessController (EfiPciBeforeChildBusEnumeration) (standard on EDK2)
*/


// For overriding PciHostBridgeResourceAllocationProtocol
pciHostBridgeResourceAllocationProtocolHook();
}
Expand Down

0 comments on commit b255430

Please sign in to comment.