decorations

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2020-04-23 19:05:21 +03:00
parent 5d38db4501
commit c48bb89e2e
16 changed files with 478 additions and 484 deletions

View File

@ -687,7 +687,7 @@ AtaAtapiPassThruStart (
Instance = NULL; Instance = NULL;
OriginalPciAttributes = 0; OriginalPciAttributes = 0;
// DBG (L"==AtaAtapiPassThru Start== Controller = %x\n", Controller); // DBG(L"==AtaAtapiPassThru Start== Controller = %x\n", Controller);
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,
@ -699,7 +699,7 @@ AtaAtapiPassThruStart (
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
// DBG (L"Open Ide_Controller_Init Error, Status=%r", Status); // DBG(L"Open Ide_Controller_Init Error, Status=%r", Status);
goto ErrorExit; goto ErrorExit;
} }
@ -872,7 +872,7 @@ AtaAtapiPassThruStop (
EFI_AHCI_REGISTERS *AhciRegisters; EFI_AHCI_REGISTERS *AhciRegisters;
UINT64 Supports; UINT64 Supports;
// DBG (L"==AtaAtapiPassThru Stop== Controller = %x\n", Controller); // DBG(L"==AtaAtapiPassThru Stop== Controller = %x\n", Controller);
Status = gBS->OpenProtocol ( Status = gBS->OpenProtocol (
Controller, Controller,

View File

@ -2985,7 +2985,7 @@ DetectAndConfigIdeDevice (
} }
// DBG (L"start identifing device for channel [%d] device [%d]\n", IdeChannel, IdeDevice); // DBG(L"start identifing device for channel [%d] device [%d]\n", IdeChannel, IdeDevice);
// //
// Send IDENTIFY cmd to the device to test if it is really attached. // Send IDENTIFY cmd to the device to test if it is really attached.
@ -3044,7 +3044,7 @@ DetectAndConfigIdeDevice (
// //
IdeInit->SubmitData (IdeInit, IdeChannel, IdeDevice, &Buffer); IdeInit->SubmitData (IdeInit, IdeChannel, IdeDevice, &Buffer);
// DBG (L"CalculateMode for device for channel [%d] device [%d]\n", IdeChannel, IdeDevice); // DBG(L"CalculateMode for device for channel [%d] device [%d]\n", IdeChannel, IdeDevice);
// //
// Now start to config ide device parameter and transfer mode. // Now start to config ide device parameter and transfer mode.
// //
@ -3070,7 +3070,7 @@ DetectAndConfigIdeDevice (
} }
TransferMode.ModeNumber = (UINT8) (SupportedModes->PioMode.Mode); TransferMode.ModeNumber = (UINT8) (SupportedModes->PioMode.Mode);
// DBG (L"Set transfer Mode for channel [%d] device [%d] start\n", IdeChannel, IdeDevice); // DBG(L"Set transfer Mode for channel [%d] device [%d] start\n", IdeChannel, IdeDevice);
if (SupportedModes->ExtModeCount == 0){ if (SupportedModes->ExtModeCount == 0){
Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL); Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL);
@ -3127,7 +3127,7 @@ DetectAndConfigIdeDevice (
Status = SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameters, NULL); Status = SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParameters, NULL);
} }
// DBG (L"Set Parameters for channel [%d] device [%d] end\n", IdeChannel, IdeDevice); // DBG(L"Set Parameters for channel [%d] device [%d] end\n", IdeChannel, IdeDevice);
// //
// Set IDE controller Timing Blocks in the PCI Configuration Space // Set IDE controller Timing Blocks in the PCI Configuration Space
// //

View File

@ -160,7 +160,7 @@ PartitionInstallElToritoChildHandles (
Catalog Catalog
); );
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DBG ("EltCheckDevice: error reading catalog %r\n", Status); DBG("EltCheckDevice: error reading catalog %r\n", Status);
continue; continue;
} }
// //
@ -168,7 +168,7 @@ PartitionInstallElToritoChildHandles (
// to make sure it looks like a Catalog header // to make sure it looks like a Catalog header
// //
if (Catalog->Catalog.Indicator != ELTORITO_ID_CATALOG || Catalog->Catalog.Id55AA != 0xAA55) { if (Catalog->Catalog.Indicator != ELTORITO_ID_CATALOG || Catalog->Catalog.Id55AA != 0xAA55) {
DBG ("EltCheckBootCatalog: El Torito boot catalog header IDs=%x not correct\n", DBG("EltCheckBootCatalog: El Torito boot catalog header IDs=%x not correct\n",
Catalog->Catalog.Indicator); Catalog->Catalog.Indicator);
continue; continue;
} }
@ -180,7 +180,7 @@ PartitionInstallElToritoChildHandles (
} }
if ((Check & 0xFFFF) != 0) { if ((Check & 0xFFFF) != 0) {
DBG ( "EltCheckBootCatalog: El Torito boot catalog header checksum failed\n"); DBG( "EltCheckBootCatalog: El Torito boot catalog header checksum failed\n");
continue; continue;
} }

View File

@ -1900,15 +1900,15 @@ XhcCreateUsbHc (
Xhc->UsbLegSupOffset = XhcGetCapabilityAddr (Xhc, XHC_CAP_USB_LEGACY); Xhc->UsbLegSupOffset = XhcGetCapabilityAddr (Xhc, XHC_CAP_USB_LEGACY);
Xhc->DebugCapSupOffset = XhcGetCapabilityAddr (Xhc, XHC_CAP_USB_DEBUG); Xhc->DebugCapSupOffset = XhcGetCapabilityAddr (Xhc, XHC_CAP_USB_DEBUG);
DBG ("XhcCreateUsb3Hc: Capability length 0x%x\n", Xhc->CapLength); DBG("XhcCreateUsb3Hc: Capability length 0x%x\n", Xhc->CapLength);
DBG ("XhcCreateUsb3Hc: ExtCapRegBase 0x%x\n", Xhc->ExtCapRegBase); DBG("XhcCreateUsb3Hc: ExtCapRegBase 0x%x\n", Xhc->ExtCapRegBase);
DBG ("XhcCreateUsb3Hc: HcSParams1 0x%x\n", Xhc->HcSParams1); DBG("XhcCreateUsb3Hc: HcSParams1 0x%x\n", Xhc->HcSParams1);
DBG ("XhcCreateUsb3Hc: HcSParams2 0x%x\n", Xhc->HcSParams2); DBG("XhcCreateUsb3Hc: HcSParams2 0x%x\n", Xhc->HcSParams2);
DBG ("XhcCreateUsb3Hc: HcCParams 0x%x\n", Xhc->HcCParams); DBG("XhcCreateUsb3Hc: HcCParams 0x%x\n", Xhc->HcCParams);
DBG ("XhcCreateUsb3Hc: DBOff 0x%x\n", Xhc->DBOff); DBG("XhcCreateUsb3Hc: DBOff 0x%x\n", Xhc->DBOff);
DBG ("XhcCreateUsb3Hc: RTSOff 0x%x\n", Xhc->RTSOff); DBG("XhcCreateUsb3Hc: RTSOff 0x%x\n", Xhc->RTSOff);
DBG ("XhcCreateUsb3Hc: UsbLegSupOffset 0x%x\n", Xhc->UsbLegSupOffset); DBG("XhcCreateUsb3Hc: UsbLegSupOffset 0x%x\n", Xhc->UsbLegSupOffset);
DBG ("XhcCreateUsb3Hc: DebugCapSupOffset 0x%x\n", Xhc->DebugCapSupOffset); DBG("XhcCreateUsb3Hc: DebugCapSupOffset 0x%x\n", Xhc->DebugCapSupOffset);
// //
// Create AsyncRequest Polling Timer // Create AsyncRequest Polling Timer

View File

@ -458,7 +458,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
DTD_string, DTD_string,
-1 -1
); );
DBG (" patched %d time(s)\n", NumReplaces); DBG(" patched %d time(s)\n", NumReplaces);
return; return;
} }
@ -647,7 +647,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
-1 -1
); );
// NumReplacesTotal += NumReplaces; // NumReplacesTotal += NumReplaces;
DBG (" patch 0: patched %d time(s)\n", NumReplaces); DBG(" patch 0: patched %d time(s)\n", NumReplaces);
NumReplaces = VideoBiosPatchSearchAndReplace ( NumReplaces = VideoBiosPatchSearchAndReplace (
(UINT8*)(UINTN)VBIOS_START, (UINT8*)(UINTN)VBIOS_START,
VBIOS_SIZE, VBIOS_SIZE,
@ -656,7 +656,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
-1 -1
); );
// NumReplacesTotal += NumReplaces; // NumReplacesTotal += NumReplaces;
DBG (" patch 1: patched %d time(s)\n", NumReplaces); DBG(" patch 1: patched %d time(s)\n", NumReplaces);
NumReplaces = VideoBiosPatchSearchAndReplace ( NumReplaces = VideoBiosPatchSearchAndReplace (
(UINT8*)(UINTN)VBIOS_START, (UINT8*)(UINTN)VBIOS_START,
VBIOS_SIZE, VBIOS_SIZE,
@ -665,7 +665,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
-1 -1
); );
// NumReplacesTotal += NumReplaces; // NumReplacesTotal += NumReplaces;
DBG (" patch 2: patched %d time(s)\n", NumReplaces); DBG(" patch 2: patched %d time(s)\n", NumReplaces);
NumReplaces = VideoBiosPatchSearchAndReplace ( NumReplaces = VideoBiosPatchSearchAndReplace (
(UINT8*)(UINTN)VBIOS_START, (UINT8*)(UINTN)VBIOS_START,
VBIOS_SIZE, VBIOS_SIZE,
@ -674,7 +674,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
-1 -1
); );
// NumReplacesTotal += NumReplaces; // NumReplacesTotal += NumReplaces;
DBG (" patch 3: patched %d time(s)\n", NumReplaces); DBG(" patch 3: patched %d time(s)\n", NumReplaces);
if ((*((UINT8*)(UINTN)(VBIOS_START + 0x34)) & 0x8F) == 0x80 ) { if ((*((UINT8*)(UINTN)(VBIOS_START + 0x34)) & 0x8F) == 0x80 ) {
*((UINT8*)(UINTN)(VBIOS_START + 0x34)) |= 0x01; *((UINT8*)(UINTN)(VBIOS_START + 0x34)) |= 0x01;

View File

@ -83,21 +83,21 @@ VideoBiosPatchInit (
return EFI_SUCCESS; return EFI_SUCCESS;
} }
DBG (" VideoBiosPatchInit("); DBG(" VideoBiosPatchInit(");
// //
// Check for EfiLegacyRegionProtocol and/or EfiLegacyRegion2Protocol // Check for EfiLegacyRegionProtocol and/or EfiLegacyRegion2Protocol
// //
Status = gBS->LocateProtocol (&gEfiLegacyRegionProtocolGuid, NULL, (VOID **) &mLegacyRegion); Status = gBS->LocateProtocol (&gEfiLegacyRegionProtocolGuid, NULL, (VOID **) &mLegacyRegion);
DBG ("LegacyRegion = %r", Status); DBG("LegacyRegion = %r", Status);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
mLegacyRegion = NULL; mLegacyRegion = NULL;
Status = gBS->LocateProtocol (&gEfiLegacyRegion2ProtocolGuid, NULL, (VOID **) &mLegacyRegion2); Status = gBS->LocateProtocol (&gEfiLegacyRegion2ProtocolGuid, NULL, (VOID **) &mLegacyRegion2);
DBG (", LegacyRegion2 = %r", Status); DBG(", LegacyRegion2 = %r", Status);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
mLegacyRegion2 = NULL; mLegacyRegion2 = NULL;
} }
} }
DBG (") = %r\n", Status); DBG(") = %r\n", Status);
return Status; return Status;
} }
@ -215,10 +215,10 @@ VideoBiosPatchBytes (
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
DBG ("VideoBiosPatchBytes(%d patches):\n", FindAndReplaceCount); DBG("VideoBiosPatchBytes(%d patches):\n", FindAndReplaceCount);
Status = VideoBiosUnlock (); Status = VideoBiosUnlock ();
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DBG (" = not done.\n"); DBG(" = not done.\n");
return Status; return Status;
} }
@ -234,10 +234,10 @@ VideoBiosPatchBytes (
-1 -1
); );
NumReplacesTotal += NumReplaces; NumReplacesTotal += NumReplaces;
DBG (" patch %d: patched %d time(s)\n", Index, NumReplaces); DBG(" patch %d: patched %d time(s)\n", Index, NumReplaces);
} }
DBG (" patched %d time(s)\n", NumReplacesTotal); DBG(" patched %d time(s)\n", NumReplacesTotal);
VideoBiosLock (); VideoBiosLock ();
@ -258,7 +258,7 @@ UINT8* VideoBiosPatchGetEdid (VOID)
EFI_EDID_ACTIVE_PROTOCOL *EdidProtocol; EFI_EDID_ACTIVE_PROTOCOL *EdidProtocol;
UINT8 *Edid; UINT8 *Edid;
DBG (" Edid:"); DBG(" Edid:");
Edid = NULL; Edid = NULL;
Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol); Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
@ -293,7 +293,7 @@ VideoBiosPatchNativeFromEdid (
BOOLEAN ReleaseEdid; BOOLEAN ReleaseEdid;
vbios_map *map; vbios_map *map;
DBG ("VideoBiosPatchNativeFromEdid:\n"); DBG("VideoBiosPatchNativeFromEdid:\n");
ReleaseEdid = FALSE; ReleaseEdid = FALSE;
if (Edid == NULL) { if (Edid == NULL) {
@ -306,7 +306,7 @@ VideoBiosPatchNativeFromEdid (
map = open_vbios(CT_UNKNOWN); map = open_vbios(CT_UNKNOWN);
if (map == NULL) { if (map == NULL) {
DBG (" = unknown video bios.\n"); DBG(" = unknown video bios.\n");
if (ReleaseEdid) { if (ReleaseEdid) {
FreePool(Edid); FreePool(Edid);
} }
@ -315,7 +315,7 @@ VideoBiosPatchNativeFromEdid (
Status = VideoBiosUnlock (); Status = VideoBiosUnlock ();
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
DBG (" = not done.\n"); DBG(" = not done.\n");
return Status; return Status;
} }

View File

@ -563,7 +563,7 @@ ProtectRtDataFromRelocation(
++RelocInfo; ++RelocInfo;
++gRelocInfoData.NumEntries; ++gRelocInfoData.NumEntries;
} else { } else {
DBG (" WARNING: Cannot save mem type for entry: %lx (type 0x%x)\n", Desc->PhysicalStart, (UINTN)Desc->Type); DBG(" WARNING: Cannot save mem type for entry: %lx (type 0x%x)\n", Desc->PhysicalStart, (UINTN)Desc->Type);
} }
DBG(" RT mem %lx (0x%x) -> MemMapIO\n", Desc->PhysicalStart, Desc->NumberOfPages); DBG(" RT mem %lx (0x%x) -> MemMapIO\n", Desc->PhysicalStart, Desc->NumberOfPages);

View File

@ -64,7 +64,7 @@ UINT8* getCurrentEdid (VOID)
EFI_EDID_ACTIVE_PROTOCOL *EdidProtocol; EFI_EDID_ACTIVE_PROTOCOL *EdidProtocol;
UINT8 *Edid; UINT8 *Edid;
DBG ("EdidActive:"); DBG("EdidActive:");
Edid = NULL; Edid = NULL;
Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol); Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {

View File

@ -1000,9 +1000,9 @@ static VOID PatchBbsTable(EFI_LEGACY_BIOS_PROTOCOL *LegacyBios, UINT16 BootEntry
&LocalBbsTable &LocalBbsTable
); );
DBG ("BBS Table of size %d, patching priorities Pold->Pnew:\n", BbsCount); DBG("BBS Table of size %d, patching priorities Pold->Pnew:\n", BbsCount);
DBG (" NO: BBS# Pold Pnew bb/dd/ff cl/sc Type Stat segm:offs\n"); DBG(" NO: BBS# Pold Pnew bb/dd/ff cl/sc Type Stat segm:offs\n");
DBG (" =====================================================\n"); DBG(" =====================================================\n");
for (Idx = 0; Idx < BbsCount; Idx++) { for (Idx = 0; Idx < BbsCount; Idx++) {
if ((LocalBbsTable[Idx].BootPriority == BBS_IGNORE_ENTRY) || if ((LocalBbsTable[Idx].BootPriority == BBS_IGNORE_ENTRY) ||
@ -1019,7 +1019,7 @@ static VOID PatchBbsTable(EFI_LEGACY_BIOS_PROTOCOL *LegacyBios, UINT16 BootEntry
LocalBbsTable[Idx].BootPriority = Priority++; LocalBbsTable[Idx].BootPriority = Priority++;
} }
DBG (" %02llu: 0x%02llX %04llX %04llX %02llX/%02llX/%02llX %02llX/%02llX %04llX %04llX %04llX:%04llX\n", DBG(" %02llu: 0x%02llX %04llX %04llX %02llX/%02llX/%02llX %02llX/%02llX %04llX %04llX %04llX:%04llX\n",
(UINTN) IdxCount, (UINTN) IdxCount,
(UINTN) Idx, (UINTN) Idx,
(UINTN) OldPriority, (UINTN) OldPriority,

View File

@ -150,31 +150,31 @@ SetNvramVariable (
UINTN OldDataSize = 0; UINTN OldDataSize = 0;
UINT32 OldAttributes = 0; UINT32 OldAttributes = 0;
//DBG ("SetNvramVariable (%ls, guid, 0x%X, %d):", VariableName, Attributes, DataSize); //DBG("SetNvramVariable (%ls, guid, 0x%X, %d):", VariableName, Attributes, DataSize);
OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, &OldAttributes, &OldDataSize); OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, &OldAttributes, &OldDataSize);
if (OldData != NULL) { if (OldData != NULL) {
// var already exists - check if it equal to new value // var already exists - check if it equal to new value
//DBG (" exists(0x%X, %d)", OldAttributes, OldDataSize); //DBG(" exists(0x%X, %d)", OldAttributes, OldDataSize);
if ((OldAttributes == Attributes) && if ((OldAttributes == Attributes) &&
(OldDataSize == DataSize) && (OldDataSize == DataSize) &&
(CompareMem (OldData, Data, DataSize) == 0)) { (CompareMem (OldData, Data, DataSize) == 0)) {
// it's the same - do nothing // it's the same - do nothing
//DBG (", equal -> not writing again.\n"); //DBG(", equal -> not writing again.\n");
FreePool(OldData); FreePool(OldData);
return EFI_SUCCESS; return EFI_SUCCESS;
} }
//DBG (", not equal\n"); //DBG(", not equal\n");
FreePool(OldData); FreePool(OldData);
// not the same - delete previous one if attributes are different // not the same - delete previous one if attributes are different
if (OldAttributes != Attributes) { if (OldAttributes != Attributes) {
DeleteNvramVariable (VariableName, VendorGuid); DeleteNvramVariable (VariableName, VendorGuid);
//DBG (", diff. attr: deleting old (%s)", strerror(Status)); //DBG(", diff. attr: deleting old (%s)", strerror(Status));
} }
} }
//DBG ("\n"); // for debug without Status //DBG("\n"); // for debug without Status
//DBG (" -> writing new (%s)\n", strerror(Status)); //DBG(" -> writing new (%s)\n", strerror(Status));
//return Status; //return Status;
return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, (VOID*)Data); // CONST missing in EFI_SET_VARIABLE->SetVariable return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, (VOID*)Data); // CONST missing in EFI_SET_VARIABLE->SetVariable
@ -193,13 +193,13 @@ AddNvramVariable (
{ {
VOID *OldData; VOID *OldData;
//DBG ("SetNvramVariable (%ls, guid, 0x%X, %d):\n", VariableName, Attributes, DataSize); //DBG("SetNvramVariable (%ls, guid, 0x%X, %d):\n", VariableName, Attributes, DataSize);
OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, NULL, NULL); OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, NULL, NULL);
if (OldData == NULL) if (OldData == NULL)
{ {
// set new value // set new value
return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data); return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
// DBG (" -> writing new (%s)\n", strerror(Status)); // DBG(" -> writing new (%s)\n", strerror(Status));
} else { } else {
FreePool(OldData); FreePool(OldData);
return EFI_ABORTED; return EFI_ABORTED;
@ -218,7 +218,7 @@ DeleteNvramVariable (
// Delete: attributes and data size = 0 // Delete: attributes and data size = 0
Status = gRT->SetVariable (VariableName, VendorGuid, 0, 0, NULL); Status = gRT->SetVariable (VariableName, VendorGuid, 0, 0, NULL);
//DBG ("DeleteNvramVariable (%ls, guid = %s):\n", VariableName, strerror(Status)); //DBG("DeleteNvramVariable (%ls, guid = %s):\n", VariableName, strerror(Status));
return Status; return Status;
} }
@ -318,13 +318,13 @@ ResetNativeNvram ()
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
if (IsDeletableVariable (Name, &Guid)) { if (IsDeletableVariable (Name, &Guid)) {
//DBG ("Deleting %s:%ls...", strguid(&Guid), Name); //DBG("Deleting %s:%ls...", strguid(&Guid), Name);
Status = DeleteNvramVariable(Name, &Guid); Status = DeleteNvramVariable(Name, &Guid);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {
//DBG ("OK\n"); //DBG("OK\n");
Restart = TRUE; Restart = TRUE;
} else { } else {
//DBG ("FAIL (%s)\n", strerror(Status)); //DBG("FAIL (%s)\n", strerror(Status));
break; break;
} }
} }
@ -535,7 +535,7 @@ EFI_GUID
/** detailed debug for BootVolumeDevicePathEqual */ /** detailed debug for BootVolumeDevicePathEqual */
#define DBG_DP(...) #define DBG_DP(...)
//#define DBG_DP(...) DBG (__VA_ARGS__) //#define DBG_DP(...) DBG(__VA_ARGS__)
/** Returns TRUE if dev paths are equal. Ignores some differences. */ /** Returns TRUE if dev paths are equal. Ignores some differences. */
BOOLEAN BOOLEAN
@ -708,10 +708,10 @@ GetEfiBootDeviceFromNvram ()
DbgHeader("GetEfiBootDeviceFromNvram"); DbgHeader("GetEfiBootDeviceFromNvram");
// DBG ("GetEfiBootDeviceFromNvram:"); // DBG("GetEfiBootDeviceFromNvram:");
if (gEfiBootDeviceData != NULL) { if (gEfiBootDeviceData != NULL) {
// DBG (" - [!] already parsed\n"); // DBG(" - [!] already parsed\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }
@ -747,12 +747,12 @@ GetEfiBootDeviceFromNvram ()
} }
} }
if (gEfiBootDeviceData == NULL) { if (gEfiBootDeviceData == NULL) {
// DBG (" - [!] efi-boot-device-data not found\n"); // DBG(" - [!] efi-boot-device-data not found\n");
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
// DBG ("\n"); // DBG("\n");
DBG (" - efi-boot-device-data: %ls\n", FileDevicePathToStr (gEfiBootDeviceData)); DBG(" - efi-boot-device-data: %ls\n", FileDevicePathToStr (gEfiBootDeviceData));
gEfiBootVolume = gEfiBootDeviceData; gEfiBootVolume = gEfiBootDeviceData;
@ -765,18 +765,18 @@ GetEfiBootDeviceFromNvram ()
gEfiBootVolume = gBootCampHD; gEfiBootVolume = gBootCampHD;
if (gBootCampHD == NULL) { if (gBootCampHD == NULL) {
// DBG (" - [!] Error: BootCampHD not found\n"); // DBG(" - [!] Error: BootCampHD not found\n");
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
if (!IsDevicePathValid(gBootCampHD, Size)) { if (!IsDevicePathValid(gBootCampHD, Size)) {
// DBG (" Error: BootCampHD device path is invalid\n"); // DBG(" Error: BootCampHD device path is invalid\n");
FreePool(gBootCampHD); FreePool(gBootCampHD);
gEfiBootVolume = gBootCampHD = NULL; gEfiBootVolume = gBootCampHD = NULL;
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
DBG (" - BootCampHD: %ls\n", FileDevicePathToStr (gBootCampHD)); DBG(" - BootCampHD: %ls\n", FileDevicePathToStr (gBootCampHD));
} }
// //
@ -793,8 +793,8 @@ GetEfiBootDeviceFromNvram ()
// gEfiBootVolume now contains only Volume path // gEfiBootVolume now contains only Volume path
} }
DBG (" - Volume: '%ls'\n", FileDevicePathToStr (gEfiBootVolume)); DBG(" - Volume: '%ls'\n", FileDevicePathToStr (gEfiBootVolume));
DBG (" - LoaderPath: '%ls'\n", gEfiBootLoaderPath); DBG(" - LoaderPath: '%ls'\n", gEfiBootLoaderPath);
// //
// if this is GPT disk, extract GUID // if this is GPT disk, extract GUID
@ -805,7 +805,7 @@ GetEfiBootDeviceFromNvram ()
gEfiBootDeviceGuid = (__typeof__(gEfiBootDeviceGuid))AllocatePool (sizeof(EFI_GUID)); gEfiBootDeviceGuid = (__typeof__(gEfiBootDeviceGuid))AllocatePool (sizeof(EFI_GUID));
if (gEfiBootDeviceGuid != NULL) { if (gEfiBootDeviceGuid != NULL) {
CopyMem (gEfiBootDeviceGuid, Guid, sizeof(EFI_GUID)); CopyMem (gEfiBootDeviceGuid, Guid, sizeof(EFI_GUID));
DBG (" - Guid = %s\n", strguid(gEfiBootDeviceGuid)); DBG(" - Guid = %s\n", strguid(gEfiBootDeviceGuid));
} }
} }
@ -837,18 +837,18 @@ LoadNvramPlist (
// //
Status = egLoadFile (RootDir, NVRAMPlistPath, (UINT8**)&NvramPtr, &Size); Status = egLoadFile (RootDir, NVRAMPlistPath, (UINT8**)&NvramPtr, &Size);
if(EFI_ERROR(Status)) { if(EFI_ERROR(Status)) {
DBG (" not present\n"); DBG(" not present\n");
return Status; return Status;
} }
DBG (" loaded, size=%llu\n", Size); DBG(" loaded, size=%llu\n", Size);
// //
// parse it into gNvramDict // parse it into gNvramDict
// //
Status = ParseXML ((const CHAR8*)NvramPtr, &gNvramDict, (UINT32)Size); Status = ParseXML ((const CHAR8*)NvramPtr, &gNvramDict, (UINT32)Size);
// if(Status != EFI_SUCCESS) { // if(Status != EFI_SUCCESS) {
// DBG (" parsing error\n"); // DBG(" parsing error\n");
// } // }
FreePool(NvramPtr); FreePool(NvramPtr);
@ -874,16 +874,16 @@ LoadLatestNvramPlist ()
REFIT_VOLUME *VolumeWithLatestNvramPlist = NULL; REFIT_VOLUME *VolumeWithLatestNvramPlist = NULL;
//there are debug messages not needed for users //there are debug messages not needed for users
DBG ("Searching volumes for latest nvram.plist ..."); DBG("Searching volumes for latest nvram.plist ...");
// //
// skip loading if already loaded // skip loading if already loaded
// //
if (gNvramDict != NULL) { if (gNvramDict != NULL) {
DBG (" already loaded\n"); DBG(" already loaded\n");
return EFI_SUCCESS; return EFI_SUCCESS;
} }
DBG ("\n"); DBG("\n");
// //
// find latest nvram.plist // find latest nvram.plist
@ -901,16 +901,16 @@ LoadLatestNvramPlist ()
/* Guid = FindGPTPartitionGuidInDevicePath (Volume->DevicePath); /* Guid = FindGPTPartitionGuidInDevicePath (Volume->DevicePath);
DBG (" %2d. Volume '%ls', GUID = %s", Index, Volume->VolName, strguid(Guid)); DBG(" %2d. Volume '%ls', GUID = %s", Index, Volume->VolName, strguid(Guid));
if (Guid == NULL) { if (Guid == NULL) {
// not a GUID partition // not a GUID partition
DBG (" - not GPT"); DBG(" - not GPT");
} */ } */
// DBG("Volume[%d]\n", Index); // DBG("Volume[%d]\n", Index);
// check if nvram.plist exists // check if nvram.plist exists
Status = Volume->RootDir->Open (Volume->RootDir, &FileHandle, L"nvram.plist", EFI_FILE_MODE_READ, 0); Status = Volume->RootDir->Open (Volume->RootDir, &FileHandle, L"nvram.plist", EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
// DBG (" - no nvram.plist - skipping!\n"); // DBG(" - no nvram.plist - skipping!\n");
continue; continue;
} }
// DBG(" Status=%s\n", strerror(Status)); // DBG(" Status=%s\n", strerror(Status));
@ -923,14 +923,14 @@ LoadLatestNvramPlist ()
FileInfo = EfiLibFileInfo(FileHandle); FileInfo = EfiLibFileInfo(FileHandle);
// DBG("got FileInfo=0x%X\n", FileInfo); // DBG("got FileInfo=0x%X\n", FileInfo);
if (FileInfo == NULL) { if (FileInfo == NULL) {
// DBG (" - no nvram.plist file info - skipping!\n"); // DBG(" - no nvram.plist file info - skipping!\n");
FileHandle->Close(FileHandle); FileHandle->Close(FileHandle);
continue; continue;
} }
// DBG (" Modified = "); // DBG(" Modified = ");
ModifTimeMs = GetEfiTimeInMs (&(FileInfo->ModificationTime)); ModifTimeMs = GetEfiTimeInMs (&(FileInfo->ModificationTime));
/* DBG ("%d-%d-%d %d:%d:%d (%ld ms)\n", /* DBG("%d-%d-%d %d:%d:%d (%ld ms)\n",
FileInfo->ModificationTime.Year, FileInfo->ModificationTime.Month, FileInfo->ModificationTime.Day, FileInfo->ModificationTime.Year, FileInfo->ModificationTime.Month, FileInfo->ModificationTime.Day,
FileInfo->ModificationTime.Hour, FileInfo->ModificationTime.Minute, FileInfo->ModificationTime.Second, FileInfo->ModificationTime.Hour, FileInfo->ModificationTime.Minute, FileInfo->ModificationTime.Second,
ModifTimeMs); */ ModifTimeMs); */
@ -939,11 +939,11 @@ LoadLatestNvramPlist ()
// check if newer // check if newer
if (LastModifTimeMs < ModifTimeMs) { if (LastModifTimeMs < ModifTimeMs) {
// DBG (" - newer - will use this one\n"); // DBG(" - newer - will use this one\n");
VolumeWithLatestNvramPlist = Volume; VolumeWithLatestNvramPlist = Volume;
LastModifTimeMs = ModifTimeMs; LastModifTimeMs = ModifTimeMs;
} else { } else {
// DBG (" - older - skipping!\n"); // DBG(" - older - skipping!\n");
} }
} }
@ -953,11 +953,11 @@ LoadLatestNvramPlist ()
// if we have nvram.plist - load it // if we have nvram.plist - load it
// //
if (VolumeWithLatestNvramPlist != NULL) { if (VolumeWithLatestNvramPlist != NULL) {
DBG ("Loading nvram.plist from Vol '%ls' -", VolumeWithLatestNvramPlist->VolName); DBG("Loading nvram.plist from Vol '%ls' -", VolumeWithLatestNvramPlist->VolName);
Status = LoadNvramPlist (VolumeWithLatestNvramPlist->RootDir, L"nvram.plist"); Status = LoadNvramPlist (VolumeWithLatestNvramPlist->RootDir, L"nvram.plist");
} else { } else {
// DBG (" nvram.plist not found!\n"); // DBG(" nvram.plist not found!\n");
} }
DBG("loaded Status=%s\n", strerror(Status)); DBG("loaded Status=%s\n", strerror(Status));
return Status; return Status;
@ -980,13 +980,13 @@ PutNvramPlistToRtVars ()
if (gNvramDict == NULL) { if (gNvramDict == NULL) {
Status = LoadLatestNvramPlist (); Status = LoadLatestNvramPlist ();
if (gNvramDict == NULL) { if (gNvramDict == NULL) {
DBG ("PutNvramPlistToRtVars: nvram.plist not found\n"); DBG("PutNvramPlistToRtVars: nvram.plist not found\n");
return; return;
} }
} }
DbgHeader("PutNvramPlistToRtVars"); DbgHeader("PutNvramPlistToRtVars");
// DBG ("PutNvramPlistToRtVars ...\n"); // DBG("PutNvramPlistToRtVars ...\n");
// iterate over dict elements // iterate over dict elements
for (Tag = gNvramDict->tag; Tag != NULL; Tag = Tag->tagNext) { for (Tag = gNvramDict->tag; Tag != NULL; Tag = Tag->tagNext) {
EFI_GUID *VendorGuid = &gEfiAppleBootGuid; EFI_GUID *VendorGuid = &gEfiAppleBootGuid;
@ -995,29 +995,29 @@ PutNvramPlistToRtVars ()
// process only valid <key> tags // process only valid <key> tags
if (Tag->type != kTagTypeKey || ValTag == NULL) { if (Tag->type != kTagTypeKey || ValTag == NULL) {
DBG (" ERROR: Tag is not <key>, type = %llu\n", Tag->type); DBG(" ERROR: Tag is not <key>, type = %llu\n", Tag->type);
continue; continue;
} }
// DBG("tag: %s\n", Tag->string); // DBG("tag: %s\n", Tag->string);
// skip OsxAptioFixDrv-RelocBase - appears and causes trouble // skip OsxAptioFixDrv-RelocBase - appears and causes trouble
// in kernel and kext patcher when mixing UEFI and CloverEFI boot // in kernel and kext patcher when mixing UEFI and CloverEFI boot
if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-RelocBase") == 0) { if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-RelocBase") == 0) {
DBG (" Skipping OsxAptioFixDrv-RelocBase\n"); DBG(" Skipping OsxAptioFixDrv-RelocBase\n");
continue; continue;
} else if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-ErrorExitingBootServices") == 0) { } else if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-ErrorExitingBootServices") == 0) {
DBG (" Skipping OsxAptioFixDrv-ErrorExitingBootServices\n"); DBG(" Skipping OsxAptioFixDrv-ErrorExitingBootServices\n");
continue; continue;
} else if (AsciiStrCmp(Tag->string, "EmuVariableUefiPresent") == 0) { } else if (AsciiStrCmp(Tag->string, "EmuVariableUefiPresent") == 0) {
DBG (" Skipping EmuVariableUefiPresent\n"); DBG(" Skipping EmuVariableUefiPresent\n");
continue; continue;
} else if (AsciiStrCmp(Tag->string, "aapl,panic-info") == 0) { } else if (AsciiStrCmp(Tag->string, "aapl,panic-info") == 0) {
DBG (" Skipping aapl,panic-info\n"); DBG(" Skipping aapl,panic-info\n");
continue; continue;
} }
// key to unicode; check if key buffer is large enough // key to unicode; check if key buffer is large enough
if (AsciiStrLen (Tag->string) > (sizeof(KeyBuf) / 2 - 1)) { if (AsciiStrLen (Tag->string) > (sizeof(KeyBuf) / 2 - 1)) {
DBG (" ERROR: Skipping too large key %s\n", Tag->string); DBG(" ERROR: Skipping too large key %s\n", Tag->string);
continue; continue;
} }
@ -1029,7 +1029,7 @@ PutNvramPlistToRtVars ()
AsciiStrToUnicodeStrS(Tag->string, KeyBuf, 128); AsciiStrToUnicodeStrS(Tag->string, KeyBuf, 128);
if (!GlobalConfig.DebugLog) { if (!GlobalConfig.DebugLog) {
DBG (" Adding Key: %ls: ", KeyBuf); DBG(" Adding Key: %ls: ", KeyBuf);
} }
// process value tag // process value tag
@ -1039,7 +1039,7 @@ PutNvramPlistToRtVars ()
Value = ValTag->string; Value = ValTag->string;
Size = AsciiStrLen((CONST CHAR8*)Value); Size = AsciiStrLen((CONST CHAR8*)Value);
if (!GlobalConfig.DebugLog) { if (!GlobalConfig.DebugLog) {
DBG ("String: Size = %lld, Val = '%s'\n", Size, (__typeof__(ValTag->string))Value); DBG("String: Size = %lld, Val = '%s'\n", Size, (__typeof__(ValTag->string))Value);
} }
} else if (ValTag->type == kTagTypeData) { } else if (ValTag->type == kTagTypeData) {
@ -1048,16 +1048,16 @@ PutNvramPlistToRtVars ()
Size = ValTag->dataLen; Size = ValTag->dataLen;
Value = ValTag->data; Value = ValTag->data;
if (!GlobalConfig.DebugLog) { if (!GlobalConfig.DebugLog) {
DBG ("Size = %lld, Data: ", Size); DBG("Size = %lld, Data: ", Size);
for (i = 0; i < Size; i++) { for (i = 0; i < Size; i++) {
DBG("%02hhX ", *((__typeof__(ValTag->string))Value + i)); DBG("%02hhX ", *((__typeof__(ValTag->string))Value + i));
} }
} }
if (!GlobalConfig.DebugLog) { if (!GlobalConfig.DebugLog) {
DBG ("\n"); DBG("\n");
} }
} else { } else {
DBG ("ERROR: Unsupported tag type: %llu\n", ValTag->type); DBG("ERROR: Unsupported tag type: %llu\n", ValTag->type);
continue; continue;
} }
@ -1104,7 +1104,7 @@ FindStartupDiskVolume (
CHAR16 *EfiBootVolumeStr; CHAR16 *EfiBootVolumeStr;
// DBG ("FindStartupDiskVolume ...\n"); // DBG("FindStartupDiskVolume ...\n");
// //
@ -1113,67 +1113,67 @@ FindStartupDiskVolume (
// //
GetEfiBootDeviceFromNvram (); GetEfiBootDeviceFromNvram ();
if (gEfiBootVolume == NULL) { if (gEfiBootVolume == NULL) {
// DBG (" - [!] EfiBootVolume not found\n"); // DBG(" - [!] EfiBootVolume not found\n");
return -1; return -1;
} }
DbgHeader("FindStartupDiskVolume"); DbgHeader("FindStartupDiskVolume");
// DBG ("FindStartupDiskVolume searching ...\n"); // DBG("FindStartupDiskVolume searching ...\n");
// //
// Check if gEfiBootVolume is disk or partition volume // Check if gEfiBootVolume is disk or partition volume
// //
EfiBootVolumeStr = FileDevicePathToStr (gEfiBootVolume); EfiBootVolumeStr = FileDevicePathToStr (gEfiBootVolume);
IsPartitionVolume = NULL != FindDevicePathNodeWithType (gEfiBootVolume, MEDIA_DEVICE_PATH, 0); IsPartitionVolume = NULL != FindDevicePathNodeWithType (gEfiBootVolume, MEDIA_DEVICE_PATH, 0);
DBG (" - Volume: %ls = %ls\n", IsPartitionVolume ? L"partition" : L"disk", EfiBootVolumeStr); DBG(" - Volume: %ls = %ls\n", IsPartitionVolume ? L"partition" : L"disk", EfiBootVolumeStr);
// //
// 1. gEfiBootVolume + gEfiBootLoaderPath // 1. gEfiBootVolume + gEfiBootLoaderPath
// PciRoot(0x0)/.../Sata(...)/HD(...)/\EFI\BOOT\XXX.EFI - set by Clover // PciRoot(0x0)/.../Sata(...)/HD(...)/\EFI\BOOT\XXX.EFI - set by Clover
// //
if (gEfiBootLoaderPath != NULL) { if (gEfiBootLoaderPath != NULL) {
DBG (" - searching for that partition and loader '%ls'\n", gEfiBootLoaderPath); DBG(" - searching for that partition and loader '%ls'\n", gEfiBootLoaderPath);
for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) {
if (MainMenu->Entries[Index].getLOADER_ENTRY()) { if (MainMenu->Entries[Index].getLOADER_ENTRY()) {
LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY(); LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY();
Volume = LoaderEntry.Volume; Volume = LoaderEntry.Volume;
LoaderPath = LoaderEntry.LoaderPath; LoaderPath = LoaderEntry.LoaderPath;
if (Volume != NULL && BootVolumeDevicePathEqual(gEfiBootVolume, Volume->DevicePath)) { if (Volume != NULL && BootVolumeDevicePathEqual(gEfiBootVolume, Volume->DevicePath)) {
//DBG (" checking '%ls'\n", DevicePathToStr (Volume->DevicePath)); //DBG(" checking '%ls'\n", DevicePathToStr (Volume->DevicePath));
//DBG (" '%ls'\n", LoaderPath); //DBG(" '%ls'\n", LoaderPath);
// case insensitive cmp // case insensitive cmp
if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) { if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) {
// that's the one // that's the one
DBG (" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath); DBG(" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath);
return Index; return Index;
} }
} }
} }
} }
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
// //
// search again, but compare only Media dev path nodes // search again, but compare only Media dev path nodes
// (in case of some dev path differences we do not cover) // (in case of some dev path differences we do not cover)
// //
DBG (" - searching again, but comparing Media dev path nodes\n"); DBG(" - searching again, but comparing Media dev path nodes\n");
for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) {
if (MainMenu->Entries[Index].getLOADER_ENTRY()) { if (MainMenu->Entries[Index].getLOADER_ENTRY()) {
LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY(); LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY();
Volume = LoaderEntry.Volume; Volume = LoaderEntry.Volume;
LoaderPath = LoaderEntry.LoaderPath; LoaderPath = LoaderEntry.LoaderPath;
if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) { if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) {
//DBG (" checking '%ls'\n", DevicePathToStr (Volume->DevicePath)); //DBG(" checking '%ls'\n", DevicePathToStr (Volume->DevicePath));
//DBG (" '%ls'\n", LoaderPath); //DBG(" '%ls'\n", LoaderPath);
// case insensitive cmp // case insensitive cmp
if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) { if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) {
// that's the one // that's the one
DBG (" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath); DBG(" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath);
return Index; return Index;
} }
} }
} }
} }
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
} }
// //
@ -1181,7 +1181,7 @@ FindStartupDiskVolume (
// PciRoot(0x0)/.../Sata(...)/HD(...) - set by Clover or macOS // PciRoot(0x0)/.../Sata(...)/HD(...) - set by Clover or macOS
// //
if (IsPartitionVolume) { if (IsPartitionVolume) {
DBG (" - searching for that partition\n"); DBG(" - searching for that partition\n");
for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) {
Volume = NULL; Volume = NULL;
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) { if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
@ -1190,15 +1190,15 @@ FindStartupDiskVolume (
Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume; Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume;
} }
if (Volume != NULL && BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) { if (Volume != NULL && BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) {
DBG (" - found entry %lld. '%ls', Volume '%ls'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName); DBG(" - found entry %lld. '%ls', Volume '%ls'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName);
return Index; return Index;
} }
} }
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
// //
// search again, but compare only Media dev path nodes // search again, but compare only Media dev path nodes
// //
DBG (" - searching again, but comparing Media dev path nodes\n"); DBG(" - searching again, but comparing Media dev path nodes\n");
for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) {
Volume = NULL; Volume = NULL;
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) { if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
@ -1207,11 +1207,11 @@ FindStartupDiskVolume (
Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume; Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume;
} }
if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) { if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) {
DBG (" - found entry %lld. '%ls', Volume '%ls'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName); DBG(" - found entry %lld. '%ls', Volume '%ls'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName);
return Index; return Index;
} }
} }
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
return -1; return -1;
} }
@ -1222,18 +1222,18 @@ FindStartupDiskVolume (
// 3.1 First find disk volume in Volumes[] // 3.1 First find disk volume in Volumes[]
// //
DiskVolume = NULL; DiskVolume = NULL;
DBG (" - searching for that disk\n"); DBG(" - searching for that disk\n");
for (Index = 0; Index < (INTN)Volumes.size(); ++Index) { for (Index = 0; Index < (INTN)Volumes.size(); ++Index) {
Volume = &Volumes[Index]; Volume = &Volumes[Index];
if (BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) { if (BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) {
// that's the one // that's the one
DiskVolume = Volume; DiskVolume = Volume;
DBG (" - found disk as volume %lld. '%ls'\n", Index, Volume->VolName); DBG(" - found disk as volume %lld. '%ls'\n", Index, Volume->VolName);
break; break;
} }
} }
if (DiskVolume == NULL) { if (DiskVolume == NULL) {
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
return -1; return -1;
} }
@ -1241,19 +1241,19 @@ FindStartupDiskVolume (
// 3.2 DiskVolume // 3.2 DiskVolume
// search for first entry with win loader or win partition on that disk // search for first entry with win loader or win partition on that disk
// //
DBG (" - searching for first entry with win loader or win partition on that disk\n"); DBG(" - searching for first entry with win loader or win partition on that disk\n");
for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) {
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) { if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index]; LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index];
Volume = LegacyEntry.Volume; Volume = LegacyEntry.Volume;
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
// check for Win // check for Win
//DBG (" checking legacy entry %d. %ls\n", Index, LegacyEntry.Title); //DBG(" checking legacy entry %d. %ls\n", Index, LegacyEntry.Title);
//DBG (" %ls\n", DevicePathToStr (Volume->DevicePath)); //DBG(" %ls\n", DevicePathToStr (Volume->DevicePath));
//DBG (" OSType = %d\n", Volume->OSType); //DBG(" OSType = %d\n", Volume->OSType);
if (Volume->LegacyOS->Type == OSTYPE_WIN) { if (Volume->LegacyOS->Type == OSTYPE_WIN) {
// that's the one - legacy win partition // that's the one - legacy win partition
DBG (" - found legacy entry %lld. '%ls', Volume '%ls'\n", Index, LegacyEntry.Title.s(), Volume->VolName); DBG(" - found legacy entry %lld. '%ls', Volume '%ls'\n", Index, LegacyEntry.Title.s(), Volume->VolName);
return Index; return Index;
} }
} }
@ -1262,33 +1262,33 @@ FindStartupDiskVolume (
Volume = LoaderEntry.Volume; Volume = LoaderEntry.Volume;
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
// check for Win // check for Win
//DBG (" checking loader entry %d. %ls\n", Index, LoaderEntry.Title); //DBG(" checking loader entry %d. %ls\n", Index, LoaderEntry.Title);
//DBG (" %ls\n", DevicePathToStr (Volume->DevicePath)); //DBG(" %ls\n", DevicePathToStr (Volume->DevicePath));
//DBG (" LoaderPath = %ls\n", LoaderEntry.LoaderPath); //DBG(" LoaderPath = %ls\n", LoaderEntry.LoaderPath);
//DBG (" LoaderType = %d\n", LoaderEntry.LoaderType); //DBG(" LoaderType = %d\n", LoaderEntry.LoaderType);
if (LoaderEntry.LoaderType == OSTYPE_WINEFI) { if (LoaderEntry.LoaderType == OSTYPE_WINEFI) {
// that's the one - win loader entry // that's the one - win loader entry
DBG (" - found loader entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath); DBG(" - found loader entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath);
return Index; return Index;
} }
} }
} }
} }
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
// //
// 3.3 DiskVolume, but no Win entry // 3.3 DiskVolume, but no Win entry
// PciRoot(0x0)/.../Sata(...) // PciRoot(0x0)/.../Sata(...)
// just find first menu entry on that disk? // just find first menu entry on that disk?
// //
DBG (" - searching for any entry from disk '%ls'\n", DiskVolume->VolName); DBG(" - searching for any entry from disk '%ls'\n", DiskVolume->VolName);
for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) {
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) { if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index]; LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index];
Volume = LegacyEntry.Volume; Volume = LegacyEntry.Volume;
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
// that's the one // that's the one
DBG (" - found legacy entry %lld. '%ls', Volume '%ls'\n", Index, LegacyEntry.Title.s(), Volume->VolName); DBG(" - found legacy entry %lld. '%ls', Volume '%ls'\n", Index, LegacyEntry.Title.s(), Volume->VolName);
return Index; return Index;
} }
@ -1297,14 +1297,14 @@ FindStartupDiskVolume (
Volume = LoaderEntry.Volume; Volume = LoaderEntry.Volume;
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
// that's the one // that's the one
DBG (" - found loader entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath); DBG(" - found loader entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath);
return Index; return Index;
} }
} }
} }
DBG (" - [!] not found\n"); DBG(" - [!] not found\n");
return -1; return -1;
} }
@ -1325,9 +1325,9 @@ EFI_STATUS SetStartupDiskVolume (
UINT32 Attributes; UINT32 Attributes;
DBG ("SetStartupDiskVolume:\n"); DBG("SetStartupDiskVolume:\n");
DBG (" * Volume: '%ls'\n", Volume->VolName); DBG(" * Volume: '%ls'\n", Volume->VolName);
DBG (" * LoaderPath: '%ls'\n", LoaderPath); DBG(" * LoaderPath: '%ls'\n", LoaderPath);
// //
// construct dev path for Volume/LoaderPath // construct dev path for Volume/LoaderPath
@ -1337,10 +1337,10 @@ EFI_STATUS SetStartupDiskVolume (
FileDevPath = FileDevicePath (NULL, LoaderPath); FileDevPath = FileDevicePath (NULL, LoaderPath);
DevPath = AppendDevicePathNode (DevPath, FileDevPath); DevPath = AppendDevicePathNode (DevPath, FileDevPath);
} }
DBG (" * DevPath: %ls\n", Volume->VolName/*, FileDevicePathToStr (DevPath)*/); DBG(" * DevPath: %ls\n", Volume->VolName/*, FileDevicePathToStr (DevPath)*/);
Guid = FindGPTPartitionGuidInDevicePath (Volume->DevicePath); Guid = FindGPTPartitionGuidInDevicePath (Volume->DevicePath);
DBG (" * GUID = %s\n", strguid(Guid)); DBG(" * GUID = %s\n", strguid(Guid));
// //
// let's save it without EFI_VARIABLE_NON_VOLATILE in CloverEFI like other vars so far // let's save it without EFI_VARIABLE_NON_VOLATILE in CloverEFI like other vars so far
@ -1379,7 +1379,7 @@ EFI_STATUS SetStartupDiskVolume (
// EfiBootDevice = (__typeof__(EfiBootDevice))AllocateZeroPool(AsciiStrLen (EfiBootDeviceTmpl) + 36); // EfiBootDevice = (__typeof__(EfiBootDevice))AllocateZeroPool(AsciiStrLen (EfiBootDeviceTmpl) + 36);
// AsciiSPrint (EfiBootDevice, Size, EfiBootDeviceTmpl, strguid(Guid)); // AsciiSPrint (EfiBootDevice, Size, EfiBootDeviceTmpl, strguid(Guid));
// Size = AsciiStrLen (EfiBootDevice); // Size = AsciiStrLen (EfiBootDevice);
// DBG (" * efi-boot-device: %s\n", EfiBootDevice); // DBG(" * efi-boot-device: %s\n", EfiBootDevice);
// //
// Status = SetNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid, Attributes, Size, EfiBootDevice); // Status = SetNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid, Attributes, Size, EfiBootDevice);
// FreePool(EfiBootDevice); // FreePool(EfiBootDevice);
@ -1408,17 +1408,17 @@ RemoveStartupDiskVolume ()
{ {
// EFI_STATUS Status; // EFI_STATUS Status;
// DBG ("RemoveStartupDiskVolume:\n"); // DBG("RemoveStartupDiskVolume:\n");
/*Status =*/ DeleteNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid); /*Status =*/ DeleteNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid);
// DBG (" * efi-boot-device = %s\n", strerror(Status)); // DBG(" * efi-boot-device = %s\n", strerror(Status));
/*Status =*/ DeleteNvramVariable (L"efi-boot-device-data", &gEfiAppleBootGuid); /*Status =*/ DeleteNvramVariable (L"efi-boot-device-data", &gEfiAppleBootGuid);
// DBG (" * efi-boot-device-data = %s\n", strerror(Status)); // DBG(" * efi-boot-device-data = %s\n", strerror(Status));
/*Status =*/ DeleteNvramVariable (L"BootCampHD", &gEfiAppleBootGuid); /*Status =*/ DeleteNvramVariable (L"BootCampHD", &gEfiAppleBootGuid);
// DBG (" * BootCampHD = %s\n", strerror(Status)); // DBG(" * BootCampHD = %s\n", strerror(Status));
// DBG ("Removed efi-boot-device-data variable: %s\n", strerror(Status)); // DBG("Removed efi-boot-device-data variable: %s\n", strerror(Status));
} }

