MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / CheckHardware

Function CheckHardware

rEFIt_UEFI/Platform/FixBiosDsdt.cpp:603–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601}
602
603VOID CheckHardware()
604{
605 EFI_STATUS Status;
606 EFI_HANDLE *HandleBuffer = NULL;
607 EFI_HANDLE Handle;
608 EFI_PCI_IO_PROTOCOL *PciIo;
609 PCI_TYPE00 Pci;
610 UINTN HandleCount = 0;
611 UINTN HandleIndex;
612
613 UINTN Segment;
614 UINTN Bus;
615 UINTN Device;
616 UINTN Function;
617 UINTN display=0;
618
619
620// pci_dt_t PCIdevice;
621 EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
622
623 usb=0;
624 // Scan PCI handles
625 Status = gBS->LocateHandleBuffer (
626 ByProtocol,
627 &gEfiPciIoProtocolGuid,
628 NULL,
629 &HandleCount,
630 &HandleBuffer
631 );
632 if (!EFI_ERROR(Status)) {
633// DBG("PciIo handles count=%d\n", HandleCount);
634 for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
635 Handle = HandleBuffer[HandleIndex];
636 Status = gBS->HandleProtocol (
637 Handle,
638 &gEfiPciIoProtocolGuid,
639 (VOID **)&PciIo
640 );
641 if (!EFI_ERROR(Status)) {
642 UINT32 deviceid;
643 /* Read PCI BUS */
644 PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function);
645 Status = PciIo->Pci.Read (
646 PciIo,
647 EfiPciIoWidthUint32,
648 0,
649 sizeof (Pci) / sizeof (UINT32),
650 &Pci
651 );
652
653 deviceid = Pci.Hdr.DeviceId | (Pci.Hdr.VendorId << 16);
654
655 // add for auto patch dsdt get DSDT Device _ADR
656 // PCIdevice.DeviceHandle = Handle;
657 DevicePath = DevicePathFromHandle (Handle);
658 if (DevicePath) {
659 // DBG("Device patch = %ls \n", DevicePathToStr(DevicePath));
660

Callers 1

FixBiosDsdtFunction · 0.85

Calls 7

GetPciADRFunction · 0.85
get_net_modelFunction · 0.85
NativeUSBFunction · 0.85
IsHDMIAudioFunction · 0.85
get_lpc_modelFunction · 0.85
get_ide_modelFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected