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

Function SetDevices

rEFIt_UEFI/Platform/Settings.cpp:6887–7805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6885
6886
6887VOID
6888SetDevices (LOADER_ENTRY *Entry)
6889{
6890 // EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *modeInfo;
6891 EFI_STATUS Status;
6892 EFI_PCI_IO_PROTOCOL *PciIo;
6893 PCI_TYPE00 Pci;
6894 UINTN HandleCount;
6895 UINTN i, j;
6896 EFI_HANDLE *HandleBuffer;
6897 pci_dt_t PCIdevice;
6898 UINTN Segment;
6899 UINTN Bus;
6900 UINTN Device;
6901 UINTN Function;
6902 BOOLEAN StringDirty = FALSE;
6903 BOOLEAN TmpDirty = FALSE;
6904 UINT16 PmCon;
6905 UINT32 Rcba;
6906 UINT32 Hptc;
6907 DEV_PROPERTY *Prop = NULL;
6908 DEV_PROPERTY *Prop2 = NULL;
6909 DevPropDevice *device = NULL;
6910
6911 GetEdidDiscovered ();
6912
6913 //First make string from Device->Properties
6914 Prop = gSettings.ArbProperties;
6915 device = NULL;
6916 if (!device_inject_string) {
6917 device_inject_string = devprop_create_string();
6918 }
6919 while (Prop) {
6920 if (Prop->Device != 0) {
6921 Prop = Prop->Next; //skip CustomProperties
6922 continue;
6923 }
6924 device = devprop_add_device_pci(device_inject_string, NULL, Prop->DevicePath);
6925 DBG("add device: %ls\n", DevicePathToXStringW(Prop->DevicePath).wc_str());
6926 Prop2 = Prop->Child;
6927 while (Prop2) {
6928 if (Prop2->MenuItem.BValue) {
6929 if (AsciiStrStr(Prop2->Key, "-platform-id") != NULL) {
6930 if (gSettings.IgPlatform == 0 && Prop2->Value) {
6931 CopyMem((UINT8*)&gSettings.IgPlatform, (UINT8*)Prop2->Value, Prop2->ValueLen);
6932 }
6933 devprop_add_value(device, Prop2->Key, (UINT8*)&gSettings.IgPlatform, 4);
6934 DBG(" Add key=%s valuelen=%llu\n", Prop2->Key, Prop2->ValueLen);
6935 } else if ((AsciiStrStr(Prop2->Key, "override-no-edid") || AsciiStrStr(Prop2->Key, "override-no-connect"))
6936 && gSettings.InjectEDID && gSettings.CustomEDID) {
6937 // special case for EDID properties
6938 devprop_add_value(device, Prop2->Key, gSettings.CustomEDID, 128);
6939 DBG(" Add key=%s from custom EDID\n", Prop2->Key);
6940 } else {
6941 devprop_add_value(device, Prop2->Key, (UINT8*)Prop2->Value, Prop2->ValueLen);
6942 DBG(" Add key=%s valuelen=%llu\n", Prop2->Key, Prop2->ValueLen);
6943 }
6944 }

Callers 1

StartLoaderMethod · 0.85

Calls 15

GetEdidDiscoveredFunction · 0.85
devprop_create_stringFunction · 0.85
devprop_add_device_pciFunction · 0.85
DevicePathToXStringWFunction · 0.85
devprop_add_valueFunction · 0.85
setup_ati_devpropFunction · 0.85
setup_gma_devpropFunction · 0.85
DivU64x32Function · 0.85
MultU64x32Function · 0.85
setup_nvidia_devpropFunction · 0.85
set_eth_propsFunction · 0.85
set_usb_propsFunction · 0.85

Tested by

no test coverage detected