mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2025-02-17 01:11:36 +01:00
Fix a wrong cast in XImage.
Fix bug about padding StartMask, MaskFind, Replace, MaskReplace Move IgPlatform in GlobalConfig. Improve panic message. Fix bug in XMLDecode.
This commit is contained in:
parent
4269083faa
commit
23b39364d2
@ -1051,10 +1051,8 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen);
|
TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen);
|
||||||
ReplaceLen = MIN(ReplaceLen, FindLen);
|
ReplaceLen = MIN(ReplaceLen, FindLen);
|
||||||
if (FindLen != 0) {
|
if (FindLen != 0) {
|
||||||
newKextPatch.StartMask.memset(0xFF, FindLen);
|
if (TmpData != NULL) newKextPatch.StartMask.ncpy(TmpData, ReplaceLen); // KextsToPatch
|
||||||
if (TmpData != NULL) {
|
newKextPatch.StartMask.setSize(FindLen, 0xFF);
|
||||||
newKextPatch.StartMask.ncpy(TmpData, ReplaceLen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (TmpData != NULL) {
|
if (TmpData != NULL) {
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
@ -1085,14 +1083,14 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
|
|
||||||
if (TmpData == NULL || MaskLen == 0) {
|
if (TmpData == NULL || MaskLen == 0) {
|
||||||
} else {
|
} else {
|
||||||
newKextPatch.MaskFind.memset(0xFF, FindLen);
|
|
||||||
newKextPatch.MaskFind.ncpy(TmpData, MaskLen);
|
newKextPatch.MaskFind.ncpy(TmpData, MaskLen);
|
||||||
|
newKextPatch.MaskFind.setSize(FindLen, 0xFF);
|
||||||
}
|
}
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
// take into account a possibility to set ReplaceLen < FindLen. In this case assumes MaskReplace = 0 for the rest of bytes
|
// take into account a possibility to set ReplaceLen < FindLen. In this case assumes MaskReplace = 0 for the rest of bytes
|
||||||
newKextPatch.Replace.memset(0, FindLen);
|
|
||||||
ReplaceLen = MIN(ReplaceLen, FindLen);
|
ReplaceLen = MIN(ReplaceLen, FindLen);
|
||||||
newKextPatch.Replace.ncpy(TmpPatch, ReplaceLen);
|
newKextPatch.Replace.ncpy(TmpPatch, ReplaceLen);
|
||||||
|
newKextPatch.Replace.setSize(FindLen, 0);
|
||||||
FreePool(TmpPatch);
|
FreePool(TmpPatch);
|
||||||
|
|
||||||
MaskLen = 0;
|
MaskLen = 0;
|
||||||
@ -1100,8 +1098,8 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
MaskLen = MIN(ReplaceLen, MaskLen);
|
MaskLen = MIN(ReplaceLen, MaskLen);
|
||||||
if (TmpData == NULL || MaskLen == 0) {
|
if (TmpData == NULL || MaskLen == 0) {
|
||||||
} else {
|
} else {
|
||||||
newKextPatch.MaskReplace.memset(0, FindLen);
|
|
||||||
newKextPatch.MaskReplace.ncpy(TmpData, MaskLen); //other bytes are zeros, means no replace
|
newKextPatch.MaskReplace.ncpy(TmpData, MaskLen); //other bytes are zeros, means no replace
|
||||||
|
newKextPatch.MaskReplace.setSize(FindLen, 0);
|
||||||
}
|
}
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
|
|
||||||
@ -1203,10 +1201,8 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen);
|
TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen);
|
||||||
ReplaceLen = MIN(ReplaceLen, FindLen);
|
ReplaceLen = MIN(ReplaceLen, FindLen);
|
||||||
if (FindLen != 0) {
|
if (FindLen != 0) {
|
||||||
newKernelPatch.StartMask.memset(0xFF, FindLen);
|
if (TmpData != NULL) newKernelPatch.StartMask.ncpy(TmpData, ReplaceLen); // KernelToPatch
|
||||||
if (TmpData != NULL) {
|
newKernelPatch.StartMask.setSize(FindLen, 0xFF);
|
||||||
newKernelPatch.StartMask.ncpy(TmpData, ReplaceLen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (TmpData != NULL) {
|
if (TmpData != NULL) {
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
@ -1237,22 +1233,22 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
MaskLen = (MaskLen > FindLen)? FindLen : MaskLen;
|
MaskLen = (MaskLen > FindLen)? FindLen : MaskLen;
|
||||||
if (TmpData == NULL || MaskLen == 0) {
|
if (TmpData == NULL || MaskLen == 0) {
|
||||||
} else {
|
} else {
|
||||||
newKernelPatch.MaskFind.memset(0xFF, FindLen);
|
|
||||||
newKernelPatch.MaskFind.ncpy(TmpData, MaskLen);
|
newKernelPatch.MaskFind.ncpy(TmpData, MaskLen);
|
||||||
|
newKernelPatch.MaskFind.setSize(FindLen, 0xFF);
|
||||||
}
|
}
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
// this is "Replace" string len of ReplaceLen
|
// this is "Replace" string len of ReplaceLen
|
||||||
ReplaceLen = MIN(ReplaceLen, FindLen);
|
ReplaceLen = MIN(ReplaceLen, FindLen);
|
||||||
newKernelPatch.Replace.memset(0, FindLen);
|
|
||||||
newKernelPatch.Replace.ncpy(TmpPatch, ReplaceLen);
|
newKernelPatch.Replace.ncpy(TmpPatch, ReplaceLen);
|
||||||
|
newKernelPatch.Replace.setSize(FindLen, 0);
|
||||||
FreePool(TmpPatch);
|
FreePool(TmpPatch);
|
||||||
MaskLen = 0;
|
MaskLen = 0;
|
||||||
TmpData = GetDataSetting (Prop2, "MaskReplace", &MaskLen); //reuse MaskLen
|
TmpData = GetDataSetting (Prop2, "MaskReplace", &MaskLen); //reuse MaskLen
|
||||||
MaskLen = MIN(ReplaceLen, MaskLen);
|
MaskLen = MIN(ReplaceLen, MaskLen);
|
||||||
if (TmpData == NULL || MaskLen == 0) {
|
if (TmpData == NULL || MaskLen == 0) {
|
||||||
} else {
|
} else {
|
||||||
newKernelPatch.MaskReplace.memset(0, FindLen);
|
|
||||||
newKernelPatch.MaskReplace.ncpy(TmpData, MaskLen);
|
newKernelPatch.MaskReplace.ncpy(TmpData, MaskLen);
|
||||||
|
newKernelPatch.MaskReplace.setSize(FindLen, 0);
|
||||||
}
|
}
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
newKernelPatch.Count = 0;
|
newKernelPatch.Count = 0;
|
||||||
@ -1337,10 +1333,10 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen);
|
TmpData = GetDataSetting (Prop2, "MaskStart", &ReplaceLen);
|
||||||
ReplaceLen = MIN(ReplaceLen, FindLen);
|
ReplaceLen = MIN(ReplaceLen, FindLen);
|
||||||
if (FindLen != 0) {
|
if (FindLen != 0) {
|
||||||
newBootPatch.StartMask.memset(0xFF, FindLen);
|
|
||||||
if (TmpData != NULL) {
|
if (TmpData != NULL) {
|
||||||
newBootPatch.StartMask.ncpy(TmpData, ReplaceLen);
|
newBootPatch.StartMask.ncpy(TmpData, ReplaceLen);
|
||||||
}
|
}
|
||||||
|
newBootPatch.StartMask.setSize(FindLen, 0xFF);
|
||||||
}
|
}
|
||||||
if (TmpData != NULL) {
|
if (TmpData != NULL) {
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
@ -1361,20 +1357,20 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches,
|
|||||||
MaskLen = MIN(FindLen, MaskLen);
|
MaskLen = MIN(FindLen, MaskLen);
|
||||||
if (TmpData == NULL || MaskLen == 0) {
|
if (TmpData == NULL || MaskLen == 0) {
|
||||||
} else {
|
} else {
|
||||||
newBootPatch.MaskFind.memset(0xFF, FindLen);
|
|
||||||
newBootPatch.MaskFind.ncpy(TmpData, MaskLen);
|
newBootPatch.MaskFind.ncpy(TmpData, MaskLen);
|
||||||
|
newBootPatch.MaskFind.setSize(FindLen, 0xFF);
|
||||||
}
|
}
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
newBootPatch.Replace.memset(0, FindLen);
|
|
||||||
newBootPatch.Replace.ncpy(TmpPatch, ReplaceLen);
|
newBootPatch.Replace.ncpy(TmpPatch, ReplaceLen);
|
||||||
|
newBootPatch.Replace.setSize(FindLen, 0);
|
||||||
FreePool(TmpPatch);
|
FreePool(TmpPatch);
|
||||||
MaskLen = 0;
|
MaskLen = 0;
|
||||||
TmpData = GetDataSetting(Prop2, "MaskReplace", &MaskLen);
|
TmpData = GetDataSetting(Prop2, "MaskReplace", &MaskLen);
|
||||||
MaskLen = MIN(ReplaceLen, MaskLen);
|
MaskLen = MIN(ReplaceLen, MaskLen);
|
||||||
if (TmpData == NULL || MaskLen == 0) {
|
if (TmpData == NULL || MaskLen == 0) {
|
||||||
} else {
|
} else {
|
||||||
newBootPatch.MaskReplace.memset(0, FindLen);
|
|
||||||
newBootPatch.MaskReplace.ncpy(TmpData, MaskLen);
|
newBootPatch.MaskReplace.ncpy(TmpData, MaskLen);
|
||||||
|
newBootPatch.MaskReplace.setSize(FindLen, 0);
|
||||||
}
|
}
|
||||||
FreePool(TmpData);
|
FreePool(TmpData);
|
||||||
newBootPatch.Count = 0;
|
newBootPatch.Count = 0;
|
||||||
@ -4644,7 +4640,7 @@ void SETTINGS_DATA::DevicesClass::FillDevicePropertiesOld(SETTINGS_DATA& gSettin
|
|||||||
|
|
||||||
//Special case. In future there must be more such cases
|
//Special case. In future there must be more such cases
|
||||||
if ((AsciiStrStr(gSettings.Devices.ArbProperties->Key, "-platform-id") != NULL)) {
|
if ((AsciiStrStr(gSettings.Devices.ArbProperties->Key, "-platform-id") != NULL)) {
|
||||||
CopyMem((CHAR8*)&gSettings.Graphics.IgPlatform, gSettings.Devices.ArbProperties->Value, 4);
|
CopyMem((CHAR8*)&gSettings.Graphics._IgPlatform, gSettings.Devices.ArbProperties->Value, 4);
|
||||||
}
|
}
|
||||||
} //for() device properties
|
} //for() device properties
|
||||||
}
|
}
|
||||||
@ -4799,10 +4795,10 @@ EFI_STATUS GetUserSettings(const TagDict* CfgDict, SETTINGS_DATA& gSettings)
|
|||||||
gSettings.Graphics.NvidiaSingle = IsPropertyNotNullAndTrue(Prop);
|
gSettings.Graphics.NvidiaSingle = IsPropertyNotNullAndTrue(Prop);
|
||||||
|
|
||||||
Prop = GraphicsDict->propertyForKey("ig-platform-id");
|
Prop = GraphicsDict->propertyForKey("ig-platform-id");
|
||||||
gSettings.Graphics.IgPlatform = (UINT32)GetPropertyAsInteger(Prop, gSettings.Graphics.IgPlatform);
|
gSettings.Graphics._IgPlatform = (UINT32)GetPropertyAsInteger(Prop, gSettings.Graphics._IgPlatform);
|
||||||
|
|
||||||
Prop = GraphicsDict->propertyForKey("snb-platform-id");
|
Prop = GraphicsDict->propertyForKey("snb-platform-id");
|
||||||
gSettings.Graphics.IgPlatform = (UINT32)GetPropertyAsInteger(Prop, gSettings.Graphics.IgPlatform);
|
gSettings.Graphics._IgPlatform = (UINT32)GetPropertyAsInteger(Prop, gSettings.Graphics._IgPlatform);
|
||||||
|
|
||||||
FillCardList(GraphicsDict, gSettings); //#@ Getcardslist
|
FillCardList(GraphicsDict, gSettings); //#@ Getcardslist
|
||||||
}
|
}
|
||||||
@ -5060,9 +5056,9 @@ EFI_STATUS GetUserSettings(const TagDict* CfgDict, SETTINGS_DATA& gSettings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Special case. In future there must be more such cases
|
//Special case. In future there must be more such cases
|
||||||
if ( newDevProp->Key.contains("-platform-id") ) {
|
// if ( newDevProp->Key.contains("-platform-id") ) {
|
||||||
CopyMem((CHAR8*)&gSettings.Graphics.IgPlatform, newDevProp->Value.data(), 4);
|
// CopyMem((CHAR8*)&gSettings.Graphics.IgPlatform, newDevProp->Value.data(), 4);
|
||||||
}
|
// }
|
||||||
if ( arbProp == NULL ) {
|
if ( arbProp == NULL ) {
|
||||||
arbProp = new SETTINGS_DATA::DevicesClass::ArbitraryPropertyClass();
|
arbProp = new SETTINGS_DATA::DevicesClass::ArbitraryPropertyClass();
|
||||||
arbProp->Device = (UINT32)DeviceAddr;
|
arbProp->Device = (UINT32)DeviceAddr;
|
||||||
@ -6911,10 +6907,10 @@ SetDevices (LOADER_ENTRY *Entry)
|
|||||||
const SETTINGS_DATA::DevicesClass::SimplePropertyClass& Prop2 = Prop.propertiesArray[jdx];
|
const SETTINGS_DATA::DevicesClass::SimplePropertyClass& Prop2 = Prop.propertiesArray[jdx];
|
||||||
if (Prop2.MenuItem.BValue) {
|
if (Prop2.MenuItem.BValue) {
|
||||||
if ( Prop2.Key.contains("-platform-id") ) {
|
if ( Prop2.Key.contains("-platform-id") ) {
|
||||||
if ( gSettings.Graphics.IgPlatform == 0 && Prop2.Value.size() == sizeof(gSettings.Graphics.IgPlatform) ) {
|
if ( GlobalConfig.IgPlatform == 0 && Prop2.Value.size() == sizeof(GlobalConfig.IgPlatform) ) {
|
||||||
CopyMem((UINT8*)&gSettings.Graphics.IgPlatform, Prop2.Value.data(), sizeof(gSettings.Graphics.IgPlatform));
|
CopyMem((UINT8*)&GlobalConfig.IgPlatform, Prop2.Value.data(), sizeof(GlobalConfig.IgPlatform));
|
||||||
}
|
}
|
||||||
devprop_add_value(device, Prop2.Key.c_str(), (UINT8*)&gSettings.Graphics.IgPlatform, 4);
|
devprop_add_value(device, Prop2.Key.c_str(), (UINT8*)&GlobalConfig.IgPlatform, 4);
|
||||||
DBG(" Add key=%s valuelen=%zu\n", Prop2.Key.c_str(), Prop2.Value.size());
|
DBG(" Add key=%s valuelen=%zu\n", Prop2.Key.c_str(), Prop2.Value.size());
|
||||||
} else if ( (Prop2.Key.contains("override-no-edid") || Prop2.Key.contains("override-no-connect"))
|
} else if ( (Prop2.Key.contains("override-no-edid") || Prop2.Key.contains("override-no-connect"))
|
||||||
&& gSettings.Graphics.EDID.InjectEDID && gSettings.Graphics.EDID.CustomEDID.notEmpty()) {
|
&& gSettings.Graphics.EDID.InjectEDID && gSettings.Graphics.EDID.CustomEDID.notEmpty()) {
|
||||||
@ -6984,7 +6980,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
|||||||
//special corrections
|
//special corrections
|
||||||
if (Prop2.MenuItem.BValue) {
|
if (Prop2.MenuItem.BValue) {
|
||||||
if ( Prop2.Key.contains("-platform-id") ) {
|
if ( Prop2.Key.contains("-platform-id") ) {
|
||||||
devprop_add_value(device, Prop2.Key.c_str(), (UINT8*)&gSettings.Graphics.IgPlatform, sizeof(gSettings.Graphics.IgPlatform));
|
devprop_add_value(device, Prop2.Key.c_str(), (UINT8*)&GlobalConfig.IgPlatform, sizeof(GlobalConfig.IgPlatform));
|
||||||
} else {
|
} else {
|
||||||
devprop_add_value(device, Prop2.Key, Prop2.Value);
|
devprop_add_value(device, Prop2.Key, Prop2.Value);
|
||||||
}
|
}
|
||||||
@ -7148,8 +7144,8 @@ SetDevices (LOADER_ENTRY *Entry)
|
|||||||
case 0x0116: // "Intel HD Graphics 3000"
|
case 0x0116: // "Intel HD Graphics 3000"
|
||||||
case 0x0122: // "Intel HD Graphics 3000"
|
case 0x0122: // "Intel HD Graphics 3000"
|
||||||
case 0x0126: // "Intel HD Graphics 3000"
|
case 0x0126: // "Intel HD Graphics 3000"
|
||||||
if (gSettings.Graphics.IgPlatform) {
|
if (GlobalConfig.IgPlatform) {
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x00030010:
|
case (UINT32)0x00030010:
|
||||||
case (UINT32)0x00050000:
|
case (UINT32)0x00050000:
|
||||||
FBLEVX = 0xFFFF;
|
FBLEVX = 0xFFFF;
|
||||||
@ -7194,8 +7190,8 @@ SetDevices (LOADER_ENTRY *Entry)
|
|||||||
case 0x0D2A: // "Intel Iris Pro Graphics 5200"
|
case 0x0D2A: // "Intel Iris Pro Graphics 5200"
|
||||||
case 0x0D2B: // "Intel Iris Pro Graphics 5200"
|
case 0x0D2B: // "Intel Iris Pro Graphics 5200"
|
||||||
case 0x0D2E: // "Intel Iris Pro Graphics 5200"
|
case 0x0D2E: // "Intel Iris Pro Graphics 5200"
|
||||||
if (gSettings.Graphics.IgPlatform) {
|
if (GlobalConfig.IgPlatform) {
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x04060000:
|
case (UINT32)0x04060000:
|
||||||
case (UINT32)0x0c060000:
|
case (UINT32)0x0c060000:
|
||||||
case (UINT32)0x04160000:
|
case (UINT32)0x04160000:
|
||||||
@ -7255,8 +7251,8 @@ SetDevices (LOADER_ENTRY *Entry)
|
|||||||
case 0x162D: // "Intel Iris Pro Graphics P6300"
|
case 0x162D: // "Intel Iris Pro Graphics P6300"
|
||||||
case 0x1622: // "Intel Iris Pro Graphics 6200"
|
case 0x1622: // "Intel Iris Pro Graphics 6200"
|
||||||
case 0x162A: // "Intel Iris Pro Graphics P6300"
|
case 0x162A: // "Intel Iris Pro Graphics P6300"
|
||||||
if (gSettings.Graphics.IgPlatform) {
|
if (GlobalConfig.IgPlatform) {
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x16060000:
|
case (UINT32)0x16060000:
|
||||||
case (UINT32)0x160e0000:
|
case (UINT32)0x160e0000:
|
||||||
case (UINT32)0x16160000:
|
case (UINT32)0x16160000:
|
||||||
@ -7322,8 +7318,8 @@ SetDevices (LOADER_ENTRY *Entry)
|
|||||||
case 0x193A: // "Intel Iris Pro Graphics P580"
|
case 0x193A: // "Intel Iris Pro Graphics P580"
|
||||||
case 0x193B: // "Intel Iris Pro Graphics 580"
|
case 0x193B: // "Intel Iris Pro Graphics 580"
|
||||||
case 0x193D: // "Intel Iris Pro Graphics P580"
|
case 0x193D: // "Intel Iris Pro Graphics P580"
|
||||||
if (gSettings.Graphics.IgPlatform) {
|
if (GlobalConfig.IgPlatform) {
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x19120001:
|
case (UINT32)0x19120001:
|
||||||
FBLEVX = 0xFFFF;
|
FBLEVX = 0xFFFF;
|
||||||
break;
|
break;
|
||||||
|
@ -1174,7 +1174,7 @@ public:
|
|||||||
XArray<UINT8> NVCAP = XArray<UINT8>();
|
XArray<UINT8> NVCAP = XArray<UINT8>();
|
||||||
INT8 BootDisplay = INT8();
|
INT8 BootDisplay = INT8();
|
||||||
UINT32 DualLink = UINT32();
|
UINT32 DualLink = UINT32();
|
||||||
UINT32 IgPlatform = UINT32(); //could also be snb-platform-id
|
UINT32 _IgPlatform = UINT32(); //could also be snb-platform-id
|
||||||
EDIDClass EDID = EDIDClass();
|
EDIDClass EDID = EDIDClass();
|
||||||
InjectAsDictClass InjectAsDict = InjectAsDictClass();
|
InjectAsDictClass InjectAsDict = InjectAsDictClass();
|
||||||
XObjArray<GRAPHIC_CARD> ATICardList = XObjArray<GRAPHIC_CARD>();
|
XObjArray<GRAPHIC_CARD> ATICardList = XObjArray<GRAPHIC_CARD>();
|
||||||
@ -1207,7 +1207,7 @@ public:
|
|||||||
if ( !(NVCAP == other.NVCAP) ) return false;
|
if ( !(NVCAP == other.NVCAP) ) return false;
|
||||||
if ( !(BootDisplay == other.BootDisplay) ) return false;
|
if ( !(BootDisplay == other.BootDisplay) ) return false;
|
||||||
if ( !(DualLink == other.DualLink) ) return false;
|
if ( !(DualLink == other.DualLink) ) return false;
|
||||||
if ( !(IgPlatform == other.IgPlatform) ) return false;
|
if ( !(_IgPlatform == other._IgPlatform) ) return false;
|
||||||
if ( !EDID.isEqual(other.EDID) ) return false;
|
if ( !EDID.isEqual(other.EDID) ) return false;
|
||||||
if ( !InjectAsDict.isEqual(other.InjectAsDict) ) return false;
|
if ( !InjectAsDict.isEqual(other.InjectAsDict) ) return false;
|
||||||
if ( !ATICardList.isEqual(other.ATICardList) ) return false;
|
if ( !ATICardList.isEqual(other.ATICardList) ) return false;
|
||||||
@ -2246,6 +2246,8 @@ public:
|
|||||||
UINT8 flagstate[32] = {0};
|
UINT8 flagstate[32] = {0};
|
||||||
MACHINE_TYPES CurrentModel = MaxMachineType;
|
MACHINE_TYPES CurrentModel = MaxMachineType;
|
||||||
|
|
||||||
|
UINT32 IgPlatform = UINT32(); //could also be snb-platform-id
|
||||||
|
|
||||||
|
|
||||||
REFIT_CONFIG() {};
|
REFIT_CONFIG() {};
|
||||||
REFIT_CONFIG(const REFIT_CONFIG& other) = delete; // Can be defined if needed
|
REFIT_CONFIG(const REFIT_CONFIG& other) = delete; // Can be defined if needed
|
||||||
|
@ -1481,18 +1481,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
case 0x0116: // "Intel HD Graphics 3000"
|
case 0x0116: // "Intel HD Graphics 3000"
|
||||||
case 0x0122: // "Intel HD Graphics 3000"
|
case 0x0122: // "Intel HD Graphics 3000"
|
||||||
case 0x0126: // "Intel HD Graphics 3000"
|
case 0x0126: // "Intel HD Graphics 3000"
|
||||||
if (gSettings.Graphics.IgPlatform != 0) {
|
if (GlobalConfig.IgPlatform != 0) {
|
||||||
devprop_add_value(device, "AAPL,snb-platform-id", (UINT8*)&gSettings.Graphics.IgPlatform, 4);
|
devprop_add_value(device, "AAPL,snb-platform-id", (UINT8*)&GlobalConfig.IgPlatform, 4);
|
||||||
MsgLog(" snb-platform-id = 0x%08x\n", gSettings.Graphics.IgPlatform);
|
MsgLog(" snb-platform-id = 0x%08x\n", GlobalConfig.IgPlatform);
|
||||||
SetSnb = TRUE;
|
SetSnb = TRUE;
|
||||||
} else {
|
} else {
|
||||||
DBG(" snb-platform-id: not set\n");
|
DBG(" snb-platform-id: not set\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (gSettings.Graphics.IgPlatform != 0) {
|
if (GlobalConfig.IgPlatform != 0) {
|
||||||
devprop_add_value(device, "AAPL,ig-platform-id", (UINT8*)&gSettings.Graphics.IgPlatform, 4);
|
devprop_add_value(device, "AAPL,ig-platform-id", (UINT8*)&GlobalConfig.IgPlatform, 4);
|
||||||
MsgLog(" ig-platform-id = 0x%08x\n", gSettings.Graphics.IgPlatform);
|
MsgLog(" ig-platform-id = 0x%08x\n", GlobalConfig.IgPlatform);
|
||||||
SetIg = TRUE;
|
SetIg = TRUE;
|
||||||
} else {
|
} else {
|
||||||
DBG(" ig-platform-id: not set\n");
|
DBG(" ig-platform-id: not set\n");
|
||||||
@ -1909,7 +1909,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x00030030:
|
case (UINT32)0x00030030:
|
||||||
case (UINT32)0x00050000:
|
case (UINT32)0x00050000:
|
||||||
break;
|
break;
|
||||||
@ -2033,7 +2033,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x01620006:
|
case (UINT32)0x01620006:
|
||||||
case (UINT32)0x01620007:
|
case (UINT32)0x01620007:
|
||||||
break;
|
break;
|
||||||
@ -2194,7 +2194,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x04120004:
|
case (UINT32)0x04120004:
|
||||||
case (UINT32)0x0412000B:
|
case (UINT32)0x0412000B:
|
||||||
break;
|
break;
|
||||||
@ -2511,7 +2511,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x19020001:
|
case (UINT32)0x19020001:
|
||||||
case (UINT32)0x19120001:
|
case (UINT32)0x19120001:
|
||||||
case (UINT32)0x19170001:
|
case (UINT32)0x19170001:
|
||||||
@ -2869,7 +2869,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x59120003:
|
case (UINT32)0x59120003:
|
||||||
case (UINT32)0x59180002:
|
case (UINT32)0x59180002:
|
||||||
break;
|
break;
|
||||||
@ -3116,7 +3116,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (gSettings.Graphics.IgPlatform) {
|
switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x3E910003:
|
case (UINT32)0x3E910003:
|
||||||
case (UINT32)0x3E920003:
|
case (UINT32)0x3E920003:
|
||||||
case (UINT32)0x3E980003:
|
case (UINT32)0x3E980003:
|
||||||
@ -3284,7 +3284,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*switch (gSettings.Graphics.IgPlatform) {
|
/*switch (GlobalConfig.IgPlatform) {
|
||||||
case (UINT32)0x5A510003:
|
case (UINT32)0x5A510003:
|
||||||
case (UINT32)0x5A520003:
|
case (UINT32)0x5A520003:
|
||||||
break;
|
break;
|
||||||
|
@ -80,6 +80,7 @@ size_t XMLDecode(const char* src, size_t srclen, char* out, size_t outlen)
|
|||||||
char* o;
|
char* o;
|
||||||
|
|
||||||
if (!src) {
|
if (!src) {
|
||||||
|
if ( outlen > 0 ) *out = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,8 +90,8 @@ size_t XMLDecode(const char* src, size_t srclen, char* out, size_t outlen)
|
|||||||
while (s < src+srclen) /* Make sure the terminator is also copied */
|
while (s < src+srclen) /* Make sure the terminator is also copied */
|
||||||
{
|
{
|
||||||
if ( *s == '&' ) {
|
if ( *s == '&' ) {
|
||||||
UINTN i;
|
|
||||||
s++;
|
s++;
|
||||||
|
size_t i;
|
||||||
for (i = 0; i < sizeof(ents)/sizeof(ents[0]); i++) {
|
for (i = 0; i < sizeof(ents)/sizeof(ents[0]); i++) {
|
||||||
if ( ents[i].name.strncmp(s, ents[i].nameLen) == 0 ) {
|
if ( ents[i].name.strncmp(s, ents[i].nameLen) == 0 ) {
|
||||||
if ( uintptr_t(o)-uintptr_t(out) >= outlen ) return uintptr_t(o)-uintptr_t(out);
|
if ( uintptr_t(o)-uintptr_t(out) >= outlen ) return uintptr_t(o)-uintptr_t(out);
|
||||||
@ -99,6 +100,7 @@ size_t XMLDecode(const char* src, size_t srclen, char* out, size_t outlen)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( i < sizeof(ents)/sizeof(ents[0]) ) continue; // if entity is found, let's go up to the beginning of the loop and avoid inserting thenext char without checking if it's another entity
|
||||||
}
|
}
|
||||||
if ( uintptr_t(o)-uintptr_t(out) >= outlen ) return uintptr_t(o)-uintptr_t(out);
|
if ( uintptr_t(o)-uintptr_t(out) >= outlen ) return uintptr_t(o)-uintptr_t(out);
|
||||||
*o++ = *s++;
|
*o++ = *s++;
|
||||||
|
@ -1689,15 +1689,16 @@ void ScanLoader(void)
|
|||||||
if ( loaderEntry1.LoaderType == OSTYPE_OSX && (loaderEntry1.Volume->ApfsRole & APPLE_APFS_VOLUME_ROLE_PREBOOT) != 0 )
|
if ( loaderEntry1.LoaderType == OSTYPE_OSX && (loaderEntry1.Volume->ApfsRole & APPLE_APFS_VOLUME_ROLE_PREBOOT) != 0 )
|
||||||
{
|
{
|
||||||
size_t prebootIdx = MainMenu.Entries.getIdx(loaderEntry1Ptr);
|
size_t prebootIdx = MainMenu.Entries.getIdx(loaderEntry1Ptr);
|
||||||
#ifdef DEBUG
|
if ( prebootIdx == SIZE_T_MAX ) {
|
||||||
if ( prebootIdx == SIZE_T_MAX ) panic ("bug");
|
panic_ask ("%s : prebootIdx == SIZE_T_MAX", __PRETTY_FUNCTION__);
|
||||||
#endif
|
}else{
|
||||||
size_t idxMain = MainMenu.Entries.getApfsLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
size_t idxMain = MainMenu.Entries.getApfsLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
||||||
if ( idxMain != SIZE_T_MAX && idxMain != prebootIdx+1 ) {
|
if ( idxMain != SIZE_T_MAX && idxMain != prebootIdx+1 ) {
|
||||||
DBG("Move preboot entry %zu before system %zu\n", prebootIdx, idxMain);
|
DBG("Move preboot entry %zu before system %zu\n", prebootIdx, idxMain);
|
||||||
MainMenu.Entries.moveBefore(prebootIdx, idxMain); // this will move preboot entry just before main
|
MainMenu.Entries.moveBefore(prebootIdx, idxMain); // this will move preboot entry just before main
|
||||||
EntriesArrayTmp.RemoveAtIndex(idx);
|
EntriesArrayTmp.RemoveAtIndex(idx);
|
||||||
hasMovedSomething = true;
|
hasMovedSomething = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++idx;
|
++idx;
|
||||||
@ -1720,26 +1721,27 @@ void ScanLoader(void)
|
|||||||
if ( loaderEntry1.LoaderType == OSTYPE_OSX_INSTALLER )
|
if ( loaderEntry1.LoaderType == OSTYPE_OSX_INSTALLER )
|
||||||
{
|
{
|
||||||
size_t installerIdx = MainMenu.Entries.getIdx(loaderEntry1Ptr);
|
size_t installerIdx = MainMenu.Entries.getIdx(loaderEntry1Ptr);
|
||||||
#ifdef DEBUG
|
if ( installerIdx == SIZE_T_MAX ) {
|
||||||
if ( installerIdx == SIZE_T_MAX ) panic ("bug");
|
panic_ask("%s : installerIdx == SIZE_T_MAX", __PRETTY_FUNCTION__);
|
||||||
#endif
|
|
||||||
size_t idxPreboot = MainMenu.Entries.getApfsPrebootLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
|
||||||
if ( idxPreboot != SIZE_T_MAX ) {
|
|
||||||
if ( idxPreboot != installerIdx + 1 ) {
|
|
||||||
DBG("Move installer entry %zu before preboot %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxPreboot);
|
|
||||||
MainMenu.Entries.moveBefore(installerIdx, idxPreboot); // this will move preboot entry just before main
|
|
||||||
EntriesArrayTmp.RemoveAtIndex(idx);
|
|
||||||
hasMovedSomething = true;
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
size_t idxMain = MainMenu.Entries.getApfsLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
size_t idxPreboot = MainMenu.Entries.getApfsPrebootLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
||||||
if ( idxMain != SIZE_T_MAX ) {
|
if ( idxPreboot != SIZE_T_MAX ) {
|
||||||
if ( idxMain != installerIdx+1 ) {
|
if ( idxPreboot != installerIdx + 1 ) {
|
||||||
DBG("Move installer entry %zu before system %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxMain);
|
DBG("Move installer entry %zu before preboot %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxPreboot);
|
||||||
MainMenu.Entries.moveBefore(installerIdx, idxMain); // this will move preboot entry just before main
|
MainMenu.Entries.moveBefore(installerIdx, idxPreboot); // this will move preboot entry just before main
|
||||||
EntriesArrayTmp.RemoveAtIndex(idx);
|
EntriesArrayTmp.RemoveAtIndex(idx);
|
||||||
hasMovedSomething = true;
|
hasMovedSomething = true;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
size_t idxMain = MainMenu.Entries.getApfsLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
||||||
|
if ( idxMain != SIZE_T_MAX ) {
|
||||||
|
if ( idxMain != installerIdx+1 ) {
|
||||||
|
DBG("Move installer entry %zu before system %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxMain);
|
||||||
|
MainMenu.Entries.moveBefore(installerIdx, idxMain); // this will move preboot entry just before main
|
||||||
|
EntriesArrayTmp.RemoveAtIndex(idx);
|
||||||
|
hasMovedSomething = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1763,26 +1765,27 @@ void ScanLoader(void)
|
|||||||
if ( loaderEntry1.LoaderType == OSTYPE_RECOVERY && (loaderEntry1.Volume->ApfsRole & APPLE_APFS_VOLUME_ROLE_RECOVERY) != 0 )
|
if ( loaderEntry1.LoaderType == OSTYPE_RECOVERY && (loaderEntry1.Volume->ApfsRole & APPLE_APFS_VOLUME_ROLE_RECOVERY) != 0 )
|
||||||
{
|
{
|
||||||
size_t recoveryIdx = MainMenu.Entries.getIdx(loaderEntry1Ptr);
|
size_t recoveryIdx = MainMenu.Entries.getIdx(loaderEntry1Ptr);
|
||||||
#ifdef DEBUG
|
if ( recoveryIdx == SIZE_T_MAX ) {
|
||||||
if ( recoveryIdx == SIZE_T_MAX ) panic ("bug");
|
panic_ask ("%s : recoveryIdx == SIZE_T_MAX", __PRETTY_FUNCTION__);
|
||||||
#endif
|
|
||||||
size_t idxMain = MainMenu.Entries.getApfsLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
|
||||||
if ( idxMain != SIZE_T_MAX ) {
|
|
||||||
if ( idxMain + 1 != recoveryIdx ) {
|
|
||||||
DBG("Move recovery entry %zu after system %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxMain);
|
|
||||||
MainMenu.Entries.moveAfter(recoveryIdx, idxMain); // this will move preboot entry just before main
|
|
||||||
EntriesArrayTmp.RemoveAtIndex(idx);
|
|
||||||
hasMovedSomething = true;
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
size_t idxPreboot = MainMenu.Entries.getApfsPrebootLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
size_t idxMain = MainMenu.Entries.getApfsLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
||||||
if ( idxPreboot != SIZE_T_MAX ) {
|
if ( idxMain != SIZE_T_MAX ) {
|
||||||
if ( idxPreboot + 1 != recoveryIdx ) {
|
if ( idxMain + 1 != recoveryIdx ) {
|
||||||
DBG("Move recovery entry %zu after preboot %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxPreboot);
|
DBG("Move recovery entry %zu after system %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxMain);
|
||||||
MainMenu.Entries.moveAfter(recoveryIdx, idxPreboot); // this will move preboot entry just before main
|
MainMenu.Entries.moveAfter(recoveryIdx, idxMain); // this will move preboot entry just before main
|
||||||
EntriesArrayTmp.RemoveAtIndex(idx);
|
EntriesArrayTmp.RemoveAtIndex(idx);
|
||||||
hasMovedSomething = true;
|
hasMovedSomething = true;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
size_t idxPreboot = MainMenu.Entries.getApfsPrebootLoaderIdx(loaderEntry1.Volume->ApfsContainerUUID, loaderEntry1.APFSTargetUUID, OSTYPE_OSX);
|
||||||
|
if ( idxPreboot != SIZE_T_MAX ) {
|
||||||
|
if ( idxPreboot + 1 != recoveryIdx ) {
|
||||||
|
DBG("Move recovery entry %zu after preboot %zu\n", EntriesArrayTmp.ElementAt(idx).idx, idxPreboot);
|
||||||
|
MainMenu.Entries.moveAfter(recoveryIdx, idxPreboot); // this will move preboot entry just before main
|
||||||
|
EntriesArrayTmp.RemoveAtIndex(idx);
|
||||||
|
hasMovedSomething = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ void XImage::Fill(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL& Color)
|
|||||||
|
|
||||||
void XImage::Fill(const EG_PIXEL* Color)
|
void XImage::Fill(const EG_PIXEL* Color)
|
||||||
{
|
{
|
||||||
Fill((const EFI_GRAPHICS_OUTPUT_BLT_PIXEL&)Color);
|
Fill( *(const EFI_GRAPHICS_OUTPUT_BLT_PIXEL*)Color );
|
||||||
}
|
}
|
||||||
|
|
||||||
void XImage::FillArea(const EG_PIXEL* Color, EG_RECT& Rect)
|
void XImage::FillArea(const EG_PIXEL* Color, EG_RECT& Rect)
|
||||||
|
@ -559,12 +559,12 @@ NullConOutOutputString(IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *, IN CONST CHAR16 *)
|
|||||||
|
|
||||||
void CheckEmptyFB()
|
void CheckEmptyFB()
|
||||||
{
|
{
|
||||||
BOOLEAN EmptyFB = (gSettings.Graphics.IgPlatform == 0x00050000) ||
|
BOOLEAN EmptyFB = (GlobalConfig.IgPlatform == 0x00050000) ||
|
||||||
(gSettings.Graphics.IgPlatform == 0x01620007) ||
|
(GlobalConfig.IgPlatform == 0x01620007) ||
|
||||||
(gSettings.Graphics.IgPlatform == 0x04120004) ||
|
(GlobalConfig.IgPlatform == 0x04120004) ||
|
||||||
(gSettings.Graphics.IgPlatform == 0x19120001) ||
|
(GlobalConfig.IgPlatform == 0x19120001) ||
|
||||||
(gSettings.Graphics.IgPlatform == 0x59120003) ||
|
(GlobalConfig.IgPlatform == 0x59120003) ||
|
||||||
(gSettings.Graphics.IgPlatform == 0x3E910003);
|
(GlobalConfig.IgPlatform == 0x3E910003);
|
||||||
if (EmptyFB) {
|
if (EmptyFB) {
|
||||||
gSettings.Smbios.gPlatformFeature |= PT_FEATURE_HAS_HEADLESS_GPU;
|
gSettings.Smbios.gPlatformFeature |= PT_FEATURE_HAS_HEADLESS_GPU;
|
||||||
} else {
|
} else {
|
||||||
@ -2793,7 +2793,16 @@ void afterGetUserSettings(SETTINGS_DATA& gSettings)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//---------
|
//---------
|
||||||
|
GlobalConfig.IgPlatform = gSettings.Graphics._IgPlatform;
|
||||||
|
for ( size_t idx = 0 ; idx < gSettings.Devices.ArbitraryArray.size() ; ++idx ) {
|
||||||
|
const SETTINGS_DATA::DevicesClass::ArbitraryPropertyClass& arbitraryProperty = gSettings.Devices.ArbitraryArray[idx];
|
||||||
|
for ( size_t jdx = 0 ; jdx < arbitraryProperty.CustomPropertyArray.size() ; ++jdx ) {
|
||||||
|
const SETTINGS_DATA::DevicesClass::SimplePropertyClass& customProperty = arbitraryProperty.CustomPropertyArray[jdx];
|
||||||
|
if ( customProperty.Key.contains("-platform-id") ) {
|
||||||
|
memcpy(&GlobalConfig.IgPlatform, customProperty.Key.data(), 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -2843,10 +2852,10 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
|||||||
/*Status = */EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (void **) &gDS);
|
/*Status = */EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (void **) &gDS);
|
||||||
|
|
||||||
ConsoleInHandle = SystemTable->ConsoleInHandle;
|
ConsoleInHandle = SystemTable->ConsoleInHandle;
|
||||||
|
//#define DEBUG_ERALY_CRASH
|
||||||
#ifdef DEBUG_ERALY_CRASH
|
#ifdef DEBUG_ERALY_CRASH
|
||||||
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Start");
|
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Step1");
|
||||||
PauseForKey(L"1) press any key\n");
|
PauseForKey(L"press any key\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_ON_SERIAL_PORT
|
#ifdef DEBUG_ON_SERIAL_PORT
|
||||||
@ -2857,12 +2866,21 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
|||||||
EFI_LOADED_IMAGE* LoadedImage;
|
EFI_LOADED_IMAGE* LoadedImage;
|
||||||
Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (void **) &LoadedImage);
|
Status = gBS->HandleProtocol(gImageHandle, &gEfiLoadedImageProtocolGuid, (void **) &LoadedImage);
|
||||||
|
|
||||||
|
#ifdef DEBUG_ERALY_CRASH
|
||||||
|
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Step2");
|
||||||
|
PauseForKey(L"press any key\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
// if ( !EFI_ERROR(Status) ) {
|
// if ( !EFI_ERROR(Status) ) {
|
||||||
// XString8 msg = S8Printf("CloverX64 : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
|
// XString8 msg = S8Printf("CloverX64 : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
|
||||||
// SerialPortWrite((UINT8*)msg.c_str(), msg.length());
|
// SerialPortWrite((UINT8*)msg.c_str(), msg.length());
|
||||||
// }
|
// }
|
||||||
if ( !EFI_ERROR(Status) ) {
|
if ( !EFI_ERROR(Status) ) {
|
||||||
DBG("CloverX64 : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
|
DBG("CloverX64 : Image base = 0x%llX\n", (uintptr_t)LoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger
|
||||||
|
#ifdef DEBUG_ERALY_CRASH
|
||||||
|
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Step3");
|
||||||
|
PauseForKey(L"press any key\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef JIEF_DEBUG
|
#ifdef JIEF_DEBUG
|
||||||
gBS->Stall(2500000); // to give time to gdb to connect
|
gBS->Stall(2500000); // to give time to gdb to connect
|
||||||
@ -2870,10 +2888,20 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_ERALY_CRASH
|
||||||
|
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Step4");
|
||||||
|
PauseForKey(L"press any key\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CLOVER_BUILD
|
#ifdef CLOVER_BUILD
|
||||||
construct_globals_objects(gImageHandle); // do this after self.getSelfLoadedImage() is initialized
|
construct_globals_objects(gImageHandle); // do this after self.getSelfLoadedImage() is initialized
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_ERALY_CRASH
|
||||||
|
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Step5");
|
||||||
|
PauseForKey(L"press any key\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef JIEF_DEBUG
|
#ifdef JIEF_DEBUG
|
||||||
// all_tests();
|
// all_tests();
|
||||||
// PauseForKey(L"press\n");
|
// PauseForKey(L"press\n");
|
||||||
@ -2881,10 +2909,15 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
|||||||
|
|
||||||
gRT->GetTime(&Now, NULL);
|
gRT->GetTime(&Now, NULL);
|
||||||
|
|
||||||
Status = InitRefitLib(gImageHandle);
|
Status = InitRefitLib(gImageHandle); // From here, debug.log starts to be saved because InitRefitLib call self.initialize()
|
||||||
if (EFI_ERROR(Status))
|
if (EFI_ERROR(Status))
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
|
#ifdef DEBUG_ERALY_CRASH
|
||||||
|
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Step6");
|
||||||
|
PauseForKey(L"press any key\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
// firmware detection
|
// firmware detection
|
||||||
gFirmwareClover = StrCmp(gST->FirmwareVendor, L"CLOVER") == 0;
|
gFirmwareClover = StrCmp(gST->FirmwareVendor, L"CLOVER") == 0;
|
||||||
if (!gFirmwareRevision) {
|
if (!gFirmwareRevision) {
|
||||||
@ -3138,10 +3171,6 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
|||||||
gEmuVariableControl->InstallEmulation(gEmuVariableControl);
|
gEmuVariableControl->InstallEmulation(gEmuVariableControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ERALY_CRASH
|
|
||||||
PauseForKey(L"2) press any key\n");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DbgHeader("InitScreen");
|
DbgHeader("InitScreen");
|
||||||
|
|
||||||
if (!GlobalConfig.isFastBoot()) {
|
if (!GlobalConfig.isFastBoot()) {
|
||||||
|
@ -217,7 +217,7 @@ void FillInputs(BOOLEAN New)
|
|||||||
InputItems[InputItemsCount].ItemType = BoolValue; //21+i*6
|
InputItems[InputItemsCount].ItemType = BoolValue; //21+i*6
|
||||||
InputItems[InputItemsCount++].BValue = gSettings.Graphics.InjectAsDict.InjectIntel;
|
InputItems[InputItemsCount++].BValue = gSettings.Graphics.InjectAsDict.InjectIntel;
|
||||||
InputItems[InputItemsCount].ItemType = Hex; //22+6i
|
InputItems[InputItemsCount].ItemType = Hex; //22+6i
|
||||||
InputItems[InputItemsCount++].SValue.SWPrintf("0x%08X", gSettings.Graphics.IgPlatform);
|
InputItems[InputItemsCount++].SValue.SWPrintf("0x%08X", GlobalConfig.IgPlatform);
|
||||||
// InputItemsCount += 3;
|
// InputItemsCount += 3;
|
||||||
// continue;
|
// continue;
|
||||||
}
|
}
|
||||||
@ -594,12 +594,12 @@ void ApplyInputs(void)
|
|||||||
hex2bin(InputItems[i].SValue, (UINT8*)&gSettings.Graphics.Dcfg[0], sizeof(gSettings.Graphics.Dcfg));
|
hex2bin(InputItems[i].SValue, (UINT8*)&gSettings.Graphics.Dcfg[0], sizeof(gSettings.Graphics.Dcfg));
|
||||||
} else if (gGraphics[j].Vendor == Intel) {
|
} else if (gGraphics[j].Vendor == Intel) {
|
||||||
//ig-platform-id for Ivy+ and snb-platform-id for Sandy
|
//ig-platform-id for Ivy+ and snb-platform-id for Sandy
|
||||||
gSettings.Graphics.IgPlatform = (UINT32)StrHexToUint64(InputItems[i].SValue.wc_str());
|
GlobalConfig.IgPlatform = (UINT32)StrHexToUint64(InputItems[i].SValue.wc_str());
|
||||||
DBG("applied *-platform-id=0x%X\n", gSettings.Graphics.IgPlatform);
|
DBG("applied *-platform-id=0x%X\n", GlobalConfig.IgPlatform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gGraphics[i].Vendor == Intel) {
|
if (gGraphics[j].Vendor == Intel) {
|
||||||
i += 3;
|
i += 3;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user