mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-23 16:17:40 +01:00
decorations
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
5d38db4501
commit
c48bb89e2e
@ -687,7 +687,7 @@ AtaAtapiPassThruStart (
|
||||
Instance = NULL;
|
||||
OriginalPciAttributes = 0;
|
||||
|
||||
// DBG (L"==AtaAtapiPassThru Start== Controller = %x\n", Controller);
|
||||
// DBG(L"==AtaAtapiPassThru Start== Controller = %x\n", Controller);
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
@ -699,7 +699,7 @@ AtaAtapiPassThruStart (
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -872,7 +872,7 @@ AtaAtapiPassThruStop (
|
||||
EFI_AHCI_REGISTERS *AhciRegisters;
|
||||
UINT64 Supports;
|
||||
|
||||
// DBG (L"==AtaAtapiPassThru Stop== Controller = %x\n", Controller);
|
||||
// DBG(L"==AtaAtapiPassThru Stop== Controller = %x\n", Controller);
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
Controller,
|
||||
|
@ -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.
|
||||
@ -3044,7 +3044,7 @@ DetectAndConfigIdeDevice (
|
||||
//
|
||||
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.
|
||||
//
|
||||
@ -3070,7 +3070,7 @@ DetectAndConfigIdeDevice (
|
||||
}
|
||||
|
||||
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){
|
||||
Status = SetDeviceTransferMode (Instance, IdeChannel, IdeDevice, &TransferMode, NULL);
|
||||
|
||||
@ -3127,7 +3127,7 @@ DetectAndConfigIdeDevice (
|
||||
|
||||
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
|
||||
//
|
||||
|
@ -160,7 +160,7 @@ PartitionInstallElToritoChildHandles (
|
||||
Catalog
|
||||
);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG ("EltCheckDevice: error reading catalog %r\n", Status);
|
||||
DBG("EltCheckDevice: error reading catalog %r\n", Status);
|
||||
continue;
|
||||
}
|
||||
//
|
||||
@ -168,7 +168,7 @@ PartitionInstallElToritoChildHandles (
|
||||
// to make sure it looks like a Catalog header
|
||||
//
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
@ -180,7 +180,7 @@ PartitionInstallElToritoChildHandles (
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1900,15 +1900,15 @@ XhcCreateUsbHc (
|
||||
Xhc->UsbLegSupOffset = XhcGetCapabilityAddr (Xhc, XHC_CAP_USB_LEGACY);
|
||||
Xhc->DebugCapSupOffset = XhcGetCapabilityAddr (Xhc, XHC_CAP_USB_DEBUG);
|
||||
|
||||
DBG ("XhcCreateUsb3Hc: Capability length 0x%x\n", Xhc->CapLength);
|
||||
DBG ("XhcCreateUsb3Hc: ExtCapRegBase 0x%x\n", Xhc->ExtCapRegBase);
|
||||
DBG ("XhcCreateUsb3Hc: HcSParams1 0x%x\n", Xhc->HcSParams1);
|
||||
DBG ("XhcCreateUsb3Hc: HcSParams2 0x%x\n", Xhc->HcSParams2);
|
||||
DBG ("XhcCreateUsb3Hc: HcCParams 0x%x\n", Xhc->HcCParams);
|
||||
DBG ("XhcCreateUsb3Hc: DBOff 0x%x\n", Xhc->DBOff);
|
||||
DBG ("XhcCreateUsb3Hc: RTSOff 0x%x\n", Xhc->RTSOff);
|
||||
DBG ("XhcCreateUsb3Hc: UsbLegSupOffset 0x%x\n", Xhc->UsbLegSupOffset);
|
||||
DBG ("XhcCreateUsb3Hc: DebugCapSupOffset 0x%x\n", Xhc->DebugCapSupOffset);
|
||||
DBG("XhcCreateUsb3Hc: Capability length 0x%x\n", Xhc->CapLength);
|
||||
DBG("XhcCreateUsb3Hc: ExtCapRegBase 0x%x\n", Xhc->ExtCapRegBase);
|
||||
DBG("XhcCreateUsb3Hc: HcSParams1 0x%x\n", Xhc->HcSParams1);
|
||||
DBG("XhcCreateUsb3Hc: HcSParams2 0x%x\n", Xhc->HcSParams2);
|
||||
DBG("XhcCreateUsb3Hc: HcCParams 0x%x\n", Xhc->HcCParams);
|
||||
DBG("XhcCreateUsb3Hc: DBOff 0x%x\n", Xhc->DBOff);
|
||||
DBG("XhcCreateUsb3Hc: RTSOff 0x%x\n", Xhc->RTSOff);
|
||||
DBG("XhcCreateUsb3Hc: UsbLegSupOffset 0x%x\n", Xhc->UsbLegSupOffset);
|
||||
DBG("XhcCreateUsb3Hc: DebugCapSupOffset 0x%x\n", Xhc->DebugCapSupOffset);
|
||||
|
||||
//
|
||||
// Create AsyncRequest Polling Timer
|
||||
|
@ -458,7 +458,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
|
||||
DTD_string,
|
||||
-1
|
||||
);
|
||||
DBG (" patched %d time(s)\n", NumReplaces);
|
||||
DBG(" patched %d time(s)\n", NumReplaces);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -647,7 +647,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
|
||||
-1
|
||||
);
|
||||
// NumReplacesTotal += NumReplaces;
|
||||
DBG (" patch 0: patched %d time(s)\n", NumReplaces);
|
||||
DBG(" patch 0: patched %d time(s)\n", NumReplaces);
|
||||
NumReplaces = VideoBiosPatchSearchAndReplace (
|
||||
(UINT8*)(UINTN)VBIOS_START,
|
||||
VBIOS_SIZE,
|
||||
@ -656,7 +656,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
|
||||
-1
|
||||
);
|
||||
// NumReplacesTotal += NumReplaces;
|
||||
DBG (" patch 1: patched %d time(s)\n", NumReplaces);
|
||||
DBG(" patch 1: patched %d time(s)\n", NumReplaces);
|
||||
NumReplaces = VideoBiosPatchSearchAndReplace (
|
||||
(UINT8*)(UINTN)VBIOS_START,
|
||||
VBIOS_SIZE,
|
||||
@ -665,7 +665,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
|
||||
-1
|
||||
);
|
||||
// NumReplacesTotal += NumReplaces;
|
||||
DBG (" patch 2: patched %d time(s)\n", NumReplaces);
|
||||
DBG(" patch 2: patched %d time(s)\n", NumReplaces);
|
||||
NumReplaces = VideoBiosPatchSearchAndReplace (
|
||||
(UINT8*)(UINTN)VBIOS_START,
|
||||
VBIOS_SIZE,
|
||||
@ -674,7 +674,7 @@ VOID set_mode(vbios_map * map, /*UINT32 mode,*/ UINT32 x, UINT32 y, UINT32 bp, U
|
||||
-1
|
||||
);
|
||||
// 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 ) {
|
||||
*((UINT8*)(UINTN)(VBIOS_START + 0x34)) |= 0x01;
|
||||
|
@ -83,21 +83,21 @@ VideoBiosPatchInit (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
DBG (" VideoBiosPatchInit(");
|
||||
DBG(" VideoBiosPatchInit(");
|
||||
//
|
||||
// Check for EfiLegacyRegionProtocol and/or EfiLegacyRegion2Protocol
|
||||
//
|
||||
Status = gBS->LocateProtocol (&gEfiLegacyRegionProtocolGuid, NULL, (VOID **) &mLegacyRegion);
|
||||
DBG ("LegacyRegion = %r", Status);
|
||||
DBG("LegacyRegion = %r", Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
mLegacyRegion = NULL;
|
||||
Status = gBS->LocateProtocol (&gEfiLegacyRegion2ProtocolGuid, NULL, (VOID **) &mLegacyRegion2);
|
||||
DBG (", LegacyRegion2 = %r", Status);
|
||||
DBG(", LegacyRegion2 = %r", Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
mLegacyRegion2 = NULL;
|
||||
}
|
||||
}
|
||||
DBG (") = %r\n", Status);
|
||||
DBG(") = %r\n", Status);
|
||||
|
||||
return Status;
|
||||
}
|
||||
@ -215,10 +215,10 @@ VideoBiosPatchBytes (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
DBG ("VideoBiosPatchBytes(%d patches):\n", FindAndReplaceCount);
|
||||
DBG("VideoBiosPatchBytes(%d patches):\n", FindAndReplaceCount);
|
||||
Status = VideoBiosUnlock ();
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG (" = not done.\n");
|
||||
DBG(" = not done.\n");
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -234,10 +234,10 @@ VideoBiosPatchBytes (
|
||||
-1
|
||||
);
|
||||
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 ();
|
||||
|
||||
@ -258,7 +258,7 @@ UINT8* VideoBiosPatchGetEdid (VOID)
|
||||
EFI_EDID_ACTIVE_PROTOCOL *EdidProtocol;
|
||||
UINT8 *Edid;
|
||||
|
||||
DBG (" Edid:");
|
||||
DBG(" Edid:");
|
||||
Edid = NULL;
|
||||
Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
@ -293,7 +293,7 @@ VideoBiosPatchNativeFromEdid (
|
||||
BOOLEAN ReleaseEdid;
|
||||
vbios_map *map;
|
||||
|
||||
DBG ("VideoBiosPatchNativeFromEdid:\n");
|
||||
DBG("VideoBiosPatchNativeFromEdid:\n");
|
||||
|
||||
ReleaseEdid = FALSE;
|
||||
if (Edid == NULL) {
|
||||
@ -306,7 +306,7 @@ VideoBiosPatchNativeFromEdid (
|
||||
|
||||
map = open_vbios(CT_UNKNOWN);
|
||||
if (map == NULL) {
|
||||
DBG (" = unknown video bios.\n");
|
||||
DBG(" = unknown video bios.\n");
|
||||
if (ReleaseEdid) {
|
||||
FreePool(Edid);
|
||||
}
|
||||
@ -315,7 +315,7 @@ VideoBiosPatchNativeFromEdid (
|
||||
|
||||
Status = VideoBiosUnlock ();
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG (" = not done.\n");
|
||||
DBG(" = not done.\n");
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -563,7 +563,7 @@ ProtectRtDataFromRelocation(
|
||||
++RelocInfo;
|
||||
++gRelocInfoData.NumEntries;
|
||||
} 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);
|
||||
|
@ -64,7 +64,7 @@ UINT8* getCurrentEdid (VOID)
|
||||
EFI_EDID_ACTIVE_PROTOCOL *EdidProtocol;
|
||||
UINT8 *Edid;
|
||||
|
||||
DBG ("EdidActive:");
|
||||
DBG("EdidActive:");
|
||||
Edid = NULL;
|
||||
Status = gBS->LocateProtocol (&gEfiEdidActiveProtocolGuid, NULL, (VOID**)&EdidProtocol);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
|
@ -1000,9 +1000,9 @@ static VOID PatchBbsTable(EFI_LEGACY_BIOS_PROTOCOL *LegacyBios, UINT16 BootEntry
|
||||
&LocalBbsTable
|
||||
);
|
||||
|
||||
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 (" =====================================================\n");
|
||||
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(" =====================================================\n");
|
||||
|
||||
for (Idx = 0; Idx < BbsCount; Idx++) {
|
||||
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++;
|
||||
}
|
||||
|
||||
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) Idx,
|
||||
(UINTN) OldPriority,
|
||||
|
@ -150,31 +150,31 @@ SetNvramVariable (
|
||||
UINTN OldDataSize = 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);
|
||||
if (OldData != NULL) {
|
||||
// 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) &&
|
||||
(OldDataSize == DataSize) &&
|
||||
(CompareMem (OldData, Data, DataSize) == 0)) {
|
||||
// it's the same - do nothing
|
||||
//DBG (", equal -> not writing again.\n");
|
||||
//DBG(", equal -> not writing again.\n");
|
||||
FreePool(OldData);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
//DBG (", not equal\n");
|
||||
//DBG(", not equal\n");
|
||||
|
||||
FreePool(OldData);
|
||||
|
||||
// not the same - delete previous one if attributes are different
|
||||
if (OldAttributes != Attributes) {
|
||||
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 (" -> writing new (%s)\n", strerror(Status));
|
||||
//DBG("\n"); // for debug without Status
|
||||
//DBG(" -> writing new (%s)\n", strerror(Status));
|
||||
//return Status;
|
||||
|
||||
return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, (VOID*)Data); // CONST missing in EFI_SET_VARIABLE->SetVariable
|
||||
@ -193,13 +193,13 @@ AddNvramVariable (
|
||||
{
|
||||
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);
|
||||
if (OldData == NULL)
|
||||
{
|
||||
// set new value
|
||||
return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||
// DBG (" -> writing new (%s)\n", strerror(Status));
|
||||
// DBG(" -> writing new (%s)\n", strerror(Status));
|
||||
} else {
|
||||
FreePool(OldData);
|
||||
return EFI_ABORTED;
|
||||
@ -218,7 +218,7 @@ DeleteNvramVariable (
|
||||
|
||||
// Delete: attributes and data size = 0
|
||||
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;
|
||||
}
|
||||
@ -318,13 +318,13 @@ ResetNativeNvram ()
|
||||
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (IsDeletableVariable (Name, &Guid)) {
|
||||
//DBG ("Deleting %s:%ls...", strguid(&Guid), Name);
|
||||
//DBG("Deleting %s:%ls...", strguid(&Guid), Name);
|
||||
Status = DeleteNvramVariable(Name, &Guid);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
//DBG ("OK\n");
|
||||
//DBG("OK\n");
|
||||
Restart = TRUE;
|
||||
} else {
|
||||
//DBG ("FAIL (%s)\n", strerror(Status));
|
||||
//DBG("FAIL (%s)\n", strerror(Status));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -535,7 +535,7 @@ EFI_GUID
|
||||
|
||||
/** detailed debug for BootVolumeDevicePathEqual */
|
||||
#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. */
|
||||
BOOLEAN
|
||||
@ -708,10 +708,10 @@ GetEfiBootDeviceFromNvram ()
|
||||
|
||||
|
||||
DbgHeader("GetEfiBootDeviceFromNvram");
|
||||
// DBG ("GetEfiBootDeviceFromNvram:");
|
||||
// DBG("GetEfiBootDeviceFromNvram:");
|
||||
|
||||
if (gEfiBootDeviceData != NULL) {
|
||||
// DBG (" - [!] already parsed\n");
|
||||
// DBG(" - [!] already parsed\n");
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -747,12 +747,12 @@ GetEfiBootDeviceFromNvram ()
|
||||
}
|
||||
}
|
||||
if (gEfiBootDeviceData == NULL) {
|
||||
// DBG (" - [!] efi-boot-device-data not found\n");
|
||||
// DBG(" - [!] efi-boot-device-data not found\n");
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
// DBG ("\n");
|
||||
DBG (" - efi-boot-device-data: %ls\n", FileDevicePathToStr (gEfiBootDeviceData));
|
||||
// DBG("\n");
|
||||
DBG(" - efi-boot-device-data: %ls\n", FileDevicePathToStr (gEfiBootDeviceData));
|
||||
|
||||
gEfiBootVolume = gEfiBootDeviceData;
|
||||
|
||||
@ -765,18 +765,18 @@ GetEfiBootDeviceFromNvram ()
|
||||
gEfiBootVolume = gBootCampHD;
|
||||
|
||||
if (gBootCampHD == NULL) {
|
||||
// DBG (" - [!] Error: BootCampHD not found\n");
|
||||
// DBG(" - [!] Error: BootCampHD not found\n");
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (!IsDevicePathValid(gBootCampHD, Size)) {
|
||||
// DBG (" Error: BootCampHD device path is invalid\n");
|
||||
// DBG(" Error: BootCampHD device path is invalid\n");
|
||||
FreePool(gBootCampHD);
|
||||
gEfiBootVolume = gBootCampHD = NULL;
|
||||
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
|
||||
}
|
||||
|
||||
DBG (" - Volume: '%ls'\n", FileDevicePathToStr (gEfiBootVolume));
|
||||
DBG (" - LoaderPath: '%ls'\n", gEfiBootLoaderPath);
|
||||
DBG(" - Volume: '%ls'\n", FileDevicePathToStr (gEfiBootVolume));
|
||||
DBG(" - LoaderPath: '%ls'\n", gEfiBootLoaderPath);
|
||||
|
||||
//
|
||||
// if this is GPT disk, extract GUID
|
||||
@ -805,7 +805,7 @@ GetEfiBootDeviceFromNvram ()
|
||||
gEfiBootDeviceGuid = (__typeof__(gEfiBootDeviceGuid))AllocatePool (sizeof(EFI_GUID));
|
||||
if (gEfiBootDeviceGuid != NULL) {
|
||||
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);
|
||||
if(EFI_ERROR(Status)) {
|
||||
DBG (" not present\n");
|
||||
DBG(" not present\n");
|
||||
return Status;
|
||||
}
|
||||
|
||||
DBG (" loaded, size=%llu\n", Size);
|
||||
DBG(" loaded, size=%llu\n", Size);
|
||||
|
||||
//
|
||||
// parse it into gNvramDict
|
||||
//
|
||||
Status = ParseXML ((const CHAR8*)NvramPtr, &gNvramDict, (UINT32)Size);
|
||||
// if(Status != EFI_SUCCESS) {
|
||||
// DBG (" parsing error\n");
|
||||
// DBG(" parsing error\n");
|
||||
// }
|
||||
|
||||
FreePool(NvramPtr);
|
||||
@ -874,16 +874,16 @@ LoadLatestNvramPlist ()
|
||||
REFIT_VOLUME *VolumeWithLatestNvramPlist = NULL;
|
||||
|
||||
//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
|
||||
//
|
||||
if (gNvramDict != NULL) {
|
||||
DBG (" already loaded\n");
|
||||
DBG(" already loaded\n");
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
DBG ("\n");
|
||||
DBG("\n");
|
||||
|
||||
//
|
||||
// find latest nvram.plist
|
||||
@ -901,16 +901,16 @@ LoadLatestNvramPlist ()
|
||||
|
||||
/* 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) {
|
||||
// not a GUID partition
|
||||
DBG (" - not GPT");
|
||||
DBG(" - not GPT");
|
||||
} */
|
||||
// DBG("Volume[%d]\n", Index);
|
||||
// check if nvram.plist exists
|
||||
Status = Volume->RootDir->Open (Volume->RootDir, &FileHandle, L"nvram.plist", EFI_FILE_MODE_READ, 0);
|
||||
if (EFI_ERROR(Status)) {
|
||||
// DBG (" - no nvram.plist - skipping!\n");
|
||||
// DBG(" - no nvram.plist - skipping!\n");
|
||||
continue;
|
||||
}
|
||||
// DBG(" Status=%s\n", strerror(Status));
|
||||
@ -923,14 +923,14 @@ LoadLatestNvramPlist ()
|
||||
FileInfo = EfiLibFileInfo(FileHandle);
|
||||
// DBG("got FileInfo=0x%X\n", FileInfo);
|
||||
if (FileInfo == NULL) {
|
||||
// DBG (" - no nvram.plist file info - skipping!\n");
|
||||
// DBG(" - no nvram.plist file info - skipping!\n");
|
||||
FileHandle->Close(FileHandle);
|
||||
continue;
|
||||
}
|
||||
|
||||
// DBG (" Modified = ");
|
||||
// DBG(" Modified = ");
|
||||
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.Hour, FileInfo->ModificationTime.Minute, FileInfo->ModificationTime.Second,
|
||||
ModifTimeMs); */
|
||||
@ -939,11 +939,11 @@ LoadLatestNvramPlist ()
|
||||
|
||||
// check if newer
|
||||
if (LastModifTimeMs < ModifTimeMs) {
|
||||
// DBG (" - newer - will use this one\n");
|
||||
// DBG(" - newer - will use this one\n");
|
||||
VolumeWithLatestNvramPlist = Volume;
|
||||
LastModifTimeMs = ModifTimeMs;
|
||||
} else {
|
||||
// DBG (" - older - skipping!\n");
|
||||
// DBG(" - older - skipping!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -953,11 +953,11 @@ LoadLatestNvramPlist ()
|
||||
// if we have nvram.plist - load it
|
||||
//
|
||||
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");
|
||||
|
||||
} else {
|
||||
// DBG (" nvram.plist not found!\n");
|
||||
// DBG(" nvram.plist not found!\n");
|
||||
}
|
||||
DBG("loaded Status=%s\n", strerror(Status));
|
||||
return Status;
|
||||
@ -980,13 +980,13 @@ PutNvramPlistToRtVars ()
|
||||
if (gNvramDict == NULL) {
|
||||
Status = LoadLatestNvramPlist ();
|
||||
if (gNvramDict == NULL) {
|
||||
DBG ("PutNvramPlistToRtVars: nvram.plist not found\n");
|
||||
DBG("PutNvramPlistToRtVars: nvram.plist not found\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DbgHeader("PutNvramPlistToRtVars");
|
||||
// DBG ("PutNvramPlistToRtVars ...\n");
|
||||
// DBG("PutNvramPlistToRtVars ...\n");
|
||||
// iterate over dict elements
|
||||
for (Tag = gNvramDict->tag; Tag != NULL; Tag = Tag->tagNext) {
|
||||
EFI_GUID *VendorGuid = &gEfiAppleBootGuid;
|
||||
@ -995,29 +995,29 @@ PutNvramPlistToRtVars ()
|
||||
|
||||
// process only valid <key> tags
|
||||
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;
|
||||
}
|
||||
// DBG("tag: %s\n", Tag->string);
|
||||
// skip OsxAptioFixDrv-RelocBase - appears and causes trouble
|
||||
// in kernel and kext patcher when mixing UEFI and CloverEFI boot
|
||||
if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-RelocBase") == 0) {
|
||||
DBG (" Skipping OsxAptioFixDrv-RelocBase\n");
|
||||
DBG(" Skipping OsxAptioFixDrv-RelocBase\n");
|
||||
continue;
|
||||
} else if (AsciiStrCmp(Tag->string, "OsxAptioFixDrv-ErrorExitingBootServices") == 0) {
|
||||
DBG (" Skipping OsxAptioFixDrv-ErrorExitingBootServices\n");
|
||||
DBG(" Skipping OsxAptioFixDrv-ErrorExitingBootServices\n");
|
||||
continue;
|
||||
} else if (AsciiStrCmp(Tag->string, "EmuVariableUefiPresent") == 0) {
|
||||
DBG (" Skipping EmuVariableUefiPresent\n");
|
||||
DBG(" Skipping EmuVariableUefiPresent\n");
|
||||
continue;
|
||||
} else if (AsciiStrCmp(Tag->string, "aapl,panic-info") == 0) {
|
||||
DBG (" Skipping aapl,panic-info\n");
|
||||
DBG(" Skipping aapl,panic-info\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// key to unicode; check if key buffer is large enough
|
||||
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;
|
||||
}
|
||||
|
||||
@ -1029,7 +1029,7 @@ PutNvramPlistToRtVars ()
|
||||
|
||||
AsciiStrToUnicodeStrS(Tag->string, KeyBuf, 128);
|
||||
if (!GlobalConfig.DebugLog) {
|
||||
DBG (" Adding Key: %ls: ", KeyBuf);
|
||||
DBG(" Adding Key: %ls: ", KeyBuf);
|
||||
}
|
||||
// process value tag
|
||||
|
||||
@ -1039,7 +1039,7 @@ PutNvramPlistToRtVars ()
|
||||
Value = ValTag->string;
|
||||
Size = AsciiStrLen((CONST CHAR8*)Value);
|
||||
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) {
|
||||
@ -1048,16 +1048,16 @@ PutNvramPlistToRtVars ()
|
||||
Size = ValTag->dataLen;
|
||||
Value = ValTag->data;
|
||||
if (!GlobalConfig.DebugLog) {
|
||||
DBG ("Size = %lld, Data: ", Size);
|
||||
DBG("Size = %lld, Data: ", Size);
|
||||
for (i = 0; i < Size; i++) {
|
||||
DBG("%02hhX ", *((__typeof__(ValTag->string))Value + i));
|
||||
}
|
||||
}
|
||||
if (!GlobalConfig.DebugLog) {
|
||||
DBG ("\n");
|
||||
DBG("\n");
|
||||
}
|
||||
} else {
|
||||
DBG ("ERROR: Unsupported tag type: %llu\n", ValTag->type);
|
||||
DBG("ERROR: Unsupported tag type: %llu\n", ValTag->type);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1104,7 +1104,7 @@ FindStartupDiskVolume (
|
||||
CHAR16 *EfiBootVolumeStr;
|
||||
|
||||
|
||||
// DBG ("FindStartupDiskVolume ...\n");
|
||||
// DBG("FindStartupDiskVolume ...\n");
|
||||
|
||||
|
||||
//
|
||||
@ -1113,67 +1113,67 @@ FindStartupDiskVolume (
|
||||
//
|
||||
GetEfiBootDeviceFromNvram ();
|
||||
if (gEfiBootVolume == NULL) {
|
||||
// DBG (" - [!] EfiBootVolume not found\n");
|
||||
// DBG(" - [!] EfiBootVolume not found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
DbgHeader("FindStartupDiskVolume");
|
||||
// DBG ("FindStartupDiskVolume searching ...\n");
|
||||
// DBG("FindStartupDiskVolume searching ...\n");
|
||||
|
||||
//
|
||||
// Check if gEfiBootVolume is disk or partition volume
|
||||
//
|
||||
EfiBootVolumeStr = FileDevicePathToStr (gEfiBootVolume);
|
||||
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
|
||||
// PciRoot(0x0)/.../Sata(...)/HD(...)/\EFI\BOOT\XXX.EFI - set by Clover
|
||||
//
|
||||
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) {
|
||||
if (MainMenu->Entries[Index].getLOADER_ENTRY()) {
|
||||
LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY();
|
||||
Volume = LoaderEntry.Volume;
|
||||
LoaderPath = LoaderEntry.LoaderPath;
|
||||
if (Volume != NULL && BootVolumeDevicePathEqual(gEfiBootVolume, Volume->DevicePath)) {
|
||||
//DBG (" checking '%ls'\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG (" '%ls'\n", LoaderPath);
|
||||
//DBG(" checking '%ls'\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG(" '%ls'\n", LoaderPath);
|
||||
// case insensitive cmp
|
||||
if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
//
|
||||
// search again, but compare only Media dev path nodes
|
||||
// (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) {
|
||||
if (MainMenu->Entries[Index].getLOADER_ENTRY()) {
|
||||
LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY();
|
||||
Volume = LoaderEntry.Volume;
|
||||
LoaderPath = LoaderEntry.LoaderPath;
|
||||
if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) {
|
||||
//DBG (" checking '%ls'\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG (" '%ls'\n", LoaderPath);
|
||||
//DBG(" checking '%ls'\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG(" '%ls'\n", LoaderPath);
|
||||
// case insensitive cmp
|
||||
if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
}
|
||||
|
||||
//
|
||||
@ -1181,7 +1181,7 @@ FindStartupDiskVolume (
|
||||
// PciRoot(0x0)/.../Sata(...)/HD(...) - set by Clover or macOS
|
||||
//
|
||||
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) {
|
||||
Volume = NULL;
|
||||
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
|
||||
@ -1190,15 +1190,15 @@ FindStartupDiskVolume (
|
||||
Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
//
|
||||
// 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) {
|
||||
Volume = NULL;
|
||||
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
|
||||
@ -1207,11 +1207,11 @@ FindStartupDiskVolume (
|
||||
Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1222,18 +1222,18 @@ FindStartupDiskVolume (
|
||||
// 3.1 First find disk volume in Volumes[]
|
||||
//
|
||||
DiskVolume = NULL;
|
||||
DBG (" - searching for that disk\n");
|
||||
DBG(" - searching for that disk\n");
|
||||
for (Index = 0; Index < (INTN)Volumes.size(); ++Index) {
|
||||
Volume = &Volumes[Index];
|
||||
if (BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) {
|
||||
// that's the one
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (DiskVolume == NULL) {
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1241,19 +1241,19 @@ FindStartupDiskVolume (
|
||||
// 3.2 DiskVolume
|
||||
// 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) {
|
||||
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
|
||||
LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index];
|
||||
Volume = LegacyEntry.Volume;
|
||||
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
|
||||
// check for Win
|
||||
//DBG (" checking legacy entry %d. %ls\n", Index, LegacyEntry.Title);
|
||||
//DBG (" %ls\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG (" OSType = %d\n", Volume->OSType);
|
||||
//DBG(" checking legacy entry %d. %ls\n", Index, LegacyEntry.Title);
|
||||
//DBG(" %ls\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG(" OSType = %d\n", Volume->OSType);
|
||||
if (Volume->LegacyOS->Type == OSTYPE_WIN) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@ -1262,33 +1262,33 @@ FindStartupDiskVolume (
|
||||
Volume = LoaderEntry.Volume;
|
||||
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
|
||||
// check for Win
|
||||
//DBG (" checking loader entry %d. %ls\n", Index, LoaderEntry.Title);
|
||||
//DBG (" %ls\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG (" LoaderPath = %ls\n", LoaderEntry.LoaderPath);
|
||||
//DBG (" LoaderType = %d\n", LoaderEntry.LoaderType);
|
||||
//DBG(" checking loader entry %d. %ls\n", Index, LoaderEntry.Title);
|
||||
//DBG(" %ls\n", DevicePathToStr (Volume->DevicePath));
|
||||
//DBG(" LoaderPath = %ls\n", LoaderEntry.LoaderPath);
|
||||
//DBG(" LoaderType = %d\n", LoaderEntry.LoaderType);
|
||||
if (LoaderEntry.LoaderType == OSTYPE_WINEFI) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
|
||||
//
|
||||
// 3.3 DiskVolume, but no Win entry
|
||||
// PciRoot(0x0)/.../Sata(...)
|
||||
// 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) {
|
||||
if (MainMenu->Entries[Index].getLEGACY_ENTRY()) {
|
||||
LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index];
|
||||
Volume = LegacyEntry.Volume;
|
||||
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
|
||||
// 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;
|
||||
}
|
||||
@ -1297,14 +1297,14 @@ FindStartupDiskVolume (
|
||||
Volume = LoaderEntry.Volume;
|
||||
if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DBG (" - [!] not found\n");
|
||||
DBG(" - [!] not found\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1325,9 +1325,9 @@ EFI_STATUS SetStartupDiskVolume (
|
||||
UINT32 Attributes;
|
||||
|
||||
|
||||
DBG ("SetStartupDiskVolume:\n");
|
||||
DBG (" * Volume: '%ls'\n", Volume->VolName);
|
||||
DBG (" * LoaderPath: '%ls'\n", LoaderPath);
|
||||
DBG("SetStartupDiskVolume:\n");
|
||||
DBG(" * Volume: '%ls'\n", Volume->VolName);
|
||||
DBG(" * LoaderPath: '%ls'\n", LoaderPath);
|
||||
|
||||
//
|
||||
// construct dev path for Volume/LoaderPath
|
||||
@ -1337,10 +1337,10 @@ EFI_STATUS SetStartupDiskVolume (
|
||||
FileDevPath = FileDevicePath (NULL, LoaderPath);
|
||||
DevPath = AppendDevicePathNode (DevPath, FileDevPath);
|
||||
}
|
||||
DBG (" * DevPath: %ls\n", Volume->VolName/*, FileDevicePathToStr (DevPath)*/);
|
||||
DBG(" * DevPath: %ls\n", Volume->VolName/*, FileDevicePathToStr (DevPath)*/);
|
||||
|
||||
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
|
||||
@ -1379,7 +1379,7 @@ EFI_STATUS SetStartupDiskVolume (
|
||||
// EfiBootDevice = (__typeof__(EfiBootDevice))AllocateZeroPool(AsciiStrLen (EfiBootDeviceTmpl) + 36);
|
||||
// AsciiSPrint (EfiBootDevice, Size, EfiBootDeviceTmpl, strguid(Guid));
|
||||
// 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);
|
||||
// FreePool(EfiBootDevice);
|
||||
@ -1408,17 +1408,17 @@ RemoveStartupDiskVolume ()
|
||||
{
|
||||
// EFI_STATUS Status;
|
||||
|
||||
// DBG ("RemoveStartupDiskVolume:\n");
|
||||
// DBG("RemoveStartupDiskVolume:\n");
|
||||
|
||||
/*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);
|
||||
// DBG (" * efi-boot-device-data = %s\n", strerror(Status));
|
||||
// DBG(" * efi-boot-device-data = %s\n", strerror(Status));
|
||||
|
||||
/*Status =*/ DeleteNvramVariable (L"BootCampHD", &gEfiAppleBootGuid);
|
||||
// DBG (" * BootCampHD = %s\n", strerror(Status));
|
||||
// DBG ("Removed efi-boot-device-data variable: %s\n", strerror(Status));
|
||||
// DBG(" * BootCampHD = %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
@ -1068,7 +1068,7 @@ VOID GetCPUProperties (VOID)
|
||||
tmpU = gCPUStructure.FSBFrequency;
|
||||
// DBG("divide by 1000\n");
|
||||
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
|
||||
if ((BusSpeed > 50*kilo) &&
|
||||
((ExternalClock > BusSpeed * 3) || (ExternalClock < 50*kilo))) { //khz
|
||||
|
@ -998,45 +998,45 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 120) {
|
||||
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 {
|
||||
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;
|
||||
case 240:
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 160) {
|
||||
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 {
|
||||
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;
|
||||
case 320:
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 240) {
|
||||
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 {
|
||||
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;
|
||||
case 400:
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 240) {
|
||||
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 {
|
||||
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;
|
||||
case 480:
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 320) {
|
||||
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 {
|
||||
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;
|
||||
case 640:
|
||||
@ -1044,14 +1044,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 360:
|
||||
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;
|
||||
case 480:
|
||||
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;
|
||||
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;
|
||||
@ -1060,14 +1060,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 480:
|
||||
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;
|
||||
case 600:
|
||||
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;
|
||||
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;
|
||||
@ -1075,9 +1075,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 480) {
|
||||
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 {
|
||||
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;
|
||||
case 960:
|
||||
@ -1085,14 +1085,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 540:
|
||||
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;
|
||||
case 640:
|
||||
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;
|
||||
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;
|
||||
@ -1101,18 +1101,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 576:
|
||||
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;
|
||||
case 600:
|
||||
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;
|
||||
case 768:
|
||||
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;
|
||||
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;
|
||||
@ -1120,9 +1120,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 864) {
|
||||
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 {
|
||||
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;
|
||||
case 1280:
|
||||
@ -1130,22 +1130,22 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 720:
|
||||
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;
|
||||
case 768:
|
||||
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;
|
||||
case 800:
|
||||
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;
|
||||
case 1024:
|
||||
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;
|
||||
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;
|
||||
@ -1153,27 +1153,27 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 768) {
|
||||
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 {
|
||||
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;
|
||||
case 1400:
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 1050) {
|
||||
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 {
|
||||
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;
|
||||
case 1440:
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 900) {
|
||||
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 {
|
||||
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;
|
||||
case 1600:
|
||||
@ -1181,14 +1181,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 900:
|
||||
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;
|
||||
case 1200:
|
||||
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;
|
||||
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;
|
||||
@ -1197,10 +1197,10 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 1050:
|
||||
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;
|
||||
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;
|
||||
@ -1209,14 +1209,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 1080:
|
||||
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;
|
||||
case 1200:
|
||||
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;
|
||||
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;
|
||||
@ -1225,14 +1225,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 1152:
|
||||
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;
|
||||
case 1536:
|
||||
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;
|
||||
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;
|
||||
@ -1241,18 +1241,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 1440:
|
||||
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;
|
||||
case 1600:
|
||||
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;
|
||||
case 2048:
|
||||
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;
|
||||
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;
|
||||
@ -1260,9 +1260,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 1800) {
|
||||
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 {
|
||||
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;
|
||||
case 3200:
|
||||
@ -1270,18 +1270,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 1800:
|
||||
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;
|
||||
case 2048:
|
||||
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;
|
||||
case 2400:
|
||||
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;
|
||||
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;
|
||||
@ -1290,14 +1290,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 2160:
|
||||
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;
|
||||
case 2400:
|
||||
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;
|
||||
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;
|
||||
@ -1305,9 +1305,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
SetUGAWidth = TRUE;
|
||||
if(UGAHeight == 3072) {
|
||||
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 {
|
||||
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;
|
||||
case 5120:
|
||||
@ -1315,18 +1315,18 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 2880:
|
||||
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;
|
||||
case 3200:
|
||||
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;
|
||||
case 4096:
|
||||
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;
|
||||
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;
|
||||
@ -1335,14 +1335,14 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 4096:
|
||||
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;
|
||||
case 4800:
|
||||
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;
|
||||
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;
|
||||
@ -1351,19 +1351,19 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev)
|
||||
switch (UGAHeight) {
|
||||
case 4320:
|
||||
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;
|
||||
case 4800:
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -898,7 +898,7 @@ VOID ScanSPD()
|
||||
//SmBus controller has class = 0x0c0500
|
||||
if ((gPci.Hdr.ClassCode[2] == 0x0c) && (gPci.Hdr.ClassCode[1] == 5)
|
||||
&& (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.DeviceId,
|
||||
gPci.Hdr.ClassCode[2],
|
||||
|
@ -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 ) {
|
||||
UINTN add_comma = 0;
|
||||
|
||||
DBG ("%sNot match custom entry %llu: ", indent, CustomIndex);
|
||||
DBG("%sNot match custom entry %llu: ", indent, CustomIndex);
|
||||
if (volume_match != 0) {
|
||||
DBG("Volume: %ls", volume_match == 1 ? L"match" : L"not match");
|
||||
add_comma++;
|
||||
|
@ -1727,7 +1727,7 @@ BOOLEAN SetOEMPathIfExists(IN EFI_FILE *Root, IN CHAR16 *path, CONST CHAR16 *Con
|
||||
BOOLEAN res2 = FileExists(Root, ConfigPath);
|
||||
if ( res2 ) {
|
||||
OEMPath = path;
|
||||
DBG ("CheckOEMPathExists: set OEMPath: %ls\n", OEMPath);
|
||||
DBG("CheckOEMPathExists: set OEMPath: %ls\n", OEMPath);
|
||||
return 1;
|
||||
}else{
|
||||
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");
|
||||
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 > 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)) {
|
||||
@ -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-%d", gSettings.OEMBoard, (INT32)(DivU64x32(gCPUStructure.CPUFrequency, Mega))), ConfName) ) {
|
||||
} else {
|
||||
DBG ("set OEMPath by default: %ls\n", OEMPath);
|
||||
DBG("set OEMPath by default: %ls\n", OEMPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user