prepare for sequoia

Signed-off-by: Slice <sergey.slice@gmail.com>
This commit is contained in:
Slice 2024-06-10 22:50:11 +03:00
parent f3d43d9c2a
commit 083b863ee6
9 changed files with 44 additions and 20 deletions

View File

@ -306,9 +306,10 @@ void GetAcpiTablesList()
UINT32 Count = XsdtTableCount(); UINT32 Count = XsdtTableCount();
UINT64* Ptr = XsdtEntryPtrFromIndex(0); UINT64* Ptr = XsdtEntryPtrFromIndex(0);
UINT64* EndPtr = XsdtEntryPtrFromIndex(Count); UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);
DBG("from XSDT:\n"); DBG("from XSDT: count=%u\n", Count);
for (; Ptr < EndPtr; Ptr++) { for (; Ptr < EndPtr; Ptr++) {
EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)ReadUnaligned64(Ptr); EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)ReadUnaligned64(Ptr);
// DBG("X: Table=%16llX\n", (UINTN)Table);
if (!Table) { if (!Table) {
// skip NULL entry // skip NULL entry
continue; continue;
@ -316,12 +317,14 @@ void GetAcpiTablesList()
AddDropTable(Table, IndexFromXsdtEntryPtr(Ptr)); AddDropTable(Table, IndexFromXsdtEntryPtr(Ptr));
} }
} else if (Rsdt) { } else if (Rsdt) {
DBG("from RSDT:\n");
UINT32 Count = RsdtTableCount(); UINT32 Count = RsdtTableCount();
DBG("from RSDT: count=%u\n", Count);
UINT32* Ptr = RsdtEntryPtrFromIndex(0); UINT32* Ptr = RsdtEntryPtrFromIndex(0);
UINT32* EndPtr = RsdtEntryPtrFromIndex(Count); UINT32* EndPtr = RsdtEntryPtrFromIndex(Count);
for (; Ptr < EndPtr; Ptr++) { for (; Ptr < EndPtr; Ptr++) {
EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)*Ptr; EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)*Ptr;
// DBG("R: Table=%16llX\n", (UINTN)Table);
if (!Table) { if (!Table) {
// skip NULL entry // skip NULL entry
continue; continue;
@ -1239,16 +1242,26 @@ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* GetFadt()
// EFI_STATUS Status; // EFI_STATUS Status;
RsdPtr = (__typeof__(RsdPtr))FindAcpiRsdPtr(); RsdPtr = (__typeof__(RsdPtr))FindAcpiRsdPtr();
// DBG("0: RsdPtr=%16llX\n", (UINTN)RsdPtr);
if (RsdPtr == NULL) { if (RsdPtr == NULL) {
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (void **)&RsdPtr); /*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (void **)&RsdPtr);
if (RsdPtr == NULL) { if (RsdPtr == NULL) {
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (void **)&RsdPtr); /*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (void **)&RsdPtr);
// DBG("1: RsdPtr=%16llX\n", (UINTN)RsdPtr);
if (RsdPtr == NULL) { if (RsdPtr == NULL) {
return 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); Rsdt = (RSDT_TABLE*)(UINTN)(RsdPtr->RsdtAddress);
// if (Rsdt) {
// DBG(" Rsdt->Header.Signature=%16llX\n", (UINTN)(Rsdt->Header.Signature));
// }
if (RsdPtr->Revision > 0) { if (RsdPtr->Revision > 0) {
if (Rsdt == NULL || Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) { if (Rsdt == NULL || Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {
Xsdt = (XSDT_TABLE *)(UINTN)(RsdPtr->XsdtAddress); Xsdt = (XSDT_TABLE *)(UINTN)(RsdPtr->XsdtAddress);
@ -1262,6 +1275,17 @@ EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* GetFadt()
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (void**)&RsdPtr); /*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (void**)&RsdPtr);
if (RsdPtr != NULL) { if (RsdPtr != NULL) {
DBG("Found UEFI Acpi 2.0 RSDP at %llx\n", (uintptr_t)RsdPtr); 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); Rsdt = (RSDT_TABLE*)(UINTN)(RsdPtr->RsdtAddress);
if (RsdPtr->Revision > 0) { if (RsdPtr->Revision > 0) {
if (Rsdt == NULL || Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) { if (Rsdt == NULL || Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {

View File

@ -239,7 +239,7 @@ DONE_ERROR:
// and we can't free memory up to stop AsyncPlay // and we can't free memory up to stop AsyncPlay
FreeAlignedPages(WaveData.Samples, EFI_SIZE_TO_PAGES(WaveData.SamplesLength + 4095)); 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; return Status;
} }

View File

@ -89,7 +89,7 @@ public:
SmbiosPlistClass::SmbiosDictClass SMBIOS_monterey = SmbiosPlistClass::SmbiosDictClass(); SmbiosPlistClass::SmbiosDictClass SMBIOS_monterey = SmbiosPlistClass::SmbiosDictClass();
SmbiosPlistClass::SmbiosDictClass SMBIOS_ventura = SmbiosPlistClass::SmbiosDictClass(); SmbiosPlistClass::SmbiosDictClass SMBIOS_ventura = SmbiosPlistClass::SmbiosDictClass();
SmbiosPlistClass::SmbiosDictClass SMBIOS_sonoma = 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(); // SmbiosPlistClass::SmbiosDictClass SMBIOS_lion = SmbiosPlistClass::SmbiosDictClass();
public: public:
SystemParameters_Class SystemParameters = SystemParameters_Class(); SystemParameters_Class SystemParameters = SystemParameters_Class();
@ -120,7 +120,7 @@ public:
{"SMBIOS_monterey", SMBIOS_monterey}, {"SMBIOS_monterey", SMBIOS_monterey},
{"SMBIOS_ventura", SMBIOS_ventura}, {"SMBIOS_ventura", SMBIOS_ventura},
{"SMBIOS_sonoma", SMBIOS_sonoma}, {"SMBIOS_sonoma", SMBIOS_sonoma},
{"SMBIOS_fifteen", SMBIOS_fifteen}, {"SMBIOS_sequoia", SMBIOS_sequoia},
{"SystemParameters", SystemParameters}, {"SystemParameters", SystemParameters},
{"RtVariables", RtVariables}, {"RtVariables", RtVariables},
{"Quirks", Quirks}, {"Quirks", Quirks},

View File

@ -761,7 +761,7 @@ public:
SmbiosDictClass SMBIOS_monterey = SmbiosDictClass(); SmbiosDictClass SMBIOS_monterey = SmbiosDictClass();
SmbiosDictClass SMBIOS_ventura = SmbiosDictClass(); SmbiosDictClass SMBIOS_ventura = SmbiosDictClass();
SmbiosDictClass SMBIOS_sonoma = SmbiosDictClass(); SmbiosDictClass SMBIOS_sonoma = SmbiosDictClass();
SmbiosDictClass SMBIOS_fifteen = SmbiosDictClass(); SmbiosDictClass SMBIOS_sequoia = SmbiosDictClass();
XmlDictField m_fields[15] = { XmlDictField m_fields[15] = {
{"SMBIOS", SMBIOS}, {"SMBIOS", SMBIOS},
@ -778,7 +778,7 @@ public:
{"SMBIOS_monterey", SMBIOS_monterey}, {"SMBIOS_monterey", SMBIOS_monterey},
{"SMBIOS_ventura", SMBIOS_ventura}, {"SMBIOS_ventura", SMBIOS_ventura},
{"SMBIOS_sonoma", SMBIOS_sonoma}, {"SMBIOS_sonoma", SMBIOS_sonoma},
{"SMBIOS_fifteen", SMBIOS_fifteen}, {"SMBIOS_sequoia", SMBIOS_sequoia},
}; };
public: public:

View File

@ -587,7 +587,7 @@ MacOsVersion GetOSVersion(int LoaderType, const EFI_GUID& APFSTargetUUID, const
OSVersion = "13"_XS8; OSVersion = "13"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%20Sonoma") || Prop->getString()->stringValue().contains("Install%20macOS%2014")) { } else if ( Prop->getString()->stringValue().contains("Install%20macOS%20Sonoma") || Prop->getString()->stringValue().contains("Install%20macOS%2014")) {
OSVersion = "14"_XS8; 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; OSVersion = "15"_XS8;
} else if ( Prop->getString()->stringValue().contains("Install%20macOS%2010.16")) { } else if ( Prop->getString()->stringValue().contains("Install%20macOS%2010.16")) {
OSVersion = "10.16"_XS8; OSVersion = "10.16"_XS8;
@ -842,8 +842,8 @@ GetOSIconName (const MacOsVersion& OSVersion)
if (OSVersion.isEmpty()) { if (OSVersion.isEmpty()) {
OSIconName = L"mac"_XSW; OSIconName = L"mac"_XSW;
} else if (OSVersion.elementAt(0) == 15 ){ } else if (OSVersion.elementAt(0) == 15 ){
// Fifteen // Sequoia
OSIconName = L"fifteen,mac"_XSW; OSIconName = L"sequoia,mac"_XSW;
} else if (OSVersion.elementAt(0) == 14 ){ } else if (OSVersion.elementAt(0) == 14 ){
// Sonoma // Sonoma
OSIconName = L"sonoma,mac"_XSW; OSIconName = L"sonoma,mac"_XSW;

View File

@ -86,7 +86,7 @@ CONST LString8 IconsNames[] = {
"os_monterey", //54 == ICON_MONTEREY "os_monterey", //54 == ICON_MONTEREY
"os_ventura", //55 == ICON_VENTURA "os_ventura", //55 == ICON_VENTURA
"os_sonoma", //56 == ICON_SONOMA "os_sonoma", //56 == ICON_SONOMA
"os_fifteen", //57 == ICON_FIFTEEN "os_sequoia", //57 == ICON_SEQUOIA
"" ""
}; };
const INTN IconsNamesSize = sizeof(IconsNames) / sizeof(IconsNames[0]); const INTN IconsNamesSize = sizeof(IconsNames) / sizeof(IconsNames[0]);

View File

@ -138,11 +138,11 @@ EFI_STATUS Status = EFI_NOT_FOUND;
ThemeDict = ThemeX->LoadTheme(XStringW(ThemeNameArray[Rnd])); ThemeDict = ThemeX->LoadTheme(XStringW(ThemeNameArray[Rnd]));
} else { } else {
ThemeDict = ThemeX->LoadTheme(gSettings.GUI.Theme); ThemeDict = ThemeX->LoadTheme(gSettings.GUI.Theme);
if (ThemeDict == NULL) { // if (ThemeDict == NULL) {
DBG("GlobalConfig: %ls not found, get embedded theme\n", gSettings.GUI.Theme.wc_str()); // DBG("GlobalConfig: %ls not found, get embedded theme\n", gSettings.GUI.Theme.wc_str());
} else { // } else {
DBG("chosen theme %ls\n", gSettings.GUI.Theme.wc_str()); // DBG("chosen theme %ls\n", gSettings.GUI.Theme.wc_str());
} // }
} }
} }
} }

View File

@ -364,7 +364,7 @@ void DebugPause(void);
#define ICON_MONTEREY (54) #define ICON_MONTEREY (54)
#define ICON_VENTURA (55) #define ICON_VENTURA (55)
#define ICON_SONOMA (56) #define ICON_SONOMA (56)
#define ICON_FIFTEEN (57) #define ICON_SEQUOIA (57)
#define BUILTIN_ICON_BACKGROUND (100) #define BUILTIN_ICON_BACKGROUND (100)
#define BUILTIN_ICON_SELECTION (101) #define BUILTIN_ICON_SELECTION (101)
#define BUILTIN_ICON_ANIME (102) #define BUILTIN_ICON_ANIME (102)

View File

@ -1242,7 +1242,7 @@ void LOADER_ENTRY::StartLoader()
if ( FileExists(&self.getCloverDir(), bundleFullPath) ) { if ( FileExists(&self.getCloverDir(), bundleFullPath) ) {
XString8 bundlePathUnderKextsDir = S8Printf("%ls\\%ls", KextEntry.KextDirNameUnderOEMPath.wc_str(), KextEntry.FileName.wc_str()); 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()); 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 { } else {
DBG("Cannot find kext bundlePath at '%s'\n", bundleFullPath.c_str()); DBG("Cannot find kext bundlePath at '%s'\n", bundleFullPath.c_str());
} }
@ -1260,7 +1260,7 @@ void LOADER_ENTRY::StartLoader()
} else { } else {
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->PlistPath, "Contents\\Info.plist"); 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 { } else {
DBG("Cannot find kext info.plist at '%ls'\n", KextEntry.FileName.wc_str()); DBG("Cannot find kext info.plist at '%ls'\n", KextEntry.FileName.wc_str());
} }
@ -1268,7 +1268,7 @@ void LOADER_ENTRY::StartLoader()
XString8 execpath = getKextExecPath(&self.getCloverDir(), KextEntry.KextDirNameUnderOEMPath, KextEntry.FileName, dict, NoContents); XString8 execpath = getKextExecPath(&self.getCloverDir(), KextEntry.KextDirNameUnderOEMPath, KextEntry.FileName, dict, NoContents);
if (execpath.notEmpty()) { if (execpath.notEmpty()) {
OC_STRING_ASSIGN(mOpenCoreConfiguration.Kernel.Add.Values[kextIdx]->ExecutablePath, execpath.c_str()); 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(); if ( dict ) dict->ReleaseTag();
} }