Skip to content

Commit

Permalink
prepare for sequoia
Browse files Browse the repository at this point in the history
Signed-off-by: Slice <[email protected]>
  • Loading branch information
SergeySlice committed Jun 10, 2024
1 parent f3d43d9 commit 083b863
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 20 deletions.
28 changes: 26 additions & 2 deletions rEFIt_UEFI/Platform/AcpiPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,25 @@ void GetAcpiTablesList()
UINT32 Count = XsdtTableCount();
UINT64* Ptr = XsdtEntryPtrFromIndex(0);
UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);
DBG("from XSDT:\n");
DBG("from XSDT: count=%u\n", Count);
for (; Ptr < EndPtr; Ptr++) {
EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)ReadUnaligned64(Ptr);
// DBG("X: Table=%16llX\n", (UINTN)Table);
if (!Table) {
// skip NULL entry
continue;
}
AddDropTable(Table, IndexFromXsdtEntryPtr(Ptr));
}
} else if (Rsdt) {
DBG("from RSDT:\n");

UINT32 Count = RsdtTableCount();
DBG("from RSDT: count=%u\n", Count);
UINT32* Ptr = RsdtEntryPtrFromIndex(0);
UINT32* EndPtr = RsdtEntryPtrFromIndex(Count);
for (; Ptr < EndPtr; Ptr++) {
EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)*Ptr;
// DBG("R: Table=%16llX\n", (UINTN)Table);
if (!Table) {
// skip NULL entry
continue;
Expand Down Expand Up @@ -1239,16 +1242,26 @@ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* GetFadt()
// EFI_STATUS Status;

RsdPtr = (__typeof__(RsdPtr))FindAcpiRsdPtr();
// DBG("0: RsdPtr=%16llX\n", (UINTN)RsdPtr);
if (RsdPtr == NULL) {
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (void **)&RsdPtr);
if (RsdPtr == NULL) {
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (void **)&RsdPtr);
// DBG("1: RsdPtr=%16llX\n", (UINTN)RsdPtr);
if (RsdPtr == NULL) {
return NULL;
}
}
}
// DBG("2: RsdPtr=%16llX\n", (UINTN)RsdPtr);
// DBG(" Rsdt=%08X\n", (UINT32)(RsdPtr->RsdtAddress));
// DBG(" Xsdt=%16llX\n", (UINTN)(RsdPtr->XsdtAddress)); //==0
// DBG(" RsdPtr->Revision=%16llX\n", (UINTN)(RsdPtr->Revision)); //==0