File diff suppressed because it is too large Load Diff

View File

@ -1068,7 +1068,7 @@ VOID GetCPUProperties (VOID)
tmpU = gCPUStructure.FSBFrequency; tmpU = gCPUStructure.FSBFrequency;
// DBG("divide by 1000\n"); // DBG("divide by 1000\n");
BusSpeed = (UINT32)DivU64x32(tmpU, kilo); //Hz -> kHz BusSpeed = (UINT32)DivU64x32(tmpU, kilo); //Hz -> kHz
DBG ("FSBFrequency = %llu MHz, DMI FSBFrequency = %llu MHz, ", DivU64x32 (tmpU + Mega - 1, Mega), DivU64x32 (ExternalClock + 499, kilo)); DBG("FSBFrequency = %llu MHz, DMI FSBFrequency = %llu MHz, ", DivU64x32 (tmpU + Mega - 1, Mega), DivU64x32 (ExternalClock + 499, kilo));
//now check if SMBIOS has ExternalClock = 4xBusSpeed //now check if SMBIOS has ExternalClock = 4xBusSpeed
if ((BusSpeed > 50*kilo) && if ((BusSpeed > 50*kilo) &&
((ExternalClock > BusSpeed * 3) || (ExternalClock < 50*kilo))) { //khz ((ExternalClock > BusSpeed * 3) || (ExternalClock < 50*kilo))) { //khz

View File

@ -998,45 +998,45 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 120) { if(UGAHeight == 120) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found quarter quarter VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found quarter quarter VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 240: case 240:
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 160) { if(UGAHeight == 160) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Half quarter VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Half quarter VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 320: case 320:
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 240) { if(UGAHeight == 240) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found quarter VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found quarter VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 400: case 400:
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 240) { if(UGAHeight == 240) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide quarter VGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide quarter VGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 480: case 480:
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 320) { if(UGAHeight == 320) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Half-size VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Half-size VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 640: case 640:
@ -1044,14 +1044,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 360: case 360:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found one ninth of a Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found one ninth of a Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 480: case 480:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1060,14 +1060,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 480: case 480:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide VGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide VGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 600: case 600:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Super VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Super VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1075,9 +1075,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 480) { if(UGAHeight == 480) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Full Wide VGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Full Wide VGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 960: case 960:
@ -1085,14 +1085,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 540: case 540:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found one quarter of Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found one quarter of Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 640: case 640:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Double-size VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Double-size VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1101,18 +1101,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 576: case 576:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Super VGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Super VGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 600: case 600:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Super VGA Display - 17:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Super VGA Display - 17:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 768: case 768:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1120,9 +1120,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 864) { if(UGAHeight == 864) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found XGA Plus Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found XGA Plus Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 1280: case 1280:
@ -1130,22 +1130,22 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 720: case 720:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 768: case 768:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide XGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide XGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 800: case 800:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 1024: case 1024:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Super XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Super XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1153,27 +1153,27 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 768) { if(UGAHeight == 768) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Full Wide XGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Full Wide XGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 1400: case 1400:
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 1050) { if(UGAHeight == 1050) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Super XGA Plus Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Super XGA Plus Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 1440: case 1440:
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 900) { if(UGAHeight == 900) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide XGA Plus Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide XGA Plus Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 1600: case 1600:
@ -1181,14 +1181,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 900: case 900:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 1200: case 1200:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1197,10 +1197,10 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 1050: case 1050:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Widescreen Super XGA Plus Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Widescreen Super XGA Plus Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1209,14 +1209,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 1080: case 1080:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 1200: case 1200:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1225,14 +1225,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 1152: case 1152:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Quad Wide XGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Quad Wide XGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 1536: case 1536:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Quad XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Quad XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1241,18 +1241,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 1440: case 1440:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Quad HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Quad HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 1600: case 1600:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Quad XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Quad XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 2048: case 2048:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Quad Wide XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Quad Wide XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1260,9 +1260,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 1800) { if(UGAHeight == 1800) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Quad XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Quad XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 3200: case 3200:
@ -1270,18 +1270,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 1800: case 1800:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Quad HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Quad HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 2048: case 2048:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Quad Super XGA Display - 25:16 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Quad Super XGA Display - 25:16 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 2400: case 2400:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Quad Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Quad Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1290,14 +1290,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 2160: case 2160:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Ultra HD, 4K Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Ultra HD, 4K Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 2400: case 2400:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Quad Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Quad Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1305,9 +1305,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
SetUGAWidth = TRUE; SetUGAWidth = TRUE;
if(UGAHeight == 3072) { if(UGAHeight == 3072) {
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Hex XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Hex XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} else { } else {
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
} }
break; break;
case 5120: case 5120:
@ -1315,18 +1315,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 2880: case 2880:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Ultra HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Ultra HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 3200: case 3200:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Hex XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Hex XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 4096: case 4096:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Hex Super XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Hex Super XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1335,14 +1335,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 4096: case 4096:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Hex Super XGA Display - 25:16 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Hex Super XGA Display - 25:16 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 4800: case 4800:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Hex Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Hex Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
@ -1351,19 +1351,19 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
switch (UGAHeight) { switch (UGAHeight) {
case 4320: case 4320:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Full Ultra HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Full Ultra HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
case 4800: case 4800:
SetUGAHeight = TRUE; SetUGAHeight = TRUE;
DBG (" Found Wide Hex Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Wide Hex Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }
break; break;
default: default:
DBG (" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); DBG(" Found Unknown Resolution Display - ?:? :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
break; break;
} }

View File

@ -898,7 +898,7 @@ VOID ScanSPD()
//SmBus controller has class = 0x0c0500 //SmBus controller has class = 0x0c0500
if ((gPci.Hdr.ClassCode[2] == 0x0c) && (gPci.Hdr.ClassCode[1] == 5) if ((gPci.Hdr.ClassCode[2] == 0x0c) && (gPci.Hdr.ClassCode[1] == 5)
&& (gPci.Hdr.ClassCode[0] == 0) && (gPci.Hdr.VendorId == 0x8086 || gPci.Hdr.VendorId == 0x10DE)) { && (gPci.Hdr.ClassCode[0] == 0) && (gPci.Hdr.VendorId == 0x8086 || gPci.Hdr.VendorId == 0x10DE)) {
DBG ("SMBus device : %04hX %04hX class=%02hhX%02hhX%02hhX status=%s\n", DBG("SMBus device : %04hX %04hX class=%02hhX%02hhX%02hhX status=%s\n",
gPci.Hdr.VendorId, gPci.Hdr.VendorId,
gPci.Hdr.DeviceId, gPci.Hdr.DeviceId,
gPci.Hdr.ClassCode[2], gPci.Hdr.ClassCode[2],

View File

@ -526,7 +526,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath,
if (volume_match == -1 || volume_type_match == -1 || path_match == -1 || type_match == -1 ) { if (volume_match == -1 || volume_type_match == -1 || path_match == -1 || type_match == -1 ) {
UINTN add_comma = 0; UINTN add_comma = 0;
DBG ("%sNot match custom entry %llu: ", indent, CustomIndex); DBG("%sNot match custom entry %llu: ", indent, CustomIndex);
if (volume_match != 0) { if (volume_match != 0) {
DBG("Volume: %ls", volume_match == 1 ? L"match" : L"not match"); DBG("Volume: %ls", volume_match == 1 ? L"match" : L"not match");
add_comma++; add_comma++;

View File

@ -1727,7 +1727,7 @@ BOOLEAN SetOEMPathIfExists(IN EFI_FILE *Root, IN CHAR16 *path, CONST CHAR16 *Con
BOOLEAN res2 = FileExists(Root, ConfigPath); BOOLEAN res2 = FileExists(Root, ConfigPath);
if ( res2 ) { if ( res2 ) {
OEMPath = path; OEMPath = path;
DBG ("CheckOEMPathExists: set OEMPath: %ls\n", OEMPath); DBG("CheckOEMPathExists: set OEMPath: %ls\n", OEMPath);
return 1; return 1;
}else{ }else{
DBG("CheckOEMPathExists tried %ls. '%ls.plist' not exists in dir\n", path, ConfName); DBG("CheckOEMPathExists tried %ls. '%ls.plist' not exists in dir\n", path, ConfName);
@ -1744,7 +1744,7 @@ VOID SetOEMPath(CONST CHAR16 *ConfName)
{ {
OEMPath = PoolPrint(L"%s", L"EFI\\CLOVER"); OEMPath = PoolPrint(L"%s", L"EFI\\CLOVER");
if (ConfName == NULL) { if (ConfName == NULL) {
DBG ("set OEMPath (ConfName == NULL): %ls\n", OEMPath); DBG("set OEMPath (ConfName == NULL): %ls\n", OEMPath);
} else if ( nLanCards > 0 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[0][0], gLanMac[0][1], gLanMac[0][2], gLanMac[0][3], gLanMac[0][4], gLanMac[0][5]), ConfName)) { } else if ( nLanCards > 0 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[0][0], gLanMac[0][1], gLanMac[0][2], gLanMac[0][3], gLanMac[0][4], gLanMac[0][5]), ConfName)) {
} else if ( nLanCards > 1 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[1][0], gLanMac[1][1], gLanMac[1][2], gLanMac[1][3], gLanMac[1][4], gLanMac[1][5]), ConfName)) { } else if ( nLanCards > 1 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[1][0], gLanMac[1][1], gLanMac[1][2], gLanMac[1][3], gLanMac[1][4], gLanMac[1][5]), ConfName)) {
} else if ( nLanCards > 2 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[2][0], gLanMac[2][1], gLanMac[2][2], gLanMac[2][3], gLanMac[2][4], gLanMac[2][5]), ConfName)) { } else if ( nLanCards > 2 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[2][0], gLanMac[2][1], gLanMac[2][2], gLanMac[2][3], gLanMac[2][4], gLanMac[2][5]), ConfName)) {
@ -1755,7 +1755,7 @@ VOID SetOEMPath(CONST CHAR16 *ConfName)
} else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a", gSettings.OEMBoard), ConfName)) { } else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a", gSettings.OEMBoard), ConfName)) {
} else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a-%d", gSettings.OEMBoard, (INT32)(DivU64x32(gCPUStructure.CPUFrequency, Mega))), ConfName) ) { } else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a-%d", gSettings.OEMBoard, (INT32)(DivU64x32(gCPUStructure.CPUFrequency, Mega))), ConfName) ) {
} else { } else {
DBG ("set OEMPath by default: %ls\n", OEMPath); DBG("set OEMPath by default: %ls\n", OEMPath);
} }
} }