60 lines
2.6 KiB
C
60 lines
2.6 KiB
C
//**********************************************************************
|
|
//**********************************************************************
|
|
//** **
|
|
//** (C)Copyright 1985-2017, American Megatrends, Inc. **
|
|
//** **
|
|
//** All Rights Reserved. **
|
|
//** **
|
|
//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
|
|
//** **
|
|
//** Phone: (770)-246-8600 **
|
|
//** **
|
|
//**********************************************************************
|
|
//**********************************************************************
|
|
/** @file SioBdsPlugin.c
|
|
|
|
Plugin to connect SIO logical devices before the End Of DXE.
|
|
**/
|
|
|
|
#include <IndustryStandard/Pci.h>
|
|
#include <Library/UefiBootServicesTableLib.h>
|
|
|
|
// Defined in Bds.c
|
|
EFI_STATUS GetPciHandlesByClass(
|
|
UINT8 Class, UINT8 SubClass, UINTN *NumberOfHandles, EFI_HANDLE **HandleBuffer
|
|
);
|
|
|
|
/**
|
|
Connect SIO handle.
|
|
**/
|
|
VOID ConnectSio(){
|
|
EFI_STATUS Status;
|
|
EFI_HANDLE *Handle;
|
|
UINTN Number,i;
|
|
|
|
//Get a list of all PCI to ISA Bridges
|
|
Status = GetPciHandlesByClass(
|
|
PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, &Number, &Handle
|
|
);
|
|
if (EFI_ERROR(Status)) return;
|
|
for(i=0; i<Number; i++)
|
|
{
|
|
gBS->ConnectController(Handle[i],NULL,NULL,FALSE);
|
|
}
|
|
gBS->FreePool(Handle);
|
|
}
|
|
|
|
//**********************************************************************
|
|
//**********************************************************************
|
|
//** **
|
|
//** (C)Copyright 1985-2017, American Megatrends, Inc. **
|
|
//** **
|
|
//** All Rights Reserved. **
|
|
//** **
|
|
//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
|
|
//** **
|
|
//** Phone: (770)-246-8600 **
|
|
//** **
|
|
//**********************************************************************
|
|
//**********************************************************************
|