Rsdt = (RSDT_TABLE*)(UINTN)(RsdPtr->RsdtAddress);
// if (Rsdt) {
// DBG(" Rsdt->Header.Signature=%16llX\n", (UINTN)(Rsdt->Header.Signature));
// }
if (RsdPtr->Revision > 0) {
if (Rsdt == NULL || Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {
Xsdt = (XSDT_TABLE *)(UINTN)(RsdPtr->XsdtAddress);
Expand All @@ -1262,6 +1275,17 @@ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* GetFadt()
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (void**)&RsdPtr);
if (RsdPtr != NULL) {
DBG("Found UEFI Acpi 2.0 RSDP at %llx\n", (uintptr_t)RsdPtr);

// DBG("3: RsdPtr=%16llX\n", (UINTN)RsdPtr);
// DBG(" Rsdt=%08X\n", (UINT32)(RsdPtr->RsdtAddress));
// DBG(" Xsdt=%16llX\n", (UINTN)(RsdPtr->XsdtAddress));
// DBG(" RsdPtr->Revision=%16llX\n", (UINTN)(RsdPtr->Revision));

Rsdt = (RSDT_TABLE*)(UINTN)(RsdPtr->RsdtAddress);
// if (Rsdt) {
// DBG(" Rsdt->Header.Signature=%16llX\n", (UINTN)(Rsdt->Header.Signature));
// }

Rsdt = (RSDT_TABLE*)(UINTN)(RsdPtr->RsdtAddress);
if (RsdPtr->Revision > 0) {
if (Rsdt == NULL || Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {
Expand Down
2 changes: 1 addition & 1 deletion rEFIt_UEFI/Platform/StartupSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ StartupSoundPlay(const EFI_FILE* Dir, CONST CHAR16* SoundFile)
// and we can't free memory up to stop AsyncPlay
FreeAlignedPages(WaveData.Samples, EFI_SIZE_TO_PAGES(WaveData.SamplesLength + 4095));
}
DBG("sound play end with status=%s\n", efiStrError(Status));
// DBG("sound play end with status=%s\n", efiStrError(Status));
return Status;
}

Expand Down
4 changes: 2 additions & 2 deletions rEFIt_UEFI/Settings/ConfigPlist/ConfigPlistClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ConfigPlistClass : public ConfigPlistAbstractClass
SmbiosPlistClass::SmbiosDictClass SMBIOS_monterey = SmbiosPlistClass::SmbiosDictClass();
SmbiosPlistClass::SmbiosDictClass SMBIOS_ventura = SmbiosPlistClass::SmbiosDictClass();
SmbiosPlistClass::SmbiosDictClass SMBIOS_sonoma = SmbiosPlistClass::SmbiosDictClass();
SmbiosPlistClass::SmbiosDictClass SMBIOS_fifteen = SmbiosPlistClass::SmbiosDictClass();
SmbiosPlistClass::SmbiosDictClass SMBIOS_sequoia = SmbiosPlistClass::SmbiosDictClass();
// SmbiosPlistClass::SmbiosDictClass SMBIOS_lion = SmbiosPlistClass::SmbiosDictClass();
public:
SystemParameters_Class SystemParameters = SystemParameters_Class();
Expand Down Expand Up @@ -120,7 +120,7 @@ class ConfigPlistClass : public ConfigPlistAbstractClass
{"SMBIOS_monterey", SMBIOS_monterey},
{"SMBIOS_ventura", SMBIOS_ventura},
{"SMBIOS_sonoma", SMBIOS_sonoma},
{"SMBIOS_fifteen", SMBIOS_fifteen},
{"SMBIOS_sequoia", SMBIOS_sequoia},
{"SystemParameters", SystemParameters},
{"RtVariables", RtVariables},
{"Quirks", Quirks},
Expand Down
4 changes: 2 additions & 2 deletions rEFIt_UEFI/Settings/ConfigPlist/SMBIOSPlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ class SmbiosPlistClass : public ConfigPlistAbstractClass
SmbiosDictClass SMBIOS_monterey = SmbiosDictClass();
SmbiosDictClass SMBIOS_ventura = SmbiosDictClass();
SmbiosDictClass SMBIOS_sonoma = SmbiosDictClass();
SmbiosDictClass SMBIOS_fifteen = SmbiosDictClass();
SmbiosDictClass SMBIOS_sequoia = SmbiosDictClass();

XmlDictField m_fields[15] = {
{"SMBIOS", SMBIOS},
Expand All @@ -778,7 +778,7 @@ class SmbiosPlistClass : public ConfigPlistAbstractClass
{"SMBIOS_monterey", SMBIOS_monterey},
{"SMBIOS_ventura", SMBIOS_ventura},
{"SMBIOS_sonoma", SMBIOS_sonoma},
{"SMBIOS_fifteen", SMBIOS_fifteen},
{"SMBIOS_sequoia", SMBIOS_sequoia},
};

public:
Expand Down
6 changes: 3 additions & 3 deletions rEFIt_UEFI/entry_scan/loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const
OSVersion = "13"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%20Sonoma") || Prop->getString()->stringValue().contains("Install%20macOS%2014")) {
OSVersion = "14"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%20Fifteen") || Prop->getString()->stringValue().contains("Install%20macOS%2015")) {
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%20Sequoia") || Prop->getString()->stringValue().contains("Install%20macOS%2015")) {
OSVersion = "15"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%2010.16")) {
OSVersion = "10.16"_XS8;
Expand Down Expand Up @@ -842,8 +842,8 @@ GetOSIconName (const MacOsVersion& OSVersion)
if (OSVersion.isEmpty()) {
OSIconName = L"mac"_XSW;
} else if (OSVersion.elementAt(0) == 15 ){
// Fifteen
OSIconName = L"fifteen,mac"_XSW;
// Sequoia
OSIconName = L"sequoia,mac"_XSW;
} else if (OSVersion.elementAt(0) == 14 ){
// Sonoma
OSIconName = L"sonoma,mac"_XSW;
Expand Down
2 changes: 1 addition & 1 deletion rEFIt_UEFI/libeg/XIcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ CONST LString8 IconsNames[] = {
"os_monterey", //54 == ICON_MONTEREY
"os_ventura", //55 == ICON_VENTURA
"os_sonoma", //56 == ICON_SONOMA
"os_fifteen", //57 == ICON_FIFTEEN
"os_sequoia", //57 == ICON_SEQUOIA
""
};
const INTN IconsNamesSize = sizeof(IconsNames) / sizeof(IconsNames[0]);
Expand Down
10 changes: 5 additions & 5 deletions rEFIt_UEFI/libeg/XTheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ EFI_STATUS Status = EFI_NOT_FOUND;
ThemeDict = ThemeX->LoadTheme(XStringW(ThemeNameArray[Rnd]));
} else {
ThemeDict = ThemeX->LoadTheme(gSettings.GUI.Theme);
if (ThemeDict == NULL) {
DBG("GlobalConfig: %ls not found, get embedded theme\n", gSettings.GUI.Theme.wc_str());
} else {
DBG("chosen theme %ls\n", gSettings.GUI.Theme.wc_str());
}
// if (ThemeDict == NULL) {
// DBG("GlobalConfig: %ls not found, get embedded theme\n", gSettings.GUI.Theme.wc_str());
// } else {
// DBG("chosen theme %ls\n", gSettings.GUI.Theme.wc_str());
// }
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rEFIt_UEFI/refit/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void DebugPause(void);
#define ICON_MONTEREY (54)
#define ICON_VENTURA (55)
#define ICON_SONOMA (56)
#define ICON_FIFTEEN (57)
#define ICON_SEQUOIA (57)
#define BUILTIN_ICON_BACKGROUND (100)
#define BUILTIN_ICON_SELECTION (101)
#define BUILTIN_ICON_ANIME (102)
Expand Down
6 changes: 3 additions & 3 deletions rEFIt_UEFI/refit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ void LOADER_ENTRY::StartLoader()
if ( FileExists(&self.getCloverDir(), bundleFullPath) ) {
XString8 bundlePathUnderKextsDir = S8Printf("%ls\\%ls", KextEntry.KextDirNameUnderOEMPath.wc_str(), KextEntry.FileName.wc_str());
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->BundlePath, bundlePathUnderKextsDir.c_str());
DBG("OC BundlePath = '%s'\n", OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->BundlePath));
// DBG("OC BundlePath = '%s'\n", OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->BundlePath));
} else {
DBG("Cannot find kext bundlePath at '%s'\n", bundleFullPath.c_str());
}
Expand All @@ -1260,15 +1260,15 @@ void LOADER_ENTRY::StartLoader()
} else {
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->PlistPath, "Contents\\Info.plist");
}
DBG("OC PlistPath = '%s'\n", OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->PlistPath));
// DBG("OC PlistPath = '%s'\n", OC_BLOB_GET(&mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->PlistPath));
} else {
DBG("Cannot find kext info.plist at '%ls'\n", KextEntry.FileName.wc_str());
}
TagDict* dict = getInfoPlist(&self.getCloverDir(), infoPlistPathRelToSelf);
XString8 execpath = getKextExecPath(&self.getCloverDir(), KextEntry.KextDirNameUnderOEMPath, KextEntry.FileName, dict, NoContents);
if (execpath.notEmpty()) {
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->ExecutablePath, execpath.c_str());
DBG("OC ExecutablePath = '%s'\n", execpath.c_str());
// DBG("OC ExecutablePath = '%s'\n", execpath.c_str());
}
if ( dict ) dict->ReleaseTag();
}
Expand Down

0 comments on commit 083b863

Please sign in to comment.