mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-25 16:37:42 +01:00
Merge branch 'CloverHackyColor:master' into master
This commit is contained in:
commit
8287b5d71a
@ -18,6 +18,13 @@
|
||||
typedef VOID (EFIAPI *MEM_LOG_CALLBACK) (IN INTN DebugMode, IN CHAR8 *LastMessage);
|
||||
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MemLogInit (
|
||||
VOID
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Prints a log message to memory buffer.
|
||||
|
||||
|
@ -427,14 +427,7 @@ UINT64
|
||||
EFIAPI
|
||||
GetMemLogTscTicksPerSecond (VOID)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (mMemLog == NULL) {
|
||||
Status = MemLogInit ();
|
||||
if (EFI_ERROR(Status)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (mMemLog == NULL) return 0;
|
||||
return mMemLog->TscFreqSec;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 93feac4ed96bad9bb54a817e24426241e1df1d5f
|
||||
Subproject commit 01a8830e3d36eeec4a10a67d5d9f199111bec93f
|
@ -1058,6 +1058,7 @@
|
||||
9AF4D970263014C600487D15 /* Volume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4D96C263014C600487D15 /* Volume.cpp */; };
|
||||
9AF4D971263014C600487D15 /* Volume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4D96C263014C600487D15 /* Volume.cpp */; };
|
||||
9AF4D972263014C600487D15 /* Volume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4D96C263014C600487D15 /* Volume.cpp */; };
|
||||
9AF5454E2702627F00CEC8FD /* XBool.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF5454C2702627F00CEC8FD /* XBool.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -1421,6 +1422,7 @@
|
||||
9AF4D936263004E200487D15 /* XmlLiteCompositeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XmlLiteCompositeTypes.h; sourceTree = "<group>"; };
|
||||
9AF4D96B263014C500487D15 /* Volume.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Volume.h; sourceTree = "<group>"; };
|
||||
9AF4D96C263014C600487D15 /* Volume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Volume.cpp; sourceTree = "<group>"; };
|
||||
9AF5454C2702627F00CEC8FD /* XBool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XBool.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -1943,6 +1945,7 @@
|
||||
9A8788CD26186897000B9362 /* XStringArray.cpp */,
|
||||
9A8788CF26186897000B9362 /* XStringArray.h */,
|
||||
9A8788D026186897000B9362 /* XToolsCommon.h */,
|
||||
9AF5454C2702627F00CEC8FD /* XBool.h */,
|
||||
);
|
||||
path = cpp_foundation;
|
||||
sourceTree = "<group>";
|
||||
@ -2060,6 +2063,7 @@
|
||||
9A87892D26186897000B9362 /* operatorNewDelete.h in Headers */,
|
||||
9A878C3626186898000B9362 /* bootscreen.h in Headers */,
|
||||
9A878AF826186897000B9362 /* HdaCodecDump.h in Headers */,
|
||||
9AF5454E2702627F00CEC8FD /* XBool.h in Headers */,
|
||||
9A87890926186897000B9362 /* stdarg.h in Headers */,
|
||||
9A8789C626186897000B9362 /* rename_helper.h in Headers */,
|
||||
9A878B4F26186897000B9362 /* DataHub.h in Headers */,
|
||||
@ -3262,6 +3266,7 @@
|
||||
DISABLE_SECURE_BOOT,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
|
||||
GCC_WARN_SHADOW = YES;
|
||||
@ -3315,6 +3320,11 @@
|
||||
"-Weffc++",
|
||||
"-Wunused-local-typedefs",
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-include",
|
||||
$PROJECT_DIR/../../rEFIt_UEFI/cpp_foundation/XBool.h,
|
||||
);
|
||||
SUPPORTED_PLATFORMS = macosx;
|
||||
USE_HEADERMAP = NO;
|
||||
VALID_ARCHS = x86_64;
|
||||
@ -3323,6 +3333,8 @@
|
||||
"-Wno-gnu-zero-variadic-macro-arguments",
|
||||
"-Wignored-qualifiers",
|
||||
"-Wreorder",
|
||||
"-Wmissing-braces",
|
||||
"-Wnon-pod-varargs",
|
||||
);
|
||||
};
|
||||
name = Debug;
|
||||
@ -3355,6 +3367,7 @@
|
||||
GCC_ENABLE_CPP_RTTI = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
|
||||
GCC_WARN_SHADOW = YES;
|
||||
@ -3408,6 +3421,11 @@
|
||||
"-Weffc++",
|
||||
"-Wunused-local-typedefs",
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-include",
|
||||
$PROJECT_DIR/../../rEFIt_UEFI/cpp_foundation/XBool.h,
|
||||
);
|
||||
SUPPORTED_PLATFORMS = macosx;
|
||||
USE_HEADERMAP = NO;
|
||||
VALID_ARCHS = x86_64;
|
||||
@ -3416,6 +3434,8 @@
|
||||
"-Wno-gnu-zero-variadic-macro-arguments",
|
||||
"-Wignored-qualifiers",
|
||||
"-Wreorder",
|
||||
"-Wmissing-braces",
|
||||
"-Wnon-pod-varargs",
|
||||
);
|
||||
};
|
||||
name = Release;
|
||||
|
@ -3462,7 +3462,7 @@
|
||||
9A82F7F326184670006F973B /* update_generated.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = update_generated.py; sourceTree = "<group>"; };
|
||||
9A82F7F426184670006F973B /* update_products.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = update_products.py; sourceTree = "<group>"; };
|
||||
9A82F7F526184670006F973B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
9A82F7F626184670006F973B /* Products.zjson */ = {isa = PBXFileReference; lastKnownFileType = file; path = Products.zjson; sourceTree = "<group>"; };
|
||||
9A82F7F626184670006F973B /* Products.zjson */ = {isa = PBXFileReference; lastKnownFileType = text; path = Products.zjson; sourceTree = "<group>"; };
|
||||
9A82F7F726184670006F973B /* DataBase.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = DataBase.md; sourceTree = "<group>"; };
|
||||
9A82F7F926184670006F973B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
9A82F7FB26184670006F973B /* hfs_format.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hfs_format.h; sourceTree = "<group>"; };
|
||||
@ -13786,6 +13786,7 @@
|
||||
"___NOT___ENABLE_SECURE_BOOT",
|
||||
"sprintf=__sprintf_is_disabled__",
|
||||
"wcscmp=__wcsncmp_is_disabled__",
|
||||
OC_TARGET_DEBUG,
|
||||
);
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
|
||||
@ -13837,6 +13838,11 @@
|
||||
"-include",
|
||||
Platform.h,
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-include",
|
||||
$PROJECT_DIR/../../rEFIt_UEFI/cpp_foundation/XBool.h,
|
||||
);
|
||||
SDKROOT = macosx;
|
||||
USE_HEADERMAP = NO;
|
||||
WARNING_CFLAGS = (
|
||||
@ -13907,6 +13913,7 @@
|
||||
"___NOT___ENABLE_SECURE_BOOT",
|
||||
"sprintf=__sprintf_is_disabled__",
|
||||
"wcscmp=__wcsncmp_is_disabled__",
|
||||
OC_TARGET_DEBUG,
|
||||
);
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
|
||||
@ -13957,6 +13964,11 @@
|
||||
"-include",
|
||||
Platform.h,
|
||||
);
|
||||
OTHER_CPLUSPLUSFLAGS = (
|
||||
"$(OTHER_CFLAGS)",
|
||||
"-include",
|
||||
$PROJECT_DIR/../../rEFIt_UEFI/cpp_foundation/XBool.h,
|
||||
);
|
||||
SDKROOT = macosx;
|
||||
USE_HEADERMAP = NO;
|
||||
WARNING_CFLAGS = (
|
||||
|
@ -13,6 +13,25 @@
|
||||
|
||||
#include "../../../rEFIt_UEFI/cpp_unit_test/all_tests.h"
|
||||
|
||||
//class Boolean
|
||||
//{
|
||||
// bool flag;
|
||||
//public:
|
||||
// explicit Boolean() : flag(false) {}
|
||||
// explicit Boolean(const bool other) { flag = other; }
|
||||
// explicit Boolean(const Boolean& other) { flag = other.flag; }
|
||||
//// template <typename T>
|
||||
//// Boolean(T other) = delete;// { return *this; }
|
||||
//
|
||||
// Boolean& operator= (const Boolean& other) { return *this; }
|
||||
// Boolean& operator= (const bool other) { return *this; }
|
||||
// template <typename T>
|
||||
// Boolean& operator= (const T other) = delete;// { return *this; }
|
||||
//
|
||||
// bool getValue() const {return flag;}
|
||||
// void setValue(bool a) {flag = a;}
|
||||
//};
|
||||
|
||||
|
||||
extern "C" int main(int argc, const char * argv[])
|
||||
{
|
||||
@ -21,9 +40,15 @@ extern "C" int main(int argc, const char * argv[])
|
||||
setlocale(LC_ALL, "en_US"); // to allow printf unicode char
|
||||
|
||||
// xcode_utf_fixed_tests();
|
||||
int i = 2;
|
||||
bool b;
|
||||
b = i;
|
||||
const int i = 2;
|
||||
(void)i;
|
||||
XBool b;
|
||||
b = true;
|
||||
b = false;
|
||||
// b = XBool(i);
|
||||
// b = (char*)NULL;
|
||||
// b = (float)1.0;
|
||||
// b = i;
|
||||
|
||||
return all_tests() ? 0 : -1 ;
|
||||
}
|
||||
|
@ -164,10 +164,10 @@ void SaveMergedXsdtEntrySize(UINT32 Index, UINTN Size)
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN IsXsdtEntryMerged(UINT32 Index)
|
||||
XBool IsXsdtEntryMerged(UINT32 Index)
|
||||
{
|
||||
if (!XsdtReplaceSizes) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
return 0 != XsdtReplaceSizes[Index];
|
||||
}
|
||||
@ -249,7 +249,7 @@ void AddDropTable(EFI_ACPI_DESCRIPTION_HEADER* Table, UINT32 Index)
|
||||
DropTable->Signature = Table->Signature;
|
||||
DropTable->TableId = Table->OemTableId;
|
||||
DropTable->Length = Table->Length;
|
||||
DropTable->MenuItem.BValue = FALSE;
|
||||
DropTable->MenuItem.BValue = false;
|
||||
DropTable->Next = GlobalConfig.ACPIDropTables;
|
||||
GlobalConfig.ACPIDropTables = DropTable;
|
||||
}
|
||||
@ -378,29 +378,29 @@ void DropTableFromXSDT(UINT32 Signature, UINT64 TableId, UINT32 Length)
|
||||
|
||||
|
||||
// by cecekpawon, edited by Slice, further edits by RehabMan
|
||||
BOOLEAN FixAsciiTableHeader(UINT8 *Str, UINTN Len)
|
||||
XBool FixAsciiTableHeader(UINT8 *Str, UINTN Len)
|
||||
{
|
||||
BOOLEAN NonAscii = FALSE;
|
||||
XBool NonAscii = false;
|
||||
UINT8* StrEnd = Str + Len;
|
||||
for (; Str < StrEnd; Str++) {
|
||||
if (!*Str) continue; // NUL is allowed
|
||||
if (*Str < ' ') {
|
||||
*Str = ' ';
|
||||
NonAscii = TRUE;
|
||||
NonAscii = true;
|
||||
}
|
||||
else if (*Str > 0x7e) {
|
||||
*Str = '_';
|
||||
NonAscii = TRUE;
|
||||
NonAscii = true;
|
||||
}
|
||||
}
|
||||
return NonAscii;
|
||||
}
|
||||
|
||||
BOOLEAN PatchTableHeader(EFI_ACPI_DESCRIPTION_HEADER *Header)
|
||||
XBool PatchTableHeader(EFI_ACPI_DESCRIPTION_HEADER *Header)
|
||||
{
|
||||
BOOLEAN Ret1, Ret2, Ret3;
|
||||
XBool Ret1, Ret2, Ret3;
|
||||
if ( !gSettings.ACPI.FixHeaders ) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
Ret1 = FixAsciiTableHeader((UINT8*)&Header->CreatorId, 4);
|
||||
Ret2 = FixAsciiTableHeader((UINT8*)&Header->OemTableId, 8);
|
||||
@ -414,7 +414,7 @@ void PatchAllTables()
|
||||
UINT64* Ptr = XsdtEntryPtrFromIndex(0);
|
||||
UINT64* EndPtr = XsdtEntryPtrFromIndex(Count);
|
||||
for (; Ptr < EndPtr; Ptr++) {
|
||||
BOOLEAN Patched = FALSE;
|
||||
XBool Patched = false;
|
||||
EFI_ACPI_DESCRIPTION_HEADER* Table = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)ReadUnaligned64(Ptr);
|
||||
if (!Table) {
|
||||
// skip NULL entry
|
||||
@ -478,12 +478,12 @@ void PatchAllTables()
|
||||
NewTable->Length = Len;
|
||||
RenameDevices((UINT8*)NewTable);
|
||||
GetBiosRegions((UINT8*)NewTable); //take Regions from SSDT even if they will be dropped
|
||||
Patched = TRUE;
|
||||
Patched = true;
|
||||
}
|
||||
if (NewTable->Signature == MCFG_SIGN && gSettings.ACPI.FixMCFG) {
|
||||
INTN Len1 = ((Len + 4 - 1) / 16 + 1) * 16 - 4;
|
||||
CopyMem(NewTable, Table, Len1); //Len increased but less than EFI_PAGE
|
||||
NewTable->Length = (UINT32)(UINTN)Len1; Patched = TRUE;
|
||||
NewTable->Length = (UINT32)(UINTN)Len1; Patched = true;
|
||||
}
|
||||
if (Patched) {
|
||||
WriteUnaligned64(Ptr, BufferPtr);
|
||||
@ -776,19 +776,19 @@ void **mSavedTables = NULL;
|
||||
UINTN mSavedTablesEntries = 0;
|
||||
UINTN mSavedTablesNum = 0;
|
||||
|
||||
/** Returns TRUE is TableEntry is already saved. */
|
||||
BOOLEAN IsTableSaved(void *TableEntry)
|
||||
/** Returns true is TableEntry is already saved. */
|
||||
XBool IsTableSaved(void *TableEntry)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
if (mSavedTables != NULL) {
|
||||
for (Index = 0; Index < mSavedTablesNum; Index++) {
|
||||
if (mSavedTables[Index] == TableEntry) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Adds TableEntry to mSavedTables if not already there. */
|
||||
@ -1451,7 +1451,7 @@ void SaveOemTables()
|
||||
// EFI_STATUS Status;
|
||||
void *RsdPtr;
|
||||
XStringW AcpiOriginPath = L"ACPI\\origin"_XSW;
|
||||
BOOLEAN Saved = FALSE;
|
||||
XBool Saved = false;
|
||||
CHAR8 *MemLogStart;
|
||||
UINTN MemLogStartLen;
|
||||
|
||||
@ -1469,7 +1469,7 @@ void SaveOemTables()
|
||||
if (gFirmwareClover) {
|
||||
// Save it
|
||||
DumpTables(RsdPtr, AcpiOriginPath.wc_str());
|
||||
Saved = TRUE;
|
||||
Saved = true;
|
||||
} else {
|
||||
// just print to log
|
||||
DumpTables(RsdPtr, NULL);
|
||||
@ -1484,7 +1484,7 @@ void SaveOemTables()
|
||||
DBG("Found UEFI Acpi 2.0 RSDP at %llx\n", (UINTN)RsdPtr);
|
||||
// if tables already saved, then just print to log
|
||||
DumpTables(RsdPtr, Saved ? NULL : AcpiOriginPath.wc_str());
|
||||
Saved = TRUE;
|
||||
Saved = true;
|
||||
}
|
||||
//
|
||||
// Then search Acpi 1.0 UEFI Sys.Tables
|
||||
@ -1495,13 +1495,13 @@ void SaveOemTables()
|
||||
DBG("Found UEFI Acpi 1.0 RSDP at %llx\n", (UINTN)RsdPtr);
|
||||
// if tables already saved, then just print to log
|
||||
DumpTables(RsdPtr, Saved ? NULL : AcpiOriginPath.wc_str());
|
||||
// Saved = TRUE;
|
||||
// Saved = true;
|
||||
}
|
||||
SaveBufferToDisk(MemLogStart, GetMemLogLen() - MemLogStartLen, AcpiOriginPath.wc_str(), L"DumpLog.txt");
|
||||
FreePool(mSavedTables);
|
||||
}
|
||||
|
||||
void SaveOemDsdt(BOOLEAN FullPatch)
|
||||
void SaveOemDsdt(XBool FullPatch)
|
||||
{
|
||||
EFI_STATUS Status = EFI_NOT_FOUND;
|
||||
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtPointer = NULL;
|
||||
@ -1580,7 +1580,7 @@ void SaveOemDsdt(BOOLEAN FullPatch)
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN LoadPatchedAML(const EFI_FILE& dir, const XStringW& acpiOemPath, CONST CHAR16* PartName, UINTN Pass)
|
||||
XBool LoadPatchedAML(const EFI_FILE& dir, const XStringW& acpiOemPath, CONST CHAR16* PartName, UINTN Pass)
|
||||
{
|
||||
// pass1 prefilter based on file names (optimization that avoids loading same files twice)
|
||||
UINTN Index = IGNORE_INDEX;
|
||||
@ -1592,7 +1592,7 @@ BOOLEAN LoadPatchedAML(const EFI_FILE& dir, const XStringW& acpiOemPath, CONST C
|
||||
// special case for SSDT.aml: no attempt to merge
|
||||
if (0 == StriCmp(PartName, L"SSDT.aml") || (8 != StrLen(PartName) && IGNORE_INDEX == Index)) {
|
||||
DBG("ignore on pass 1\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
UINT8 *buffer = NULL;
|
||||
@ -1603,7 +1603,7 @@ BOOLEAN LoadPatchedAML(const EFI_FILE& dir, const XStringW& acpiOemPath, CONST C
|
||||
EFI_ACPI_DESCRIPTION_HEADER* TableHeader = (EFI_ACPI_DESCRIPTION_HEADER*)buffer;
|
||||
if (TableHeader->Length > 500 * Kilo) {
|
||||
DBG("wrong table\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
DBG("size=%lld ", (UINT64)bufferLen);
|
||||
@ -1716,8 +1716,8 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion)
|
||||
// UINTN ApicLen;
|
||||
UINTN ApicCPUNum;
|
||||
UINT8 *SubTable;
|
||||
BOOLEAN DsdtLoaded = FALSE;
|
||||
BOOLEAN NeedUpdate = FALSE;
|
||||
XBool DsdtLoaded = false;
|
||||
XBool NeedUpdate = false;
|
||||
OPER_REGION *tmpRegion;
|
||||
// XStringW AcpiOemPath = SWPrintf("%ls\\ACPI\\patched", OEMPath.wc_str());
|
||||
|
||||
@ -1787,7 +1787,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion)
|
||||
NewRsdPointer->Revision = 2;
|
||||
NewRsdPointer->Length = sizeof(EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER);
|
||||
RsdPointer = NewRsdPointer;
|
||||
NeedUpdate = TRUE;
|
||||
NeedUpdate = true;
|
||||
// gBS->InstallConfigurationTable(&gEfiAcpiTableGuid, RsdPointer);
|
||||
// DBG("first install success\n");
|
||||
// gBS->InstallConfigurationTable(&gEfiAcpi10TableGuid, RsdPointer);
|
||||
@ -1868,7 +1868,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion)
|
||||
//should correct headers if needed and if asked
|
||||
PatchTableHeader((EFI_ACPI_DESCRIPTION_HEADER*)newFadt);
|
||||
|
||||
if (gSettings.ACPI.smartUPS==TRUE) {
|
||||
if (gSettings.ACPI.smartUPS==true) {
|
||||
newFadt->PreferredPmProfile = 3;
|
||||
} else {
|
||||
newFadt->PreferredPmProfile = gMobile?2:1; //as calculated before
|
||||
@ -2002,7 +2002,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion)
|
||||
//apply DSDT loaded from a file into buffer
|
||||
//else FADT will contain old BIOS DSDT
|
||||
//
|
||||
DsdtLoaded = FALSE;
|
||||
DsdtLoaded = false;
|
||||
if (!EFI_ERROR(Status)) {
|
||||
// if we will apply fixes, allocate additional space
|
||||
bufferLen = bufferLen + bufferLen / 8;
|
||||
@ -2022,7 +2022,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion)
|
||||
FadtPointer->Dsdt = (UINT32)dsdt;
|
||||
FadtPointer->XDsdt = dsdt;
|
||||
FixChecksum(&FadtPointer->Header);
|
||||
DsdtLoaded = TRUE;
|
||||
DsdtLoaded = true;
|
||||
}
|
||||
}
|
||||
if(buffer) FreePool(buffer); //the buffer is allocated if egLoadFile() is success. Else the pointer must be nullptr
|
||||
@ -2420,7 +2420,7 @@ EFI_STATUS LoadAndInjectAcpiTable(CONST CHAR16 *PathPatched,
|
||||
/**
|
||||
* Patches UEFI ACPI tables with tables found in OsSubdir.
|
||||
*/
|
||||
EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT)
|
||||
EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, XBool DropSSDT)
|
||||
{
|
||||
EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *RsdPointer;
|
||||
EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *FadtPointer;
|
||||
|
@ -48,7 +48,7 @@ EFI_STATUS
|
||||
PatchACPI(IN REFIT_VOLUME *Volume, const MacOsVersion& OSVersion);
|
||||
|
||||
EFI_STATUS
|
||||
PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT);
|
||||
PatchACPI_OtherOS(CONST CHAR16* OsSubdir, XBool DropSSDT);
|
||||
|
||||
UINT8
|
||||
Checksum8 (
|
||||
@ -61,7 +61,7 @@ void FixChecksum(EFI_ACPI_DESCRIPTION_HEADER* Table);
|
||||
|
||||
void
|
||||
SaveOemDsdt (
|
||||
BOOLEAN FullPatch
|
||||
XBool FullPatch
|
||||
);
|
||||
|
||||
void
|
||||
|
@ -8,10 +8,10 @@
|
||||
* additions and corrections by Slice and pcj, 2012.
|
||||
*/
|
||||
|
||||
#include "AmlGenerator.h"
|
||||
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
|
||||
#include "AmlGenerator.h"
|
||||
|
||||
BOOLEAN aml_add_to_parent(AML_CHUNK* parent, AML_CHUNK* node)
|
||||
XBool aml_add_to_parent(AML_CHUNK* parent, AML_CHUNK* node)
|
||||
{
|
||||
if (parent && node)
|
||||
{
|
||||
@ -24,12 +24,12 @@ BOOLEAN aml_add_to_parent(AML_CHUNK* parent, AML_CHUNK* node)
|
||||
case AML_CHUNK_QWORD:
|
||||
case AML_CHUNK_ALIAS:
|
||||
MsgLog("aml_add_to_parent: node doesn't support child nodes!\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
case AML_CHUNK_NAME:
|
||||
if (parent->First)
|
||||
{
|
||||
MsgLog("aml_add_to_parent: name node supports only one child node!\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -45,10 +45,10 @@ BOOLEAN aml_add_to_parent(AML_CHUNK* parent, AML_CHUNK* node)
|
||||
|
||||
parent->Last = node;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
AML_CHUNK* aml_create_node(AML_CHUNK* parent)
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
/*
|
||||
static inline BOOLEAN aml_isvalidchar(char c)
|
||||
static inline XBool aml_isvalidchar(char c)
|
||||
{
|
||||
return IS_UPPER(c) || IS_DIGIT(c) || c == '_';
|
||||
};
|
||||
@ -70,7 +70,7 @@ typedef struct aml_chunk AML_CHUNK;
|
||||
#define AML_CHUNK_ARG3 0x6B
|
||||
|
||||
|
||||
BOOLEAN aml_add_to_parent(AML_CHUNK* parent, AML_CHUNK* node);
|
||||
XBool aml_add_to_parent(AML_CHUNK* parent, AML_CHUNK* node);
|
||||
AML_CHUNK* aml_create_node(AML_CHUNK* parent);
|
||||
void aml_destroy_node(AML_CHUNK* node);
|
||||
AML_CHUNK* aml_add_buffer(AML_CHUNK* parent, CONST UINT8* buffer, UINT32 size);
|
||||
|
@ -9,15 +9,15 @@
|
||||
#define PLATFORM_BASICIO_H_
|
||||
|
||||
|
||||
BOOLEAN ReadAllKeyStrokes(void);
|
||||
XBool ReadAllKeyStrokes(void);
|
||||
void PauseForKey(const XString8& msg);
|
||||
|
||||
//void DebugPause(void);
|
||||
void EndlessIdleLoop(void);
|
||||
|
||||
|
||||
BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where);
|
||||
BOOLEAN CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where);
|
||||
XBool CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where);
|
||||
XBool CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where);
|
||||
|
||||
|
||||
#endif /* PLATFORM_BASICIO_H_ */
|
||||
|
@ -161,7 +161,7 @@ BdsLibConnectDevicePath (
|
||||
PreviousHandle = Handle;
|
||||
//
|
||||
// Connect all drivers that apply to Handle and RemainingDevicePath,
|
||||
// the Recursive flag is FALSE so only one level will be expanded.
|
||||
// the Recursive flag is false so only one level will be expanded.
|
||||
//
|
||||
// Do not check the connect status here, if the connect controller fail,
|
||||
// then still give the chance to do dispatch, because partial
|
||||
@ -174,7 +174,7 @@ BdsLibConnectDevicePath (
|
||||
// change, then avoid the dispatch, we have chance to continue the
|
||||
// next connection
|
||||
//
|
||||
gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE);
|
||||
gBS->ConnectController (Handle, NULL, RemainingDevicePath, false);
|
||||
}
|
||||
}
|
||||
//
|
||||
@ -229,7 +229,7 @@ BdsLibConnectAllEfi (
|
||||
|
||||
for (Index = 0; Index < HandleCount; Index++) {
|
||||
//Status =
|
||||
gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE);
|
||||
gBS->ConnectController (HandleBuffer[Index], NULL, NULL, true);
|
||||
}
|
||||
|
||||
if (HandleBuffer != NULL) {
|
||||
@ -432,8 +432,8 @@ EFI_STATUS BdsLibConnectMostlyAllEfi()
|
||||
EFI_HANDLE *HandleBuffer = NULL;
|
||||
UINT32 *HandleType = NULL;
|
||||
UINTN HandleIndex;
|
||||
BOOLEAN Parent;
|
||||
BOOLEAN Device;
|
||||
XBool Parent;
|
||||
XBool Device;
|
||||
EFI_PCI_IO_PROTOCOL* PciIo = NULL;
|
||||
PCI_TYPE00 Pci;
|
||||
|
||||
@ -447,18 +447,18 @@ EFI_STATUS BdsLibConnectMostlyAllEfi()
|
||||
if (EFI_ERROR(Status))
|
||||
goto Done;
|
||||
|
||||
Device = TRUE;
|
||||
Device = true;
|
||||
|
||||
if (HandleType[Index] & EFI_HANDLE_TYPE_DRIVER_BINDING_HANDLE)
|
||||
Device = FALSE;
|
||||
Device = false;
|
||||
if (HandleType[Index] & EFI_HANDLE_TYPE_IMAGE_HANDLE)
|
||||
Device = FALSE;
|
||||
Device = false;
|
||||
|
||||
if (Device) {
|
||||
Parent = FALSE;
|
||||
Parent = false;
|
||||
for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
|
||||
if (HandleType[HandleIndex] & EFI_HANDLE_TYPE_PARENT_HANDLE)
|
||||
Parent = TRUE;
|
||||
Parent = true;
|
||||
}
|
||||
|
||||
if (!Parent) {
|
||||
@ -467,12 +467,12 @@ EFI_STATUS BdsLibConnectMostlyAllEfi()
|
||||
if (!EFI_ERROR(Status)) {
|
||||
Status = PciIo->Pci.Read (PciIo,EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if(IS_PCI_VGA(&Pci)==TRUE) {
|
||||
if(IS_PCI_VGA(&Pci)==true) {
|
||||
gBS->DisconnectController(AllHandleBuffer[Index], NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
Status = gBS->ConnectController(AllHandleBuffer[Index], NULL, NULL, TRUE);
|
||||
Status = gBS->ConnectController(AllHandleBuffer[Index], NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -552,7 +552,7 @@ BdsLibConnectUsbDevByShortFormDP(
|
||||
UINTN Index;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
UINT8 Class[3];
|
||||
BOOLEAN AtLeastOneConnected;
|
||||
XBool AtLeastOneConnected;
|
||||
|
||||
//
|
||||
// Check the passed in parameters
|
||||
@ -579,7 +579,7 @@ BdsLibConnectUsbDevByShortFormDP(
|
||||
//
|
||||
// Find the usb host controller firstly, then connect with the remaining device path
|
||||
//
|
||||
AtLeastOneConnected = FALSE;
|
||||
AtLeastOneConnected = false;
|
||||
Status = gBS->LocateHandleBuffer (
|
||||
ByProtocol,
|
||||
&gEfiPciIoProtocolGuid,
|
||||
@ -607,10 +607,10 @@ BdsLibConnectUsbDevByShortFormDP(
|
||||
HandleArray[Index],
|
||||
NULL,
|
||||
RemainingDevicePath,
|
||||
FALSE
|
||||
false
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
AtLeastOneConnected = TRUE;
|
||||
AtLeastOneConnected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,11 @@ Headers collection for procedures
|
||||
#ifndef __BOOTLOG__H__
|
||||
#define __BOOTLOG__H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "../cpp_foundation/XBool.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -36,10 +41,12 @@ InitBooterLog (void);
|
||||
|
||||
void closeDebugLog(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
EFI_STATUS
|
||||
SetupBooterLog (
|
||||
BOOLEAN AllowGrownSize
|
||||
XBool AllowGrownSize
|
||||
);
|
||||
#endif
|
||||
|
||||
EFI_STATUS
|
||||
SaveBooterLog (
|
||||
|
@ -158,7 +158,7 @@ Clover_FindDevicePathNodeWithType (
|
||||
|
||||
|
||||
/** Creates device path for boot option: device path for file system volume + file name.
|
||||
* If UseShortForm == TRUE, then only the hard drive media dev path will be used instead
|
||||
* If UseShortForm == true, then only the hard drive media dev path will be used instead
|
||||
* of full device path.
|
||||
* Long (full) form:
|
||||
* PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0x1,0x0)/HD(1,GPT,96004846-a018-49ad-bc9f-4e5a340adc4b,0x800,0x64000)/\EFI\BOOT\File.efi
|
||||
@ -168,9 +168,9 @@ Clover_FindDevicePathNodeWithType (
|
||||
*/
|
||||
EFI_STATUS
|
||||
CreateBootOptionDevicePath (
|
||||
IN EFI_HANDLE FileDeviceHandle,
|
||||
IN EFI_HANDLE FileDeviceHandle,
|
||||
IN CONST XStringW& FileName,
|
||||
IN BOOLEAN UseShortForm,
|
||||
IN XBool UseShortForm,
|
||||
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
|
||||
)
|
||||
{
|
||||
@ -219,14 +219,14 @@ CreateBootOptionDevicePath (
|
||||
}
|
||||
|
||||
|
||||
/** Returns TRUE if dev paths are equal. Has special ascii case insensitive compare for file dev paths. */
|
||||
BOOLEAN
|
||||
/** Returns true if dev paths are equal. Has special ascii case insensitive compare for file dev paths. */
|
||||
XBool
|
||||
DevicePathEqual (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
|
||||
)
|
||||
{
|
||||
BOOLEAN Equal;
|
||||
XBool Equal;
|
||||
UINT8 Type1;
|
||||
UINT8 SubType1;
|
||||
UINTN Len1;
|
||||
@ -234,9 +234,9 @@ DevicePathEqual (
|
||||
CHAR16 *FPath2;
|
||||
|
||||
|
||||
Equal = FALSE;
|
||||
Equal = false;
|
||||
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
Type1 = DevicePathType (DevicePath1);
|
||||
SubType1 = DevicePathSubType (DevicePath1);
|
||||
Len1 = DevicePathNodeLength (DevicePath1);
|
||||
@ -265,7 +265,7 @@ DevicePathEqual (
|
||||
|
||||
if (IsDevicePathEnd (DevicePath1)) {
|
||||
// END node - they are the same
|
||||
Equal = TRUE;
|
||||
Equal = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -769,14 +769,14 @@ FindBootOptionForFile (
|
||||
//
|
||||
// Create FileDeviceHandle/FileName device paths (long and short form) - we will search boot options for that.
|
||||
//
|
||||
Status = CreateBootOptionDevicePath (FileDeviceHandle, FileName, FALSE, &SearchedDevicePath[0]);
|
||||
Status = CreateBootOptionDevicePath (FileDeviceHandle, FileName, false, &SearchedDevicePath[0]);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
SearchedDevicePathSize[0] = GetDevicePathSize (SearchedDevicePath[0]);
|
||||
DBG(" Searching for: %ls (Len: %llu)\n", FileDevicePathToXStringW(SearchedDevicePath[0]).wc_str(), SearchedDevicePathSize[0]);
|
||||
|
||||
Status = CreateBootOptionDevicePath (FileDeviceHandle, FileName, TRUE, &SearchedDevicePath[1]);
|
||||
Status = CreateBootOptionDevicePath (FileDeviceHandle, FileName, true, &SearchedDevicePath[1]);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
@ -828,10 +828,10 @@ FindBootOptionForFile (
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/** Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == TRUE. */
|
||||
/** Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == true. */
|
||||
void
|
||||
PrintBootOptions (
|
||||
IN BOOLEAN AllBootOptions
|
||||
IN XBool AllBootOptions
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@ -840,7 +840,7 @@ PrintBootOptions (
|
||||
UINTN Index;
|
||||
UINTN BootNum;
|
||||
BO_BOOT_OPTION BootOption;
|
||||
BOOLEAN FoundOthers;
|
||||
XBool FoundOthers;
|
||||
|
||||
|
||||
DBG("\nBoot options:\n-------------\n");
|
||||
@ -873,7 +873,7 @@ PrintBootOptions (
|
||||
|
||||
if (AllBootOptions) {
|
||||
DBG("\nBoot options not in BootOrder list:\n");
|
||||
FoundOthers = FALSE;
|
||||
FoundOthers = false;
|
||||
//
|
||||
// Additionally print BootXXXX vars which are not in BootOrder
|
||||
//
|
||||
@ -902,7 +902,7 @@ PrintBootOptions (
|
||||
|
||||
PrintBootOption (&BootOption, 0);
|
||||
FreePool(BootOption.Variable);
|
||||
FoundOthers = TRUE;
|
||||
FoundOthers = true;
|
||||
}
|
||||
if (!FoundOthers) {
|
||||
DBG(" not found\n");
|
||||
@ -988,7 +988,7 @@ AddBootOption (
|
||||
|
||||
/** Adds new boot option for given file system device handle FileDeviceHandle, file path FileName
|
||||
* and Description, to be BootIndex in the list of options (0 based).
|
||||
* If UseShortForm == TRUE, then only the hard drive media dev path will be used instead
|
||||
* If UseShortForm == true, then only the hard drive media dev path will be used instead
|
||||
* of full device path.
|
||||
* Long (full) form:
|
||||
* PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0x1,0x0)/HD(1,GPT,96004846-a018-49ad-bc9f-4e5a340adc4b,0x800,0x64000)/\EFI\BOOT\File.efi
|
||||
@ -997,13 +997,13 @@ AddBootOption (
|
||||
*/
|
||||
EFI_STATUS
|
||||
AddBootOptionForFile (
|
||||
IN EFI_HANDLE FileDeviceHandle,
|
||||
IN EFI_HANDLE FileDeviceHandle,
|
||||
IN CONST XStringW& FileName,
|
||||
IN BOOLEAN UseShortForm,
|
||||
IN CONST CHAR16 *Description,
|
||||
IN XBool UseShortForm,
|
||||
IN CONST CHAR16 *Description,
|
||||
IN UINT8 *OptionalData,
|
||||
IN UINTN OptionalDataSize,
|
||||
IN UINTN BootIndex,
|
||||
IN UINTN OptionalDataSize,
|
||||
IN UINTN BootIndex,
|
||||
OUT UINT16 *BootNum
|
||||
)
|
||||
{
|
||||
|
@ -68,10 +68,10 @@ Clover_FindDevicePathNodeWithType (
|
||||
EFI_STATUS
|
||||
ParseBootOption (OUT BO_BOOT_OPTION *BootOption);
|
||||
|
||||
/** Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == TRUE. */
|
||||
/** Prints BootXXXX vars found listed in BootOrder, plus print others if AllBootOptions == true. */
|
||||
void
|
||||
PrintBootOptions (
|
||||
IN BOOLEAN AllBootOptions
|
||||
IN XBool AllBootOptions
|
||||
);
|
||||
|
||||
/** Prints BootOrder with DBG. */
|
||||
@ -113,7 +113,7 @@ FindBootOptionForFile (
|
||||
|
||||
/** Adds new boot option for given file system device handle FileDeviceHandle, file path FileName
|
||||
* and Description, to be BootIndex in the list of options (0 based).
|
||||
* If UseShortForm == TRUE, then only the hard drive media dev path will be used instead
|
||||
* If UseShortForm == true, then only the hard drive media dev path will be used instead
|
||||
* of full device path.
|
||||
* Long (full) form:
|
||||
* PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0x1,0x0)/HD(1,GPT,96004846-a018-49ad-bc9f-4e5a340adc4b,0x800,0x64000)/\EFI\BOOT\File.efi
|
||||
@ -122,14 +122,14 @@ FindBootOptionForFile (
|
||||
*/
|
||||
EFI_STATUS
|
||||
AddBootOptionForFile (
|
||||
IN EFI_HANDLE FileDeviceHandle,
|
||||
IN EFI_HANDLE FileDeviceHandle,
|
||||
IN CONST XStringW &FileName,
|
||||
IN BOOLEAN UseShortForm,
|
||||
IN CONST CHAR16 *Description,
|
||||
IN UINT8 *OptionalData,
|
||||
IN UINTN OptionalDataSize,
|
||||
IN UINTN BootIndex,
|
||||
OUT UINT16 *BootNum
|
||||
IN XBool UseShortForm,
|
||||
IN CONST CHAR16 *Description,
|
||||
IN UINT8 *OptionalData,
|
||||
IN UINTN OptionalDataSize,
|
||||
IN UINTN BootIndex,
|
||||
OUT UINT16 *BootNum
|
||||
);
|
||||
|
||||
/** Deletes boot option specified with BootNum (XXXX in BootXXXX var name). */
|
||||
|
@ -36,11 +36,11 @@ GetModeImpl (
|
||||
*Mode = CurrentMode;
|
||||
|
||||
if (GopUgaExists) {
|
||||
*GopUgaExists = TRUE;
|
||||
*GopUgaExists = true;
|
||||
}
|
||||
|
||||
if (StdInLocked) {
|
||||
*StdInLocked = FALSE;
|
||||
*StdInLocked = false;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
|
||||
#include "DataHub.h"
|
||||
|
||||
//
|
||||
@ -172,14 +173,14 @@ GetNextDataRecord (
|
||||
{
|
||||
EFI_DATA_ENTRY *LogEntry;
|
||||
LIST_ENTRY *Link;
|
||||
BOOLEAN ReturnFirstEntry;
|
||||
XBool ReturnFirstEntry;
|
||||
EFI_DATA_RECORD_HEADER *Record;
|
||||
EFI_DATA_ENTRY *NextLogEntry;
|
||||
|
||||
//
|
||||
// If MonotonicCount == 0 just return the first one
|
||||
//
|
||||
ReturnFirstEntry = (BOOLEAN) (*PtrCurrentMTC == 0);
|
||||
ReturnFirstEntry = *PtrCurrentMTC == 0;
|
||||
|
||||
Record = NULL;
|
||||
for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) {
|
||||
|
@ -456,7 +456,7 @@ AddSMCkey(SMC_KEY Key, SMC_DATA_SIZE Size, SMC_KEY_TYPE Type, SMC_DATA *Data)
|
||||
// SetupDataForOSX
|
||||
/// Sets the DataHub data used by OS X
|
||||
void EFIAPI
|
||||
SetupDataForOSX(BOOLEAN Hibernate)
|
||||
SetupDataForOSX(XBool Hibernate)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
@ -467,7 +467,7 @@ SetupDataForOSX(BOOLEAN Hibernate)
|
||||
UINT64 ARTFrequency;
|
||||
UINTN Revision;
|
||||
UINT16 Zero = 0;
|
||||
BOOLEAN isRevLess = (ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[0] == 0 &&
|
||||
XBool isRevLess = (ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[0] == 0 &&
|
||||
ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[1] == 0 &&
|
||||
ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[2] == 0 &&
|
||||
ApplePlatformData[GlobalConfig.CurrentModel].smcRevision[3] == 0 &&
|
||||
|
@ -27,7 +27,7 @@ LogDataHub (
|
||||
|
||||
void
|
||||
EFIAPI
|
||||
SetupDataForOSX (BOOLEAN Hibernate);
|
||||
SetupDataForOSX (XBool Hibernate);
|
||||
|
||||
|
||||
#endif /* PLATFORM_DATAHUBCPU_H_ */
|
||||
|
@ -69,7 +69,7 @@ void WaitForCR()
|
||||
EFI_INPUT_KEY key;
|
||||
UINTN ind;
|
||||
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &key);
|
||||
if (Status == EFI_NOT_READY) {
|
||||
gBS->WaitForEvent(1, &gST->ConIn->WaitForKey, &ind);
|
||||
@ -278,7 +278,7 @@ OnExitBootServices(IN EFI_EVENT Event, IN void *Context)
|
||||
UINTN archMode = sizeof(UINTN) * 8;
|
||||
UINTN Version = 0;
|
||||
|
||||
while(TRUE)
|
||||
while(true)
|
||||
{
|
||||
bootArgs2v = (BootArgs2*)ptr;
|
||||
bootArgs1v = (BootArgs1*)ptr;
|
||||
|
@ -44,25 +44,25 @@ OPER_REGION *gRegions = NULL;
|
||||
CHAR8* device_name[12]; // 0=>Display 1=>network 2=>firewire 3=>LPCB 4=>HDAAudio 5=>RTC 6=>TMR 7=>SBUS 8=>PIC 9=>Airport 10=>XHCI 11=>HDMI
|
||||
CHAR8* UsbName[10];
|
||||
|
||||
BOOLEAN HDAFIX = TRUE;
|
||||
BOOLEAN GFXHDAFIX = TRUE;
|
||||
BOOLEAN DisplayName1;
|
||||
BOOLEAN DisplayName2;
|
||||
BOOLEAN NetworkName;
|
||||
BOOLEAN ArptName;
|
||||
BOOLEAN XhciName;
|
||||
BOOLEAN ArptBCM;
|
||||
BOOLEAN ArptAtheros;
|
||||
BOOLEAN LPCBFIX;
|
||||
BOOLEAN IDEFIX;
|
||||
BOOLEAN SATAFIX;
|
||||
BOOLEAN ASUSFIX;
|
||||
BOOLEAN USBIntel;
|
||||
BOOLEAN USBNForce;
|
||||
BOOLEAN USBIDFIX = TRUE;
|
||||
//BOOLEAN Display1PCIE;
|
||||
//BOOLEAN Display2PCIE;
|
||||
BOOLEAN FirewireName;
|
||||
XBool HDAFIX = true;
|
||||
XBool GFXHDAFIX = true;
|
||||
XBool DisplayName1;
|
||||
XBool DisplayName2;
|
||||
XBool NetworkName;
|
||||
XBool ArptName;
|
||||
XBool XhciName;
|
||||
XBool ArptBCM;
|
||||
XBool ArptAtheros;
|
||||
XBool LPCBFIX;
|
||||
XBool IDEFIX;
|
||||
XBool SATAFIX;
|
||||
XBool ASUSFIX;
|
||||
XBool USBIntel;
|
||||
XBool USBNForce;
|
||||
XBool USBIDFIX = true;
|
||||
//XBool Display1PCIE;
|
||||
//XBool Display2PCIE;
|
||||
XBool FirewireName;
|
||||
|
||||
// for read computer data
|
||||
UINT32 DisplayADR1[4];
|
||||
@ -494,7 +494,7 @@ UINT8 darwin[] = //it is not const
|
||||
};
|
||||
|
||||
|
||||
BOOLEAN CmpNum(UINT8 *dsdt, INT32 i, BOOLEAN Sure)
|
||||
XBool CmpNum(UINT8 *dsdt, INT32 i, XBool Sure)
|
||||
{
|
||||
return ((Sure && ((dsdt[i-1] == 0x0A) ||
|
||||
(dsdt[i-2] == 0x0B) ||
|
||||
@ -507,37 +507,37 @@ BOOLEAN CmpNum(UINT8 *dsdt, INT32 i, BOOLEAN Sure)
|
||||
// for HDA from device_inject.c and mark device_inject function
|
||||
//extern UINT32 HDA_IC_sendVerb(EFI_PCI_IO_PROTOCOL *PciIo, UINT32 codecAdr, UINT32 nodeId, UINT32 verb);
|
||||
|
||||
BOOLEAN get_lpc_model(UINT32 id) {
|
||||
XBool get_lpc_model(UINT32 id) {
|
||||
UINTN i;
|
||||
|
||||
for (i=1; i< (sizeof(lpc_chipset) / sizeof(lpc_chipset[0])); i++) {
|
||||
if (lpc_chipset[i].id == id) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_ide_model(UINT32 id) {
|
||||
XBool get_ide_model(UINT32 id) {
|
||||
UINTN i;
|
||||
|
||||
for (i=1; i< (sizeof(ide_chipset) / sizeof(ide_chipset[0])); i++) {
|
||||
if (ide_chipset[i].id == id) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
BOOLEAN get_ahci_model(UINT32 id) {
|
||||
XBool get_ahci_model(UINT32 id) {
|
||||
UINTN i;
|
||||
|
||||
for (i=1; i< (sizeof(ahci_chipset) / sizeof(ahci_chipset[0])); i++) {
|
||||
if (ahci_chipset[i].id == id) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
CONST CHAR8* get_net_model(UINT32 id) {
|
||||
@ -595,7 +595,7 @@ void GetPciADR(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT32 *Addr1, OUT U
|
||||
/* Discussion
|
||||
Native USB mean for those chipsets IOUSBFamily set some "errata"
|
||||
for example native 0x1cXX has no such errata */
|
||||
BOOLEAN NativeUSB(UINT16 DID)
|
||||
XBool NativeUSB(UINT16 DID)
|
||||
{
|
||||
UINT16 d = DID & 0xFF00;
|
||||
return ((d == 0x2600) || (d == 0x2700) || (d == 0x2800) || (d == 0x3a00) || (d == /*NFORCE_USB->*/0x0a00));
|
||||
@ -686,8 +686,8 @@ void CheckHardware()
|
||||
Displaydevice[display].revision = Pci.Hdr.RevisionID;
|
||||
Displaydevice[display].subclass = Pci.Hdr.ClassCode[0];
|
||||
Displaydevice[display].class_id = *((UINT16*)(Pci.Hdr.ClassCode+1));
|
||||
Displaydevice[display].subsys_id.subsys.vendor_id = Pci.Device.SubsystemVendorID;
|
||||
Displaydevice[display].subsys_id.subsys.device_id = Pci.Device.SubsystemID;
|
||||
Displaydevice[display].subsys_id_union.subsys.vendor_id = Pci.Device.SubsystemVendorID;
|
||||
Displaydevice[display].subsys_id_union.subsys.device_id = Pci.Device.SubsystemID;
|
||||
//
|
||||
// Detect if PCI Express Device
|
||||
//
|
||||
@ -697,9 +697,9 @@ void CheckHardware()
|
||||
/* PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo);
|
||||
if (PciIoDevice->IsPciExp) {
|
||||
if (display==0)
|
||||
Display1PCIE = TRUE;
|
||||
Display1PCIE = true;
|
||||
else
|
||||
Display2PCIE = TRUE;
|
||||
Display2PCIE = true;
|
||||
}
|
||||
DBG("Display %d is %sPCIE\n", display, (PciIoDevice->IsPciExp) ? "" :" not"); */
|
||||
display++;
|
||||
@ -800,12 +800,12 @@ void CheckHardware()
|
||||
DBG("Audio HDA (addr:0x%X) setting specified layout-id=%d (0x%X)\n", HDAADR1, layoutId, layoutId);
|
||||
}
|
||||
|
||||
HDAFIX = TRUE;
|
||||
HDAFIX = true;
|
||||
HDAcodecId = codecId;
|
||||
HDAlayoutId = layoutId;
|
||||
} else { //HDMI
|
||||
GetPciADR(DevicePath, &HDMIADR1, &HDMIADR2, NULL);
|
||||
GFXHDAFIX = TRUE;
|
||||
GFXHDAFIX = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -899,7 +899,7 @@ void findCPU(UINT8* dsdt, UINT32 length)
|
||||
{
|
||||
UINT32 i, k, size;
|
||||
UINT32 SBSIZE = 0, SBADR = 0;
|
||||
BOOLEAN SBFound = FALSE;
|
||||
XBool SBFound = false;
|
||||
UINT32 off2, j1;
|
||||
|
||||
if (acpi_cpu_score) {
|
||||
@ -949,7 +949,7 @@ void findCPU(UINT8* dsdt, UINT32 length)
|
||||
if (dsdt[i] == 0x5B && dsdt[i + 1] == 0x83) { // ProcessorOP
|
||||
UINT32 j;
|
||||
UINT32 offset = i + 3 + (dsdt[i + 2] >> 6); // name
|
||||
BOOLEAN add_name = TRUE;
|
||||
XBool add_name = true;
|
||||
if (acpi_cpu_count == 0) { //only first time in the cycle
|
||||
CHAR8 c1 = dsdt[offset + 1];
|
||||
// I want to determine a scope of PR
|
||||
@ -976,7 +976,7 @@ void findCPU(UINT8* dsdt, UINT32 length)
|
||||
//check device
|
||||
k = j + 2;
|
||||
if ((dsdt[j] == 0x5B) && (dsdt[j + 1] == 0x82) &&
|
||||
!CmpNum(dsdt, j, TRUE)) { //device candidate
|
||||
!CmpNum(dsdt, j, true)) { //device candidate
|
||||
// DBG("device candidate at %X\n", j);
|
||||
size = get_size(dsdt, k);
|
||||
if (size) {
|
||||
@ -1006,7 +1006,7 @@ void findCPU(UINT8* dsdt, UINT32 length)
|
||||
if (dsdt[j - j1] != 0x10) {
|
||||
continue;
|
||||
}
|
||||
if (!CmpNum(dsdt, j - j1, TRUE)) {
|
||||
if (!CmpNum(dsdt, j - j1, true)) {
|
||||
SBADR = j - j1 + 1;
|
||||
SBSIZE = get_size(dsdt, SBADR);
|
||||
// DBG("found Scope(\\_SB) address = 0x%08X size = 0x%08X\n", SBADR, SBSIZE);
|
||||
@ -1014,7 +1014,7 @@ void findCPU(UINT8* dsdt, UINT32 length)
|
||||
//if found
|
||||
k = SBADR - 6;
|
||||
if ((SBADR + SBSIZE) > i + 4) { //Yes - it is outer
|
||||
SBFound = TRUE;
|
||||
SBFound = true;
|
||||
break; //SB found
|
||||
} //else not an outer scope
|
||||
}
|
||||
@ -1048,7 +1048,7 @@ void findCPU(UINT8* dsdt, UINT32 length)
|
||||
}
|
||||
|
||||
if (!(IS_UPPER(c) || IS_DIGIT(c) || c == '_')) {
|
||||
add_name = FALSE;
|
||||
add_name = false;
|
||||
DBG("Invalid character found in ProcessorOP 0x%hhX!\n", c);
|
||||
break;
|
||||
}
|
||||
@ -1206,18 +1206,18 @@ INT32 FindName(UINT8 *dsdt, INT32 len, CONST CHAR8* name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOLEAN GetName(UINT8 *dsdt, INT32 adr, OUT CHAR8* name, OUT INTN *shift)
|
||||
XBool GetName(UINT8 *dsdt, INT32 adr, OUT CHAR8* name, OUT INTN *shift)
|
||||
{
|
||||
INT32 i;
|
||||
INT32 j = (dsdt[adr] == 0x5C)?1:0; //now we accept \NAME
|
||||
if (!name) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
for (i = adr + j; i < adr + j + 4; i++) {
|
||||
if ((dsdt[i] < 0x2F) ||
|
||||
((dsdt[i] > 0x39) && (dsdt[i] < 0x41)) ||
|
||||
((dsdt[i] > 0x5A) && (dsdt[i] != 0x5F))) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
name[i - adr - j] = dsdt[i];
|
||||
}
|
||||
@ -1225,13 +1225,13 @@ BOOLEAN GetName(UINT8 *dsdt, INT32 adr, OUT CHAR8* name, OUT INTN *shift)
|
||||
if (shift) {
|
||||
*shift = j;
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN CmpAdr (UINT8 *dsdt, UINT32 j, UINT32 PciAdr)
|
||||
XBool CmpAdr (UINT8 *dsdt, UINT32 j, UINT32 PciAdr)
|
||||
{
|
||||
// Name (_ADR, 0x001f0001)
|
||||
return (BOOLEAN)
|
||||
return
|
||||
((dsdt[j + 4] == 0x08) &&
|
||||
(dsdt[j + 5] == 0x5F) &&
|
||||
(dsdt[j + 6] == 0x41) &&
|
||||
@ -1263,11 +1263,11 @@ BOOLEAN CmpAdr (UINT8 *dsdt, UINT32 j, UINT32 PciAdr)
|
||||
);
|
||||
}
|
||||
|
||||
BOOLEAN CmpPNP (UINT8 *dsdt, UINT32 j, UINT16 PNP)
|
||||
XBool CmpPNP (UINT8 *dsdt, UINT32 j, UINT16 PNP)
|
||||
{
|
||||
// Name (_HID, EisaId ("PNP0C0F")) for PNP=0x0C0F BigEndian
|
||||
if (PNP == 0) {
|
||||
return (BOOLEAN)
|
||||
return
|
||||
((dsdt[j + 0] == 0x08) &&
|
||||
(dsdt[j + 1] == 0x5F) &&
|
||||
(dsdt[j + 2] == 0x48) &&
|
||||
@ -1277,7 +1277,7 @@ BOOLEAN CmpPNP (UINT8 *dsdt, UINT32 j, UINT16 PNP)
|
||||
(dsdt[j + 6] == 0x41) &&
|
||||
(dsdt[j + 7] == 0xD0));
|
||||
}
|
||||
return (BOOLEAN)
|
||||
return
|
||||
((dsdt[j + 0] == 0x08) &&
|
||||
(dsdt[j + 1] == 0x5F) &&
|
||||
(dsdt[j + 2] == 0x48) &&
|
||||
@ -1333,13 +1333,13 @@ INT32 CmpDev(UINT8 *dsdt, UINT32 i, const XBuffer<UINT8>& Name)
|
||||
INT32 FindBin (UINT8 *dsdt, UINT32 len, const UINT8* bin, UINT32 N)
|
||||
{
|
||||
UINT32 i, j;
|
||||
BOOLEAN eq;
|
||||
XBool eq;
|
||||
|
||||
for (i=0; len >= N && i < len - N; i++) {
|
||||
eq = TRUE;
|
||||
eq = true;
|
||||
for (j=0; j<N; j++) {
|
||||
if (dsdt[i+j] != bin[j]) {
|
||||
eq = FALSE;
|
||||
eq = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1397,7 +1397,7 @@ UINT32 CorrectOuterMethod (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
|
||||
i = adr; //usually adr = @5B - 1 = sizefield - 3
|
||||
while (i-- > 0x20) { //find method that previous to adr
|
||||
k = i + 1;
|
||||
if ((dsdt[i] == 0x14) && !CmpNum(dsdt, i, FALSE)) { //method candidate
|
||||
if ((dsdt[i] == 0x14) && !CmpNum(dsdt, i, false)) { //method candidate
|
||||
size = get_size(dsdt, k);
|
||||
if (!size) {
|
||||
continue;
|
||||
@ -1428,7 +1428,7 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
|
||||
INT32 size = 0;
|
||||
INT32 offset = 0;
|
||||
// UINT32 SBSIZE = 0, SBADR = 0;
|
||||
BOOLEAN SBFound = FALSE;
|
||||
XBool SBFound = false;
|
||||
|
||||
if (shift == 0) {
|
||||
return len;
|
||||
@ -1438,21 +1438,21 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
|
||||
while (i > 0x20) { //find devices that previous to adr
|
||||
//check device
|
||||
k = 0;
|
||||
if ((dsdt[i] == 0x5B) && (dsdt[i+1] == 0x82) && !CmpNum(dsdt, i, TRUE)) { //device candidate
|
||||
if ((dsdt[i] == 0x5B) && (dsdt[i+1] == 0x82) && !CmpNum(dsdt, i, true)) { //device candidate
|
||||
k = i + 2;
|
||||
} else if ((dsdt[i] == 0x10) && //looks like Scope
|
||||
(dsdt[i-1] != 0x14) && //this is Method()
|
||||
(dsdt[i-1] != 0xA0) && //this is If()
|
||||
(dsdt[i-1] != 0xA1) && //this is Else()
|
||||
(dsdt[i-1] != 0xA2) && //this is While()
|
||||
!CmpNum(dsdt, i, TRUE)) { //device scope like Scope (_PCI)
|
||||
!CmpNum(dsdt, i, true)) { //device scope like Scope (_PCI)
|
||||
//additional check for Field
|
||||
// a problem with fields 52 4D 53 33 10 41 4D 45 4D
|
||||
// 1. Search outer filed
|
||||
// 2. check the size of the field
|
||||
// 3. compare if we are in the filed
|
||||
j = i - 1;
|
||||
SBFound = TRUE;
|
||||
SBFound = true;
|
||||
while (j > 0x20) {
|
||||
if (((dsdt[j - 1] == 0x5B) && (dsdt[j] == 0x81)) ||
|
||||
((dsdt[j - 1] == 0x5B) && (dsdt[j] == 0x82)) ||
|
||||
@ -1460,7 +1460,7 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
|
||||
size = (INT32)get_size(dsdt, j + 1); // if it is not a size then size = 0
|
||||
if (j + size >= i) {
|
||||
// it is inside a Field, skip it
|
||||
SBFound = FALSE;
|
||||
SBFound = false;
|
||||
}
|
||||
break; // other field so we stop search
|
||||
}
|
||||
@ -1489,7 +1489,7 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
|
||||
if (dsdt[i-j] != 0x10) {
|
||||
continue;
|
||||
}
|
||||
if (!CmpNum(dsdt, i-j, TRUE)) {
|
||||
if (!CmpNum(dsdt, i-j, true)) {
|
||||
SBADR = i-j+1;
|
||||
SBSIZE = get_size(dsdt, SBADR);
|
||||
// DBG("found Scope(\\_SB) address = 0x%08X size = 0x%08X\n", SBADR, SBSIZE);
|
||||
@ -1501,7 +1501,7 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift)
|
||||
offset = write_size(SBADR, dsdt, len, shift);
|
||||
shift += offset;
|
||||
len += offset;
|
||||
SBFound = TRUE;
|
||||
SBFound = true;
|
||||
break; //SB found
|
||||
} //else not an outer scope
|
||||
}
|
||||
@ -1578,18 +1578,18 @@ UINT32 devFind(UINT8 *dsdt, UINT32 address)
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN CustProperties(AML_CHUNK* pack, UINT32 Dev)
|
||||
XBool CustProperties(AML_CHUNK* pack, UINT32 Dev)
|
||||
{
|
||||
UINTN i;
|
||||
BOOLEAN Injected = FALSE;
|
||||
XBool Injected = false;
|
||||
if (gSettings.Devices.AddPropertyArray.size() == 0xFFFE) { // Looks like NrAddProperties == 0xFFFE is not used anymore
|
||||
return FALSE; // not do this for Arbitrary properties?
|
||||
return false; // not do this for Arbitrary properties?
|
||||
}
|
||||
for (i = 0; i < gSettings.Devices.AddPropertyArray.size(); i++) {
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != Dev) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -1672,12 +1672,12 @@ void findPciRoot (UINT8 *dsdt, UINT32 len)
|
||||
UINT32 PCIADR, PCISIZE = 0;
|
||||
|
||||
//initialising
|
||||
NetworkName = FALSE;
|
||||
DisplayName1 = FALSE;
|
||||
DisplayName2 = FALSE;
|
||||
FirewireName = FALSE;
|
||||
ArptName = FALSE;
|
||||
XhciName = FALSE;
|
||||
NetworkName = false;
|
||||
DisplayName1 = false;
|
||||
DisplayName2 = false;
|
||||
FirewireName = false;
|
||||
ArptName = false;
|
||||
XhciName = false;
|
||||
|
||||
PCIADR = GetPciDevice(dsdt, len);
|
||||
if (PCIADR) {
|
||||
@ -1778,7 +1778,7 @@ UINT32 FixAny (UINT8* dsdt, UINT32 len, const XBuffer<UINT8> ToFind, const XBuff
|
||||
size_t sizeoffset;
|
||||
INT32 adr;
|
||||
UINT32 i;
|
||||
BOOLEAN found = FALSE;
|
||||
XBool found = false;
|
||||
if ( ToFind.isEmpty() || ToReplace.isEmpty() ) {
|
||||
DBG(" invalid patches!\n");
|
||||
return len;
|
||||
@ -1810,7 +1810,7 @@ UINT32 FixAny (UINT8* dsdt, UINT32 len, const XBuffer<UINT8> ToFind, const XBuff
|
||||
}
|
||||
|
||||
// MsgLog(" (%X)", adr);
|
||||
found = TRUE;
|
||||
found = true;
|
||||
len = move_data(adr + i, dsdt, len, (INT32)sizeoffset); // safe cast, sizeoffset < MAX_INT32
|
||||
CopyMem(dsdt + adr + i, ToReplace.data(), ToReplace.size());
|
||||
len = CorrectOuterMethod(dsdt, len, adr + i - 2, (INT32)sizeoffset); // safe cast, sizeoffset < MAX_INT32
|
||||
@ -1825,7 +1825,7 @@ UINT32 FixAny (UINT8* dsdt, UINT32 len, const XBuffer<UINT8> ToFind, const XBuff
|
||||
UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, const XBuffer<UINT8>& TgtBrgName, const XBuffer<UINT8>& ToFind, const XBuffer<UINT8>& ToReplace)
|
||||
{
|
||||
INT32 adr;
|
||||
BOOLEAN found = FALSE;
|
||||
XBool found = false;
|
||||
UINT32 i, k;
|
||||
UINT32 BrdADR = 0, BridgeSize;
|
||||
|
||||
@ -1857,7 +1857,7 @@ UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, const XBuffer<UINT8>& TgtBrg
|
||||
if(BridgeSize <= ToFind.size()) continue;
|
||||
|
||||
k = 0;
|
||||
found = FALSE;
|
||||
found = false;
|
||||
while (k <= 100) {
|
||||
adr = FindBin(dsdt + BrdADR, BridgeSize, ToFind);
|
||||
if (adr < 0) {
|
||||
@ -1874,7 +1874,7 @@ UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, const XBuffer<UINT8>& TgtBrg
|
||||
}
|
||||
|
||||
DBG(" (%X)", adr);
|
||||
found = TRUE;
|
||||
found = true;
|
||||
if ( ToReplace.notEmpty() ) {
|
||||
CopyMem(dsdt + BrdADR + adr, ToReplace.data(), ToReplace.size());
|
||||
}
|
||||
@ -2506,17 +2506,17 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard)
|
||||
UINT32 PCIADR = 0, PCISIZE = 0, Size;
|
||||
CHAR8 *display;
|
||||
UINT32 devadr=0, devsize=0, devadr1=0, devsize1=0;
|
||||
BOOLEAN DISPLAYFIX = FALSE;
|
||||
BOOLEAN NonUsable = FALSE;
|
||||
BOOLEAN DsmFound = FALSE;
|
||||
BOOLEAN NeedHDMI = !!(gSettings.ACPI.DSDT.FixDsdt & FIX_HDMI);
|
||||
XBool DISPLAYFIX = false;
|
||||
XBool NonUsable = false;
|
||||
XBool DsmFound = false;
|
||||
XBool NeedHDMI = !!(gSettings.ACPI.DSDT.FixDsdt & FIX_HDMI);
|
||||
AML_CHUNK *root = NULL;
|
||||
AML_CHUNK *gfx0, *peg0;
|
||||
AML_CHUNK *met, *met2;
|
||||
AML_CHUNK *pack;
|
||||
UINT32 FakeID = 0;
|
||||
UINT32 FakeVen = 0;
|
||||
DisplayName1 = FALSE;
|
||||
DisplayName1 = false;
|
||||
|
||||
if (!DisplayADR1[VCard]) return len;
|
||||
|
||||
@ -2538,7 +2538,7 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard)
|
||||
}
|
||||
devsize = get_size(dsdt, devadr); //sizeof PEG0 0x35
|
||||
if (devsize) {
|
||||
DisplayName1 = TRUE;
|
||||
DisplayName1 = true;
|
||||
break;
|
||||
}
|
||||
} // End Display1
|
||||
@ -2555,7 +2555,7 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard)
|
||||
devsize1 = get_size(dsdt, devadr1);
|
||||
if (devsize1) {
|
||||
MsgLog("Found internal video device %X @%X\n", DisplayADR2[VCard], devadr1);
|
||||
DISPLAYFIX = TRUE;
|
||||
DISPLAYFIX = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2575,10 +2575,10 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard)
|
||||
dsdt[j+11] = 0;
|
||||
MsgLog("Found internal video device FFFF@%X, ReUse as 0\n", devadr1);
|
||||
} else {
|
||||
NonUsable = TRUE;
|
||||
NonUsable = true;
|
||||
MsgLog("Found internal video device FFFF@%X, unusable\n", devadr1);
|
||||
}
|
||||
DISPLAYFIX = TRUE;
|
||||
DISPLAYFIX = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2590,7 +2590,7 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard)
|
||||
i = devadr1;
|
||||
} else if (DisplayADR2[VCard] == 0xFFFE) { //builtin
|
||||
i = devadr;
|
||||
DISPLAYFIX = TRUE;
|
||||
DISPLAYFIX = true;
|
||||
devadr1 = devadr;
|
||||
MsgLog(" builtin display\n");
|
||||
}
|
||||
@ -2801,8 +2801,8 @@ UINT32 AddHDMI (UINT8 *dsdt, UINT32 len)
|
||||
UINT32 PCIADR = 0, PCISIZE = 0, Size;
|
||||
CHAR8 *hdmi = NULL;
|
||||
UINT32 devadr=0, BridgeSize=0, devadr1=0; //, devsize1=0;
|
||||
BOOLEAN BridgeFound = FALSE;
|
||||
BOOLEAN HdauFound = FALSE;
|
||||
XBool BridgeFound = false;
|
||||
XBool HdauFound = false;
|
||||
AML_CHUNK* brd = NULL;
|
||||
AML_CHUNK *root = NULL;
|
||||
AML_CHUNK *met, *met2;
|
||||
@ -2828,7 +2828,7 @@ UINT32 AddHDMI (UINT8 *dsdt, UINT32 len)
|
||||
if (!BridgeSize) {
|
||||
continue;
|
||||
}
|
||||
BridgeFound = TRUE;
|
||||
BridgeFound = true;
|
||||
if (HDMIADR2 != 0xFFFE){
|
||||
for (k = devadr + 9; k < devadr + BridgeSize; k++) {
|
||||
if (CmpAdr(dsdt, k, HDMIADR2))
|
||||
@ -2842,7 +2842,7 @@ UINT32 AddHDMI (UINT8 *dsdt, UINT32 len)
|
||||
DBG("found HDMI device [0x%08X:%X] at %X and Name is %s\n",
|
||||
HDMIADR1, HDMIADR2, devadr1, device_name[11]);
|
||||
ReplaceName(dsdt + devadr, BridgeSize, device_name[11], "HDAU");
|
||||
HdauFound = TRUE;
|
||||
HdauFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2985,7 +2985,7 @@ UINT32 FIXNetwork (UINT8 *dsdt, UINT32 len, UINT32 card)
|
||||
PCISIZE = get_size(dsdt, PCIADR);
|
||||
}
|
||||
if (!PCISIZE) return len; //what is the bad DSDT ?!
|
||||
NetworkName = FALSE;
|
||||
NetworkName = false;
|
||||
// Network Address
|
||||
for (i = 0x24; len >=10 && i < len - 10; i++) {
|
||||
if (CmpAdr(dsdt, i, NetworkADR1[card])) { //0x001C0004
|
||||
@ -3012,7 +3012,7 @@ UINT32 FIXNetwork (UINT8 *dsdt, UINT32 len, UINT32 card)
|
||||
NetworkADR1[card], NetworkADR2[card], NetworkADR, device_name[1]);
|
||||
//renaming disabled until better way will found
|
||||
// ReplaceName(dsdt + BrdADR, BridgeSize, device_name[1], "GIGE");
|
||||
NetworkName = TRUE;
|
||||
NetworkName = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3193,7 +3193,7 @@ DBG("FIXAirport dsdt len=%d\n", len);
|
||||
if (!PCISIZE) return len; //what is the bad DSDT ?!
|
||||
|
||||
DBG("Start Airport Fix\n");
|
||||
ArptName = FALSE;
|
||||
ArptName = false;
|
||||
for (i=0x20; len >= 10 && i < len - 10; i++) {
|
||||
// AirPort Address
|
||||
if ( CmpAdr(dsdt, i, ArptADR1) || (gSettings.Devices.AirportBridgeDeviceName.notEmpty() && CmpDev(dsdt, i, gSettings.Devices.AirportBridgeDeviceName)) ) {
|
||||
@ -3215,7 +3215,7 @@ DBG("FIXAirport dsdt len=%d\n", len);
|
||||
DBG("found Airport device [%08X:%X] at %X And Name is %s\n",
|
||||
ArptADR1, ArptADR2, ArptADR, device_name[9]);
|
||||
// ReplaceName(dsdt + BrdADR, BridgeSize, device_name[9], "ARPT"); //sometimes dangeous
|
||||
ArptName = TRUE;
|
||||
ArptName = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3650,7 +3650,7 @@ UINT32 FIXFirewire (UINT8 *dsdt, UINT32 len)
|
||||
DBG("found Firewire device NAME(_ADR,0x%08X) at %X And Name is %s\n",
|
||||
FirewireADR2, k, device_name[2]);
|
||||
ReplaceName(dsdt + BrdADR, BridgeSize, device_name[2], "FRWR");
|
||||
FirewireName = TRUE;
|
||||
FirewireName = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3788,7 +3788,7 @@ UINT32 AddHDEF (UINT8 *dsdt, UINT32 len, const MacOsVersion& OSVersion)
|
||||
DBG("found HDA device NAME(_ADR,0x%08X) And Name is %s\n",
|
||||
HDAADR1, device_name[4]);
|
||||
ReplaceName(dsdt, len, device_name[4], "HDEF");
|
||||
HDAFIX = FALSE;
|
||||
HDAFIX = false;
|
||||
break;
|
||||
} // End HDA
|
||||
}
|
||||
@ -4055,7 +4055,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len)
|
||||
// find USB adr
|
||||
for (j = 0x20; len >= 4 && j < len - 4; j++) {
|
||||
if (CmpAdr(dsdt, j, USBADR[i])) { //j+4 -> _ADR
|
||||
XhciName = FALSE;
|
||||
XhciName = false;
|
||||
UsbName[i] = (__typeof_am__(UsbName[i]))AllocateZeroPool(5);
|
||||
// DBG("found USB at 0x%X\n", j);
|
||||
adr1 = devFind(dsdt, j + 2);
|
||||
@ -4094,7 +4094,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len)
|
||||
}
|
||||
DBG(" %s\n", UsbName[i]);
|
||||
ReplaceName(dsdt + adr1, Size, device_name[10], UsbName[i]);
|
||||
XhciName = TRUE;
|
||||
XhciName = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4265,14 +4265,14 @@ UINT8 VenIDE[] = {0x86,0x80,0x00,0x00};
|
||||
|
||||
UINT32 FIXIDE (UINT8 *dsdt, UINT32 len)
|
||||
{
|
||||
UINT32 i, k;
|
||||
UINT32 j;
|
||||
UINT32 IDEADR = 0, BridgeSize = 0, Size;
|
||||
INT32 sizeoffset;
|
||||
UINT32 i, k;
|
||||
UINT32 j;
|
||||
UINT32 IDEADR = 0, BridgeSize = 0, Size;
|
||||
INT32 sizeoffset;
|
||||
AML_CHUNK *root;
|
||||
AML_CHUNK *device;
|
||||
CHAR8 *ide;
|
||||
BOOLEAN PATAFIX=TRUE;
|
||||
XBool PATAFIX=true;
|
||||
AML_CHUNK *met, *met2;
|
||||
AML_CHUNK *pack;
|
||||
AML_CHUNK *device1;
|
||||
@ -4300,7 +4300,7 @@ UINT32 FIXIDE (UINT8 *dsdt, UINT32 len)
|
||||
{
|
||||
if (CmpAdr(dsdt, j, 0))
|
||||
{
|
||||
PATAFIX = FALSE;
|
||||
PATAFIX = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4676,7 +4676,7 @@ UINT32 FIXWAK (UINT8 *dsdt, UINT32 len, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABL
|
||||
UINT32 waksize=0;
|
||||
UINT32 sizeoffset = 0, sizeoffset2 = 0;
|
||||
// UINT16 PM30 = 0x430; //default
|
||||
BOOLEAN ReturnFound = FALSE;
|
||||
XBool ReturnFound = false;
|
||||
|
||||
DBG("Start _WAK Return Fix\n");
|
||||
|
||||
@ -4694,7 +4694,7 @@ UINT32 FIXWAK (UINT8 *dsdt, UINT32 len, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABL
|
||||
if (dsdt[i+k] == 0xA4) { // Return
|
||||
DBG( "_WAK Method find return data, don't need to patch.\n");
|
||||
// return len;
|
||||
ReturnFound = TRUE;
|
||||
ReturnFound = true;
|
||||
}
|
||||
}
|
||||
//Slice - this patch disabled as useless
|
||||
@ -4758,9 +4758,9 @@ UINT32 FIXGPE (UINT8 *dsdt, UINT32 len)
|
||||
// UINT32 adr=0;
|
||||
INT32 offset=0;
|
||||
INT32 sizeoffset;
|
||||
// BOOLEAN pwrbfix = FALSE;
|
||||
// BOOLEAN usbpwrb = FALSE;
|
||||
// BOOLEAN foundpwrb = FALSE;
|
||||
// XBool pwrbfix = false;
|
||||
// XBool usbpwrb = false;
|
||||
// XBool foundpwrb = false;
|
||||
|
||||
sizeoffset = sizeof(pwrb);
|
||||
if (!PWRBADR) {
|
||||
@ -4783,7 +4783,7 @@ UINT32 FIXGPE (UINT8 *dsdt, UINT32 len)
|
||||
if (dsdt[k] == UsbName[l][0] && dsdt[k+1] == UsbName[l][1] &&
|
||||
dsdt[k+2] == UsbName[l][2] && dsdt[k+3] == UsbName[l][3]) {
|
||||
//DBG( "found USB _GPE Method.\n");
|
||||
// usbpwrb = TRUE;
|
||||
// usbpwrb = true;
|
||||
|
||||
if (!usbcount) {
|
||||
//DBG( "will to find Scope(\\_GPE).\n");
|
||||
@ -5044,11 +5044,11 @@ UINT32 FIXOTHER (UINT8 *dsdt, UINT32 len)
|
||||
void FixRegions (UINT8 *dsdt, UINT32 len)
|
||||
{
|
||||
UINTN i, j;
|
||||
INTN shift;
|
||||
INTN shift = 0; // to silence warning
|
||||
CHAR8 Name[8];
|
||||
CHAR8 NameAdr[8];
|
||||
OPER_REGION *p;
|
||||
// BOOLEAN Corrected = FALSE;
|
||||
// XBool Corrected = false;
|
||||
|
||||
// OperationRegion (GNVS, SystemMemory, 0xDE2E9E18, 0x01CD)
|
||||
// 5B 80 47 4E 56 53 00 0C 18 9E 2E DE 0B CD 01
|
||||
@ -5084,7 +5084,7 @@ void FixRegions (UINT8 *dsdt, UINT32 len)
|
||||
if (dsdt[j+4] == 0x0C) {
|
||||
CopyMem(&oldAddress, &dsdt[j+5], 4);
|
||||
CopyMem(&dsdt[j+5], &p->Address, 4);
|
||||
// Corrected = TRUE;
|
||||
// Corrected = true;
|
||||
} else if (dsdt[j+4] == 0x0B) {
|
||||
CopyMem(&oldAddress, &dsdt[j+5], 2);
|
||||
CopyMem(&dsdt[j+5], &p->Address, 2);
|
||||
@ -5111,7 +5111,8 @@ void GetBiosRegions(UINT8 *buffer)
|
||||
// UINT8 *buffer = NULL;
|
||||
UINT32 bufferLen = 0;
|
||||
UINTN i, j;
|
||||
INTN shift, shift2;
|
||||
INTN shift = 0; // to silence warning
|
||||
INTN shift2;
|
||||
CHAR8 Name[8];
|
||||
CHAR8 NameAdr[8];
|
||||
|
||||
@ -5218,7 +5219,7 @@ Scope(\_SB)
|
||||
PSXS._ON() <- to not patch
|
||||
}
|
||||
*/
|
||||
BOOLEAN isACPI_Char(CHAR8 C)
|
||||
XBool isACPI_Char(CHAR8 C)
|
||||
{
|
||||
return (((C >= 'A') && (C <= 'Z')) ||
|
||||
((C >= '0') && (C <= '9')) ||
|
||||
@ -5226,7 +5227,7 @@ BOOLEAN isACPI_Char(CHAR8 C)
|
||||
}
|
||||
|
||||
// all string in Bridge is supposed to be 4 chars long.
|
||||
BOOLEAN CmpFullName(UINT8* Table, UINTN Len, const XString8Array& Bridge)
|
||||
XBool CmpFullName(UINT8* Table, UINTN Len, const XString8Array& Bridge)
|
||||
{
|
||||
// "RP02" NameLen=4
|
||||
// "_SB_PCI0RP02" NameLen=12
|
||||
@ -5237,7 +5238,7 @@ BOOLEAN CmpFullName(UINT8* Table, UINTN Len, const XString8Array& Bridge)
|
||||
while ((NameLen < Len) && isACPI_Char((CHAR8)Table[NameLen])) NameLen++;
|
||||
NameLen &= ~3;
|
||||
if (NameLen < 4) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
Name = (__typeof__(Name))AllocateCopyPool(NameLen + 1, Table);
|
||||
Name[NameLen] = '\0';
|
||||
@ -5245,12 +5246,12 @@ BOOLEAN CmpFullName(UINT8* Table, UINTN Len, const XString8Array& Bridge)
|
||||
for (size_t idx = 0 ; idx < Bridge.size() && i >= 0 ; ++idx ) {
|
||||
if (AsciiStrStr(Name + i, Bridge[idx].c_str()) == NULL) { //compare Bridge->Name with RP02, Next->Name with PCI0 then _SB_
|
||||
FreePool(Name);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
i -= 4;
|
||||
}
|
||||
FreePool(Name);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RenameDevices(UINT8* table)
|
||||
@ -5264,7 +5265,7 @@ void RenameDevices(UINT8* table)
|
||||
INTN size;
|
||||
UINTN len = ((EFI_ACPI_DESCRIPTION_HEADER*)table)->Length;
|
||||
INTN adr, shift, Num = 0;
|
||||
BOOLEAN found;
|
||||
XBool found;
|
||||
for (UINTN index = 0; index < gSettings.ACPI.DeviceRename.size(); index++) {
|
||||
const ACPI_RENAME_DEVICE& deviceRename = gSettings.ACPI.DeviceRename[index];
|
||||
XString8Array FindList = deviceRename.acpiName.getSplittedName();
|
||||
@ -5299,17 +5300,17 @@ void RenameDevices(UINT8* table)
|
||||
i -= 6; //skip size and device field
|
||||
// DBG("search for bridge since %lld\n", adr);
|
||||
while (i > 0x20) { //find devices that previous to adr
|
||||
found = FALSE;
|
||||
found = false;
|
||||
//check device
|
||||
if ((table[i] == 0x5B) && (table[i + 1] == 0x82) && !CmpNum(table, (INT32)i, TRUE)) { //device candidate
|
||||
if ((table[i] == 0x5B) && (table[i + 1] == 0x82) && !CmpNum(table, (INT32)i, true)) { //device candidate
|
||||
k = i + 2;
|
||||
found = TRUE;
|
||||
found = true;
|
||||
}
|
||||
//check scope
|
||||
|
||||
if ((table[i] == 0x10) && !CmpNum(table, (INT32)i, TRUE)) {
|
||||
if ((table[i] == 0x10) && !CmpNum(table, (INT32)i, true)) {
|
||||
k = i + 1;
|
||||
found = TRUE;
|
||||
found = true;
|
||||
}
|
||||
if (found) { // i points to Device or Scope
|
||||
size = get_size(table, (UINT32)(UINTN)k); //k points to size //
|
||||
@ -5357,9 +5358,9 @@ void FixBiosDsdt(UINT8* temp, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, c
|
||||
}
|
||||
|
||||
//Reenter requires ZERO values
|
||||
HDAFIX = TRUE;
|
||||
GFXHDAFIX = TRUE;
|
||||
USBIDFIX = TRUE;
|
||||
HDAFIX = true;
|
||||
GFXHDAFIX = true;
|
||||
USBIDFIX = true;
|
||||
|
||||
EFI_ACPI_DESCRIPTION_HEADER* efi_acpi_description_header = (EFI_ACPI_DESCRIPTION_HEADER*)temp;
|
||||
DsdtLen = efi_acpi_description_header->Length;
|
||||
|
@ -60,7 +60,7 @@ CONST CHAR8 *gColors[HDA_CONFIG_DEFAULT_COLOR_OTHER + 1] = {
|
||||
//#pragma clang diagnostic push
|
||||
//#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
|
||||
|
||||
#define HdaLog(format, ...) MemLogf(FALSE, 0, format, ##__VA_ARGS__)
|
||||
#define HdaLog(format, ...) MemLogf(false, 0, format, ##__VA_ARGS__)
|
||||
|
||||
//#pragma clang diagnostic pop
|
||||
|
||||
@ -446,7 +446,7 @@ EFI_STATUS SaveHdaDumpBin()
|
||||
HdaWidget.ConnectionSelect = 0;
|
||||
HdaWidget.SupportedPowerStates = Widgets[w].SupportedPowerStates;
|
||||
HdaWidget.DefaultPowerState = Widgets[w].DefaultPowerState;
|
||||
HdaWidget.AmpOverride = Widgets[w].AmpOverride;
|
||||
HdaWidget.AmpOverride = Widgets[w].AmpOverride != 0;
|
||||
HdaWidget.AmpInCapabilities = Widgets[w].AmpInCapabilities;
|
||||
HdaWidget.AmpOutCapabilities = Widgets[w].AmpOutCapabilities;
|
||||
HdaWidget.AmpOutLeftDefaultGainMute = Widgets[w].AmpOutLeftDefaultGainMute;
|
||||
|
@ -33,33 +33,33 @@
|
||||
#define HDA_MAX_NAMELEN 32
|
||||
|
||||
typedef struct {
|
||||
UINT8 NodeId;
|
||||
UINT8 Type;
|
||||
UINT32 Capabilities;
|
||||
UINT8 DefaultUnSol;
|
||||
UINT32 ConnectionListLength;
|
||||
UINT8 ConnectionSelect;
|
||||
UINT16 Connections[HDA_MAX_CONNS];
|
||||
UINT32 SupportedPowerStates;
|
||||
UINT32 DefaultPowerState;
|
||||
BOOLEAN AmpOverride;
|
||||
UINT32 AmpInCapabilities;
|
||||
UINT32 AmpOutCapabilities;
|
||||
UINT8 AmpInLeftDefaultGainMute[HDA_MAX_CONNS];
|
||||
UINT8 AmpInRightDefaultGainMute[HDA_MAX_CONNS];
|
||||
UINT8 AmpOutLeftDefaultGainMute;
|
||||
UINT8 AmpOutRightDefaultGainMute;
|
||||
UINT32 SupportedPcmRates;
|
||||
UINT32 SupportedFormats;
|
||||
UINT16 DefaultConvFormat;
|
||||
UINT8 DefaultConvStreamChannel;
|
||||
UINT8 DefaultConvChannelCount;
|
||||
UINT32 PinCapabilities;
|
||||
UINT8 DefaultEapd;
|
||||
UINT8 DefaultPinControl;
|
||||
UINT32 DefaultConfiguration;
|
||||
UINT32 VolumeCapabilities;
|
||||
UINT8 DefaultVolume;
|
||||
UINT8 NodeId = 0;
|
||||
UINT8 Type = 0;
|
||||
UINT32 Capabilities = 0;
|
||||
UINT8 DefaultUnSol = 0;
|
||||
UINT32 ConnectionListLength = 0;
|
||||
UINT8 ConnectionSelect = 0;
|
||||
UINT16 Connections[HDA_MAX_CONNS] = { 0 };
|
||||
UINT32 SupportedPowerStates = 0;
|
||||
UINT32 DefaultPowerState = 0;
|
||||
XBool AmpOverride = false;
|
||||
UINT32 AmpInCapabilities = 0;
|
||||
UINT32 AmpOutCapabilities = 0;
|
||||
UINT8 AmpInLeftDefaultGainMute[HDA_MAX_CONNS] = { 0 };
|
||||
UINT8 AmpInRightDefaultGainMute[HDA_MAX_CONNS] = { 0 };
|
||||
UINT8 AmpOutLeftDefaultGainMute = 0;
|
||||
UINT8 AmpOutRightDefaultGainMute = 0;
|
||||
UINT32 SupportedPcmRates = 0;
|
||||
UINT32 SupportedFormats = 0;
|
||||
UINT16 DefaultConvFormat = 0;
|
||||
UINT8 DefaultConvStreamChannel = 0;
|
||||
UINT8 DefaultConvChannelCount = 0;
|
||||
UINT32 PinCapabilities = 0;
|
||||
UINT8 DefaultEapd = 0;
|
||||
UINT8 DefaultPinControl = 0;
|
||||
UINT32 DefaultConfiguration = 0;
|
||||
UINT32 VolumeCapabilities = 0;
|
||||
UINT8 DefaultVolume = 0;
|
||||
} HdaWidget;
|
||||
|
||||
typedef struct {
|
||||
|
@ -578,10 +578,10 @@ GetSleepImagePosition (IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume)
|
||||
}
|
||||
|
||||
|
||||
/** Returns TRUE if /private/var/vm/sleepimage exists
|
||||
/** Returns true if /private/var/vm/sleepimage exists
|
||||
* and it's modification time is close to volume modification time).
|
||||
*/
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@ -608,13 +608,13 @@ IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume)
|
||||
Pages = EFI_SIZE_TO_PAGES(BlockIo->Media->BlockSize);
|
||||
Buffer = (__typeof__(Buffer))AllocatePages(Pages);
|
||||
if (Buffer == NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, 2, BlockIo->Media->BlockSize, Buffer);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG(" can not read HFS+ header -> %s\n", efiStrError(Status));
|
||||
FreePages(Buffer, Pages);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
HFSHeader = (HFSPlusVolumeHeaderMin *)Buffer;
|
||||
HFSVolumeModifyDate = SwapBytes32(HFSHeader->modifyDate);
|
||||
@ -635,19 +635,19 @@ IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume)
|
||||
//Slice - if image newer then volume it should be OK
|
||||
DBG(" image too old\n");
|
||||
FreePages(Buffer, Pages);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
DBG(" machineSignature from FACS =0x%llX\n", machineSignature);
|
||||
// machineSignature = ((IOHibernateImageHeaderMin*)Buffer)->machineSignature;
|
||||
// DBG(" image has machineSignature =0x%X\n", machineSignature);
|
||||
FreePages(Buffer, Pages);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Returns TRUE if /private/var/vm/sleepimage exists
|
||||
/** Returns true if /private/var/vm/sleepimage exists
|
||||
* and it's signature is kIOHibernateHeaderSignature.
|
||||
*/
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsSleepImageValidBySignature (IN REFIT_VOLUME *Volume)
|
||||
{
|
||||
// We'll have to detect offset here also in case driver caches
|
||||
@ -708,17 +708,17 @@ REFIT_VOLUME *FoundParentVolume(REFIT_VOLUME *Volume)
|
||||
|
||||
STATIC CHAR16 OffsetHexStr[100];
|
||||
|
||||
/** Returns TRUE if given OSX on given volume is hibernated. */
|
||||
BOOLEAN
|
||||
/** Returns true if given OSX on given volume is hibernated. */
|
||||
XBool
|
||||
IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
{
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINTN Size = 0;
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINTN Size = 0;
|
||||
UINT8 *Data = NULL;
|
||||
// REFIT_VOLUME *ThisVolume = Entry->Volume;
|
||||
REFIT_VOLUME *Volume = Entry->Volume;
|
||||
EFI_GUID *BootGUID = NULL;
|
||||
BOOLEAN ret = FALSE;
|
||||
XBool ret = false;
|
||||
UINT8 *Value = NULL;
|
||||
|
||||
// UINTN VolumeIndex;
|
||||
@ -726,7 +726,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
// CHAR16 *VolumeUUIDStr = NULL;
|
||||
|
||||
if (!Volume) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
Status = GetRootUUID(ThisVolume); // already done
|
||||
@ -777,7 +777,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
if (Volume) {
|
||||
DBG(" Found parent Volume with name %ls\n", Volume->VolName);
|
||||
if (Volume->RootDir == NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
DBG(" Parent Volume not found, use this one\n");
|
||||
@ -807,7 +807,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
//or we choose "cancel hibernate wake" then it must be canceled
|
||||
if (gSettings.Boot.NeverHibernate) {
|
||||
DBG(" hibernated: set as never\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
DBG(" Check if volume Is Hibernated:\n");
|
||||
@ -817,15 +817,15 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
if (IsSleepImageValidBySignature(Volume)) {
|
||||
if ((gSleepTime == 0) || IsSleepImageValidBySleepTime(Volume)) {
|
||||
DBG(" hibernated: yes\n");
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
} else {
|
||||
DBG(" hibernated: no - time\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// IsHibernate = TRUE;
|
||||
// IsHibernate = true;
|
||||
} else {
|
||||
DBG(" hibernated: no - sign\n");
|
||||
return FALSE; //test
|
||||
return false; //test
|
||||
}
|
||||
}
|
||||
|
||||
@ -835,10 +835,10 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
Status = GetVariable2 (L"Boot0082", &gEfiGlobalVariableGuid, (void**)&Data, &Size);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG(" no, Boot0082 not exists\n");
|
||||
ret = FALSE;
|
||||
ret = false;
|
||||
} else {
|
||||
DBG("yes\n");
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
//1. Parse Media Device Path from Boot0082 load option
|
||||
//Cut Data pointer by 0x08 up to DevicePath
|
||||
// Data += 0x08;
|
||||
@ -862,7 +862,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
}
|
||||
//DBG(" Volume has PartUUID=%s\n", strguid(VolumeUUID));
|
||||
if (BootGUID != NULL && VolumeUUID != NULL && !CompareGuid(BootGUID, VolumeUUID)) {
|
||||
ret = FALSE;
|
||||
ret = false;
|
||||
} else {
|
||||
DBG(" Boot0082 points to Volume with UUID:%s\n", strguid(BootGUID));
|
||||
|
||||
@ -887,7 +887,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
if (EFI_ERROR(Status)) {
|
||||
// leave it as is
|
||||
DBG(" boot-image not found while we want StrictHibernate\n");
|
||||
ret = FALSE;
|
||||
ret = false;
|
||||
} else {
|
||||
|
||||
EFI_DEVICE_PATH_PROTOCOL *BootImageDevPath;
|
||||
@ -907,7 +907,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
EFI_GUID TmpGuid;
|
||||
// CHAR16 *TmpStr = NULL;
|
||||
|
||||
ResumeFromCoreStorage = TRUE;
|
||||
ResumeFromCoreStorage = true;
|
||||
// DBG("got str=%ls\n", Ptr);
|
||||
XString8 xs8;
|
||||
xs8.takeValueFrom(Ptr);
|
||||
@ -942,7 +942,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
Size , Value);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG(" can not write boot-image -> %s\n", efiStrError(Status));
|
||||
ret = FALSE;
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -974,7 +974,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
|
||||
* That's the only way for CloverEFI and should be OK for UEFI hack also.
|
||||
*/
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@ -986,9 +986,9 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
UINT8 *VarData = NULL;
|
||||
REFIT_VOLUME *SleepImageVolume;
|
||||
UINT32 Attributes;
|
||||
BOOLEAN HasIORTCVariables = FALSE;
|
||||
BOOLEAN HasHibernateInfo = FALSE;
|
||||
BOOLEAN HasHibernateInfoInRTC = FALSE;
|
||||
XBool HasIORTCVariables = false;
|
||||
XBool HasHibernateInfo = false;
|
||||
XBool HasHibernateInfoInRTC = false;
|
||||
|
||||
DBG("PrepareHibernation:\n");
|
||||
|
||||
@ -998,7 +998,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
DBG(" SleepImageOffset: %llx\n", SleepImageOffset);
|
||||
if (SleepImageOffset == 0 || SleepImageVolume == NULL) {
|
||||
DBG(" sleepimage offset not found\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set boot-image var
|
||||
@ -1020,7 +1020,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
Size , BootImageDevPath);
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG(" can not write boot-image -> %s\n", efiStrError(Status));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1041,7 +1041,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
DBG(" boot-switch-vars present\n");
|
||||
ZeroMem (Value, Size);
|
||||
gBS->FreePool(Value);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
@ -1062,7 +1062,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
// Prior to 10.13.6.
|
||||
//
|
||||
Status = GetVariable2 (L"IOHibernateRTCVariables", &gEfiAppleBootGuid, &Value, &Size);
|
||||
DBG("get IOHR variable status=%s, size=%llu, RTC info=%d\n", efiStrError(Status), Size, HasHibernateInfoInRTC);
|
||||
DBG("get IOHR variable status=%s, size=%llu, RTC info=%d\n", efiStrError(Status), Size, (bool)HasHibernateInfoInRTC);
|
||||
if (!HasHibernateInfo && !EFI_ERROR(Status) && Size == sizeof (RtcVars)) {
|
||||
CopyMem(RtcRawVars, Value, sizeof (RtcVars));
|
||||
HasHibernateInfo = (RtcVars.signature[0] == 'A' && RtcVars.signature[1] == 'A' &&
|
||||
@ -1110,7 +1110,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
// We have everything we need now.
|
||||
//
|
||||
if (HasHibernateInfo) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1129,7 +1129,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
Status = gRT->SetVariable(L"IOHibernateRTCVariables", &gEfiAppleBootGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
0, NULL);
|
||||
HasIORTCVariables = TRUE;
|
||||
HasIORTCVariables = true;
|
||||
} else {
|
||||
//
|
||||
// No NVRAM support, trying unencrypted.
|
||||
@ -1168,9 +1168,9 @@ PrepareHibernation (IN REFIT_VOLUME *Volume)
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
DBG(" can not write boot-switch-vars -> %s\n", efiStrError(Status));
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -8,17 +8,17 @@
|
||||
#ifndef PLATFORM_HIBERNATE_H_
|
||||
#define PLATFORM_HIBERNATE_H_
|
||||
|
||||
/** Returns TRUE if given macOS on given volume is hibernated
|
||||
/** Returns true if given macOS on given volume is hibernated
|
||||
* (/private/var/vm/sleepimage exists and it's modification time is close to volume modification time).
|
||||
*/
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsOsxHibernated (
|
||||
IN LOADER_ENTRY *Entry
|
||||
);
|
||||
|
||||
|
||||
/** Prepares nvram vars needed for boot.efi to wake from hibernation. */
|
||||
BOOLEAN
|
||||
XBool
|
||||
PrepareHibernation (
|
||||
IN REFIT_VOLUME *Volume
|
||||
);
|
||||
|
@ -290,7 +290,7 @@ EFI_OS_INFO_PROTOCOL mEfiOSInfo = {
|
||||
->LocateProtocol(gAppleGraphConfigProtocolGuid, 0, 78000000438/1F7DAEC8) = Success
|
||||
call sub_30150
|
||||
->GetVariable(boot-gamma, gEfiAppleBootGuid, 0/50, 0, 0) = Not Found
|
||||
mRestored = TRUE;
|
||||
mRestored = true;
|
||||
->GraphConfig.RestoreConfig(2, 400, 1FFCE8B0, 1FFCE0B0, 1FFCD8B0) status=Success
|
||||
*/
|
||||
|
||||
@ -341,7 +341,7 @@ EFI_KEYBOARD_INFO_PROTOCOL mKeyboardInfo = {
|
||||
//EFIAPI
|
||||
//GetQuirksConfig (IN OCQUIRKS_PROTOCOL *This,
|
||||
// OUT OC_ABC_SETTINGS_4CLOVER *Buffer,
|
||||
// OUT BOOLEAN *GopEnable
|
||||
// OUT XBool *GopEnable
|
||||
// )
|
||||
//{
|
||||
// DBG("GetQuirksConfig called\n");
|
||||
|
@ -8,18 +8,18 @@
|
||||
#include "KERNEL_AND_KEXT_PATCHES.h"
|
||||
#include "MacOsVersion.h"
|
||||
|
||||
bool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build)
|
||||
XBool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build)
|
||||
{
|
||||
BOOLEAN ret = FALSE;
|
||||
XBool ret = false;
|
||||
|
||||
if (MatchBuild.isEmpty() || Build.isEmpty()) {
|
||||
return TRUE; //undefined matched corresponds to old behavior
|
||||
return true; //undefined matched corresponds to old behavior
|
||||
}
|
||||
|
||||
XString8Array mos = Split<XString8Array>(MatchBuild, ","_XS8).trimEachString();
|
||||
|
||||
if ( mos[0] == "All"_XS8) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < mos.size(); ++i) {
|
||||
@ -27,7 +27,7 @@ bool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build)
|
||||
MacOsVersion mosv = mos[i];
|
||||
if ( mos[i].contains(Build) ) { // MatchBuild
|
||||
//DBG("\nthis patch will activated for OS %ls!\n", mos->array[i]);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -35,18 +35,18 @@ bool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build)
|
||||
}
|
||||
|
||||
|
||||
bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS)
|
||||
XBool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS)
|
||||
{
|
||||
BOOLEAN ret = FALSE;
|
||||
XBool ret = false;
|
||||
|
||||
if (MatchOS.isEmpty() || CurrOS.isEmpty()) {
|
||||
return TRUE; //undefined matched corresponds to old behavior
|
||||
return true; //undefined matched corresponds to old behavior
|
||||
}
|
||||
|
||||
XString8Array mos = Split<XString8Array>(MatchOS, ","_XS8).trimEachString();
|
||||
|
||||
if ( mos[0] == "All"_XS8) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < mos.size(); ++i) {
|
||||
@ -54,7 +54,7 @@ bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS)
|
||||
MacOsVersion mosv = mos[i];
|
||||
if ( CurrOS.match(mos[i]) ) {
|
||||
//DBG("\nthis patch will activated for OS %ls!\n", mos->array[i]);
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -63,18 +63,18 @@ bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS)
|
||||
|
||||
|
||||
//
|
||||
//bool KERNEL_AND_KEXT_PATCHES::IsPatchEnabledByBuildNumber(const XString8& Build)
|
||||
//XBool KERNEL_AND_KEXT_PATCHES::IsPatchEnabledByBuildNumber(const XString8& Build)
|
||||
//{
|
||||
// BOOLEAN ret = FALSE;
|
||||
// XBool ret = false;
|
||||
//
|
||||
// if (MatchBuild.isEmpty() || Build.isEmpty()) {
|
||||
// return TRUE; //undefined matched corresponds to old behavior
|
||||
// return true; //undefined matched corresponds to old behavior
|
||||
// }
|
||||
//
|
||||
// XString8Array mos = Split<XString8Array>(MatchBuild, ","_XS8).trimEachString();
|
||||
//
|
||||
// if ( mos[0] == "All"_XS8) {
|
||||
// return TRUE;
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// for (size_t i = 0; i < mos.size(); ++i) {
|
||||
@ -82,7 +82,7 @@ bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS)
|
||||
// MacOsVersion mosv = mos[i];
|
||||
// if ( mos[i].contains(Build) ) { // MatchBuild
|
||||
// //DBG("\nthis patch will activated for OS %ls!\n", mos->array[i]);
|
||||
// ret = TRUE;
|
||||
// ret = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
@ -22,7 +22,7 @@ extern "C" {
|
||||
class ABSTRACT_PATCH
|
||||
{
|
||||
public:
|
||||
bool Disabled = bool();
|
||||
XBool Disabled = XBool();
|
||||
XBuffer<UINT8> Find = XBuffer<UINT8> ();
|
||||
XBuffer<UINT8> Replace = XBuffer<UINT8> ();
|
||||
XBuffer<UINT8> MaskFind = XBuffer<UINT8> ();
|
||||
@ -43,9 +43,9 @@ public:
|
||||
virtual ~ABSTRACT_PATCH() {}
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
bool operator == (const ABSTRACT_PATCH&) const = default;
|
||||
XBool operator == (const ABSTRACT_PATCH&) const = default;
|
||||
#endif
|
||||
bool isEqual(const ABSTRACT_PATCH& other) const
|
||||
XBool isEqual(const ABSTRACT_PATCH& other) const
|
||||
{
|
||||
if ( !(Disabled == other.Disabled ) ) return false;
|
||||
if ( !(Find == other.Find ) ) return false;
|
||||
@ -82,8 +82,8 @@ public:
|
||||
}
|
||||
|
||||
/** Returns a boolean and then enable disable the patch if MachOSEntry have a match for the booted OS. */
|
||||
bool IsPatchEnabledByBuildNumber(const XString8& Build);
|
||||
bool IsPatchEnabled(const MacOsVersion& CurrOS);
|
||||
XBool IsPatchEnabledByBuildNumber(const XString8& Build);
|
||||
XBool IsPatchEnabled(const MacOsVersion& CurrOS);
|
||||
|
||||
|
||||
};
|
||||
@ -96,15 +96,15 @@ public:
|
||||
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
bool operator == (const ABSTRACT_KEXT_OR_KERNEL_PATCH&) const = default;
|
||||
XBool operator == (const ABSTRACT_KEXT_OR_KERNEL_PATCH&) const = default;
|
||||
#endif
|
||||
bool isEqual(const ABSTRACT_KEXT_OR_KERNEL_PATCH& other) const
|
||||
XBool isEqual(const ABSTRACT_KEXT_OR_KERNEL_PATCH& other) const
|
||||
{
|
||||
if ( !super::isEqual (other) ) return false;
|
||||
if ( !(ProcedureName == other.ProcedureName ) ) return false;
|
||||
return true;
|
||||
}
|
||||
bool takeValueFrom(const ConfigPlistClass::KernelAndKextPatches_Class::ABSTRACT_KEXT_OR_KERNEL_PATCH& other)
|
||||
XBool takeValueFrom(const ConfigPlistClass::KernelAndKextPatches_Class::ABSTRACT_KEXT_OR_KERNEL_PATCH& other)
|
||||
{
|
||||
super::takeValueFrom(other);
|
||||
ProcedureName = other.dgetProcedureName();
|
||||
@ -119,15 +119,15 @@ class KEXT_PATCH : public ABSTRACT_KEXT_OR_KERNEL_PATCH
|
||||
using super = ABSTRACT_KEXT_OR_KERNEL_PATCH;
|
||||
public:
|
||||
XString8 Name = XString8();
|
||||
bool IsPlistPatch = BOOLEAN();
|
||||
XBool IsPlistPatch = XBool();
|
||||
|
||||
|
||||
virtual XString8 getName() const { return Name; }
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
bool operator == (const KEXT_PATCH&) const = default;
|
||||
XBool operator == (const KEXT_PATCH&) const = default;
|
||||
#endif
|
||||
bool isEqual(const KEXT_PATCH& other) const
|
||||
XBool isEqual(const KEXT_PATCH& other) const
|
||||
{
|
||||
if ( !super::isEqual (other) ) return false;
|
||||
if ( !(Name == other.Name ) ) return false;
|
||||
@ -150,9 +150,9 @@ public:
|
||||
virtual XString8 getName() const { return "kernel"_XS8; }
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
bool operator == (const KERNEL_PATCH&) const = default;
|
||||
XBool operator == (const KERNEL_PATCH&) const = default;
|
||||
#endif
|
||||
bool isEqual(const KERNEL_PATCH& other) const
|
||||
XBool isEqual(const KERNEL_PATCH& other) const
|
||||
{
|
||||
if ( !super::isEqual (other) ) return false;
|
||||
return true;
|
||||
@ -171,9 +171,9 @@ public:
|
||||
virtual XString8 getName() const { return "boot.efi"_XS8; }
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
bool operator == (const BOOT_PATCH&) const = default;
|
||||
XBool operator == (const BOOT_PATCH&) const = default;
|
||||
#endif
|
||||
bool isEqual(const BOOT_PATCH& other) const
|
||||
XBool isEqual(const BOOT_PATCH& other) const
|
||||
{
|
||||
if ( !super::isEqual (other) ) return false;
|
||||
return true;
|
||||
@ -187,15 +187,15 @@ public:
|
||||
class KERNEL_AND_KEXT_PATCHES
|
||||
{
|
||||
public:
|
||||
bool KPDebug = bool();
|
||||
bool KPKernelLapic = bool();
|
||||
bool KPKernelXCPM = bool();
|
||||
bool _KPKernelPm = bool();
|
||||
bool KPPanicNoKextDump = bool();
|
||||
bool _KPAppleIntelCPUPM = bool();
|
||||
bool KPAppleRTC = bool();
|
||||
bool EightApple = bool();
|
||||
bool KPDELLSMBIOS = bool(); // Dell SMBIOS patch
|
||||
XBool KPDebug = XBool();
|
||||
XBool KPKernelLapic = XBool();
|
||||
XBool KPKernelXCPM = XBool();
|
||||
XBool _KPKernelPm = XBool();
|
||||
XBool KPPanicNoKextDump = XBool();
|
||||
XBool _KPAppleIntelCPUPM = XBool();
|
||||
XBool KPAppleRTC = XBool();
|
||||
XBool EightApple = XBool();
|
||||
XBool KPDELLSMBIOS = XBool(); // Dell SMBIOS patch
|
||||
UINT32 FakeCPUID = UINT32();
|
||||
XString8 KPATIConnectorsController = XString8();
|
||||
XBuffer<UINT8> KPATIConnectorsData = XBuffer<UINT8>();
|
||||
@ -208,9 +208,9 @@ public:
|
||||
KERNEL_AND_KEXT_PATCHES() : ForceKextsToLoad(), KextPatches(), KernelPatches(), BootPatches() {}
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
bool operator == (const KERNEL_AND_KEXT_PATCHES&) const = default;
|
||||
XBool operator == (const KERNEL_AND_KEXT_PATCHES&) const = default;
|
||||
#endif
|
||||
bool isEqual(const KERNEL_AND_KEXT_PATCHES& other) const
|
||||
XBool isEqual(const KERNEL_AND_KEXT_PATCHES& other) const
|
||||
{
|
||||
if ( !(KPDebug == other.KPDebug ) ) return false;
|
||||
if ( !(KPKernelLapic == other.KPKernelLapic ) ) return false;
|
||||
|
@ -66,22 +66,22 @@ XStringW GetBundleVersion(const XStringW& pathUnderSelf)
|
||||
void GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath)
|
||||
{
|
||||
|
||||
REFIT_DIR_ITER DirIter;
|
||||
EFI_FILE_INFO* DirEntry;
|
||||
SIDELOAD_KEXT* mKext;
|
||||
SIDELOAD_KEXT* mPlugInKext;
|
||||
XStringW FullName;
|
||||
REFIT_DIR_ITER DirIter;
|
||||
EFI_FILE_INFO *DirEntry;
|
||||
SIDELOAD_KEXT *mKext;
|
||||
SIDELOAD_KEXT *mPlugInKext;
|
||||
XStringW FullName;
|
||||
// XStringW FullPath = SWPrintf("%ls\\KEXTS\\%ls", OEMPath.wc_str(), KextDirNameUnderOEMPath);
|
||||
REFIT_DIR_ITER PlugInsIter;
|
||||
REFIT_DIR_ITER PlugInsIter;
|
||||
EFI_FILE_INFO *PlugInEntry;
|
||||
XStringW PlugInsPath;
|
||||
XStringW PlugInsPath;
|
||||
XStringW PlugInsName;
|
||||
BOOLEAN Blocked = FALSE;
|
||||
XBool Blocked = false;
|
||||
|
||||
if( !selfOem.isKextsDirFound() ) return;
|
||||
|
||||
if (StrCmp(KextDirNameUnderOEMPath, L"Off") == 0) {
|
||||
Blocked = TRUE;
|
||||
Blocked = true;
|
||||
}
|
||||
|
||||
DirIterOpen(&selfOem.getKextsDir(), KextDirNameUnderOEMPath, &DirIter);
|
||||
|
@ -175,7 +175,7 @@ DisconnectVga ( void )
|
||||
Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, 0, sizeof (Pci) / sizeof (UINT32), &Pci);
|
||||
if (!EFI_ERROR(Status))
|
||||
{
|
||||
if(IS_PCI_VGA(&Pci) == TRUE)
|
||||
if(IS_PCI_VGA(&Pci) == true)
|
||||
{
|
||||
// disconnect VGA
|
||||
DBG("Disonnecting VGA\n");
|
||||
@ -199,11 +199,11 @@ DisconnectVga ( void )
|
||||
@param BiosInt Processor interrupt vector to invoke
|
||||
@param Reg Register contexted passed into (and returned) from thunk to 16-bit mode
|
||||
|
||||
@retval TRUE Thunk completed, and there were no BIOS errors in the target code.
|
||||
@retval true Thunk completed, and there were no BIOS errors in the target code.
|
||||
See Regs for status.
|
||||
@retval FALSE There was a BIOS erro in the target code.
|
||||
@retval false There was a BIOS erro in the target code.
|
||||
**/
|
||||
BOOLEAN
|
||||
XBool
|
||||
EFIAPI
|
||||
LegacyBiosInt86 (
|
||||
// IN BIOS_VIDEO_DEV *BiosDev,
|
||||
@ -214,8 +214,8 @@ LegacyBiosInt86 (
|
||||
UINTN Status;
|
||||
UINTN Eflags;
|
||||
IA32_REGISTER_SET ThunkRegSet;
|
||||
BOOLEAN Ret;
|
||||
UINT16 *Stack16;
|
||||
XBool Ret;
|
||||
UINT16 *Stack16;
|
||||
|
||||
ZeroMem (&ThunkRegSet, sizeof (ThunkRegSet));
|
||||
ThunkRegSet.E.EFLAGS.Bits.Reserved_0 = 1;
|
||||
@ -252,7 +252,7 @@ LegacyBiosInt86 (
|
||||
Status = gLegacy8259->SetMode (gLegacy8259, Efi8259LegacyMode, NULL, NULL);
|
||||
// ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
Stack16 = (UINT16 *)((UINT8 *) mThunkContext->RealModeBuffer + mThunkContext->RealModeBufferSize - sizeof (UINT16));
|
||||
@ -271,7 +271,7 @@ LegacyBiosInt86 (
|
||||
Status = gLegacy8259->SetMode (gLegacy8259, Efi8259ProtectedMode, NULL, NULL);
|
||||
// ASSERT_EFI_ERROR(Status);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
@ -295,12 +295,12 @@ LegacyBiosInt86 (
|
||||
|
||||
CopyMem(&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
|
||||
|
||||
Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);
|
||||
Ret = Regs->E.EFLAGS.Bits.CF == 1;
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
EFIAPI
|
||||
LegacyBiosFarCall86 (
|
||||
// IN EFI_LEGACY_BIOS_THUNK_PROTOCOL *This,
|
||||
@ -311,17 +311,17 @@ LegacyBiosFarCall86 (
|
||||
// IN UINTN StackSize
|
||||
)
|
||||
{
|
||||
UINTN Status;
|
||||
UINT32 Eflags;
|
||||
IA32_REGISTER_SET ThunkRegSet;
|
||||
BOOLEAN Ret;
|
||||
UINT16 *Stack16;
|
||||
UINTN Status;
|
||||
UINT32 Eflags;
|
||||
IA32_REGISTER_SET ThunkRegSet;
|
||||
XBool Ret;
|
||||
UINT16 *Stack16;
|
||||
// UINT16 BiosInt = 0x100;
|
||||
EFI_TPL OriginalTpl;
|
||||
EFI_TPL OriginalTpl;
|
||||
EFI_TIMER_ARCH_PROTOCOL *Timer;
|
||||
UINT64 TimerPeriod = 0;
|
||||
UINT64 TimerPeriod = 0;
|
||||
#if ENABLE_PS2MOUSE_LEGACYBOOT == 1
|
||||
UINT16 LegacyMaskOld, LegacyMaskNew;
|
||||
UINT16 LegacyMaskOld, LegacyMaskNew;
|
||||
#endif
|
||||
|
||||
// Disconnect EFI VGA driver (and switch to Text VGA Mode)
|
||||
@ -449,7 +449,7 @@ LegacyBiosFarCall86 (
|
||||
|
||||
CopyMem(&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
|
||||
|
||||
Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);
|
||||
Ret = Regs->E.EFLAGS.Bits.CF == 1;
|
||||
|
||||
// Connect VGA EFI Driver
|
||||
BdsLibConnectAllDriversToAllControllers();
|
||||
|
@ -56,7 +56,7 @@ InitializeInterruptRedirection (
|
||||
// IN EFI_LEGACY_8259_PROTOCOL *Legacy8259
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
EFIAPI
|
||||
LegacyBiosInt86 (
|
||||
// IN EFI_LEGACY_BIOS_THUNK_PROTOCOL *This,
|
||||
@ -64,7 +64,7 @@ LegacyBiosInt86 (
|
||||
IN IA32_REGISTER_SET *Regs
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
EFIAPI
|
||||
LegacyBiosFarCall86 (
|
||||
// IN EFI_LEGACY_BIOS_THUNK_PROTOCOL *This,
|
||||
|
@ -197,7 +197,7 @@ EFI_STATUS BiosReadSectorsFromDrive(UINT8 DriveNum, UINT64 Lba, UINTN NumSectors
|
||||
Regs.H.DL = DriveNum;
|
||||
Status = EFI_SUCCESS;
|
||||
if (LegacyBiosInt86(0x13, &Regs)) {
|
||||
// TRUE = error
|
||||
// true = error
|
||||
DBG("Reset 0 disk controller: %hhX\n", DriveNum);
|
||||
Regs.H.AH = 0x0D; // INT 13h AH=00h: Reset disk controller
|
||||
Regs.H.DL = DriveNum;
|
||||
@ -220,7 +220,7 @@ EFI_STATUS BiosReadSectorsFromDrive(UINT8 DriveNum, UINT64 Lba, UINTN NumSectors
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
if (LegacyBiosInt86(0x13, &Regs)) {
|
||||
// TRUE = error
|
||||
// true = error
|
||||
Regs.H.AH = 0x01; // INT 13h AH=01h: Get Status of Last Drive Operation
|
||||
LegacyBiosInt86(0x13, &Regs);
|
||||
Status = EFI_NOT_FOUND;
|
||||
@ -681,7 +681,7 @@ EFI_STATUS bootPBRtest(REFIT_VOLUME* volume)
|
||||
Regs.H.DL = 0x80;
|
||||
Status = EFI_SUCCESS;
|
||||
if (LegacyBiosInt86(0x13, &Regs)) {
|
||||
// TRUE = error
|
||||
// true = error
|
||||
Status = EFI_NOT_FOUND;
|
||||
DBG("reset controller 0x80 error\n");
|
||||
// return Status;
|
||||
@ -749,7 +749,7 @@ gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
|
||||
/** For BIOS and some UEFI boots.
|
||||
* Loads partition boot record (PBR) and starts it.
|
||||
*/
|
||||
EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset)
|
||||
EFI_STATUS bootPBR(REFIT_VOLUME* volume, XBool SataReset)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_BLOCK_IO *pDisk = volume->BlockIO;
|
||||
@ -963,7 +963,7 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset)
|
||||
Regs.X.SI = (UINT16)(UINTN)pMBR;
|
||||
}
|
||||
|
||||
DBG("mbr: %d index: %llX pointer: %llX dx: %hX si: %hX\n", volume->IsMbrPartition, volume->MbrPartitionIndex, (uintptr_t)volume->MbrPartitionTable, Regs.X.DX, Regs.X.SI);
|
||||
DBG("mbr: %d index: %llX pointer: %llX dx: %hX si: %hX\n", (bool)volume->IsMbrPartition, volume->MbrPartitionIndex, (uintptr_t)volume->MbrPartitionTable, Regs.X.DX, Regs.X.SI);
|
||||
DBG("pmbr: %llX start: %X size: %X\n", (uintptr_t)&pMBR[volume->MbrPartitionIndex], pMBR[volume->MbrPartitionIndex].StartLBA, pMBR[volume->MbrPartitionIndex].Size);
|
||||
|
||||
//
|
||||
|
@ -23,7 +23,7 @@ bootMBR (
|
||||
|
||||
EFI_STATUS
|
||||
bootPBR (
|
||||
IN REFIT_VOLUME *volume, BOOLEAN SataReset
|
||||
IN REFIT_VOLUME *volume, XBool SataReset
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -26,8 +26,8 @@ class AbstractMacOsVersion
|
||||
int nbElement() const { int idx; for ( idx=0 ; idx < nbMaxElement && versionsNumber[idx] != -1 ; idx++ ) {}; return idx; }
|
||||
int lastElement() const { int idx; for ( idx=1 ; idx < nbMaxElement && versionsNumber[idx] != -1 ; idx++ ) {}; return versionsNumber[idx-1]; }
|
||||
void setEmpty() { lastError.setEmpty(); for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) versionsNumber[idx] = -1; }
|
||||
bool isEmpty() const { return versionsNumber[0] == -1; }
|
||||
bool notEmpty() const { return !isEmpty(); }
|
||||
XBool isEmpty() const { return versionsNumber[0] == -1; }
|
||||
XBool notEmpty() const { return !isEmpty(); }
|
||||
|
||||
template<typename IntegralType, enable_if(is_integral(IntegralType))>
|
||||
int elementAt(IntegralType i) const {
|
||||
@ -230,7 +230,7 @@ class MacOsVersion : public AbstractMacOsVersion
|
||||
}
|
||||
|
||||
|
||||
bool match(const MacOsVersionPattern& pattern) const
|
||||
XBool match(const MacOsVersionPattern& pattern) const
|
||||
{
|
||||
// int nbMax = nbElemen() <= pattern.nbMaxElement ? nbMaxElement : pattern.nbMaxElement;
|
||||
int idx;
|
||||
@ -251,16 +251,16 @@ class MacOsVersion : public AbstractMacOsVersion
|
||||
return false;
|
||||
}
|
||||
|
||||
bool operator ==(const MacOsVersion &other) const
|
||||
XBool operator ==(const MacOsVersion &other) const
|
||||
{
|
||||
for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) {
|
||||
if ( versionsNumber[idx] != other.elementAt(idx) ) return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
bool operator !=(const MacOsVersion &other) const { return ! ( *this == other); }
|
||||
XBool operator !=(const MacOsVersion &other) const { return ! ( *this == other); }
|
||||
|
||||
bool operator <(const MacOsVersion &other) const
|
||||
XBool operator <(const MacOsVersion &other) const
|
||||
{
|
||||
for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) {
|
||||
if ( versionsNumber[idx] < other.elementAt(idx) ) return true;
|
||||
@ -268,9 +268,9 @@ class MacOsVersion : public AbstractMacOsVersion
|
||||
}
|
||||
return false; // here, means it's equal
|
||||
};
|
||||
bool operator >=(const MacOsVersion &other) const { return ! ( *this < other); }
|
||||
XBool operator >=(const MacOsVersion &other) const { return ! ( *this < other); }
|
||||
|
||||
bool operator >(const MacOsVersion &other) const
|
||||
XBool operator >(const MacOsVersion &other) const
|
||||
{
|
||||
for ( size_t idx=0 ; idx < nbMaxElement ; idx++ ) {
|
||||
if ( versionsNumber[idx] > other.elementAt(idx) ) return true;
|
||||
@ -278,7 +278,7 @@ class MacOsVersion : public AbstractMacOsVersion
|
||||
}
|
||||
return false; // here, means it's equal
|
||||
};
|
||||
bool operator <=(const MacOsVersion &other) const { return ! ( *this > other); }
|
||||
XBool operator <=(const MacOsVersion &other) const { return ! ( *this > other); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -282,7 +282,7 @@ DeleteNvramVariable (
|
||||
return Status;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsDeletableVariable (
|
||||
IN CHAR16 *Name,
|
||||
IN EFI_GUID *Guid
|
||||
@ -299,7 +299,7 @@ IsDeletableVariable (
|
||||
CompareGuid(Guid, &gAppleSecureBootVariableGuid) ||
|
||||
CompareGuid(Guid, &gAppleTamperResistantBootSecureVariableGuid) ||
|
||||
CompareGuid(Guid, &gAppleTamperResistantBootEfiUserVariableGuid)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// Disable Clover Boot Options from being deleted
|
||||
// Global variable boot options
|
||||
@ -308,26 +308,26 @@ IsDeletableVariable (
|
||||
// I.e. BootOrder, Boot####, DriverOrder, Driver####
|
||||
if (!StrnCmp (Name, L"Boot", StrLen(L"Boot")) ||
|
||||
!StrnCmp (Name, L"Driver", StrLen(L"Driver"))) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}*/
|
||||
|
||||
// Lilu / OpenCore extensions
|
||||
} else if (CompareGuid (Guid, &gOcVendorVariableGuid) ||
|
||||
CompareGuid(Guid, &gOcReadOnlyVariableGuid) ||
|
||||
CompareGuid(Guid, &gOcWriteOnlyVariableGuid)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// Ozmozis extensions
|
||||
} else if (CompareGuid (Guid, &mOzmosisProprietary1Guid) ||
|
||||
CompareGuid (Guid, &mOzmosisProprietary2Guid)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
|
||||
// BootChime
|
||||
} else if (CompareGuid (Guid, &gBootChimeVendorVariableGuid)) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef JIEF_DEBUG
|
||||
@ -372,7 +372,7 @@ ResetNativeNvram ()
|
||||
CHAR16 *Name;
|
||||
UINTN NameSize;
|
||||
UINTN NewNameSize;
|
||||
BOOLEAN Restart = TRUE;
|
||||
XBool Restart = true;
|
||||
UINTN VolumeIndex;
|
||||
REFIT_VOLUME *Volume;
|
||||
EFI_FILE* FileHandle;
|
||||
@ -385,11 +385,11 @@ ResetNativeNvram ()
|
||||
return Status;
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
if (Restart) {
|
||||
ZeroMem (&Guid, sizeof(Guid));
|
||||
ZeroMem (Name, sizeof(Name));
|
||||
Restart = FALSE;
|
||||
Restart = false;
|
||||
}
|
||||
|
||||
NewNameSize = NameSize;
|
||||
@ -414,7 +414,7 @@ ResetNativeNvram ()
|
||||
Status = DeleteNvramVariable(Name, &Guid);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
//DBG("OK\n");
|
||||
Restart = TRUE;
|
||||
Restart = true;
|
||||
} else {
|
||||
//DBG("FAIL (%s)\n", efiStrError(Status));
|
||||
break;
|
||||
@ -492,7 +492,7 @@ INT8 SAdr[4] = {0, 0, 3, 0};
|
||||
INT8 SNum[1] = {1};
|
||||
|
||||
void
|
||||
GetSmcKeys (BOOLEAN WriteToSMC)
|
||||
GetSmcKeys (XBool WriteToSMC)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *Name;
|
||||
@ -522,7 +522,7 @@ GetSmcKeys (BOOLEAN WriteToSMC)
|
||||
gAppleSmc = NULL;
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
NewNameSize = NameSize;
|
||||
Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
@ -629,14 +629,14 @@ EFI_GUID
|
||||
#define DBG_DP(...)
|
||||
//#define DBG_DP(...) DBG(__VA_ARGS__)
|
||||
|
||||
/** Returns TRUE if dev paths are equal. Ignores some differences. */
|
||||
BOOLEAN
|
||||
/** Returns true if dev paths are equal. Ignores some differences. */
|
||||
XBool
|
||||
BootVolumeDevicePathEqual (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
|
||||
)
|
||||
{
|
||||
BOOLEAN Equal;
|
||||
XBool Equal;
|
||||
UINT8 Type1;
|
||||
UINT8 SubType1;
|
||||
UINT8 Type2;
|
||||
@ -645,14 +645,14 @@ BootVolumeDevicePathEqual (
|
||||
UINTN Len2;
|
||||
SATA_DEVICE_PATH *SataNode1;
|
||||
SATA_DEVICE_PATH *SataNode2;
|
||||
BOOLEAN ForceEqualNodes;
|
||||
XBool ForceEqualNodes;
|
||||
|
||||
|
||||
// DBG_DP (" BootVolumeDevicePathEqual:\n %ls\n %ls\n", FileDevicePathToStr (DevicePath1), FileDevicePathToStr (DevicePath2));
|
||||
// DBG_DP (" N1: (Type, Subtype, Len) N2: (Type, Subtype, Len)\n");
|
||||
|
||||
Equal = FALSE;
|
||||
while (TRUE) {
|
||||
Equal = false;
|
||||
while (true) {
|
||||
Type1 = DevicePathType (DevicePath1);
|
||||
SubType1 = DevicePathSubType (DevicePath1);
|
||||
Len1 = DevicePathNodeLength (DevicePath1);
|
||||
@ -661,7 +661,7 @@ BootVolumeDevicePathEqual (
|
||||
SubType2 = DevicePathSubType (DevicePath2);
|
||||
Len2 = DevicePathNodeLength (DevicePath2);
|
||||
|
||||
ForceEqualNodes = FALSE;
|
||||
ForceEqualNodes = false;
|
||||
|
||||
// DBG_DP (" N1: (%d, %d, %lld)", Type1, SubType1, Len1);
|
||||
// DBG_DP (" N2: (%d, %d, %lld)", Type2, SubType2, Len2);
|
||||
@ -681,12 +681,12 @@ BootVolumeDevicePathEqual (
|
||||
if (Type1 == MESSAGING_DEVICE_PATH && SubType1 == MSG_SATA_DP) {
|
||||
if ((Type2 == HARDWARE_DEVICE_PATH && SubType2 == HW_VENDOR_DP)
|
||||
|| (Type2 == MESSAGING_DEVICE_PATH && SubType2 == MSG_NVME_NAMESPACE_DP)) {
|
||||
ForceEqualNodes = TRUE;
|
||||
ForceEqualNodes = true;
|
||||
}
|
||||
} else if (Type2 == MESSAGING_DEVICE_PATH && SubType2 == MSG_SATA_DP &&
|
||||
((Type1 == HARDWARE_DEVICE_PATH && SubType1 == HW_VENDOR_DP)
|
||||
|| (Type1 == MESSAGING_DEVICE_PATH && SubType1 == MSG_NVME_NAMESPACE_DP))) {
|
||||
ForceEqualNodes = TRUE;
|
||||
ForceEqualNodes = true;
|
||||
}
|
||||
|
||||
//
|
||||
@ -694,7 +694,7 @@ BootVolumeDevicePathEqual (
|
||||
// we'll assume Acpi dev path nodes to be equal to cover that
|
||||
//
|
||||
if (Type1 == ACPI_DEVICE_PATH && Type2 == ACPI_DEVICE_PATH) {
|
||||
ForceEqualNodes = TRUE;
|
||||
ForceEqualNodes = true;
|
||||
}
|
||||
|
||||
if (ForceEqualNodes) {
|
||||
@ -716,7 +716,7 @@ BootVolumeDevicePathEqual (
|
||||
//
|
||||
if (IsDevicePathEnd (DevicePath1)) {
|
||||
// END node - they are the same
|
||||
Equal = TRUE;
|
||||
Equal = true;
|
||||
// DBG_DP (" - END = equal\n");
|
||||
break;
|
||||
}
|
||||
@ -760,8 +760,8 @@ BootVolumeDevicePathEqual (
|
||||
}
|
||||
|
||||
|
||||
/** Returns TRUE if dev paths contain the same MEDIA_DEVICE_PATH. */
|
||||
BOOLEAN
|
||||
/** Returns true if dev paths contain the same MEDIA_DEVICE_PATH. */
|
||||
XBool
|
||||
BootVolumeMediaDevicePathNodesEqual (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
|
||||
@ -769,12 +769,12 @@ BootVolumeMediaDevicePathNodesEqual (
|
||||
{
|
||||
DevicePath1 = Clover_FindDevicePathNodeWithType (DevicePath1, MEDIA_DEVICE_PATH, 0);
|
||||
if (DevicePath1 == NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
DevicePath2 = Clover_FindDevicePathNodeWithType (DevicePath2, MEDIA_DEVICE_PATH, 0);
|
||||
if (DevicePath2 == NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return (DevicePathNodeLength (DevicePath1) == DevicePathNodeLength (DevicePath1))
|
||||
@ -1177,7 +1177,7 @@ PutNvramPlistToRtVars ()
|
||||
keyTag->keyStringValue() == "BootNext"_XS8 ) {
|
||||
VendorGuid = &gEfiGlobalVariableGuid;
|
||||
// it may happen only in this case
|
||||
gSettings.Boot.HibernationFixup = TRUE;
|
||||
gSettings.Boot.HibernationFixup = true;
|
||||
}
|
||||
|
||||
// AsciiStrToUnicodeStrS(Tag.stringValue(), KeyBuf, 128);
|
||||
@ -1243,7 +1243,7 @@ FindStartupDiskVolume (
|
||||
// LOADER_ENTRY *LoaderEntry;
|
||||
// REFIT_VOLUME *Volume;
|
||||
REFIT_VOLUME *DiskVolume;
|
||||
BOOLEAN IsPartitionVolume;
|
||||
XBool IsPartitionVolume;
|
||||
XStringW LoaderPath;
|
||||
XStringW EfiBootVolumeStr;
|
||||
|
||||
|
@ -79,7 +79,7 @@ DeleteNvramVariable (
|
||||
void
|
||||
ResetNvram (void);
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsDeletableVariable (
|
||||
IN CHAR16 *Name,
|
||||
IN EFI_GUID *Guid
|
||||
@ -101,7 +101,7 @@ void
|
||||
PutNvramPlistToRtVars (void);
|
||||
|
||||
void
|
||||
GetSmcKeys(BOOLEAN WriteToSMC);
|
||||
GetSmcKeys(XBool WriteToSMC);
|
||||
#if CHECK_SMC
|
||||
void DumpSmcKeys();
|
||||
#endif
|
||||
|
@ -63,7 +63,7 @@ INTN OldChosenTheme;
|
||||
INTN OldChosenConfig;
|
||||
INTN OldChosenDsdt;
|
||||
UINTN OldChosenAudio;
|
||||
BOOLEAN SavePreBootLog;
|
||||
XBool SavePreBootLog;
|
||||
UINT8 DefaultAudioVolume;
|
||||
INTN LayoutBannerOffset = 64;
|
||||
INTN LayoutTextOffset = 0;
|
||||
@ -94,17 +94,17 @@ XStringWArray DsdtsList;
|
||||
XObjArray<HDA_OUTPUTS> AudioList;
|
||||
|
||||
// firmware
|
||||
BOOLEAN gFirmwareClover = FALSE;
|
||||
XBool gFirmwareClover = false;
|
||||
UINTN gEvent;
|
||||
UINT16 gBacklightLevel;
|
||||
//BOOLEAN defDSM;
|
||||
//UINT16 dropDSM;
|
||||
//XBool defDSM;
|
||||
//UINT16 dropDSM;
|
||||
|
||||
BOOLEAN ResumeFromCoreStorage = false;
|
||||
//BOOLEAN gRemapSmBiosIsRequire;
|
||||
XBool ResumeFromCoreStorage = false;
|
||||
//XBool gRemapSmBiosIsRequire;
|
||||
|
||||
// QPI
|
||||
//BOOLEAN SetTable132 = FALSE;
|
||||
//XBool SetTable132 = false;
|
||||
|
||||
//EG_PIXEL SelectionBackgroundPixel = { 0xef, 0xef, 0xef, 0xff }; //define in lib.h
|
||||
const INTN BCSMargin = 11;
|
||||
@ -186,7 +186,7 @@ XString8Array CUSTOM_LOADER_SUBENTRY::getLoadOptions() const
|
||||
return LoadOptions;
|
||||
}
|
||||
|
||||
UINT8 CUSTOM_LOADER_SUBENTRY::getFlags(bool NoCachesDefault) const
|
||||
UINT8 CUSTOM_LOADER_SUBENTRY::getFlags(XBool NoCachesDefault) const
|
||||
{
|
||||
UINT8 Flags = parent.getFlags(NoCachesDefault);
|
||||
if ( settings._Arguments.isDefined() ) Flags = OSFLAG_SET(Flags, OSFLAG_NODEFAULTARGS);
|
||||
@ -226,7 +226,7 @@ const XString8& CUSTOM_LOADER_SUBENTRY::getFullTitle() const {
|
||||
};
|
||||
|
||||
|
||||
bool SETTINGS_DATA::GUIClass::getDarkEmbedded(bool isDaylight) const {
|
||||
XBool SETTINGS_DATA::GUIClass::getDarkEmbedded(XBool isDaylight) const {
|
||||
if ( EmbeddedThemeType.isEqualIC("Dark") ) return true;
|
||||
if ( EmbeddedThemeType.isEqualIC("Daytime") ) return !isDaylight;
|
||||
return false;
|
||||
@ -369,17 +369,17 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
{
|
||||
ACPI_DROP_TABLE *DropTable = GlobalConfig.ACPIDropTables;
|
||||
DBG(" - [%02zd]: Drop table : %.4s, %16llx : ", idx, (const char*)&settingsData.ACPI.ACPIDropTablesArray[idx].Signature, settingsData.ACPI.ACPIDropTablesArray[idx].TableId);
|
||||
bool Dropped = FALSE;
|
||||
XBool Dropped = false;
|
||||
while (DropTable) {
|
||||
if (((settingsData.ACPI.ACPIDropTablesArray[idx].Signature == DropTable->Signature) &&
|
||||
(!settingsData.ACPI.ACPIDropTablesArray[idx].TableId || (DropTable->TableId == settingsData.ACPI.ACPIDropTablesArray[idx].TableId)) &&
|
||||
(!settingsData.ACPI.ACPIDropTablesArray[idx].TabLength || (DropTable->Length == settingsData.ACPI.ACPIDropTablesArray[idx].TabLength))) ||
|
||||
(!settingsData.ACPI.ACPIDropTablesArray[idx].Signature && (DropTable->TableId == settingsData.ACPI.ACPIDropTablesArray[idx].TableId))) {
|
||||
DropTable->MenuItem.BValue = TRUE;
|
||||
DropTable->MenuItem.BValue = true;
|
||||
DropTable->OtherOS = settingsData.ACPI.ACPIDropTablesArray[idx].OtherOS;
|
||||
GlobalConfig.DropSSDT = FALSE; // if one item=true then dropAll=false by default
|
||||
GlobalConfig.DropSSDT = false; // if one item=true then dropAll=false by default
|
||||
//DBG(" true");
|
||||
Dropped = TRUE;
|
||||
Dropped = true;
|
||||
}
|
||||
DropTable = DropTable->Next;
|
||||
}
|
||||
@ -419,7 +419,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// DBG("4: GlobalConfig.C3Latency=%x\n", GlobalConfig.C3Latency);
|
||||
|
||||
if (settingsData.CPU.HWPEnable && (gCPUStructure.Model >= CPU_MODEL_SKYLAKE_U)) {
|
||||
GlobalConfig.HWP = TRUE;
|
||||
GlobalConfig.HWP = true;
|
||||
AsmWriteMsr64 (MSR_IA32_PM_ENABLE, 1);
|
||||
if ( settingsData.CPU.HWPValue.isDefined() ) {
|
||||
AsmWriteMsr64 (MSR_IA32_HWP_REQUEST, settingsData.CPU.HWPValue.value());
|
||||
@ -467,7 +467,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
if (NowHour >= 24 ) NowHour -= 24;
|
||||
ThemeX.Daylight = (NowHour > 8) && (NowHour < 20);
|
||||
} else {
|
||||
ThemeX.Daylight = TRUE;
|
||||
ThemeX.Daylight = true;
|
||||
}
|
||||
|
||||
ThemeX.DarkEmbedded = settingsData.GUI.getDarkEmbedded(ThemeX.Daylight);
|
||||
@ -586,7 +586,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// NGFX = 0;
|
||||
// NHDA = 0;
|
||||
// AudioList.setEmpty();
|
||||
// //Arpt.Valid = FALSE; //global variables initialized by 0 - c-language
|
||||
// //Arpt.Valid = false; //global variables initialized by 0 - c-language
|
||||
// XStringW GopDevicePathStr;
|
||||
// XStringW DevicePathStr;
|
||||
//
|
||||
@ -694,13 +694,13 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// }
|
||||
// gfx->Connectors = *(UINT32*)(gfx->Mmio + RADEON_BIOS_0_SCRATCH);
|
||||
// // DBG(" - RADEON_BIOS_0_SCRATCH = 0x%08X\n", gfx->Connectors);
|
||||
// gfx->ConnChanged = FALSE;
|
||||
// gfx->ConnChanged = false;
|
||||
//
|
||||
// SlotDevice = &gSettings.Smbios.SlotDevices[0];
|
||||
// SlotDevice->SegmentGroupNum = (UINT16)Segment;
|
||||
// SlotDevice->BusNum = (UINT8)Bus;
|
||||
// SlotDevice->DevFuncNum = (UINT8)((Device << 3) | (Function & 0x07));
|
||||
// SlotDevice->Valid = TRUE;
|
||||
// SlotDevice->Valid = true;
|
||||
// SlotDevice->SlotName = "PCI Slot 0"_XS8;
|
||||
// SlotDevice->SlotID = 1;
|
||||
// SlotDevice->SlotType = SlotTypePciExpressX16;
|
||||
@ -712,7 +712,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// DBG(" - GFX: Model=%s (Intel)\n", gfx->Model);
|
||||
// gfx->Ports = 1;
|
||||
// gfx->Connectors = (1 << NGFX);
|
||||
// gfx->ConnChanged = FALSE;
|
||||
// gfx->ConnChanged = false;
|
||||
// break;
|
||||
//
|
||||
// case 0x10de:
|
||||
@ -767,7 +767,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// SlotDevice->SegmentGroupNum = (UINT16)Segment;
|
||||
// SlotDevice->BusNum = (UINT8)Bus;
|
||||
// SlotDevice->DevFuncNum = (UINT8)((Device << 3) | (Function & 0x07));
|
||||
// SlotDevice->Valid = TRUE;
|
||||
// SlotDevice->Valid = true;
|
||||
// SlotDevice->SlotName = "PCI Slot 0"_XS8;
|
||||
// SlotDevice->SlotID = 1;
|
||||
// SlotDevice->SlotType = SlotTypePciExpressX16;
|
||||
@ -778,7 +778,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// snprintf (gfx->Model, 64, "pci%hx,%hx", Pci.Hdr.VendorId, Pci.Hdr.DeviceId);
|
||||
// gfx->Ports = 1;
|
||||
// gfx->Connectors = (1 << NGFX);
|
||||
// gfx->ConnChanged = FALSE;
|
||||
// gfx->ConnChanged = false;
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
@ -792,7 +792,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// SlotDevice->SegmentGroupNum = (UINT16)Segment;
|
||||
// SlotDevice->BusNum = (UINT8)Bus;
|
||||
// SlotDevice->DevFuncNum = (UINT8)((Device << 3) | (Function & 0x07));
|
||||
// SlotDevice->Valid = TRUE;
|
||||
// SlotDevice->Valid = true;
|
||||
// SlotDevice->SlotName = "AirPort"_XS8;
|
||||
// SlotDevice->SlotID = 0;
|
||||
// SlotDevice->SlotType = SlotTypePciExpressX1;
|
||||
@ -830,7 +830,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// SlotDevice->SegmentGroupNum = (UINT16)Segment;
|
||||
// SlotDevice->BusNum = (UINT8)Bus;
|
||||
// SlotDevice->DevFuncNum = (UINT8)((Device << 3) | (Function & 0x07));
|
||||
// SlotDevice->Valid = TRUE;
|
||||
// SlotDevice->Valid = true;
|
||||
// SlotDevice->SlotName = "Ethernet"_XS8;
|
||||
// SlotDevice->SlotID = 2;
|
||||
// SlotDevice->SlotType = SlotTypePciExpressX1;
|
||||
@ -875,7 +875,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// SlotDevice->SegmentGroupNum = (UINT16)Segment;
|
||||
// SlotDevice->BusNum = (UINT8)Bus;
|
||||
// SlotDevice->DevFuncNum = (UINT8)((Device << 3) | (Function & 0x07));
|
||||
// SlotDevice->Valid = TRUE;
|
||||
// SlotDevice->Valid = true;
|
||||
// SlotDevice->SlotName = "FireWire"_XS8;
|
||||
// SlotDevice->SlotID = 3;
|
||||
// SlotDevice->SlotType = SlotTypePciExpressX4;
|
||||
@ -902,7 +902,7 @@ void afterGetUserSettings(SETTINGS_DATA& settingsData)
|
||||
// SlotDevice->SegmentGroupNum = (UINT16)Segment;
|
||||
// SlotDevice->BusNum = (UINT8)Bus;
|
||||
// SlotDevice->DevFuncNum = (UINT8)((Device << 3) | (Function & 0x07));
|
||||
// SlotDevice->Valid = TRUE;
|
||||
// SlotDevice->Valid = true;
|
||||
// SlotDevice->SlotName = "HDMI port"_XS8;
|
||||
// SlotDevice->SlotID = 5;
|
||||
// SlotDevice->SlotType = SlotTypePciExpressX4;
|
||||
@ -943,8 +943,8 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
UINTN Bus;
|
||||
UINTN Device;
|
||||
UINTN Function;
|
||||
BOOLEAN StringDirty = FALSE;
|
||||
BOOLEAN TmpDirty = FALSE;
|
||||
XBool StringDirty = false;
|
||||
XBool TmpDirty = false;
|
||||
UINT32 Rcba;
|
||||
UINT32 Hptc;
|
||||
DevPropDevice *device = NULL;
|
||||
@ -990,7 +990,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
}else{
|
||||
DBG("Skip disabled properties with Path=%ls, Key=%s\n", Prop.DevicePathAsString.wc_str(), Prop2.Key.c_str());
|
||||
}
|
||||
StringDirty = TRUE;
|
||||
StringDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1022,9 +1022,9 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
PCIdevice.revision = Pci.Hdr.RevisionID;
|
||||
PCIdevice.subclass = Pci.Hdr.ClassCode[0];
|
||||
PCIdevice.class_id = *((UINT16*)(Pci.Hdr.ClassCode+1));
|
||||
PCIdevice.subsys_id.subsys.vendor_id = Pci.Device.SubsystemVendorID;
|
||||
PCIdevice.subsys_id.subsys.device_id = Pci.Device.SubsystemID;
|
||||
PCIdevice.used = FALSE;
|
||||
PCIdevice.subsys_id_union.subsys.vendor_id = Pci.Device.SubsystemVendorID;
|
||||
PCIdevice.subsys_id_union.subsys.device_id = Pci.Device.SubsystemID;
|
||||
PCIdevice.used = false;
|
||||
|
||||
//if (gSettings.Devices.AddPropertyArray.size() == 0xFFFE) { //yyyy it means Arbitrary // Looks like NrAddProperties == 0xFFFE is not used anymore
|
||||
//------------------
|
||||
@ -1039,7 +1039,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
}
|
||||
if (!PCIdevice.used) {
|
||||
device = devprop_add_device_pci(device_inject_string, &PCIdevice, NULL);
|
||||
PCIdevice.used = TRUE;
|
||||
PCIdevice.used = true;
|
||||
}
|
||||
for ( size_t jdx = 0 ; jdx < Prop.CustomPropertyArray.size() ; ++jdx ) {
|
||||
const SETTINGS_DATA::DevicesClass::SimplePropertyClass& Prop2 = Prop.CustomPropertyArray[jdx];
|
||||
@ -1051,7 +1051,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
devprop_add_value(device, Prop2.Key, Prop2.Value);
|
||||
}
|
||||
}
|
||||
StringDirty = TRUE;
|
||||
StringDirty = true;
|
||||
}
|
||||
}
|
||||
//------------------
|
||||
@ -1796,7 +1796,7 @@ SetDevices (LOADER_ENTRY *Entry)
|
||||
mProperties = (UINT8*)(UINTN)BufferPtr;
|
||||
// DBG(gDeviceProperties);
|
||||
// DBG("\n");
|
||||
// StringDirty = FALSE;
|
||||
// StringDirty = false;
|
||||
//-------
|
||||
mPropSize = (UINT32)hex2bin(newDeviceProperties, mProperties, EFI_PAGES_TO_SIZE(nbPages)); // cast should be safe as hex2bin return <= MAXUINT32
|
||||
gDeviceProperties = newDeviceProperties.forgetDataWithoutFreeing(); // do this AFTER hex2bin
|
||||
@ -1859,7 +1859,7 @@ ApplySettings()
|
||||
|
||||
// to determine the use of Table 132
|
||||
if (gSettings.CPU.QPI) {
|
||||
GlobalConfig.SetTable132 = TRUE;
|
||||
GlobalConfig.SetTable132 = true;
|
||||
//DBG("QPI: use Table 132\n");
|
||||
}
|
||||
else {
|
||||
@ -1868,7 +1868,7 @@ ApplySettings()
|
||||
case CPU_MODEL_WESTMERE:// Core i7 LGA1366, Six-core, "Westmere", "Gulftown", 32nm
|
||||
case CPU_MODEL_NEHALEM_EX:// Core i7, Nehalem-Ex Xeon, "Beckton"
|
||||
case CPU_MODEL_WESTMERE_EX:// Core i7, Nehalem-Ex Xeon, "Eagleton"
|
||||
GlobalConfig.SetTable132 = TRUE;
|
||||
GlobalConfig.SetTable132 = true;
|
||||
DBG("QPI: use Table 132\n");
|
||||
break;
|
||||
default:
|
||||
@ -1882,7 +1882,7 @@ ApplySettings()
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
XStringW GetOtherKextsDir (BOOLEAN On)
|
||||
XStringW GetOtherKextsDir (XBool On)
|
||||
{
|
||||
if ( !selfOem.isKextsDirFound() ) return NullXStringW;
|
||||
if ( FileExists(&selfOem.getKextsDir(), On ? L"Other" : L"Off") ) {
|
||||
@ -1943,11 +1943,11 @@ XStringW GetOSVersionKextsDir(const MacOsVersion& OSVersion)
|
||||
// Do we need that with OC ? For old version ?
|
||||
//EFI_STATUS LOADER_ENTRY::SetFSInjection()
|
||||
//{
|
||||
// EFI_STATUS Status;
|
||||
// EFI_STATUS Status;
|
||||
// FSINJECTION_PROTOCOL *FSInject;
|
||||
// XStringW SrcDir;
|
||||
// //BOOLEAN InjectionNeeded = FALSE;
|
||||
// //BOOLEAN BlockCaches = FALSE;
|
||||
// //XBool InjectionNeeded = false;
|
||||
// //XBool BlockCaches = false;
|
||||
// FSI_STRING_LIST *Blacklist = 0;
|
||||
// FSI_STRING_LIST *ForceLoadKexts = NULL;
|
||||
//
|
||||
@ -1964,7 +1964,7 @@ XStringW GetOSVersionKextsDir(const MacOsVersion& OSVersion)
|
||||
// // check if blocking of caches is needed
|
||||
// if ( OSFLAG_ISSET(Flags, OSFLAG_NOCACHES) || LoadOptions.contains("-f") ) {
|
||||
// MsgLog ("Blocking kext caches\n");
|
||||
// // BlockCaches = TRUE;
|
||||
// // BlockCaches = true;
|
||||
// // add caches to blacklist
|
||||
// Blacklist = FSInject->CreateStringList();
|
||||
// if (Blacklist == NULL) {
|
||||
@ -2030,7 +2030,7 @@ XStringW GetOSVersionKextsDir(const MacOsVersion& OSVersion)
|
||||
// // (will be done only if caches are blocked or if boot.efi refuses to load kernelcache)
|
||||
// //SrcDir = NULL;
|
||||
// if (OSFLAG_ISSET(Flags, OSFLAG_WITHKEXTS)) {
|
||||
// SrcDir = GetOtherKextsDir(TRUE);
|
||||
// SrcDir = GetOtherKextsDir(true);
|
||||
// Status = FSInject->Install(
|
||||
// Volume->DeviceHandle,
|
||||
// L"\\System\\Library\\Extensions",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -70,7 +70,7 @@ static void SmbiosFillPatchingValues(const SETTINGS_DATA::SmbiosClass::RamSlotIn
|
||||
SmbiosFillPatchingValues(other.User, &Memory._User);
|
||||
}
|
||||
|
||||
void SmbiosFillPatchingValues(bool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr)
|
||||
void SmbiosFillPatchingValues(XBool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr)
|
||||
{
|
||||
SmbiosInjectedSettings& smbiosInjectedSetting = *smbiosInjectedSettingsPtr;
|
||||
// from CPUStructure
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "../Platform/Settings.h"
|
||||
#include "../Platform/smbios.h"
|
||||
|
||||
void SmbiosFillPatchingValues(bool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr);
|
||||
void SmbiosFillPatchingValues(XBool _SetTable132, uint8_t pEnabledCores, uint16_t pRamSlotCount, const SlotDeviceArrayClass& SlotDeviceArray, const SETTINGS_DATA& globalSettings, const CPU_STRUCTURE& CPUStructure, SmbiosInjectedSettings* smbiosInjectedSettingsPtr);
|
||||
|
||||
|
||||
|
||||
|
@ -369,12 +369,12 @@ DONE:
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS CheckSyncSound(BOOLEAN Stop)
|
||||
EFI_STATUS CheckSyncSound(XBool Stop)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
AUDIO_IO_PRIVATE_DATA *AudioIoPrivateData;
|
||||
EFI_HDA_IO_PROTOCOL *HdaIo;
|
||||
BOOLEAN StreamRunning = FALSE;
|
||||
BOOLEAN StreamRunning = false;
|
||||
if (!AudioIo) {
|
||||
return EFI_NOT_STARTED;
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ StartupSoundPlay(const EFI_FILE* Dir, CONST CHAR16* SoundFile);
|
||||
|
||||
void GetOutputs();
|
||||
|
||||
EFI_STATUS CheckSyncSound(BOOLEAN Stop);
|
||||
EFI_STATUS CheckSyncSound(XBool Stop);
|
||||
|
||||
#endif /* PLATFORM_STARTUPSOUND_H_ */
|
||||
|
@ -113,9 +113,9 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
|
||||
if (gMobile) {
|
||||
switch (gCPUStructure.Model) {
|
||||
case CPU_MODEL_IVY_BRIDGE:
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "U")) {
|
||||
if ( gCPUStructure.BrandString.contains("U") ) {
|
||||
Aplf = 0;
|
||||
} else if (AsciiStrStr(gCPUStructure.BrandString, "M")) {
|
||||
} else if ( gCPUStructure.BrandString.contains("M") ) {
|
||||
Aplf = 4;
|
||||
}
|
||||
break;
|
||||
@ -137,7 +137,7 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gSettings.ACPI.SSDT.Generate.GenerateAPLF = FALSE;
|
||||
gSettings.ACPI.SSDT.Generate.GenerateAPLF = false;
|
||||
}
|
||||
|
||||
if (Number > 0) {
|
||||
@ -503,11 +503,11 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number)
|
||||
|
||||
SSDT_TABLE *generate_cst_ssdt(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, UINTN Number)
|
||||
{
|
||||
BOOLEAN c2_enabled = GlobalConfig.EnableC2;
|
||||
BOOLEAN c3_enabled;
|
||||
BOOLEAN c4_enabled = GlobalConfig.EnableC4;
|
||||
// BOOLEAN c6_enabled = GlobalConfig.EnableC6;
|
||||
BOOLEAN cst_using_systemio = gSettings.ACPI.SSDT.EnableISS;
|
||||
XBool c2_enabled = GlobalConfig.EnableC2;
|
||||
XBool c3_enabled;
|
||||
XBool c4_enabled = GlobalConfig.EnableC4;
|
||||
// XBool c6_enabled = GlobalConfig.EnableC6;
|
||||
XBool cst_using_systemio = gSettings.ACPI.SSDT.EnableISS;
|
||||
UINT8 p_blk_lo, p_blk_hi;
|
||||
UINT8 cstates_count;
|
||||
UINT32 acpi_cpu_p_blk;
|
||||
|
@ -53,12 +53,12 @@ UINT8 hexstrtouint8 (const CHAR8* buf)
|
||||
return i;
|
||||
}
|
||||
|
||||
BOOLEAN IsHexDigit(char c) {
|
||||
return (IS_DIGIT(c) || (IS_HEX(c)))?TRUE:FALSE;
|
||||
XBool IsHexDigit(char c) {
|
||||
return (IS_DIGIT(c) || (IS_HEX(c)))?true:false;
|
||||
}
|
||||
|
||||
BOOLEAN IsHexDigit(wchar_t c) {
|
||||
return (IS_DIGIT(c) || (IS_HEX(c)))?TRUE:FALSE;
|
||||
XBool IsHexDigit(wchar_t c) {
|
||||
return (IS_DIGIT(c) || (IS_HEX(c)))?true:false;
|
||||
}
|
||||
|
||||
//out value is a number of byte. out = len
|
||||
@ -72,7 +72,7 @@ BOOLEAN IsHexDigit(wchar_t c) {
|
||||
//
|
||||
// if (hex == NULL || bin == NULL || len <= 0 || AsciiStrLen(hex) < len * 2) {
|
||||
// // DBG("[ERROR] bin2hex input error\n"); //this is not error, this is empty value
|
||||
// return FALSE;
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// buf[2] = '\0';
|
||||
@ -143,5 +143,5 @@ UINT32 GetCrc32(UINT8 *Buffer, UINTN Size)
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN haveError = FALSE;
|
||||
XBool haveError = false;
|
||||
|
||||
|
@ -35,12 +35,12 @@
|
||||
#define IS_PUNCT(x) ((x == '.') || (x == '-'))
|
||||
#define IS_BLANK(x) ((x == ' ') || (x == '\t'))
|
||||
|
||||
inline bool isPathSeparator(char32_t c) { return c == '/' || c == '\\'; }
|
||||
inline XBool isPathSeparator(char32_t c) { return c == '/' || c == '\\'; }
|
||||
|
||||
|
||||
////void LowCase (IN OUT CHAR8 *Str);
|
||||
//UINT32 hex2bin(IN const CHAR8 *hex, OUT UINT8 *bin, UINT32 len);
|
||||
BOOLEAN IsHexDigit (CHAR8 c);
|
||||
XBool IsHexDigit (CHAR8 c);
|
||||
UINT8 hexstrtouint8 (CONST CHAR8* buf); //one or two hex letters to one byte
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ UINT32 GetCrc32(UINT8 *Buffer, UINTN Size);
|
||||
|
||||
|
||||
|
||||
extern BOOLEAN haveError;
|
||||
extern XBool haveError;
|
||||
|
||||
|
||||
#endif // __cplusplus
|
||||
|
@ -25,9 +25,9 @@ GetRootUUID (IN REFIT_VOLUME *Volume)
|
||||
CONST CHAR16* SystemPlistP;
|
||||
CONST CHAR16* SystemPlistS;
|
||||
|
||||
BOOLEAN HasRock;
|
||||
BOOLEAN HasPaper;
|
||||
BOOLEAN HasScissors;
|
||||
XBool HasRock;
|
||||
XBool HasPaper;
|
||||
XBool HasScissors;
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
if (Volume == NULL) {
|
||||
|
@ -37,11 +37,11 @@ public:
|
||||
XStringW VolLabel = XStringW(); // comes from \\.VolumeLabel.txt, or empty.
|
||||
UINT8 DiskKind = 0;
|
||||
LEGACY_OS *LegacyOS = 0;
|
||||
BOOLEAN Hidden = 0;
|
||||
XBool Hidden = false;
|
||||
UINT8 BootType = 0;
|
||||
BOOLEAN IsAppleLegacy = 0;
|
||||
BOOLEAN HasBootCode = 0;
|
||||
BOOLEAN IsMbrPartition = 0;
|
||||
XBool IsAppleLegacy = false;
|
||||
XBool HasBootCode = false;
|
||||
XBool IsMbrPartition = false;
|
||||
UINTN MbrPartitionIndex = 0;
|
||||
EFI_BLOCK_IO *BlockIO = 0;
|
||||
UINT64 BlockIOOffset = 0;
|
||||
|
@ -1169,82 +1169,82 @@ const CHAR8 *chip_family_name[] = {
|
||||
};
|
||||
|
||||
AtiDevProp ati_devprop_list[] = {
|
||||
{FLAGTRUE, FALSE, "@0,AAPL,boot-display", get_bootdisplay_val, NULVAL },
|
||||
// {FLAGTRUE, FALSE, "@0,ATY,EFIDisplay", NULL, STRVAL("TMDSA") },
|
||||
{FLAGTRUE, false, "@0,AAPL,boot-display", get_bootdisplay_val, NULVAL },
|
||||
// {FLAGTRUE, false, "@0,ATY,EFIDisplay", NULL, STRVAL("TMDSA") },
|
||||
|
||||
//{FLAGTRUE, TRUE, "@0,AAPL,vram-memory", get_vrammemory_val, NULVAL },
|
||||
{FLAGDYNAMIC, TRUE, "AAPL00,override-no-connect", get_edid_val, NULVAL },
|
||||
{FLAGNOTFAKE, TRUE, "@0,compatible", get_name_val, NULVAL },
|
||||
{FLAGTRUE, TRUE, "@0,connector-type", get_conntype_val, NULVAL },
|
||||
{FLAGTRUE, TRUE, "@0,device_type", NULL, STRVAL("display") },
|
||||
// {FLAGTRUE, FALSE, "@0,display-connect-flags", NULL, DWRVAL(0) },
|
||||
//{FLAGTRUE, true, "@0,AAPL,vram-memory", get_vrammemory_val, NULVAL },
|
||||
{FLAGDYNAMIC, true, "AAPL00,override-no-connect", get_edid_val, NULVAL },
|
||||
{FLAGNOTFAKE, true, "@0,compatible", get_name_val, NULVAL },
|
||||
{FLAGTRUE, true, "@0,connector-type", get_conntype_val, NULVAL },
|
||||
{FLAGTRUE, true, "@0,device_type", NULL, STRVAL("display") },
|
||||
// {FLAGTRUE, false, "@0,display-connect-flags", NULL, DWRVAL(0) },
|
||||
|
||||
//some set of properties for mobile radeons
|
||||
{FLAGMOBILE, FALSE, "@0,display-link-component-bits", NULL, DWRVAL(6) },
|
||||
{FLAGMOBILE, FALSE, "@0,display-pixel-component-bits", NULL, DWRVAL(6) },
|
||||
{FLAGMOBILE, FALSE, "@0,display-dither-support", NULL, DWRVAL(0) },
|
||||
{FLAGMOBILE, FALSE, "@0,backlight-control", NULL, DWRVAL(1) },
|
||||
{FLAGTRUE, FALSE, "AAPL00,Dither", NULL, DWRVAL(0) },
|
||||
{FLAGMOBILE, false, "@0,display-link-component-bits", NULL, DWRVAL(6) },
|
||||
{FLAGMOBILE, false, "@0,display-pixel-component-bits", NULL, DWRVAL(6) },
|
||||
{FLAGMOBILE, false, "@0,display-dither-support", NULL, DWRVAL(0) },
|
||||
{FLAGMOBILE, false, "@0,backlight-control", NULL, DWRVAL(1) },
|
||||
{FLAGTRUE, false, "AAPL00,Dither", NULL, DWRVAL(0) },
|
||||
|
||||
|
||||
// {FLAGTRUE, TRUE, "@0,display-type", NULL, STRVAL("NONE") },
|
||||
{FLAGTRUE, TRUE, "@0,name", get_name_val, NULVAL },
|
||||
{FLAGTRUE, TRUE, "@0,VRAM,memsize", get_vrammemsize_val, NULVAL },
|
||||
// {FLAGTRUE, TRUE, "@0,ATY,memsize", get_vrammemsize_val, NULVAL },
|
||||
// {FLAGTRUE, true, "@0,display-type", NULL, STRVAL("NONE") },
|
||||
{FLAGTRUE, true, "@0,name", get_name_val, NULVAL },
|
||||
{FLAGTRUE, true, "@0,VRAM,memsize", get_vrammemsize_val, NULVAL },
|
||||
// {FLAGTRUE, true, "@0,ATY,memsize", get_vrammemsize_val, NULVAL },
|
||||
|
||||
{FLAGTRUE, FALSE, "AAPL,aux-power-connected", NULL, DWRVAL(1) },
|
||||
{FLAGTRUE, FALSE, "AAPL00,DualLink", get_dual_link_val, NULVAL },
|
||||
{FLAGMOBILE, FALSE, "AAPL,HasPanel", NULL, DWRVAL(1) },
|
||||
{FLAGMOBILE, FALSE, "AAPL,HasLid", NULL, DWRVAL(1) },
|
||||
{FLAGMOBILE, FALSE, "AAPL,backlight-control", NULL, DWRVAL(1) },
|
||||
{FLAGTRUE, FALSE, "AAPL,overwrite_binimage", get_binimage_owr, NULVAL },
|
||||
{FLAGDYNAMIC, FALSE, "ATY,bin_image", get_binimage_val, NULVAL },
|
||||
{FLAGTRUE, FALSE, "ATY,Copyright", NULL, STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2011") },
|
||||
{FLAGTRUE, FALSE, "ATY,EFIVersion", NULL, STRVAL("01.00.3180") },
|
||||
{FLAGTRUE, FALSE, "ATY,Card#", get_romrevision_val, NULVAL },
|
||||
// {FLAGTRUE, FALSE, "ATY,Rom#", NULL, STRVAL("www.amd.com") },
|
||||
{FLAGNOTFAKE, FALSE, "ATY,VendorID", NULL, WRDVAL(0x1002) },
|
||||
{FLAGNOTFAKE, FALSE, "ATY,DeviceID", get_deviceid_val, NULVAL },
|
||||
{FLAGTRUE, false, "AAPL,aux-power-connected", NULL, DWRVAL(1) },
|
||||
{FLAGTRUE, false, "AAPL00,DualLink", get_dual_link_val, NULVAL },
|
||||
{FLAGMOBILE, false, "AAPL,HasPanel", NULL, DWRVAL(1) },
|
||||
{FLAGMOBILE, false, "AAPL,HasLid", NULL, DWRVAL(1) },
|
||||
{FLAGMOBILE, false, "AAPL,backlight-control", NULL, DWRVAL(1) },
|
||||
{FLAGTRUE, false, "AAPL,overwrite_binimage", get_binimage_owr, NULVAL },
|
||||
{FLAGDYNAMIC, false, "ATY,bin_image", get_binimage_val, NULVAL },
|
||||
{FLAGTRUE, false, "ATY,Copyright", NULL, STRVAL("Copyright AMD Inc. All Rights Reserved. 2005-2011") },
|
||||
{FLAGTRUE, false, "ATY,EFIVersion", NULL, STRVAL("01.00.3180") },
|
||||
{FLAGTRUE, false, "ATY,Card#", get_romrevision_val, NULVAL },
|
||||
// {FLAGTRUE, false, "ATY,Rom#", NULL, STRVAL("www.amd.com") },
|
||||
{FLAGNOTFAKE, false, "ATY,VendorID", NULL, WRDVAL(0x1002) },
|
||||
{FLAGNOTFAKE, false, "ATY,DeviceID", get_deviceid_val, NULVAL },
|
||||
|
||||
// {FLAGTRUE, FALSE, "ATY,MCLK", get_mclk_val, NULVAL },
|
||||
// {FLAGTRUE, FALSE, "ATY,SCLK", get_sclk_val, NULVAL },
|
||||
{FLAGTRUE, FALSE, "ATY,RefCLK", get_refclk_val, DWRVAL(0x0a8c) },
|
||||
// {FLAGTRUE, false, "ATY,MCLK", get_mclk_val, NULVAL },
|
||||
// {FLAGTRUE, false, "ATY,SCLK", get_sclk_val, NULVAL },
|
||||
{FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL(0x0a8c) },
|
||||
|
||||
{FLAGTRUE, FALSE, "ATY,PlatformInfo", get_platforminfo_val, NULVAL },
|
||||
{FLAGOLD, FALSE, "compatible", get_name_pci_val, NULVAL },
|
||||
{FLAGTRUE, FALSE, "name", get_nameparent_val, NULVAL },
|
||||
{FLAGTRUE, FALSE, "device_type", get_nameparent_val, NULVAL },
|
||||
{FLAGTRUE, FALSE, "model", get_model_val, STRVAL("ATI Radeon")},
|
||||
// {FLAGTRUE, FALSE, "VRAM,totalsize", get_vramtotalsize_val, NULVAL },
|
||||
{FLAGTRUE, false, "ATY,PlatformInfo", get_platforminfo_val, NULVAL },
|
||||
{FLAGOLD, false, "compatible", get_name_pci_val, NULVAL },
|
||||
{FLAGTRUE, false, "name", get_nameparent_val, NULVAL },
|
||||
{FLAGTRUE, false, "device_type", get_nameparent_val, NULVAL },
|
||||
{FLAGTRUE, false, "model", get_model_val, STRVAL("ATI Radeon")},
|
||||
// {FLAGTRUE, false, "VRAM,totalsize", get_vramtotalsize_val, NULVAL },
|
||||
|
||||
{FLAGTRUE, FALSE, NULL, NULL, NULVAL}
|
||||
{FLAGTRUE, false, NULL, NULL, NULVAL}
|
||||
};
|
||||
|
||||
BOOLEAN get_bootdisplay_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_bootdisplay_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
static UINT32 v = 0;
|
||||
|
||||
if (v) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (!card->posted) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
v = 1;
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocatePool(4);
|
||||
*(val->data) = (UINT8)v;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_dual_link_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_dual_link_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
UINT32 DualLink = 1;
|
||||
static UINT32 v = 0;
|
||||
|
||||
if (v) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((gSettings.Graphics.DualLink == 0) || (gSettings.Graphics.DualLink == 1)) {
|
||||
@ -1257,40 +1257,40 @@ BOOLEAN get_dual_link_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocatePool(4);
|
||||
*(val->data) = (UINT8)v;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN get_vrammemory_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_vrammemory_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOLEAN get_edid_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_edid_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
static UINT32 v = 0;
|
||||
if (!gSettings.Graphics.EDID.InjectEDID) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (v) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
//CustomEDID will point to user EDID if set else to EdidDiscovered
|
||||
if (gSettings.Graphics.EDID.CustomEDID.isEmpty()) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
v = 1;
|
||||
val->type = kPtr;
|
||||
val->size = 128;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, gSettings.Graphics.EDID.CustomEDID.data());
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static CONST CHAR8* dtyp[] = {"LCD", "CRT", "DVI", "NONE"};
|
||||
static UINT32 dti = 0;
|
||||
|
||||
BOOLEAN get_display_type(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_display_type(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
|
||||
dti++;
|
||||
@ -1300,47 +1300,47 @@ BOOLEAN get_display_type(value_t *val, INTN index, BOOLEAN Sier)
|
||||
val->type = kStr;
|
||||
val->size = (UINT32)AsciiStrSize(dtyp[dti]);
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, (UINT8 *)dtyp[dti]);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN get_name_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_name_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
val->type = aty_name.type;
|
||||
val->size = aty_name.size;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(aty_name.size, (UINT8 *)aty_name.data);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_nameparent_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_nameparent_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
val->type = aty_nameparent.type;
|
||||
val->size = aty_nameparent.size;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(aty_nameparent.size, (UINT8 *)aty_nameparent.data);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//static CHAR8 pciName[15];
|
||||
BOOLEAN get_name_pci_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_name_pci_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
CHAR8* pciName = (__typeof__(pciName))AllocateZeroPool(15);
|
||||
|
||||
if (!card->info->model_name || !gSettings.Devices.FakeID.FakeATI) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
snprintf(pciName, 15, "pci1002,%x", gSettings.Devices.FakeID.FakeATI >> 16);
|
||||
val->type = kStr;
|
||||
val->size = 13;
|
||||
val->data = (UINT8 *)pciName;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_model_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_model_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
CHAR8 *ModelName = (__typeof__(ModelName))AllocateZeroPool(35);
|
||||
if (!card->info->model_name) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
val->type = kStr;
|
||||
if (card->pci_dev->device_id != 0x67DF) {
|
||||
@ -1374,7 +1374,7 @@ BOOLEAN get_model_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, ModelName);
|
||||
}
|
||||
FreePool(ModelName);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//static CONST UINT32 ctm[] = {0x02, 0x10, 0x800, 0x400}; //mobile
|
||||
@ -1384,7 +1384,7 @@ BOOLEAN get_model_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
KERNEL_AND_KEXT_PATCHES *CurrentPatches;
|
||||
|
||||
//TODO - get connectors from ATIConnectorsPatch
|
||||
BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_conntype_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
UINT8 *ct;
|
||||
INTN Len;
|
||||
@ -1396,7 +1396,7 @@ BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
//0x02: LVDS
|
||||
|
||||
if ((CurrentPatches == NULL) || (CurrentPatches->KPATIConnectorsData.isEmpty())) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
ct = CurrentPatches->KPATIConnectorsPatch.data();
|
||||
Len = Sier?24:16;
|
||||
@ -1413,10 +1413,10 @@ BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
// cti++;
|
||||
// if(cti > 3) cti = 0;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_vrammemsize_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_vrammemsize_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
static INTN idx = -1;
|
||||
UINT64 memsize;
|
||||
@ -1429,33 +1429,33 @@ BOOLEAN get_vrammemsize_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
val->type = kCst;
|
||||
val->size = 8;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, (UINT8 *)&memsize);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_binimage_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_binimage_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
if (!card->rom) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
val->type = kPtr;
|
||||
val->size = card->rom_size;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, (UINT8 *)card->rom);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_binimage_owr(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_binimage_owr(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
if (!gSettings.Graphics.LoadVBios) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocatePool(4);
|
||||
*(val->data) = 1;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_romrevision_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
CONST CHAR8* cRev="109-B77101-00";
|
||||
UINT8 *rev;
|
||||
@ -1463,7 +1463,7 @@ BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
val->type = kPtr;
|
||||
val->size = 13;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, cRev);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
rev = card->rom + *(UINT8 *)(card->rom + OFFSET_TO_GET_ATOMBIOS_STRINGS_START);
|
||||
@ -1475,60 +1475,60 @@ BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
val->size = 13;
|
||||
}
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, rev);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_deviceid_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_deviceid_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
val->type = kCst;
|
||||
val->size = 2;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, (UINT8 *)&card->pci_dev->device_id);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_mclk_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_mclk_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOLEAN get_sclk_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_sclk_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOLEAN get_refclk_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_refclk_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
if (!gSettings.Graphics.RefCLK) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
//
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, (UINT8 *)&gSettings.Graphics.RefCLK);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_platforminfo_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_platforminfo_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
val->data = (__typeof__(val->data))AllocateZeroPool(0x80);
|
||||
if (!val->data)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
// bzero(val->data, 0x80);
|
||||
|
||||
val->type = kPtr;
|
||||
val->size = 0x80;
|
||||
val->data[0] = 1;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN get_vramtotalsize_val(value_t *val, INTN index, BOOLEAN Sier)
|
||||
XBool get_vramtotalsize_val(value_t *val, INTN index, XBool Sier)
|
||||
{
|
||||
|
||||
val->type = kCst;
|
||||
val->size = 4;
|
||||
val->data = (__typeof__(val->data))AllocateCopyPool(val->size, (UINT8 *)&card->vram_size);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void free_val(value_t *val )
|
||||
@ -1539,20 +1539,20 @@ void free_val(value_t *val )
|
||||
ZeroMem(val, sizeof(value_t));
|
||||
}
|
||||
|
||||
// {FLAGTRUE, TRUE, "@0,compatible", get_name_val, NULVAL },
|
||||
// {FLAGTRUE, FALSE, "ATY,VendorID", NULL, WRDVAL(0x1002) },
|
||||
// {FLAGTRUE, true, "@0,compatible", get_name_val, NULVAL },
|
||||
// {FLAGTRUE, false, "ATY,VendorID", NULL, WRDVAL(0x1002) },
|
||||
/*typedef struct {
|
||||
UINT32 flags;
|
||||
BOOLEAN all_ports;
|
||||
XBool all_ports;
|
||||
CHAR8 *name;
|
||||
BOOLEAN (*get_value)(value_t *val, INTN index, BOOLEAN Sier);
|
||||
XBool (*get_value)(value_t *val, INTN index, XBool Sier);
|
||||
value_t default_val;
|
||||
} AtiDevProp;
|
||||
*/
|
||||
void devprop_add_list(AtiDevProp devprop_list[], const MacOsVersion& OSVersion)
|
||||
{
|
||||
INTN i, pnum;
|
||||
BOOLEAN Sier;
|
||||
XBool Sier;
|
||||
value_t *val = (__typeof__(val))AllocateZeroPool(sizeof(value_t));
|
||||
|
||||
Sier = ( OSVersion.isEmpty() || OSVersion >= MacOsVersion("10.12"_XS8));
|
||||
@ -1606,31 +1606,31 @@ void devprop_add_list(AtiDevProp devprop_list[], const MacOsVersion& OSVersion)
|
||||
FreePool(val);
|
||||
}
|
||||
|
||||
BOOLEAN validate_rom(option_rom_header_t *rom_header, pci_dt_t *pci_dev)
|
||||
XBool validate_rom(option_rom_header_t *rom_header, pci_dt_t *pci_dev)
|
||||
{
|
||||
option_rom_pci_header_t *rom_pci_header;
|
||||
|
||||
if (rom_header->signature != 0xaa55) {
|
||||
DBG("invalid ROM signature %hX\n", rom_header->signature);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
rom_pci_header = (option_rom_pci_header_t *)((UINT8 *)rom_header + rom_header->pci_header_offset);
|
||||
|
||||
if (rom_pci_header->signature != 0x52494350) {
|
||||
DBG("invalid ROM header %X\n", rom_pci_header->signature);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rom_pci_header->vendor_id != pci_dev->vendor_id || rom_pci_header->device_id != pci_dev->device_id){
|
||||
DBG("invalid ROM vendor=%04hX deviceID=%04hX\n", rom_pci_header->vendor_id, rom_pci_header->device_id);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN load_vbios_file(UINT16 vendor_id, UINT16 device_id)
|
||||
XBool load_vbios_file(UINT16 vendor_id, UINT16 device_id)
|
||||
{
|
||||
EFI_STATUS Status = EFI_NOT_FOUND;
|
||||
UINTN bufferLen = 0;
|
||||
@ -1654,13 +1654,13 @@ BOOLEAN load_vbios_file(UINT16 vendor_id, UINT16 device_id)
|
||||
DBG("ATI ROM not found \n");
|
||||
card->rom_size = 0;
|
||||
card->rom = 0;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
DBG("Loaded ROM len=%llu\n", bufferLen);
|
||||
card->rom_size = (UINT32)bufferLen;
|
||||
card->rom = (__typeof__(card->rom))AllocateZeroPool(bufferLen);
|
||||
if (!card->rom) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
CopyMem(card->rom, buffer, bufferLen);
|
||||
// read(fd, (CHAR8 *)card->rom, card->rom_size);
|
||||
@ -1671,7 +1671,7 @@ BOOLEAN load_vbios_file(UINT16 vendor_id, UINT16 device_id)
|
||||
FreePool(card->rom);
|
||||
card->rom = 0;
|
||||
FreePool(buffer);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
bufferLen = ((option_rom_header_t *)card->rom)->rom_size;
|
||||
card->rom_size = (UINT32)(bufferLen << 9);
|
||||
@ -1679,7 +1679,7 @@ BOOLEAN load_vbios_file(UINT16 vendor_id, UINT16 device_id)
|
||||
// close(fd);
|
||||
FreePool(buffer);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void get_vram_size(void)
|
||||
@ -1716,7 +1716,7 @@ void get_vram_size(void)
|
||||
DBG("ATI: get_vram_size returned 0x%llX\n", card->vram_size);
|
||||
}
|
||||
|
||||
BOOLEAN read_vbios(BOOLEAN from_pci)
|
||||
XBool read_vbios(XBool from_pci)
|
||||
{
|
||||
option_rom_header_t *rom_addr;
|
||||
|
||||
@ -1730,30 +1730,30 @@ BOOLEAN read_vbios(BOOLEAN from_pci)
|
||||
if (!validate_rom(rom_addr, card->pci_dev)) {
|
||||
DBG("There is no ROM @0x%llX\n", (uintptr_t)rom_addr);
|
||||
// gBS->Stall(3000000);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
card->rom_size = (UINT32)(rom_addr->rom_size) << 9;
|
||||
if (!card->rom_size) {
|
||||
DBG("invalid ROM size =0\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
card->rom = (__typeof__(card->rom))AllocateZeroPool(card->rom_size);
|
||||
if (!card->rom) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
CopyMem(card->rom, (void *)rom_addr, card->rom_size);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN read_disabled_vbios(void)
|
||||
XBool read_disabled_vbios(void)
|
||||
{
|
||||
BOOLEAN ret = FALSE;
|
||||
XBool ret = false;
|
||||
ati_chip_family_t chip_family = card->info->chip_family;
|
||||
if (chip_family > CHIP_FAMILY_TURKS) {
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if (chip_family >= CHIP_FAMILY_RV770) {
|
||||
UINT32 viph_control = REG32(card->mmio, RADEON_VIPH_CONTROL);
|
||||
UINT32 bus_cntl = REG32(card->mmio, RADEON_BUS_CNTL);
|
||||
@ -1791,7 +1791,7 @@ BOOLEAN read_disabled_vbios(void)
|
||||
WRITEREG32(card->mmio, R600_ROM_CNTL, (rom_cntl | R600_SCK_OVERWRITE));
|
||||
}
|
||||
|
||||
ret = read_vbios(TRUE);
|
||||
ret = read_vbios(true);
|
||||
|
||||
// restore regs
|
||||
if (chip_family == CHIP_FAMILY_RV730) {
|
||||
@ -1841,7 +1841,7 @@ BOOLEAN read_disabled_vbios(void)
|
||||
WRITEREG32(card->mmio, R600_CTXSW_VID_LOWER_GPIO_CNTL, (ctxsw_vid_lower_gpio_cntl & ~0x400));
|
||||
WRITEREG32(card->mmio, R600_LOWER_GPIO_ENABLE, (lower_gpio_enable | 0x400));
|
||||
|
||||
ret = read_vbios(TRUE);
|
||||
ret = read_vbios(true);
|
||||
|
||||
// restore regs
|
||||
WRITEREG32(card->mmio, RADEON_VIPH_CONTROL, viph_control);
|
||||
@ -1861,7 +1861,7 @@ BOOLEAN read_disabled_vbios(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOLEAN radeon_card_posted(void)
|
||||
XBool radeon_card_posted(void)
|
||||
{
|
||||
UINTN reg;
|
||||
// ati_chip_family_t chip_family = card->info->chip_family;
|
||||
@ -1888,29 +1888,29 @@ BOOLEAN radeon_card_posted(void)
|
||||
DBG("RADEON_CRTC2_GEN_CNTL == 0x%08X\n", REG32(card->mmio, RADEON_CRTC2_GEN_CNTL));
|
||||
if ((reg & 0xFFFFFFFF) == 0xFFFFFFFF) {
|
||||
DBG(" card not posted because GEN_CNTL = -1\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (reg & RADEON_CRTC_EN) {
|
||||
DBG(" card posted because CRTC_EN, GEN_CNTL=%llX\n", reg);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
// then check MEM_SIZE, in case something turned the crtcs off
|
||||
reg = (UINTN)REG32(card->mmio, R600_CONFIG_MEMSIZE);
|
||||
if (reg) {
|
||||
DBG(" card posted because CONFIG_MEMSIZE=0x%llX\n", reg);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if 0 //may be inject this as saved-config?
|
||||
BOOLEAN devprop_add_pci_config_space(void)
|
||||
XBool devprop_add_pci_config_space(void)
|
||||
{
|
||||
int offset;
|
||||
|
||||
UINT8 *config_space = (__typeof__(config_space))AllocateZeroPool(0x100);
|
||||
if (!config_space)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
for (offset = 0; offset < 0x100; offset += 4)
|
||||
config_space[offset / 4] = pci_config_read32(card->pci_dev, offset);
|
||||
@ -1918,13 +1918,13 @@ BOOLEAN devprop_add_pci_config_space(void)
|
||||
devprop_add_value(card->device, "ATY,PCIConfigSpace", config_space, 0x100);
|
||||
FreePool(config_space);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
static BOOLEAN init_card(pci_dt_t *pci_dev)
|
||||
static XBool init_card(pci_dt_t *pci_dev)
|
||||
{
|
||||
BOOLEAN add_vbios = gSettings.Graphics.LoadVBios;
|
||||
XBool add_vbios = gSettings.Graphics.LoadVBios;
|
||||
CHAR8 *name;
|
||||
CHAR8 *name_parent;
|
||||
// CHAR8 *model;
|
||||
@ -1936,7 +1936,7 @@ static BOOLEAN init_card(pci_dt_t *pci_dev)
|
||||
|
||||
card = (__typeof__(card))AllocateZeroPool(sizeof(card_t));
|
||||
if (!card) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
card->pci_dev = pci_dev;
|
||||
|
||||
@ -1963,7 +1963,7 @@ static BOOLEAN init_card(pci_dt_t *pci_dev)
|
||||
|
||||
if (!card->info || !card->info->device_id || !card->info->cfg_name) {
|
||||
DBG("Unsupported ATI card! Device ID: [%04hX:%04hX] Subsystem ID: [%08X] \n",
|
||||
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id);
|
||||
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id_union.subsys_id);
|
||||
DBG("search for brothers family\n");
|
||||
for (i = 0; radeon_cards[i].device_id ; i++) {
|
||||
if ((radeon_cards[i].device_id & ~0xf) == (pci_dev->device_id & ~0xf)) {
|
||||
@ -1974,7 +1974,7 @@ static BOOLEAN init_card(pci_dt_t *pci_dev)
|
||||
if (!card->info->cfg_name) {
|
||||
DBG("...compatible config is not found, set common\n");
|
||||
card->info->cfg_name = kRadeon;
|
||||
// return FALSE;
|
||||
// return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2004,7 +2004,7 @@ static BOOLEAN init_card(pci_dt_t *pci_dev)
|
||||
if (!card->rom) {
|
||||
DBG("reading VBIOS from %s", card->posted ? "legacy space" : "PCI ROM");
|
||||
if (card->posted) { // && ExpansionRom != 0)
|
||||
read_vbios(FALSE);
|
||||
read_vbios(false);
|
||||
} else {
|
||||
read_disabled_vbios();
|
||||
}
|
||||
@ -2077,10 +2077,10 @@ static BOOLEAN init_card(pci_dt_t *pci_dev)
|
||||
aty_nameparent.size = (UINT32)AsciiStrLen(name_parent);
|
||||
aty_nameparent.data = (UINT8 *)name_parent;
|
||||
//how can we free pool when we leave the procedure? Make all pointers global?
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
XBool setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
{
|
||||
CHAR8 compatible[64];
|
||||
XString8 devicepath;
|
||||
@ -2088,7 +2088,7 @@ BOOLEAN setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
UINTN i;
|
||||
|
||||
if (!init_card(ati_dev)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
CurrentPatches = &Entry->KernelAndKextPatches;
|
||||
|
||||
@ -2102,11 +2102,11 @@ BOOLEAN setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
//card->device = devprop_add_device(string, devicepath);
|
||||
if (ati_dev && !ati_dev->used) {
|
||||
card->device = devprop_add_device_pci(device_inject_string, ati_dev, NULL);
|
||||
ati_dev->used = TRUE;
|
||||
ati_dev->used = true;
|
||||
}
|
||||
|
||||
if (!card->device) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// -------------------------------------------------
|
||||
|
||||
@ -2159,7 +2159,7 @@ BOOLEAN setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
chip_family_name[card->info->chip_family], card->info->model_name,
|
||||
(UINT32)RShiftU64(card->vram_size, 20), card->cfg_name,
|
||||
ati_dev->vendor_id, ati_dev->device_id,
|
||||
ati_dev->subsys_id.subsys.vendor_id, ati_dev->subsys_id.subsys.device_id,
|
||||
ati_dev->subsys_id_union.subsys.vendor_id, ati_dev->subsys_id_union.subsys.device_id,
|
||||
devicepath.c_str());
|
||||
|
||||
FreePool(card->info);
|
||||
@ -2167,5 +2167,5 @@ BOOLEAN setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev)
|
||||
FreePool(aty_name.data);
|
||||
FreePool(aty_nameparent.data);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ typedef struct {
|
||||
const CHAR8 *cfg_name;
|
||||
UINT8 ports;
|
||||
UINT32 flags;
|
||||
BOOLEAN posted;
|
||||
XBool posted;
|
||||
} card_t;
|
||||
|
||||
// Chip flags
|
||||
@ -278,32 +278,32 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
UINT32 flags;
|
||||
BOOLEAN all_ports;
|
||||
XBool all_ports;
|
||||
CONST CHAR8 *name;
|
||||
BOOLEAN (*get_value)(value_t *val, INTN index, BOOLEAN Sier);
|
||||
XBool (*get_value)(value_t *val, INTN index, XBool Sier);
|
||||
value_t default_val;
|
||||
} AtiDevProp;
|
||||
|
||||
BOOLEAN get_bootdisplay_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_vrammemory_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_edid_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_display_type(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_name_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_nameparent_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_model_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_vrammemsize_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_binimage_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_binimage_owr(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_deviceid_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_mclk_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_sclk_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_refclk_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_platforminfo_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_vramtotalsize_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_dual_link_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
BOOLEAN get_name_pci_val(value_t *val, INTN index, BOOLEAN Sier);
|
||||
XBool get_bootdisplay_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_vrammemory_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_edid_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_display_type(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_name_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_nameparent_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_model_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_conntype_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_vrammemsize_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_binimage_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_binimage_owr(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_romrevision_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_deviceid_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_mclk_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_sclk_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_refclk_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_platforminfo_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_vramtotalsize_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_dual_link_val(value_t *val, INTN index, XBool Sier);
|
||||
XBool get_name_pci_val(value_t *val, INTN index, XBool Sier);
|
||||
|
||||
// Constants. Can be defined even if DONT_DEFINE_GLOBALS
|
||||
extern const radeon_card_info_t radeon_cards[];
|
||||
@ -314,7 +314,7 @@ extern AtiDevProp ati_devprop_list[];
|
||||
extern const CHAR8 *chip_family_name[];
|
||||
#endif
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
setup_ati_devprop (
|
||||
LOADER_ENTRY *Entry,
|
||||
pci_dt_t *ati_dev
|
||||
|
@ -68,7 +68,7 @@
|
||||
//LIST_ENTRY gCardList = INITIALIZE_LIST_HEAD_VARIABLE (gCardList);
|
||||
|
||||
|
||||
//void AddCard(CONST CHAR8* Model, UINT32 Id, UINT32 SubId, UINT64 VideoRam, UINTN VideoPorts, BOOLEAN LoadVBios)
|
||||
//void AddCard(CONST CHAR8* Model, UINT32 Id, UINT32 SubId, UINT64 VideoRam, UINTN VideoPorts, XBool LoadVBios)
|
||||
//{
|
||||
// CARDLIST* new_card = new CARDLIST;
|
||||
// new_card->Signature = CARDLIST_SIGNATURE;
|
||||
|
@ -27,7 +27,7 @@ FindCardWithIds (
|
||||
// UINT32 SubId,
|
||||
// UINT64 VideoRam,
|
||||
// UINTN VideoPorts,
|
||||
// BOOLEAN LoadVBios
|
||||
// XBool LoadVBios
|
||||
// );
|
||||
|
||||
|
||||
|
@ -142,7 +142,7 @@ void GetCPUProperties (void)
|
||||
gSettings.CPU.CpuFreqMHz = 0;
|
||||
gCPUStructure.FSBFrequency = MultU64x32(gCPUStructure.ExternalClock, Kilo); //kHz -> Hz
|
||||
gCPUStructure.ProcessorInterconnectSpeed = 0;
|
||||
gCPUStructure.Mobile = FALSE; //not same as gMobile
|
||||
gCPUStructure.Mobile = false; //not same as gMobile
|
||||
|
||||
if (!gCPUStructure.CurrentSpeed) {
|
||||
gCPUStructure.CurrentSpeed = (UINT32)DivU64x32(gCPUStructure.TSCCalibr + (Mega >> 1), Mega);
|
||||
@ -212,13 +212,13 @@ void GetCPUProperties (void)
|
||||
for (s = str; *s != '\0'; s++){
|
||||
if (*s != ' ') break; //remove leading spaces
|
||||
}
|
||||
AsciiStrnCpyS(gCPUStructure.BrandString, 48, s, 48);
|
||||
gCPUStructure.BrandString.takeValueFrom(s);
|
||||
gCPUStructure.BrandString.trim();
|
||||
|
||||
if (!strncmp((const CHAR8*)gCPUStructure.BrandString, CPU_STRING_UNKNOWN, iStrLen((gCPUStructure.BrandString) + 1, 48))) {
|
||||
gCPUStructure.BrandString[0] = '\0';
|
||||
if ( gCPUStructure.BrandString.isEqual(CPU_STRING_UNKNOWN) ) {
|
||||
gCPUStructure.BrandString.setEmpty();
|
||||
}
|
||||
gCPUStructure.BrandString[47] = '\0';
|
||||
DBG("BrandString = %s\n", gCPUStructure.BrandString);
|
||||
DBG("BrandString = %s\n", gCPUStructure.BrandString.c_str());
|
||||
}
|
||||
|
||||
//Calculate Nr of Cores
|
||||
@ -278,16 +278,16 @@ void GetCPUProperties (void)
|
||||
}
|
||||
|
||||
// if ((bit(9) & gCPUStructure.CPUID[CPUID_1][ECX]) != 0) {
|
||||
// SSSE3 = TRUE;
|
||||
// SSSE3 = true;
|
||||
// }
|
||||
gCPUStructure.Turbo = FALSE;
|
||||
gCPUStructure.Turbo = false;
|
||||
if (gCPUStructure.Vendor == CPU_VENDOR_INTEL) {
|
||||
// Determine turbo boost support
|
||||
DoCpuid(6, gCPUStructure.CPUID[CPUID_6]);
|
||||
gCPUStructure.Turbo = ((gCPUStructure.CPUID[CPUID_6][EAX] & BIT1) != 0);
|
||||
DBG(" The CPU%s supported turbo\n", gCPUStructure.Turbo?"":" not");
|
||||
//get cores and threads
|
||||
BOOLEAN PerfBias = (gCPUStructure.CPUID[CPUID_6][ECX] & BIT3) != 0;
|
||||
XBool PerfBias = (gCPUStructure.CPUID[CPUID_6][ECX] & BIT3) != 0;
|
||||
DBG(" Energy PerfBias is %s visible:\n", PerfBias?"":" not");
|
||||
switch (gCPUStructure.Model)
|
||||
{
|
||||
@ -368,18 +368,19 @@ void GetCPUProperties (void)
|
||||
//workaround for Xeon Harpertown and Yorkfield
|
||||
if ((gCPUStructure.Model == CPU_MODEL_PENRYN) &&
|
||||
(gCPUStructure.Cores == 0)) {
|
||||
if ((AsciiStrStr(gCPUStructure.BrandString, "X54")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "E54")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "W35")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "X34")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "X33")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "L33")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "X32")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "L3426")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "L54"))) {
|
||||
if ( gCPUStructure.BrandString.contains("X54") ||
|
||||
gCPUStructure.BrandString.contains("E54") ||
|
||||
gCPUStructure.BrandString.contains("W35") ||
|
||||
gCPUStructure.BrandString.contains("X34") ||
|
||||
gCPUStructure.BrandString.contains("X33") ||
|
||||
gCPUStructure.BrandString.contains("L33") ||
|
||||
gCPUStructure.BrandString.contains("X32") ||
|
||||
gCPUStructure.BrandString.contains("L3426") ||
|
||||
gCPUStructure.BrandString.contains("L54")
|
||||
) {
|
||||
gCPUStructure.Cores = 4;
|
||||
gCPUStructure.Threads = 4;
|
||||
} else if (AsciiStrStr(gCPUStructure.BrandString, "W36")) {
|
||||
} else if ( gCPUStructure.BrandString.contains("W36") ) {
|
||||
gCPUStructure.Cores = 6;
|
||||
gCPUStructure.Threads = 6;
|
||||
} else { //other Penryn and Wolfdale
|
||||
@ -397,14 +398,13 @@ void GetCPUProperties (void)
|
||||
}
|
||||
|
||||
//workaround for N270. I don't know why it detected wrong
|
||||
if ((gCPUStructure.Model == CPU_MODEL_ATOM) &&
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "270"))) {
|
||||
if ((gCPUStructure.Model == CPU_MODEL_ATOM) && gCPUStructure.BrandString.contains("270") ) {
|
||||
gCPUStructure.Cores = 1;
|
||||
gCPUStructure.Threads = 2;
|
||||
}
|
||||
|
||||
//workaround for Quad
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Quad")) {
|
||||
if ( gCPUStructure.BrandString.contains("Quad") ) {
|
||||
gCPUStructure.Cores = 4;
|
||||
gCPUStructure.Threads = 4;
|
||||
}
|
||||
@ -530,7 +530,7 @@ void GetCPUProperties (void)
|
||||
MsgLog("MSR 0xE2 before patch %08llX\n", msr);
|
||||
if (msr & 0x8000) {
|
||||
MsgLog("MSR 0xE2 is locked, PM patches will be turned on\n");
|
||||
GlobalConfig.NeedPMfix = TRUE;
|
||||
GlobalConfig.NeedPMfix = true;
|
||||
}
|
||||
// AsmWriteMsr64(MSR_PKG_CST_CONFIG_CONTROL, (msr & 0x8000000ULL));
|
||||
// msr = AsmReadMsr64(MSR_PKG_CST_CONFIG_CONTROL);
|
||||
@ -613,7 +613,7 @@ void GetCPUProperties (void)
|
||||
case CPU_MODEL_PENRYN:// Core 2 Duo/Extreme, Xeon, 45nm , Mobile
|
||||
//case CPU_MODEL_WOLFDALE:// Core 2 Duo/Extreme, Xeon, 45nm, Desktop like Penryn but not Mobile
|
||||
if(AsmReadMsr64(MSR_IA32_PLATFORM_ID) & (1 << 28)){
|
||||
gCPUStructure.Mobile = TRUE;
|
||||
gCPUStructure.Mobile = true;
|
||||
}
|
||||
gCPUStructure.TSCFrequency = MultU64x32(gCPUStructure.MaxSpeed, Mega); //MHz -> Hz
|
||||
gCPUStructure.CPUFrequency = gCPUStructure.TSCFrequency;
|
||||
@ -636,7 +636,7 @@ void GetCPUProperties (void)
|
||||
gCPUStructure.MaxRatio = (UINT32)DivU64x32(gCPUStructure.TSCFrequency, 200 * Mega);
|
||||
}
|
||||
gCPUStructure.MaxRatio = gCPUStructure.MaxRatio * 10 + gCPUStructure.SubDivider * 5;
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "P8400")) {
|
||||
if ( gCPUStructure.BrandString.contains("P8400") ) {
|
||||
gCPUStructure.MaxRatio = 85;
|
||||
gCPUStructure.FSBFrequency = DivU64x32(MultU64x32(gCPUStructure.TSCFrequency, 10), gCPUStructure.MaxRatio);
|
||||
DBG("workaround for Code2Duo P8400, MaxRatio=8.5\n");
|
||||
@ -1290,7 +1290,7 @@ UINT16 GetAdvancedCpuType()
|
||||
case CPU_MODEL_CELERON: //M520
|
||||
case CPU_MODEL_MEROM: // Merom
|
||||
case CPU_MODEL_PENRYN:// Penryn
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Xeon"))
|
||||
if ( gCPUStructure.BrandString.contains("Xeon") )
|
||||
return 0x402; // Xeon
|
||||
case CPU_MODEL_ATOM: // Atom (45nm)
|
||||
return GetStandardCpuType();
|
||||
@ -1299,21 +1299,21 @@ UINT16 GetAdvancedCpuType()
|
||||
return 0x402;
|
||||
|
||||
case CPU_MODEL_NEHALEM: // Intel Core i7 LGA1366 (45nm)
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Xeon"))
|
||||
if ( gCPUStructure.BrandString.contains("Xeon") )
|
||||
return 0x501; // Xeon
|
||||
return 0x701; // Core i7
|
||||
|
||||
case CPU_MODEL_FIELDS: // Lynnfield, Clarksfield, Jasper
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x601; // Core i5
|
||||
return 0x701; // Core i7
|
||||
|
||||
case CPU_MODEL_DALES: // Intel Core i5, i7 LGA1156 (45nm) (Havendale, Auburndale)
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
|
||||
return 0x901; // Core i3 //why not 902? Ask Apple
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x602; // Core i5
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7") )
|
||||
return 0x702; // Core i7
|
||||
if (gCPUStructure.Cores <= 2) {
|
||||
return 0x602;
|
||||
@ -1323,11 +1323,11 @@ UINT16 GetAdvancedCpuType()
|
||||
//case CPU_MODEL_ARRANDALE:
|
||||
case CPU_MODEL_CLARKDALE: // Intel Core i3, i5, i7 LGA1156 (32nm) (Clarkdale, Arrandale)
|
||||
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
|
||||
return 0x901; // Core i3
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x601; // Core i5 - (M540 -> 0x0602)
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7") )
|
||||
return 0x701; // Core i7
|
||||
if (gCPUStructure.Cores <= 2) {
|
||||
return 0x601;
|
||||
@ -1336,26 +1336,26 @@ UINT16 GetAdvancedCpuType()
|
||||
|
||||
case CPU_MODEL_WESTMERE: // Intel Core i7 LGA1366 (32nm) 6 Core (Gulftown, Westmere-EP, Westmere-WS)
|
||||
case CPU_MODEL_WESTMERE_EX: // Intel Core i7 LGA1366 (45nm) 6 Core ???
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Xeon"))
|
||||
if ( gCPUStructure.BrandString.contains("Xeon") )
|
||||
return 0x501; // Xeon
|
||||
return 0x701; // Core i7
|
||||
case CPU_MODEL_SANDY_BRIDGE:
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
|
||||
return 0x903; // Core i3
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x603; // Core i5
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7") )
|
||||
return 0x703; // Core i7
|
||||
if (gCPUStructure.Cores <= 2) {
|
||||
return 0x603;
|
||||
}
|
||||
return 0x703;
|
||||
case CPU_MODEL_IVY_BRIDGE:
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
|
||||
return 0x903; // Core i3 - Apple doesn't use it
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x604; // Core i5
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7") )
|
||||
return 0x704; // Core i7
|
||||
if (gCPUStructure.Cores <= 2) {
|
||||
return 0x604;
|
||||
@ -1363,13 +1363,13 @@ UINT16 GetAdvancedCpuType()
|
||||
return 0x704;
|
||||
case CPU_MODEL_HASWELL_U5:
|
||||
// case CPU_MODEL_SKYLAKE_S:
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) M"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) M") )
|
||||
return 0xB06; // Core M
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
|
||||
return 0x906; // Core i3 - Apple doesn't use it
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x606; // Core i5
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7") )
|
||||
return 0x706; // Core i7
|
||||
if (gCPUStructure.Cores <= 2) {
|
||||
return 0x606;
|
||||
@ -1401,27 +1401,27 @@ UINT16 GetAdvancedCpuType()
|
||||
case CPU_MODEL_COMETLAKE_U:
|
||||
case CPU_MODEL_TIGERLAKE_C:
|
||||
case CPU_MODEL_TIGERLAKE_D:
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i3") )
|
||||
return 0x905; // Core i3 - Apple doesn't use it
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i5") )
|
||||
return 0x605; // Core i5
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7-8"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7-8") )
|
||||
return 0x709; // Core i7 CoffeeLake
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7-9"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7-9") )
|
||||
return 0x1005; // Core i7 CoffeeLake
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7-1"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7-1") )
|
||||
return 0x070B; // Core i7 IceLake
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i7") )
|
||||
return 0x705; // Core i7
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) i9"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) i9") )
|
||||
return 0x1009; // Core i7 CoffeeLake
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) m3"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) m3") )
|
||||
return 0xC05;
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) m5"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) m5") )
|
||||
return 0xD05;
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Core(TM) m7"))
|
||||
if ( gCPUStructure.BrandString.contains("Core(TM) m7") )
|
||||
return 0xE05;
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "Xeon"))
|
||||
if ( gCPUStructure.BrandString.contains("Xeon") )
|
||||
return 0xF01;
|
||||
if (gCPUStructure.Cores <= 2) {
|
||||
return 0x605;
|
||||
@ -1441,7 +1441,7 @@ MACHINE_TYPES GetDefaultModel()
|
||||
return MacPro61;
|
||||
}
|
||||
// TODO: Add more CPU models and configure the correct machines per CPU/GFX model
|
||||
bool isMobile = getMobileFromSmbios();
|
||||
XBool isMobile = getMobileFromSmbios();
|
||||
if(isMobile) {
|
||||
switch (gCPUStructure.Model)
|
||||
{
|
||||
@ -1470,8 +1470,7 @@ MACHINE_TYPES GetDefaultModel()
|
||||
break;
|
||||
case CPU_MODEL_JAKETOWN:
|
||||
case CPU_MODEL_SANDY_BRIDGE:
|
||||
if((AsciiStrStr(gCPUStructure.BrandString, "i3")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "i5"))) {
|
||||
if ( gCPUStructure.BrandString.contains("i3") || gCPUStructure.BrandString.contains("i5") ) {
|
||||
DefaultType = MacBookPro81;
|
||||
break;
|
||||
}
|
||||
@ -1492,21 +1491,21 @@ MACHINE_TYPES GetDefaultModel()
|
||||
DefaultType = MacBookPro111;
|
||||
break;
|
||||
case CPU_MODEL_HASWELL_U5: // Broadwell Mobile
|
||||
if(AsciiStrStr(gCPUStructure.BrandString, "M")) {
|
||||
if ( gCPUStructure.BrandString.contains("M") ) {
|
||||
DefaultType = MacBook81;
|
||||
break;
|
||||
}
|
||||
DefaultType = MacBookPro121;
|
||||
break;
|
||||
case CPU_MODEL_SKYLAKE_U:
|
||||
if(AsciiStrStr(gCPUStructure.BrandString, "m")) {
|
||||
if ( gCPUStructure.BrandString.contains("m") ) {
|
||||
DefaultType = MacBook91;
|
||||
break;
|
||||
}
|
||||
DefaultType = MacBookPro131;
|
||||
break;
|
||||
case CPU_MODEL_KABYLAKE1:
|
||||
if(AsciiStrStr(gCPUStructure.BrandString, "Y")) {
|
||||
if ( gCPUStructure.BrandString.contains("Y") ) {
|
||||
DefaultType = MacBook101;
|
||||
break;
|
||||
}
|
||||
@ -1550,7 +1549,7 @@ MACHINE_TYPES GetDefaultModel()
|
||||
DefaultType = MacPro41;
|
||||
break;
|
||||
case CPU_MODEL_FIELDS:
|
||||
if(AsciiStrStr(gCPUStructure.BrandString, "Xeon")) {
|
||||
if ( gCPUStructure.BrandString.contains("Xeon") ) {
|
||||
DefaultType = MacPro41;
|
||||
break;
|
||||
}
|
||||
@ -1573,12 +1572,11 @@ MACHINE_TYPES GetDefaultModel()
|
||||
DefaultType = MacMini51;
|
||||
break;
|
||||
}
|
||||
if((AsciiStrStr(gCPUStructure.BrandString, "i3")) ||
|
||||
(AsciiStrStr(gCPUStructure.BrandString, "i5"))) {
|
||||
if ( gCPUStructure.BrandString.contains("i3") || gCPUStructure.BrandString.contains("i5") ) {
|
||||
DefaultType = iMac121;
|
||||
break;
|
||||
}
|
||||
if(AsciiStrStr(gCPUStructure.BrandString, "i7")) {
|
||||
if ( gCPUStructure.BrandString.contains("i7") ) {
|
||||
DefaultType = iMac122;
|
||||
break;
|
||||
}
|
||||
@ -1591,7 +1589,7 @@ MACHINE_TYPES GetDefaultModel()
|
||||
DefaultType = MacMini62;
|
||||
break;
|
||||
}
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "i3")) {
|
||||
if ( gCPUStructure.BrandString.contains("i3") ) {
|
||||
DefaultType = iMac131;
|
||||
break;
|
||||
}
|
||||
@ -1608,7 +1606,7 @@ MACHINE_TYPES GetDefaultModel()
|
||||
break;
|
||||
case CPU_MODEL_KABYLAKE1:
|
||||
case CPU_MODEL_KABYLAKE2:
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "i5")) {
|
||||
if ( gCPUStructure.BrandString.contains("i5") ) {
|
||||
DefaultType = iMac182;
|
||||
break;
|
||||
}
|
||||
@ -1617,7 +1615,7 @@ MACHINE_TYPES GetDefaultModel()
|
||||
case CPU_MODEL_HASWELL:
|
||||
case CPU_MODEL_HASWELL_E:
|
||||
DefaultType = iMac142;
|
||||
if (AsciiStrStr(gCPUStructure.BrandString, "70S")) {
|
||||
if ( gCPUStructure.BrandString.contains("70S") ) {
|
||||
DefaultType = iMac141;
|
||||
break;
|
||||
}
|
||||
|
@ -343,53 +343,53 @@ MSR C001006B 0000-0000-0000-0000
|
||||
|
||||
typedef struct {
|
||||
//values from CPUID
|
||||
UINT32 CPUID[CPUID_MAX][4];
|
||||
UINT32 Vendor;
|
||||
UINT32 Signature;
|
||||
UINT32 Family;
|
||||
UINT32 Model;
|
||||
UINT32 Stepping;
|
||||
UINT32 Type;
|
||||
UINT32 Extmodel;
|
||||
UINT32 Extfamily;
|
||||
UINT64 Features;
|
||||
UINT64 ExtFeatures;
|
||||
UINT32 CoresPerPackage;
|
||||
UINT32 LogicalPerPackage;
|
||||
CHAR8 BrandString[48];
|
||||
UINT32 CPUID[CPUID_MAX][4] = {{0}};
|
||||
UINT32 Vendor = 0;
|
||||
UINT32 Signature = 0;
|
||||
UINT32 Family = 0;
|
||||
UINT32 Model = 0;
|
||||
UINT32 Stepping = 0;
|
||||
UINT32 Type = 0;
|
||||
UINT32 Extmodel = 0;
|
||||
UINT32 Extfamily = 0;
|
||||
UINT64 Features = 0;
|
||||
UINT64 ExtFeatures = 0;
|
||||
UINT32 CoresPerPackage = 0;
|
||||
UINT32 LogicalPerPackage = 0;
|
||||
XString8 BrandString = XString8();
|
||||
|
||||
//values from BIOS
|
||||
UINT64 ExternalClock;
|
||||
UINT32 MaxSpeed; //MHz
|
||||
UINT32 CurrentSpeed; //MHz
|
||||
// UINT32 Pad;
|
||||
UINT64 ExternalClock = 0;
|
||||
UINT32 MaxSpeed = 0; //MHz
|
||||
UINT32 CurrentSpeed = 0; //MHz
|
||||
// UINT32 Pad = 0;
|
||||
|
||||
//calculated from MSR
|
||||
UINT64 MicroCode;
|
||||
UINT64 ProcessorFlag;
|
||||
UINT32 MaxRatio;
|
||||
UINT32 SubDivider;
|
||||
UINT32 MinRatio;
|
||||
UINT32 DynFSB;
|
||||
UINT64 ProcessorInterconnectSpeed; //MHz
|
||||
UINT64 FSBFrequency; //Hz
|
||||
UINT64 CPUFrequency;
|
||||
UINT64 TSCFrequency;
|
||||
UINT8 Cores;
|
||||
UINT8 EnabledCores;
|
||||
UINT8 Threads;
|
||||
UINT8 Mobile; //not for i3-i7
|
||||
BOOLEAN Turbo;
|
||||
UINT8 Pad2[3];
|
||||
UINT64 MicroCode = 0;
|
||||
UINT64 ProcessorFlag = 0;
|
||||
UINT32 MaxRatio = 0;
|
||||
UINT32 SubDivider = 0;
|
||||
UINT32 MinRatio = 0;
|
||||
UINT32 DynFSB = 0;
|
||||
UINT64 ProcessorInterconnectSpeed = 0; //MHz
|
||||
UINT64 FSBFrequency = 0; //Hz
|
||||
UINT64 CPUFrequency = 0;
|
||||
UINT64 TSCFrequency = 0;
|
||||
UINT8 Cores = 0;
|
||||
UINT8 EnabledCores = 0;
|
||||
UINT8 Threads = 0;
|
||||
UINT8 Mobile = 0; //not for i3-i7
|
||||
XBool Turbo = false;
|
||||
UINT8 Pad2[3] = {0};
|
||||
|
||||
/* Core i7,5,3 */
|
||||
UINT16 Turbo1; //1 Core
|
||||
UINT16 Turbo2; //2 Core
|
||||
UINT16 Turbo3; //3 Core
|
||||
UINT16 Turbo4; //4 Core
|
||||
UINT16 Turbo1 = 0; //1 Core
|
||||
UINT16 Turbo2 = 0; //2 Core
|
||||
UINT16 Turbo3 = 0; //3 Core
|
||||
UINT16 Turbo4 = 0; //4 Core
|
||||
|
||||
UINT64 TSCCalibr;
|
||||
UINT64 ARTFrequency;
|
||||
UINT64 TSCCalibr = 0;
|
||||
UINT64 ARTFrequency = 0;
|
||||
|
||||
} CPU_STRUCTURE;
|
||||
|
||||
|
@ -213,7 +213,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt,
|
||||
|
||||
|
||||
|
||||
BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *vl, UINTN len)
|
||||
XBool devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *vl, UINTN len)
|
||||
{
|
||||
UINT32 offset;
|
||||
UINT32 off;
|
||||
@ -224,7 +224,7 @@ BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *v
|
||||
UINT8 *newdata;
|
||||
|
||||
if(!device || !nm || !vl /*|| !len*/) //rehabman: allow zero length data
|
||||
return FALSE;
|
||||
return false;
|
||||
/* DBG("devprop_add_value %s=", nm);
|
||||
for (i=0; i<len; i++) {
|
||||
DBG("%02X", vl[i]);
|
||||
@ -234,7 +234,7 @@ BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *v
|
||||
length = (UINT32)((l * 2) + len + (2 * sizeof(UINT32)) + 2);
|
||||
data = (UINT8*)AllocateZeroPool(length);
|
||||
if(!data)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
off= 0;
|
||||
|
||||
@ -260,7 +260,7 @@ BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *v
|
||||
|
||||
newdata = (UINT8*)AllocateZeroPool((length + offset));
|
||||
if(!newdata)
|
||||
return FALSE;
|
||||
return false;
|
||||
if((device->data) && (offset > 1)) {
|
||||
CopyMem((void*)newdata, (void*)device->data, offset);
|
||||
}
|
||||
@ -273,10 +273,10 @@ BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *v
|
||||
device->data = newdata;
|
||||
|
||||
FreePool(data);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer<uint8_t>& vl)
|
||||
XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer<uint8_t>& vl)
|
||||
{
|
||||
return devprop_add_value(device, nm.data(), vl.data(), vl.size());
|
||||
}
|
||||
@ -343,19 +343,19 @@ void devprop_free_string(DevPropString *StringBuf)
|
||||
}
|
||||
|
||||
// Ethernet built-in device injection
|
||||
BOOLEAN set_eth_props(pci_dt_t *eth_dev)
|
||||
XBool set_eth_props(pci_dt_t *eth_dev)
|
||||
{
|
||||
#if DEBUG_INJECT
|
||||
// CHAR8 *devicepath;
|
||||
#endif
|
||||
DevPropDevice *device = NULL;
|
||||
UINT8 builtin = 0x0;
|
||||
BOOLEAN Injected = FALSE;
|
||||
XBool Injected = false;
|
||||
UINTN i;
|
||||
CHAR8 compatible[64];
|
||||
|
||||
if (!gSettings.Devices.LANInjection) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!device_inject_string) {
|
||||
@ -366,11 +366,11 @@ BOOLEAN set_eth_props(pci_dt_t *eth_dev)
|
||||
#endif
|
||||
if (eth_dev && !eth_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, eth_dev, NULL);
|
||||
eth_dev->used = TRUE;
|
||||
eth_dev->used = true;
|
||||
}
|
||||
|
||||
if (!device) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// -------------------------------------------------
|
||||
// DBG("LAN Controller [%04X:%04X] :: %s\n", eth_dev->vendor_id, eth_dev->device_id, devicepath);
|
||||
@ -384,7 +384,7 @@ BOOLEAN set_eth_props(pci_dt_t *eth_dev)
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != DEV_LAN) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -396,7 +396,7 @@ BOOLEAN set_eth_props(pci_dt_t *eth_dev)
|
||||
}
|
||||
if (Injected) {
|
||||
DBG("custom LAN properties injected, continue\n");
|
||||
// return TRUE;
|
||||
// return true;
|
||||
}
|
||||
|
||||
// DBG("Setting dev.prop built-in=0x%X\n", builtin);
|
||||
@ -430,14 +430,14 @@ static UINT16 current_in_sleep = 1000;
|
||||
static UINT16 current_available_high = 2100; //mA
|
||||
static UINT16 current_extra_high = 3200;
|
||||
|
||||
BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
XBool set_usb_props(pci_dt_t *usb_dev)
|
||||
{
|
||||
#if DEBUG_INJECT
|
||||
// CHAR8 *devicepath;
|
||||
#endif
|
||||
DevPropDevice *device = NULL;
|
||||
UINT32 fake_devid;
|
||||
BOOLEAN Injected = FALSE;
|
||||
XBool Injected = false;
|
||||
UINTN i;
|
||||
|
||||
if (!device_inject_string)
|
||||
@ -448,11 +448,11 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
|
||||
if (usb_dev && !usb_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, usb_dev, NULL);
|
||||
usb_dev->used = TRUE;
|
||||
usb_dev->used = true;
|
||||
}
|
||||
|
||||
if (!device) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// -------------------------------------------------
|
||||
// DBG("USB Controller [%04X:%04X] :: %s\n", usb_dev->vendor_id, usb_dev->device_id, devicepath);
|
||||
@ -463,7 +463,7 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != DEV_USB) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -475,7 +475,7 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
}
|
||||
if (Injected) {
|
||||
DBG("custom USB properties injected, continue\n");
|
||||
// return TRUE;
|
||||
// return true;
|
||||
}
|
||||
|
||||
if (gSettings.Devices.USB.InjectClockID) {
|
||||
|
@ -121,13 +121,13 @@ extern UINT32 device_inject_stringlength;
|
||||
DevPropString *devprop_create_string(void);
|
||||
//DevPropDevice *devprop_add_device(DevPropString *string, char *path);
|
||||
DevPropDevice *devprop_add_device_pci(DevPropString *string, pci_dt_t *PciDt, EFI_DEVICE_PATH_PROTOCOL *DevicePath);
|
||||
BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *vl, UINTN len); // to be removed
|
||||
bool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer<uint8_t>& vl);
|
||||
XBool devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, const UINT8 *vl, UINTN len); // to be removed
|
||||
XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer<uint8_t>& vl);
|
||||
XBuffer<char> devprop_generate_string(DevPropString *string);
|
||||
void devprop_free_string(DevPropString *string);
|
||||
|
||||
BOOLEAN set_eth_props(pci_dt_t *eth_dev);
|
||||
BOOLEAN set_usb_props(pci_dt_t *usb_dev);
|
||||
XBool set_eth_props(pci_dt_t *eth_dev);
|
||||
XBool set_usb_props(pci_dt_t *usb_dev);
|
||||
|
||||
UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath);
|
||||
|
||||
|
@ -959,7 +959,7 @@ CONST CHAR8 *get_gma_model(UINT16 id)
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& BuildVersion, EFI_FILE* RootDir, pci_dt_t *gma_dev)
|
||||
XBool setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& BuildVersion, EFI_FILE* RootDir, pci_dt_t *gma_dev)
|
||||
{
|
||||
UINTN j;
|
||||
UINTN i;
|
||||
@ -970,12 +970,12 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
UINT32 FakeID;
|
||||
UINT32 DualLink = 1;
|
||||
// UINT64 os_version = AsciiOSVersionToUint64(macOSVersion);
|
||||
BOOLEAN SetUGAWidth = FALSE;
|
||||
BOOLEAN SetUGAHeight = FALSE;
|
||||
BOOLEAN Injected = FALSE;
|
||||
BOOLEAN SetFake = FALSE;
|
||||
BOOLEAN SetSnb = FALSE;
|
||||
BOOLEAN SetIg = FALSE;
|
||||
XBool SetUGAWidth = false;
|
||||
XBool SetUGAHeight = false;
|
||||
XBool Injected = false;
|
||||
XBool SetFake = false;
|
||||
XBool SetSnb = false;
|
||||
XBool SetIg = false;
|
||||
|
||||
MACHINE_TYPES MacModel = GetModelFromString(gSettings.Smbios.ProductName);
|
||||
|
||||
@ -998,14 +998,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
// Resolution
|
||||
switch (UGAWidth) {
|
||||
case 640:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 360:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found one ninth of a Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 480:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1014,14 +1014,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 800:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 480:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide VGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 600:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Super VGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1030,23 +1030,23 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 854:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 480) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 960:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 540:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found one quarter of Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 640:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Double-size VGA Display - 3:2 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1055,18 +1055,18 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 1024:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 576:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Super VGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 600:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Super VGA Display - 17:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 768:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1075,31 +1075,31 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 1152:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 864) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 1280:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 720:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 768:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide XGA Display - 5:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 800:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 1024:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Super XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1108,41 +1108,41 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 1366:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 768) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 1400:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 1050) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 1440:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 900) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 1600:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 900:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 1200:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1151,10 +1151,10 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 1680:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 1050:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Widescreen Super XGA Plus Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1163,14 +1163,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 1920:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 1080:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Full HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 1200:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1179,14 +1179,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 2048:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 1152:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Quad Wide XGA Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 1536:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Quad XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1195,18 +1195,18 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 2560:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 1440:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Quad HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 1600:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Quad XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 2048:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Quad Wide XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1215,27 +1215,27 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 2880:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 1800) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 3200:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 1800:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Quad HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 2048:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Quad Super XGA Display - 25:16 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 2400:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Quad Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1244,14 +1244,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 3840:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 2160:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Ultra HD, 4K Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 2400:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Quad Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1260,27 +1260,27 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 4096:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
if(UGAHeight == 3072) {
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
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);
|
||||
}
|
||||
break;
|
||||
case 5120:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 2880:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Ultra HD Plus Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 3200:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Hex XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 4096:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Hex Super XGA Display - 5:4 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1289,14 +1289,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 6400:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 4096:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Hex Super XGA Display - 25:16 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 4800:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Hex Ultra XGA Display - 4:3 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1305,14 +1305,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
}
|
||||
break;
|
||||
case 7680:
|
||||
SetUGAWidth = TRUE;
|
||||
SetUGAWidth = true;
|
||||
switch (UGAHeight) {
|
||||
case 4320:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Full Ultra HD Display - 16:9 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
case 4800:
|
||||
SetUGAHeight = TRUE;
|
||||
SetUGAHeight = true;
|
||||
DBG(" Found Wide Hex Ultra XGA Display - 16:10 :: Width=%lld Height=%lld\n", UGAWidth, UGAHeight);
|
||||
break;
|
||||
default:
|
||||
@ -1331,11 +1331,11 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
|
||||
if (gma_dev && !gma_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, gma_dev, NULL);
|
||||
gma_dev->used = TRUE;
|
||||
gma_dev->used = true;
|
||||
}
|
||||
|
||||
if (!device) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gSettings.Devices.AddPropertyArray.size() != 0xFFFE) { // Looks like NrAddProperties == 0xFFFE is not used anymore
|
||||
@ -1343,7 +1343,7 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != DEV_INTEL) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -1468,7 +1468,7 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
devprop_add_value(device, "device-id", (UINT8*)&FakeID, 4);
|
||||
FakeID = gSettings.Devices.FakeID.FakeIntel & 0xFFFF;
|
||||
devprop_add_value(device, "vendor-id", (UINT8*)&FakeID, 4);
|
||||
SetFake = TRUE;
|
||||
SetFake = true;
|
||||
MsgLog(" FakeID Intel GFX = 0x%08x\n", gSettings.Devices.FakeID.FakeIntel);
|
||||
} else {
|
||||
DBG(" FakeID Intel GFX: not set\n");
|
||||
@ -1486,7 +1486,7 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
if (GlobalConfig.IgPlatform != 0) {
|
||||
devprop_add_value(device, "AAPL,snb-platform-id", (UINT8*)&GlobalConfig.IgPlatform, 4);
|
||||
MsgLog(" snb-platform-id = 0x%08x\n", GlobalConfig.IgPlatform);
|
||||
SetSnb = TRUE;
|
||||
SetSnb = true;
|
||||
} else {
|
||||
DBG(" snb-platform-id: not set\n");
|
||||
}
|
||||
@ -1495,7 +1495,7 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
if (GlobalConfig.IgPlatform != 0) {
|
||||
devprop_add_value(device, "AAPL,ig-platform-id", (UINT8*)&GlobalConfig.IgPlatform, 4);
|
||||
MsgLog(" ig-platform-id = 0x%08x\n", GlobalConfig.IgPlatform);
|
||||
SetIg = TRUE;
|
||||
SetIg = true;
|
||||
} else {
|
||||
DBG(" ig-platform-id: not set\n");
|
||||
}
|
||||
@ -1504,7 +1504,7 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
|
||||
if (gSettings.Devices.NoDefaultProperties) {
|
||||
MsgLog(" Intel: no default properties\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
devprop_add_value(device, "model", (UINT8*)model, (UINT32)AsciiStrLen(model));
|
||||
@ -3344,14 +3344,14 @@ BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& Buil
|
||||
|
||||
default:
|
||||
DBG(" Intel card id=%hX unsupported, please report to the clover thread\n", gma_dev->device_id);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
#if DEBUG_GMA == 2
|
||||
gBS->Stall(5000000);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
//thanks to jalavoui
|
||||
#if 0
|
||||
|
@ -7,8 +7,8 @@
|
||||
//#include "device_inject.h"
|
||||
//#include "../gui/menu_items/menu_items.h"
|
||||
|
||||
//BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev); // do not use LOADER_ENTRY to avoid dependency
|
||||
BOOLEAN setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& BuildVersion, EFI_FILE* RootDir, pci_dt_t *gma_dev);
|
||||
//XBool setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev); // do not use LOADER_ENTRY to avoid dependency
|
||||
XBool setup_gma_devprop(const MacOsVersion& macOSVersion, const XString8& BuildVersion, EFI_FILE* RootDir, pci_dt_t *gma_dev);
|
||||
|
||||
struct gma_gpu_t {
|
||||
UINT32 device;
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
|
||||
EFI_GUIDClass(const EFI_GUID& other) { Data1 = other.Data1; Data2 = other.Data2; Data3 = other.Data3; memcpy(Data4, other.Data4, sizeof(Data4)); }
|
||||
|
||||
bool operator == (const EFI_GUID& other) const {
|
||||
XBool operator == (const EFI_GUID& other) const {
|
||||
if ( !(Data1 == other.Data1) ) return false;
|
||||
if ( !(Data2 == other.Data2) ) return false;
|
||||
if ( !(Data3 == other.Data3) ) return false;
|
||||
@ -40,20 +40,20 @@ public:
|
||||
extern const XString8 nullGuidAsString;
|
||||
extern EFI_GUID nullGuid;
|
||||
|
||||
/** Returns TRUE is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
|
||||
/** Returns true is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
|
||||
template <typename T, typename IntegralType, enable_if( is_char(T) && is_integral(IntegralType) ) >
|
||||
BOOLEAN IsValidGuidString(const T* Str, IntegralType n)
|
||||
XBool IsValidGuidString(const T* Str, IntegralType n)
|
||||
{
|
||||
UINTN Index4IsValidGuidAsciiString; // stupid name to avoid warning : Declaration shadows a variable in the global namespace
|
||||
|
||||
if ( n != 36 ) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Index4IsValidGuidAsciiString = 0; Index4IsValidGuidAsciiString < 36; Index4IsValidGuidAsciiString++) {
|
||||
if (Index4IsValidGuidAsciiString == 8 || Index4IsValidGuidAsciiString == 13 || Index4IsValidGuidAsciiString == 18 || Index4IsValidGuidAsciiString == 23) {
|
||||
if (Str[Index4IsValidGuidAsciiString] != '-') {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!(
|
||||
@ -63,36 +63,36 @@ BOOLEAN IsValidGuidString(const T* Str, IntegralType n)
|
||||
)
|
||||
)
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Returns TRUE is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
|
||||
/** Returns true is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
|
||||
template <typename T, enable_if( is___String(T) )>
|
||||
BOOLEAN IsValidGuidString(const T& Str)
|
||||
XBool IsValidGuidString(const T& Str)
|
||||
{
|
||||
if ( Str.isEmpty() ) return false;
|
||||
return IsValidGuidString(Str.data(), Str.length());
|
||||
}
|
||||
|
||||
///** Returns TRUE is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
|
||||
///** Returns true is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */
|
||||
//template <typename T, enable_if( is___String(T) )>
|
||||
//BOOLEAN IsValidGuidAsciiString(const T& Str)
|
||||
//XBool IsValidGuidAsciiString(const T& Str)
|
||||
//{
|
||||
// UINTN Index4IsValidGuidAsciiString; // stupid name to avoid warning : Declaration shadows a variable in the global namespace
|
||||
//
|
||||
// if ( Str.length() != 36 ) {
|
||||
// return FALSE;
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// for (Index4IsValidGuidAsciiString = 0; Index4IsValidGuidAsciiString < 36; Index4IsValidGuidAsciiString++) {
|
||||
// if (Index4IsValidGuidAsciiString == 8 || Index4IsValidGuidAsciiString == 13 || Index4IsValidGuidAsciiString == 18 || Index4IsValidGuidAsciiString == 23) {
|
||||
// if (Str[Index4IsValidGuidAsciiString] != '-') {
|
||||
// return FALSE;
|
||||
// return false;
|
||||
// }
|
||||
// } else {
|
||||
// if (!(
|
||||
@ -102,12 +102,12 @@ BOOLEAN IsValidGuidString(const T& Str)
|
||||
// )
|
||||
// )
|
||||
// {
|
||||
// return FALSE;
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return TRUE;
|
||||
// return true;
|
||||
//}
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ UINT32 HDA_IC_sendVerb(EFI_PCI_IO_PROTOCOL *PciIo, UINT32 codecAdr, UINT32 nodeI
|
||||
#endif
|
||||
|
||||
|
||||
BOOLEAN EFIAPI IsHDMIAudio(EFI_HANDLE PciDevHandle)
|
||||
XBool EFIAPI IsHDMIAudio(EFI_HANDLE PciDevHandle)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
@ -130,13 +130,13 @@ BOOLEAN EFIAPI IsHDMIAudio(EFI_HANDLE PciDevHandle)
|
||||
// get device PciIo protocol
|
||||
Status = gBS->OpenProtocol(PciDevHandle, &gEfiPciIoProtocolGuid, (void **)&PciIo, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// get device location
|
||||
Status = PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function);
|
||||
if (EFI_ERROR(Status)) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// iterate over all GFX devices and check for sibling
|
||||
@ -144,19 +144,19 @@ BOOLEAN EFIAPI IsHDMIAudio(EFI_HANDLE PciDevHandle)
|
||||
if (gConf.GfxPropertiesArray[Index].Segment == Segment
|
||||
&& gConf.GfxPropertiesArray[Index].Bus == Bus
|
||||
&& gConf.GfxPropertiesArray[Index].Device == Device) {
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const MacOsVersion& OSVersion)
|
||||
XBool setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const MacOsVersion& OSVersion)
|
||||
{
|
||||
DevPropDevice *device = NULL;
|
||||
UINT32 layoutId = 0;
|
||||
UINT32 codecId = 0;
|
||||
BOOLEAN Injected = FALSE;
|
||||
XBool Injected = false;
|
||||
UINTN i;
|
||||
|
||||
if (!device_inject_string) {
|
||||
@ -164,15 +164,15 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const M
|
||||
}
|
||||
if (IsHDMIAudio(hda_dev->DeviceHandle)) {
|
||||
if (!gSettings.Devices.HDMIInjection) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hda_dev && !hda_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, hda_dev, NULL);
|
||||
hda_dev->used = TRUE;
|
||||
hda_dev->used = true;
|
||||
}
|
||||
if (!device) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gSettings.Devices.AddPropertyArray.size() != 0xFFFE) { // Looks like NrAddProperties == 0xFFFE is not used anymore
|
||||
@ -180,7 +180,7 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const M
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != DEV_HDMI) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -192,7 +192,7 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const M
|
||||
}
|
||||
if (Injected) {
|
||||
DBG("Additional HDMI properties injected, continue\n");
|
||||
//return TRUE;
|
||||
//return true;
|
||||
} else {
|
||||
if (gSettings.Devices.UseIntelHDMI) {
|
||||
DBG(" HDMI Audio, used with HDA setting hda-gfx=onboard-2\n");
|
||||
@ -204,14 +204,14 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const M
|
||||
}
|
||||
} else {
|
||||
if (!gSettings.Devices.Audio.HDAInjection) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
if (hda_dev && !hda_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, hda_dev, NULL);
|
||||
hda_dev->used = TRUE;
|
||||
hda_dev->used = true;
|
||||
}
|
||||
if (!device) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
// HDA - determine layout-id
|
||||
if (gSettings.Devices.Audio.HDALayoutId > 0) {
|
||||
@ -226,7 +226,7 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const M
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != DEV_HDA) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -253,7 +253,7 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, const M
|
||||
devprop_add_value(device, "PinConfigurations", (UINT8 *)&layoutId, 1);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -341,14 +341,14 @@ typedef enum {
|
||||
} HRDW_MANUFACTERER;
|
||||
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
setup_hda_devprop (
|
||||
EFI_PCI_IO_PROTOCOL *PciIo,
|
||||
pci_dt_t *hda_dev,
|
||||
const MacOsVersion& OSVersion
|
||||
);
|
||||
|
||||
BOOLEAN EFIAPI IsHDMIAudio(EFI_HANDLE PciDevHandle);
|
||||
XBool EFIAPI IsHDMIAudio(EFI_HANDLE PciDevHandle);
|
||||
void ResetHDA();
|
||||
|
||||
#endif /* !__LIBSAIO_GMA_H */
|
||||
|
@ -52,13 +52,13 @@
|
||||
//UINT32 *dtLength;
|
||||
//UINT8 *KernelData = NULL;
|
||||
//UINT32 KernelSlide = 0;
|
||||
//BOOLEAN isKernelcache = FALSE;
|
||||
//BOOLEAN is64BitKernel = FALSE;
|
||||
//BOOLEAN SSSE3;
|
||||
//XBool isKernelcache = false;
|
||||
//XBool is64BitKernel = false;
|
||||
//XBool SSSE3;
|
||||
|
||||
//BOOLEAN PatcherInited = FALSE;
|
||||
//BOOLEAN gSNBEAICPUFixRequire = FALSE; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not
|
||||
//BOOLEAN gBDWEIOPCIFixRequire = FALSE; // Broadwell-E IOPCIFamily fix require or not
|
||||
//XBool PatcherInited = false;
|
||||
//XBool gSNBEAICPUFixRequire = false; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not
|
||||
//XBool gBDWEIOPCIFixRequire = false; // Broadwell-E IOPCIFamily fix require or not
|
||||
|
||||
extern EFI_GUID gEfiAppleBootGuid;
|
||||
|
||||
@ -224,7 +224,7 @@ UINTN LOADER_ENTRY::searchProcInDriver(UINT8 * driver, UINT32 driverLen, const X
|
||||
}
|
||||
INT32 i;
|
||||
UINT32 Offset = 0; // Init to avoid warning
|
||||
bool found = false;
|
||||
XBool found = false;
|
||||
for (i = 0; i < lSizeVtable; ++i) {
|
||||
Offset = vArray[i].n_un.n_strx;
|
||||
if (strstr(&Names[Offset], procedure.c_str())) {
|
||||
@ -334,7 +334,7 @@ UINTN LOADER_ENTRY::searchProc(const XString8& procedure)
|
||||
//search for the name
|
||||
// gBS->Stall(9000000);
|
||||
size_t i;
|
||||
bool found = false;
|
||||
XBool found = false;
|
||||
for (i=0; i<SizeVtable; ++i) {
|
||||
size_t Offset = vArray[i].NameOffset;
|
||||
if (Offset == 0) break;
|
||||
@ -820,13 +820,13 @@ const UINT8 CataSearchExt[] = {0x44, 0x89, 0xE0, 0xC1, 0xE8, 0x10};
|
||||
const UINT8 CataReplaceMovEax[] = {0xB8, 0x00, 0x00, 0x00, 0x00, 0x90}; // mov eax, val || nop
|
||||
|
||||
|
||||
BOOLEAN LOADER_ENTRY::PatchCPUID(const UINT8* Location, INT32 LenLoc,
|
||||
XBool LOADER_ENTRY::PatchCPUID(const UINT8* Location, INT32 LenLoc,
|
||||
const UINT8* Search4, const UINT8* Search10, const UINT8* ReplaceModel,
|
||||
const UINT8* ReplaceExt, INT32 Len)
|
||||
{
|
||||
INT32 patchLocation=0, patchLocation1=0;
|
||||
INT32 Adr = 0, Num;
|
||||
BOOLEAN Patched = FALSE;
|
||||
XBool Patched = false;
|
||||
UINT8 FakeModel = (KernelAndKextPatches.FakeCPUID >> 4) & 0x0f;
|
||||
UINT8 FakeExt = (KernelAndKextPatches.FakeCPUID >> 0x10) & 0x0f;
|
||||
for (Num = 0; Num < 2; Num++) {
|
||||
@ -847,7 +847,7 @@ BOOLEAN LOADER_ENTRY::PatchCPUID(const UINT8* Location, INT32 LenLoc,
|
||||
CopyMem(&KernelData[Adr + patchLocation1], ReplaceExt, Len);
|
||||
KernelData[Adr + patchLocation1 + 1] = FakeExt;
|
||||
}
|
||||
Patched = TRUE;
|
||||
Patched = true;
|
||||
}
|
||||
}
|
||||
return Patched;
|
||||
@ -917,7 +917,7 @@ void LOADER_ENTRY::KernelCPUIDPatch()
|
||||
|
||||
#define NEW_PM 1
|
||||
|
||||
BOOLEAN LOADER_ENTRY::KernelPatchPm()
|
||||
XBool LOADER_ENTRY::KernelPatchPm()
|
||||
{
|
||||
DBG_RT("Patching kernel power management...\n");
|
||||
#if NEW_PM
|
||||
@ -987,7 +987,7 @@ BOOLEAN LOADER_ENTRY::KernelPatchPm()
|
||||
UINT64* Ptr = (UINT64*)KernelData;
|
||||
UINT64* End = Ptr + 0x1000000/sizeof(UINT64);
|
||||
if (Ptr == NULL) {
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -1032,24 +1032,24 @@ BOOLEAN LOADER_ENTRY::KernelPatchPm()
|
||||
gBS->Stall(3000000);
|
||||
}
|
||||
#endif
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
const UINT8 PanicNoKextDumpFind[] = {0x00, 0x25, 0x2E, 0x2A, 0x73, 0x00};
|
||||
//STATIC UINT8 PanicNoKextDumpReplace[6] = {0x00, 0x00, 0x2E, 0x2A, 0x73, 0x00};
|
||||
|
||||
BOOLEAN LOADER_ENTRY::KernelPanicNoKextDump()
|
||||
XBool LOADER_ENTRY::KernelPanicNoKextDump()
|
||||
{
|
||||
INT32 patchLocation;
|
||||
patchLocation = FindBin(KernelData, 0xF00000, PanicNoKextDumpFind, 6);
|
||||
if (patchLocation > 0) {
|
||||
KernelData[patchLocation + 1] = 0;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
BOOLEAN LOADER_ENTRY::KernelLapicPatch_64()
|
||||
XBool LOADER_ENTRY::KernelLapicPatch_64()
|
||||
{
|
||||
// Credits to donovan6000 and Sherlocks for providing the lapic kernel patch source used to build this function
|
||||
|
||||
@ -1125,7 +1125,7 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_64()
|
||||
|
||||
if (!patchLocation1) {
|
||||
DBG_RT( "Can't find Lapic panic, kernel patch aborted.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Already patched? May be running a non-vanilla kernel already?
|
||||
@ -1133,11 +1133,11 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_64()
|
||||
bytes[patchLocation1 + 2] == 0x90 && bytes[patchLocation1 + 3] == 0x90 &&
|
||||
bytes[patchLocation1 + 4] == 0x90) {
|
||||
DBG_RT( "Lapic panic already patched, kernel file (10.6 - 10.9) manually patched?\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
} else if (bytes[patchLocation1 + 0] == 0x31 && bytes[patchLocation1 + 1] == 0xC0 &&
|
||||
bytes[patchLocation1 + 2] == 0x90 && bytes[patchLocation1 + 3] == 0x90) {
|
||||
DBG_RT( "Lapic panic already patched, kernel file (10.10 - recent macOS) manually patched?\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
if (bytes[patchLocation1 + 8] == 0x3B && bytes[patchLocation1 + 9] == 0x05 &&
|
||||
bytes[patchLocation1 + 13] == 0x00) {
|
||||
@ -1174,13 +1174,13 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_64()
|
||||
|
||||
if (!patchLocation2) {
|
||||
DBG_RT( "Can't find Lapic panic master (10.10 - recent macOS), kernel patch aborted.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Already patched? May be running a non-vanilla kernel already?
|
||||
if (bytes[patchLocation2 + 5] == 0x31 && bytes[patchLocation2 + 6] == 0xC0) {
|
||||
DBG_RT( "Lapic panic master already patched, kernel file (10.10 - recent macOS) manually patched?\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
DBG_RT( "Patched Lapic panic master (10.10 - recent macOS)\n");
|
||||
// E8 XX XX FF FF 83 XX XX XX XX 00 00
|
||||
@ -1203,10 +1203,10 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_64()
|
||||
Stall(3000000);
|
||||
// }
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN LOADER_ENTRY::KernelLapicPatch_32()
|
||||
XBool LOADER_ENTRY::KernelLapicPatch_32()
|
||||
{
|
||||
// Credits to donovan6000 and Sherlocks for providing the lapic kernel patch source used to build this function
|
||||
|
||||
@ -1229,7 +1229,7 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_32()
|
||||
|
||||
if (!patchLocation) {
|
||||
DBG_RT( "Can't find Lapic panic, kernel patch aborted.\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Already patched? May be running a non-vanilla kernel already?
|
||||
@ -1238,7 +1238,7 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_32()
|
||||
bytes[patchLocation + 2] == 0x90 && bytes[patchLocation + 3] == 0x90 &&
|
||||
bytes[patchLocation + 4] == 0x90) {
|
||||
DBG_RT( "Lapic panic already patched, kernel file manually patched?\n");
|
||||
return FALSE;
|
||||
return false;
|
||||
} else {
|
||||
DBG_RT( "Patched Lapic panic (32-bit)\n");
|
||||
for (i = 0; i < 5; i++) {
|
||||
@ -1250,7 +1250,7 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_32()
|
||||
Stall(3000000);
|
||||
// }
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
@ -1259,7 +1259,7 @@ BOOLEAN LOADER_ENTRY::KernelLapicPatch_32()
|
||||
// SandyBridge-E, Ivy Bridge, Ivy Bridge-E, Haswell Celeron/Pentium, Haswell-E, Broadwell-E, ...
|
||||
// credit Pike R.Alpha, stinga11, syscl
|
||||
//
|
||||
//BOOLEAN (*EnableExtCpuXCPM)(void *kernelData);
|
||||
//XBool (*EnableExtCpuXCPM)(void *kernelData);
|
||||
|
||||
//
|
||||
// syscl - applyKernPatch a wrapper for SearchAndReplace() to make the CpuPM patch tidy and clean
|
||||
@ -1278,7 +1278,7 @@ void LOADER_ENTRY::applyKernPatch(const UINT8 *find, UINTN size, const UINT8 *re
|
||||
// Global XCPM patches compatibility
|
||||
// Currently 10.8.5 - 10.15
|
||||
//
|
||||
static inline BOOLEAN IsXCPMOSVersionCompat(const MacOsVersion& macOSVersion)
|
||||
static inline XBool IsXCPMOSVersionCompat(const MacOsVersion& macOSVersion)
|
||||
{
|
||||
return macOSVersion >= MacOsVersion("10.8.5"_XS8) && macOSVersion < MacOsVersion("11.1.0"_XS8);
|
||||
}
|
||||
@ -1288,17 +1288,17 @@ static inline BOOLEAN IsXCPMOSVersionCompat(const MacOsVersion& macOSVersion)
|
||||
//
|
||||
// syscl - SandyBridgeEPM(): enable PowerManagement on SandyBridge-E
|
||||
//
|
||||
BOOLEAN LOADER_ENTRY::SandyBridgeEPM()
|
||||
XBool LOADER_ENTRY::SandyBridgeEPM()
|
||||
{
|
||||
// note: a dummy function that made patches consistency
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// syscl - Enable Haswell-E XCPM
|
||||
// Hex data provided and polished (c) PMheart, idea (c) Pike R.Alpha
|
||||
//
|
||||
BOOLEAN LOADER_ENTRY::HaswellEXCPM()
|
||||
XBool LOADER_ENTRY::HaswellEXCPM()
|
||||
{
|
||||
DBG("HaswellEXCPM() ===>\n");
|
||||
UINT8 *kern = KernelData;
|
||||
@ -1310,8 +1310,8 @@ BOOLEAN LOADER_ENTRY::HaswellEXCPM()
|
||||
// check OS version suit for patches
|
||||
if (!IsXCPMOSVersionCompat(macOSVersion)) {
|
||||
DBG("HaswellEXCPM(): Unsupported macOS.\n");
|
||||
DBG("HaswellEXCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("HaswellEXCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// _cpuid_set_info
|
||||
@ -1453,19 +1453,19 @@ BOOLEAN LOADER_ENTRY::HaswellEXCPM()
|
||||
DBG("Applied _xcpm_pkg_scope_msr patch\n");
|
||||
} else {
|
||||
DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
|
||||
DBG("HaswellEXCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("HaswellEXCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DBG("HaswellEXCPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Enable Broadwell-E/EP PowerManagement on 10.12+ by syscl
|
||||
//
|
||||
BOOLEAN LOADER_ENTRY::BroadwellEPM()
|
||||
XBool LOADER_ENTRY::BroadwellEPM()
|
||||
{
|
||||
DBG("BroadwellEPM() ===>\n");
|
||||
|
||||
@ -1476,8 +1476,8 @@ BOOLEAN LOADER_ENTRY::BroadwellEPM()
|
||||
// check OS version suit for patches
|
||||
if (!IsXCPMOSVersionCompat(macOSVersion)) {
|
||||
DBG("BroadwellEPM(): Unsupported macOS.\n");
|
||||
DBG("BroadwellEPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("BroadwellEPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
KernelAndKextPatches.FakeCPUID = (UINT32)(macOSVersion.notEmpty() && macOSVersion < MacOsVersion("10.10.3"_XS8) ? 0x0306C0 : 0x040674);
|
||||
@ -1511,20 +1511,20 @@ BOOLEAN LOADER_ENTRY::BroadwellEPM()
|
||||
DBG("Applied _xcpm_pkg_scope_msr patch\n");
|
||||
} else {
|
||||
DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
|
||||
DBG("BroadwellEPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("BroadwellEPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DBG("BroadwellEPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
//
|
||||
// syscl - this patch provides XCPM support for Haswell low-end(HSWLowEnd) and platforms later than Haswell
|
||||
// implemented by syscl
|
||||
// credit also Pike R.Alpha, stinga11, Sherlocks, vit9696
|
||||
//
|
||||
BOOLEAN LOADER_ENTRY::HaswellLowEndXCPM()
|
||||
XBool LOADER_ENTRY::HaswellLowEndXCPM()
|
||||
{
|
||||
DBG("HaswellLowEndXCPM() ===>\n");
|
||||
// UINT64 os_version = AsciiOSVersionToUint64(macOSVersion);
|
||||
@ -1533,8 +1533,8 @@ BOOLEAN LOADER_ENTRY::HaswellLowEndXCPM()
|
||||
// check OS version suit for patches
|
||||
if (!IsXCPMOSVersionCompat(macOSVersion)) {
|
||||
DBG("HaswellLowEndXCPM(): Unsupported macOS.\n");
|
||||
DBG("HaswellLowEndXCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("HaswellLowEndXCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
KernelAndKextPatches.FakeCPUID = (UINT32)(0x0306A0); // correct FakeCPUID
|
||||
@ -1543,7 +1543,7 @@ BOOLEAN LOADER_ENTRY::HaswellLowEndXCPM()
|
||||
// 10.8.5 - 10.11.x no need the following kernel patches on Haswell Celeron/Pentium
|
||||
if (macOSVersion >= MacOsVersion("10.8.5"_XS8) && macOSVersion < MacOsVersion("10.12"_XS8)) {
|
||||
DBG("HaswellLowEndXCPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
// _xcpm_idle //this is a part of KernelPM
|
||||
@ -1611,13 +1611,13 @@ BOOLEAN LOADER_ENTRY::HaswellLowEndXCPM()
|
||||
}
|
||||
|
||||
DBG("HaswellLowEndXCPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// this patch provides XCPM support for Ivy Bridge. by PMheart
|
||||
//
|
||||
BOOLEAN LOADER_ENTRY::KernelIvyBridgeXCPM()
|
||||
XBool LOADER_ENTRY::KernelIvyBridgeXCPM()
|
||||
{
|
||||
XString8 comment;
|
||||
// UINT32 i;
|
||||
@ -1627,20 +1627,20 @@ BOOLEAN LOADER_ENTRY::KernelIvyBridgeXCPM()
|
||||
// check whether Ivy Bridge
|
||||
if (gCPUStructure.Model != CPU_MODEL_IVY_BRIDGE) {
|
||||
DBG("KernelIvyBridgeXCPM(): Unsupported platform.\nRequires Ivy Bridge, aborted\n");
|
||||
DBG("KernelIvyBridgeXCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("KernelIvyBridgeXCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check OS version suit for patches
|
||||
// PMheart: attempt to add 10.14 compatibility
|
||||
if (!IsXCPMOSVersionCompat(macOSVersion)) {
|
||||
DBG("KernelIvyBridgeXCPM():Unsupported macOS.\n");
|
||||
DBG("KernelIvyBridgeXCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("KernelIvyBridgeXCPM() <===false\n");
|
||||
return false;
|
||||
} else if (macOSVersion >= MacOsVersion("10.8.5"_XS8) && macOSVersion < MacOsVersion("10.12"_XS8)) {
|
||||
// 10.8.5 - 10.11.x no need the following kernel patches on Ivy Bridge - we just use -xcpm boot-args
|
||||
DBG("KernelIvyBridgeXCPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
DBG("Searching _xcpm_pkg_scope_msr ...\n");
|
||||
@ -1667,8 +1667,8 @@ BOOLEAN LOADER_ENTRY::KernelIvyBridgeXCPM()
|
||||
DBG("Applied _xcpm_pkg_scope_msr patch\n");
|
||||
} else {
|
||||
DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
|
||||
DBG("KernelIvyBridgeXCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("KernelIvyBridgeXCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1715,14 +1715,14 @@ BOOLEAN LOADER_ENTRY::KernelIvyBridgeXCPM()
|
||||
}
|
||||
*/
|
||||
DBG("KernelIvyBridgeXCPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// this patch provides XCPM support for Ivy Bridge-E. by PMheart
|
||||
// attempt to enable XCPM for Ivy-E, still need to test further
|
||||
//
|
||||
BOOLEAN LOADER_ENTRY::KernelIvyE5XCPM()
|
||||
XBool LOADER_ENTRY::KernelIvyE5XCPM()
|
||||
{
|
||||
UINT8 *kern = (UINT8*)KernelData;
|
||||
XString8 comment;
|
||||
@ -1733,16 +1733,16 @@ BOOLEAN LOADER_ENTRY::KernelIvyE5XCPM()
|
||||
// check whether Ivy Bridge-E5
|
||||
if (gCPUStructure.Model != CPU_MODEL_IVY_BRIDGE_E5) {
|
||||
DBG("KernelIvyE5XCPM(): Unsupported platform.\nRequires Ivy Bridge-E, aborted\n");
|
||||
DBG("KernelIvyE5XCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("KernelIvyE5XCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// check OS version suit for patches
|
||||
// PMheart: attempt to add 10.15 compatibility
|
||||
if (!IsXCPMOSVersionCompat(macOSVersion)) {
|
||||
DBG("KernelIvyE5XCPM(): Unsupported macOS.\n");
|
||||
DBG("KernelIvyE5XCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("KernelIvyE5XCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// _cpuid_set_info
|
||||
@ -1806,8 +1806,8 @@ BOOLEAN LOADER_ENTRY::KernelIvyE5XCPM()
|
||||
DBG("Applied _xcpm_pkg_scope_msr patch\n");
|
||||
} else {
|
||||
// DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
|
||||
DBG("KernelIvyE5XCPM() <===FALSE\n");
|
||||
return FALSE;
|
||||
DBG("KernelIvyE5XCPM() <===false\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1888,7 +1888,7 @@ BOOLEAN LOADER_ENTRY::KernelIvyE5XCPM()
|
||||
}
|
||||
|
||||
DBG("KernelIvyE5XCPM() <===\n");
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#if 0
|
||||
void Patcher_SSE3_6(void* kernelData)
|
||||
@ -1903,7 +1903,7 @@ void Patcher_SSE3_6(void* kernelData)
|
||||
// DBG("Start find SSE3 address\n");
|
||||
i=0;
|
||||
//for (i=0;i<Length;i++)
|
||||
while(TRUE) {
|
||||
while(true) {
|
||||
if (bytes[i] == 0x66 && bytes[i+1] == 0x0F && bytes[i+2] == 0x6F &&
|
||||
bytes[i+3] == 0x44 && bytes[i+4] == 0x0E && bytes[i+5] == 0xF1 &&
|
||||
bytes[i-1664-32] == 0x55
|
||||
@ -1932,7 +1932,7 @@ void Patcher_SSE3_6(void* kernelData)
|
||||
// DBG("Found SSE3 last data addres Start\n");
|
||||
i = patchLocation1 + 1500;
|
||||
//for (i=(patchLocation1+1500); i<(patchLocation1+3000); i++)
|
||||
while(TRUE) {
|
||||
while(true) {
|
||||
if (bytes[i] == 0x90 && bytes[i+1] == 0x90 && bytes[i+2] == 0x55 ) {
|
||||
patchlast = (i+1) - patchLocation1;
|
||||
// DBG("Found SSE3 last data addres at 0x%08X\n", patchlast);
|
||||
@ -2288,7 +2288,7 @@ LOADER_ENTRY::FindBootArgs()
|
||||
ptr = (UINT8*)0x200000ull;
|
||||
|
||||
|
||||
while(TRUE) {
|
||||
while(true) {
|
||||
|
||||
// check bootargs for 10.7 and up
|
||||
bootArgs2 = (BootArgs2*)ptr;
|
||||
@ -2352,7 +2352,7 @@ LOADER_ENTRY::FindBootArgs()
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
LOADER_ENTRY::KernelUserPatch()
|
||||
{
|
||||
INTN Num, y = 0;
|
||||
@ -2372,7 +2372,7 @@ LOADER_ENTRY::KernelUserPatch()
|
||||
}
|
||||
// if we modify directly KernelAndKextPatches.KernelPatches[i].SearchLen, it will wrong for next driver
|
||||
UINTN SearchLen = KernelAndKextPatches.KernelPatches[i].SearchLen;
|
||||
bool once = false;
|
||||
XBool once = false;
|
||||
UINTN procLen = 0;
|
||||
UINTN procAddr = searchProc(KernelAndKextPatches.KernelPatches[i].ProcedureName);
|
||||
DBG("procedure %s found at 0x%llx\n", KernelAndKextPatches.KernelPatches[i].ProcedureName.c_str(), procAddr);
|
||||
@ -2423,7 +2423,7 @@ LOADER_ENTRY::KernelUserPatch()
|
||||
return (y != 0);
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
{
|
||||
INTN Num, y = 0;
|
||||
@ -2490,7 +2490,7 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// PatcherInited = TRUE;
|
||||
// PatcherInited = true;
|
||||
//
|
||||
// // KernelRelocBase will normally be 0
|
||||
// // but if OsxAptioFixDrv is used, then it will be > 0
|
||||
@ -2523,7 +2523,7 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// // check that it is Mach-O header and detect architecture
|
||||
// if(MACH_GET_MAGIC(KernelData) == MH_MAGIC || MACH_GET_MAGIC(KernelData) == MH_CIGAM) {
|
||||
// DBG("Found 32 bit kernel at 0x%llx\n", (UINTN)KernelData);
|
||||
// is64BitKernel = FALSE;
|
||||
// is64BitKernel = false;
|
||||
// } else if (MACH_GET_MAGIC(KernelData) == MH_MAGIC_64 || MACH_GET_MAGIC(KernelData) == MH_CIGAM_64) {
|
||||
// DBG( "Found 64 bit kernel at 0x%llx\n", (UINTN)KernelData);
|
||||
//// DBG_RT("text section is: %s\n", (const char*)&KernelData[0x28]);
|
||||
@ -2549,7 +2549,7 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// KernelOffset = GetTextExec();
|
||||
//// DBG("BigSur: KernelOffset =0x%X\n", KernelOffset);
|
||||
// }
|
||||
// is64BitKernel = TRUE;
|
||||
// is64BitKernel = true;
|
||||
// } else {
|
||||
// // not valid Mach-O header - exiting
|
||||
// DBG( "Kernel not found at 0x%llx - skipping patches!\n", (UINTN)KernelData);
|
||||
@ -2596,7 +2596,7 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
//void
|
||||
//LOADER_ENTRY::KernelAndKextsPatcherStart()
|
||||
//{
|
||||
// BOOLEAN KextPatchesNeeded, patchedOk;
|
||||
// XBool KextPatchesNeeded, patchedOk;
|
||||
// /*
|
||||
// * it was intended for custom entries but not work if no custom entries used
|
||||
// * so set common until better solution invented
|
||||
@ -2673,7 +2673,7 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// DBG( "KernelPm patch: Enabled\n");
|
||||
//// KernelAndKextPatcherInit();
|
||||
//// if (KernelData == NULL) goto NoKernelData;
|
||||
// patchedOk = FALSE;
|
||||
// patchedOk = false;
|
||||
// if (is64BitKernel) {
|
||||
// patchedOk = KernelPatchPm();
|
||||
// }
|
||||
@ -2718,8 +2718,8 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// // syscl - EnableExtCpuXCPM: Enable unsupported CPU's PowerManagement
|
||||
// //
|
||||
//// EnableExtCpuXCPM = NULL;
|
||||
// patchedOk = FALSE;
|
||||
//// BOOLEAN apply_idle_patch = (gCPUStructure.Model >= CPU_MODEL_SKYLAKE_U) && gSettings.HWP;
|
||||
// patchedOk = false;
|
||||
//// XBool apply_idle_patch = (gCPUStructure.Model >= CPU_MODEL_SKYLAKE_U) && gSettings.HWP;
|
||||
//// KernelAndKextPatcherInit();
|
||||
//// if (KernelData == NULL) goto NoKernelData;
|
||||
//
|
||||
@ -2733,7 +2733,7 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// case CPU_MODEL_JAKETOWN:
|
||||
// // SandyBridge-E LGA2011
|
||||
// patchedOk = SandyBridgeEPM();
|
||||
// gSNBEAICPUFixRequire = TRUE; // turn on SandyBridge-E AppleIntelCPUPowerManagement Fix
|
||||
// gSNBEAICPUFixRequire = true; // turn on SandyBridge-E AppleIntelCPUPowerManagement Fix
|
||||
// break;
|
||||
//
|
||||
// case CPU_MODEL_IVY_BRIDGE:
|
||||
@ -2755,13 +2755,13 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// case CPU_MODEL_BROADWELL_DE:
|
||||
// // Broadwell-E/EP
|
||||
// patchedOk = BroadwellEPM();
|
||||
// gBDWEIOPCIFixRequire = TRUE;
|
||||
// gBDWEIOPCIFixRequire = true;
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// if (gCPUStructure.Model >= CPU_MODEL_HASWELL &&
|
||||
// (AsciiStrStr(gCPUStructure.BrandString, "Celeron") ||
|
||||
// AsciiStrStr(gCPUStructure.BrandString, "Pentium"))) {
|
||||
// ( gCPUStructure.BrandString.contains("Celeron") ||
|
||||
// gCPUStructure.BrandString.contains("Pentium"))) {
|
||||
// // Haswell+ low-end CPU
|
||||
// patchedOk = HaswellLowEndXCPM();
|
||||
// }
|
||||
@ -2780,8 +2780,8 @@ LOADER_ENTRY::BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize)
|
||||
// if (/*OSFLAG_ISSET(Flags, OSFLAG_WITHKEXTS) || */
|
||||
// OSFLAG_ISSET(Flags, OSFLAG_CHECKFAKESMC)) {
|
||||
// DBG_RT( "\nAllowing kext patching to check if FakeSMC is present\n");
|
||||
// GlobalConfig.KextPatchesAllowed = TRUE;
|
||||
// KextPatchesNeeded = TRUE;
|
||||
// GlobalConfig.KextPatchesAllowed = true;
|
||||
// KextPatchesNeeded = true;
|
||||
// }
|
||||
//
|
||||
// DBG_RT( "\nKextPatches Needed: %c, Allowed: %c ... ",
|
||||
|
@ -138,16 +138,16 @@ typedef struct SEGMENT {
|
||||
//extern UINT32 *dtLength;
|
||||
//extern UINT8 *KernelData;
|
||||
//extern UINT32 KernelSlide;
|
||||
//extern BOOLEAN isKernelcache;
|
||||
//extern BOOLEAN is64BitKernel;
|
||||
//extern BOOLEAN gSNBEAICPUFixRequire; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not
|
||||
//extern BOOLEAN gBDWEIOPCIFixRequire; // Broadwell-E IOPCIFamily fix require or not
|
||||
//extern XBool isKernelcache;
|
||||
//extern XBool is64BitKernel;
|
||||
//extern XBool gSNBEAICPUFixRequire; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not
|
||||
//extern XBool gBDWEIOPCIFixRequire; // Broadwell-E IOPCIFamily fix require or not
|
||||
|
||||
|
||||
//extern UINT32 DisplayVendor[];
|
||||
//void findCPUfamily();
|
||||
|
||||
//extern BOOLEAN SSSE3;
|
||||
//extern XBool SSSE3;
|
||||
|
||||
|
||||
//UINT64 kernelsize;
|
||||
|
@ -107,9 +107,9 @@ void toLowerStr(CHAR8 *tstr, IN CONST CHAR8 *str) {
|
||||
*tstr = '\0';
|
||||
}
|
||||
|
||||
BOOLEAN LOADER_ENTRY::checkOSBundleRequired(const TagDict* dict)
|
||||
XBool LOADER_ENTRY::checkOSBundleRequired(const TagDict* dict)
|
||||
{
|
||||
BOOLEAN inject = TRUE;
|
||||
XBool inject = true;
|
||||
const TagStruct* osBundleRequiredTag;
|
||||
XString8 osbundlerequired;
|
||||
|
||||
@ -125,7 +125,7 @@ BOOLEAN LOADER_ENTRY::checkOSBundleRequired(const TagDict* dict)
|
||||
osbundlerequired != "local"_XS8 &&
|
||||
osbundlerequired != "console"_XS8 &&
|
||||
osbundlerequired != "network-root"_XS8 ) {
|
||||
inject = FALSE;
|
||||
inject = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ BOOLEAN LOADER_ENTRY::checkOSBundleRequired(const TagDict* dict)
|
||||
//extern void AnyKextPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize, INT32 N, LOADER_ENTRY *Entry);
|
||||
|
||||
//XStringW infoPlistPath = getKextPlist(dir, KextEntry, &NoContents);
|
||||
XStringW LOADER_ENTRY::getKextPlist(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, BOOLEAN* NoContents)
|
||||
XStringW LOADER_ENTRY::getKextPlist(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, XBool* NoContents)
|
||||
{
|
||||
XStringW TempName;
|
||||
|
||||
@ -151,9 +151,9 @@ XStringW LOADER_ENTRY::getKextPlist(const XStringW& dirPath, const SIDELOAD_KEXT
|
||||
MsgLog("Failed to load extra kext : %ls \n", TempName.wc_str());
|
||||
return L""_XSW;
|
||||
}
|
||||
*NoContents = TRUE;
|
||||
*NoContents = true;
|
||||
} else {
|
||||
*NoContents = FALSE;
|
||||
*NoContents = false;
|
||||
}
|
||||
return TempName;
|
||||
}
|
||||
@ -179,7 +179,7 @@ TagDict* LOADER_ENTRY::getInfoPlist(const XStringW& infoPlistPath)
|
||||
}
|
||||
|
||||
//XString8 execpath = getKextExecPath(dir, KextEntry, dict, NoContents);
|
||||
XString8 LOADER_ENTRY::getKextExecPath(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, TagDict* dict, BOOLEAN NoContents)
|
||||
XString8 LOADER_ENTRY::getKextExecPath(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, TagDict* dict, XBool NoContents)
|
||||
{
|
||||
const TagStruct* prop = NULL;
|
||||
XString8 TempName;
|
||||
@ -213,11 +213,11 @@ EFI_STATUS LOADER_ENTRY::LoadKext(const EFI_FILE *RootDir, const XString8& FileN
|
||||
UINTN executableBufferLength = 0;
|
||||
// CHAR8* bundlePathBuffer = NULL;
|
||||
// UINTN bundlePathBufferLength = 0;
|
||||
XStringW TempName;
|
||||
TagDict* dict = NULL;
|
||||
XStringW TempName;
|
||||
TagDict* dict = NULL;
|
||||
const TagStruct* prop = NULL;
|
||||
BOOLEAN NoContents = FALSE;
|
||||
BOOLEAN inject = FALSE;
|
||||
XBool NoContents = false;
|
||||
XBool inject = false;
|
||||
_BooterKextFileInfo *infoAddr = NULL;
|
||||
_DeviceTreeBuffer *kext = (_DeviceTreeBuffer *)kext_v;
|
||||
|
||||
@ -232,7 +232,7 @@ EFI_STATUS LOADER_ENTRY::LoadKext(const EFI_FILE *RootDir, const XString8& FileN
|
||||
MsgLog("Failed to load extra kext : %ls status=%s\n", TempName.wc_str(), efiStrError(Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
NoContents = TRUE;
|
||||
NoContents = true;
|
||||
}
|
||||
if( ParseXML((CHAR8*)infoDictBuffer, &dict,infoDictBufferLength)!=0 ) {
|
||||
FreePool(infoDictBuffer);
|
||||
@ -338,7 +338,7 @@ UINT32 GetListCount(LIST_ENTRY const* List)
|
||||
// return kextsSize;
|
||||
//}
|
||||
|
||||
void LOADER_ENTRY::LoadPlugInKexts(const EFI_FILE *RootDir, const XString8& DirName, IN cpu_type_t archCpuType, IN BOOLEAN Force)
|
||||
void LOADER_ENTRY::LoadPlugInKexts(const EFI_FILE *RootDir, const XString8& DirName, IN cpu_type_t archCpuType, IN XBool Force)
|
||||
{
|
||||
REFIT_DIR_ITER PlugInIter;
|
||||
EFI_FILE_INFO *PlugInFile;
|
||||
@ -504,14 +504,14 @@ void LOADER_ENTRY::AddKextsInArray(XObjArray<SIDELOAD_KEXT>* kextArray)
|
||||
MsgLog(" Force kext: %s\n", FileName.c_str());
|
||||
AddKext( Volume->RootDir, FileName, archCpuType);
|
||||
XString8 PlugIns = S8Printf("%s\\Contents\\PlugIns", FileName.c_str());
|
||||
LoadPlugInKexts(Volume->RootDir, PlugIns, archCpuType, TRUE);
|
||||
LoadPlugInKexts(Volume->RootDir, PlugIns, archCpuType, true);
|
||||
}
|
||||
DirIterClose(&PlugInIter);
|
||||
} else {
|
||||
XString8 Path = S8Printf("%ls", p);
|
||||
AddKext( Volume->RootDir, Path, archCpuType);
|
||||
XString8 PlugIns = S8Printf("%s\\Contents\\PlugIns", Path.c_str());
|
||||
LoadPlugInKexts(Volume->RootDir, PlugIns, archCpuType, TRUE);
|
||||
LoadPlugInKexts(Volume->RootDir, PlugIns, archCpuType, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -536,18 +536,18 @@ void LOADER_ENTRY::AddKextsInArray(XObjArray<SIDELOAD_KEXT>* kextArray)
|
||||
|
||||
// syscl - allow specific load inject kext
|
||||
// Clover/Kexts/Other is for general injection thus we need to scan both Other and macOSVersion folder
|
||||
SrcDir = GetOtherKextsDir(TRUE);
|
||||
SrcDir = GetOtherKextsDir(true);
|
||||
if ( SrcDir.notEmpty() ) {
|
||||
AddKextsFromDirInArray(SrcDir, archCpuType, kextArray);
|
||||
} else {
|
||||
DBG("GetOtherKextsDir(TRUE) return NULL\n");
|
||||
DBG("GetOtherKextsDir(true) return NULL\n");
|
||||
}
|
||||
// slice: CLOVER/kexts/Off keep disabled kext which can be allowed
|
||||
SrcDir = GetOtherKextsDir(FALSE);
|
||||
SrcDir = GetOtherKextsDir(false);
|
||||
if ( SrcDir.notEmpty() ) {
|
||||
AddKextsFromDirInArray(SrcDir, archCpuType, kextArray);
|
||||
} else {
|
||||
DBG("GetOtherKextsDir(FALSE) return NULL\n");
|
||||
DBG("GetOtherKextsDir(false) return NULL\n");
|
||||
}
|
||||
|
||||
if ( macOSVersion.notEmpty() )
|
||||
|
@ -60,20 +60,20 @@ UINTN FindRelative32(const UINT8 *Source, UINTN Start, UINTN SourceSize, UINTN t
|
||||
/*
|
||||
UINTN FindSection(const UINT8 *Source, UINTN len, const UINT8* seg, const UINT8* sec)
|
||||
{
|
||||
BOOLEAN eq;
|
||||
XBool eq;
|
||||
|
||||
for (UINTN i = 0x20; i < len; i++) {
|
||||
eq = TRUE;
|
||||
eq = true;
|
||||
for (UINTN j = 0; j < 16 && (sec[j] != 0); j++) {
|
||||
if (Source[i + j] != sec[j]) {
|
||||
eq = FALSE;
|
||||
eq = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (eq) {
|
||||
for (UINTN j = 0; j < 16 && (seg[j] != 0); j++) {
|
||||
if (Source[i + 0x10 + j] != seg[j]) {
|
||||
eq = FALSE;
|
||||
eq = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -143,10 +143,10 @@ void ExtractKextBundleIdentifier(CHAR8 *Plist)
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
isPatchNameMatch (CHAR8 *BundleIdentifier, CHAR8 *Name)
|
||||
{
|
||||
BOOLEAN isBundle = (AsciiStrStr(Name, ".") != NULL);
|
||||
XBool isBundle = (AsciiStrStr(Name, ".") != NULL);
|
||||
return
|
||||
isBundle
|
||||
? (AsciiStrCmp(BundleIdentifier, Name) == 0)
|
||||
@ -163,7 +163,7 @@ isPatchNameMatch (CHAR8 *BundleIdentifier, CHAR8 *Name)
|
||||
//
|
||||
|
||||
// inited or not?
|
||||
BOOLEAN ATIConnectorsPatchInited = FALSE;
|
||||
XBool ATIConnectorsPatchInited = false;
|
||||
|
||||
// ATIConnectorsController's boundle IDs for
|
||||
// 0: ATI version - Lion, SnowLeo 10.6.7 2011 MBP
|
||||
@ -193,7 +193,7 @@ void LOADER_ENTRY::ATIConnectorsPatchInit()
|
||||
KernelAndKextPatches.KPATIConnectorsController.c_str()
|
||||
);
|
||||
|
||||
ATIConnectorsPatchInited = TRUE;
|
||||
ATIConnectorsPatchInited = true;
|
||||
|
||||
//DBG(L"Bundle1: %s\n", ATIKextBundleId[0]);
|
||||
//DBG(L"Bundle2: %s\n", ATIKextBundleId[1]);
|
||||
@ -574,7 +574,7 @@ void LOADER_ENTRY::SNBE_AICPUPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *Info
|
||||
// now let's patch it
|
||||
if (macOSVersion < MacOsVersion("10.9"_XS8) || macOSVersion >= MacOsVersion("10.14"_XS8)) {
|
||||
DBG("Unsupported macOS.\nSandyBridge-E requires macOS 10.9 - 10.13.x, aborted\n");
|
||||
DBG("SNBE_AICPUPatch() <===FALSE\n");
|
||||
DBG("SNBE_AICPUPatch() <===false\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -957,7 +957,7 @@ void LOADER_ENTRY::AnyKextPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPli
|
||||
if (!kextpatch.IsPlistPatch) {
|
||||
// kext binary patch
|
||||
DBG_RT("Binary patch\n");
|
||||
bool once = false;
|
||||
XBool once = false;
|
||||
UINTN procLen = 0;
|
||||
UINTN procAddr = searchProcInDriver(Driver, DriverSize, kextpatch.ProcedureName);
|
||||
|
||||
@ -1122,7 +1122,7 @@ void LOADER_ENTRY::PatchKext(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist,
|
||||
|
||||
for (size_t i = 0; i < KernelAndKextPatches.KextPatches.size(); i++) {
|
||||
XString8& Name = KernelAndKextPatches.KextPatches[i].Name;
|
||||
BOOLEAN isBundle = Name.contains(".");
|
||||
XBool isBundle = Name.contains(".");
|
||||
if ((KernelAndKextPatches.KextPatches[i].Find.size() > 0) &&
|
||||
isBundle?(AsciiStrCmp(gKextBundleIdentifier, Name.c_str()) == 0):(AsciiStrStr(gKextBundleIdentifier, Name.c_str()) != NULL)) {
|
||||
// (AsciiStrStr(InfoPlist, KernelAndKextPatches.KextPatches[i].Name) != NULL)) {
|
||||
|
@ -1823,7 +1823,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom)
|
||||
UINT16 dcbptr;
|
||||
UINT8 *dcbtable;
|
||||
UINT8 *togroup;
|
||||
INT32 has_lvds = FALSE;
|
||||
INT32 has_lvds = false;
|
||||
struct dcbentry {
|
||||
UINT8 type;
|
||||
UINT8 index;
|
||||
@ -1832,7 +1832,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom)
|
||||
|
||||
// DBG("patch_nvidia_rom\n");
|
||||
if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) {
|
||||
DBG("FALSE ROM signature: 0x%02hhX%02hhX\n", rom[0], rom[1]);
|
||||
DBG("false ROM signature: 0x%02hhX%02hhX\n", rom[0], rom[1]);
|
||||
return PATCH_ROM_FAILED;
|
||||
}
|
||||
|
||||
@ -1907,7 +1907,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom)
|
||||
|
||||
for (i = 0; i < num_outputs; i++) {
|
||||
if (entries[i].type == 3) {
|
||||
has_lvds =TRUE;
|
||||
has_lvds =true;
|
||||
//DBG("found LVDS\n");
|
||||
channel1 |= (0x1 << entries[i].index);
|
||||
entries[i].type = TYPE_GROUPED;
|
||||
@ -2019,7 +2019,7 @@ CONST CHAR8 *get_nvidia_model(UINT32 device_id, UINT32 subsys_id)
|
||||
|
||||
//ErmaC added selector for nVidia "old" style in System Profiler
|
||||
//DBG("NvidiaGeneric = %ls\n", gSettings.Graphics.NvidiaGeneric?L"YES":L"NO");
|
||||
if (gSettings.Graphics.NvidiaGeneric == FALSE)
|
||||
if (gSettings.Graphics.NvidiaGeneric == false)
|
||||
{
|
||||
// Then check the exceptions table
|
||||
if (subsys_id) {
|
||||
@ -2148,7 +2148,7 @@ UINT64 mem_detect(UINT16 nvCardType, pci_dt_t *nvda_dev)
|
||||
break;
|
||||
case 0x0649: // 9600M GT 0649
|
||||
// 10DE06491043202D 1GB VRAM
|
||||
if (((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id) == 0x1043202D) {
|
||||
if (((nvda_dev->subsys_id_union.subsys.vendor_id << 16) | nvda_dev->subsys_id_union.subsys.device_id) == 0x1043202D) {
|
||||
vram_size = 1024*1024*1024;
|
||||
}
|
||||
break;
|
||||
@ -2171,14 +2171,14 @@ UINT64 mem_detect(UINT16 nvCardType, pci_dt_t *nvda_dev)
|
||||
return vram_size;
|
||||
}
|
||||
|
||||
BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
XBool setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
{
|
||||
const INT32 MAX_BIOS_VERSION_LENGTH = 32;
|
||||
EFI_STATUS Status = EFI_NOT_FOUND;
|
||||
DevPropDevice *device = NULL;
|
||||
XString8 devicepath;
|
||||
BOOLEAN load_vbios = gSettings.Graphics.LoadVBios;
|
||||
BOOLEAN Injected = FALSE;
|
||||
XBool load_vbios = gSettings.Graphics.LoadVBios;
|
||||
XBool Injected = false;
|
||||
UINT8 *rom = NULL;
|
||||
UINT16 nvCardType = 0;
|
||||
UINT64 videoRam = 0;
|
||||
@ -2194,7 +2194,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
INT32 crlf_count = 0;
|
||||
option_rom_pci_header_t *rom_pci_header;
|
||||
XString8 version_str;
|
||||
BOOLEAN RomAssigned = FALSE;
|
||||
XBool RomAssigned = false;
|
||||
UINT32 device_id, subsys_id;
|
||||
const SETTINGS_DATA::GraphicsClass::GRAPHIC_CARD *nvcard;
|
||||
|
||||
@ -2204,7 +2204,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
// subsystem = (nvda_dev->subsys_id.subsys.vendor_id << 16) +
|
||||
// nvda_dev->subsys_id.subsys.device_id;
|
||||
device_id = ((nvda_dev->vendor_id << 16) | nvda_dev->device_id);
|
||||
subsys_id = ((nvda_dev->subsys_id.subsys.vendor_id << 16) | nvda_dev->subsys_id.subsys.device_id);
|
||||
subsys_id = ((nvda_dev->subsys_id_union.subsys.vendor_id << 16) | nvda_dev->subsys_id_union.subsys.device_id);
|
||||
|
||||
// get card type
|
||||
nvCardType = (REG32(nvda_dev->regs, 0) >> 20) & 0x1ff;
|
||||
@ -2245,7 +2245,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
if (n_ports == 0) { // !nvcard->VideoPorts
|
||||
n_ports = gConf.GfxPropertiesArray[j].Ports;
|
||||
}
|
||||
if (load_vbios == FALSE) { // !nvcard->LoadVBios
|
||||
if (load_vbios == false) { // !nvcard->LoadVBios
|
||||
load_vbios = gConf.GfxPropertiesArray[j].LoadVBios;
|
||||
}
|
||||
break;
|
||||
@ -2255,12 +2255,12 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
|
||||
|
||||
if (load_vbios) {
|
||||
XStringW FileName = SWPrintf("ROM\\10de_%04hX_%04hX_%04hX.rom", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id);
|
||||
XStringW FileName = SWPrintf("ROM\\10de_%04hX_%04hX_%04hX.rom", nvda_dev->device_id, nvda_dev->subsys_id_union.subsys.vendor_id, nvda_dev->subsys_id_union.subsys.device_id);
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
if ( selfOem.oemDirExists() ) {
|
||||
if (FileExists(&selfOem.getOemDir(), FileName)) {
|
||||
DBG("Found specific VBIOS ROM file (10de_%04hX_%04hX_%04hX.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id);
|
||||
DBG("Found specific VBIOS ROM file (10de_%04hX_%04hX_%04hX.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id_union.subsys.vendor_id, nvda_dev->subsys_id_union.subsys.device_id);
|
||||
Status = egLoadFile(&selfOem.getOemDir(), FileName.wc_str(), &buffer, &bufferLen);
|
||||
} else {
|
||||
FileName.SWPrintf("ROM\\10de_%04hX.rom", nvda_dev->device_id);
|
||||
@ -2272,9 +2272,9 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
}
|
||||
|
||||
if ( Status == EFI_NOT_FOUND ) {
|
||||
FileName.SWPrintf("ROM\\10de_%04hX_%04hX_%04hX.rom", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id);
|
||||
FileName.SWPrintf("ROM\\10de_%04hX_%04hX_%04hX.rom", nvda_dev->device_id, nvda_dev->subsys_id_union.subsys.vendor_id, nvda_dev->subsys_id_union.subsys.device_id);
|
||||
if (FileExists(&self.getCloverDir(), FileName)) {
|
||||
DBG("Found specific VBIOS ROM file (10de_%04hX_%04hX_%04hX.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id);
|
||||
DBG("Found specific VBIOS ROM file (10de_%04hX_%04hX_%04hX.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id_union.subsys.vendor_id, nvda_dev->subsys_id_union.subsys.device_id);
|
||||
Status = egLoadFile(&self.getCloverDir(), FileName.wc_str(), &buffer, &bufferLen);
|
||||
} else {
|
||||
FileName.SWPrintf("ROM\\10de_%04hX.rom", nvda_dev->device_id);
|
||||
@ -2324,11 +2324,11 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
}
|
||||
}
|
||||
if (!rom) rom = buffer;
|
||||
RomAssigned = TRUE;
|
||||
RomAssigned = true;
|
||||
DBG(" using loaded ROM image\n");
|
||||
} else {
|
||||
DBG(" there are no ROM loaded and no VBIOS read from hardware\n");
|
||||
// return FALSE;
|
||||
// return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2405,7 +2405,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
|
||||
if (nvda_dev && !nvda_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, nvda_dev, NULL);
|
||||
nvda_dev->used = TRUE;
|
||||
nvda_dev->used = true;
|
||||
}
|
||||
|
||||
DBG("Nvidia: VideoPorts:");
|
||||
@ -2434,7 +2434,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
if (gSettings.Devices.AddPropertyArray[i].Device != DEV_NVIDIA) {
|
||||
continue;
|
||||
}
|
||||
Injected = TRUE;
|
||||
Injected = true;
|
||||
|
||||
if (!gSettings.Devices.AddPropertyArray[i].MenuItem.BValue) {
|
||||
//DBG(" disabled property Key: %s, len: %d\n", gSettings.Devices.AddPropertyArray[i].Key, gSettings.Devices.AddPropertyArray[i].ValueLen);
|
||||
@ -2445,7 +2445,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev)
|
||||
}
|
||||
if (Injected) {
|
||||
DBG("custom NVIDIA properties injected, continue\n");
|
||||
//return TRUE;
|
||||
//return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2544,6 +2544,6 @@ done:
|
||||
if (!RomAssigned) {
|
||||
FreePool(rom);
|
||||
}
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
extern CHAR8* gDeviceProperties;
|
||||
|
||||
//BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev);
|
||||
//XBool setup_nvidia_devprop(pci_dt_t *nvda_dev);
|
||||
|
||||
typedef struct nvidia_pci_info_t
|
||||
{
|
||||
@ -180,7 +180,7 @@ extern const UINT8 default_NVPM[];
|
||||
extern const UINT8 default_dcfg_0[];
|
||||
extern const UINT8 default_dcfg_1[];
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
setup_nvidia_devprop (
|
||||
pci_dt_t *nvda_dev
|
||||
);
|
||||
|
@ -757,7 +757,7 @@ uint64_t GetExtFwFeaturesMask(MACHINE_TYPES Model)
|
||||
return (uint64_t)GetFwFeaturesMaskFromModel(Model) + 0xFF00000000ull;
|
||||
}
|
||||
|
||||
bool GetMobile(MACHINE_TYPES Model)
|
||||
XBool GetMobile(MACHINE_TYPES Model)
|
||||
{
|
||||
// Mobile: the battery tab in Energy Saver
|
||||
switch ( Model )
|
||||
@ -829,7 +829,7 @@ bool GetMobile(MACHINE_TYPES Model)
|
||||
case MacBookAir81:
|
||||
case MacBookAir82:
|
||||
case MacBookAir91:
|
||||
return TRUE;
|
||||
return true;
|
||||
case MacMini11:
|
||||
case MacMini21:
|
||||
case MacMini31:
|
||||
@ -841,7 +841,7 @@ bool GetMobile(MACHINE_TYPES Model)
|
||||
case MacMini62:
|
||||
case MacMini71:
|
||||
case MacMini81:
|
||||
return FALSE;
|
||||
return false;
|
||||
case iMac41:
|
||||
case iMac42:
|
||||
case iMac51:
|
||||
@ -875,7 +875,7 @@ bool GetMobile(MACHINE_TYPES Model)
|
||||
case iMac201:
|
||||
case iMac202:
|
||||
case iMacPro11:
|
||||
return FALSE;
|
||||
return false;
|
||||
case MacPro11:
|
||||
case MacPro21:
|
||||
case MacPro31:
|
||||
@ -883,13 +883,13 @@ bool GetMobile(MACHINE_TYPES Model)
|
||||
case MacPro51:
|
||||
case MacPro61:
|
||||
case MacPro71:
|
||||
return FALSE;
|
||||
return false;
|
||||
case Xserve11:
|
||||
case Xserve21:
|
||||
case Xserve31:
|
||||
return FALSE;
|
||||
return false;
|
||||
case MaxMachineType: // currently a copy of iMac132
|
||||
return FALSE;
|
||||
return false;
|
||||
default: // bug, unknown Apple model
|
||||
log_technical_bug("%s : cannot find model %d\n", __PRETTY_FUNCTION__, Model);
|
||||
return false;
|
||||
@ -988,7 +988,7 @@ UINT64 GetPlatformFeature(MACHINE_TYPES Model)
|
||||
}
|
||||
}
|
||||
|
||||
void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RBr[8])
|
||||
void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RBr[8])
|
||||
{
|
||||
memset(RBr, 0, 8);
|
||||
if (ApplePlatformData[Model].smcBranch[0] != 'N') {
|
||||
@ -1066,7 +1066,7 @@ void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RBr[8])
|
||||
}
|
||||
}
|
||||
|
||||
void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RPlt[8])
|
||||
void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RPlt[8])
|
||||
{
|
||||
memset(RPlt, 0, 8);
|
||||
if (ApplePlatformData[Model].smcPlatform[0] != 'N') {
|
||||
@ -1142,7 +1142,7 @@ void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RPlt[8])
|
||||
}
|
||||
}
|
||||
|
||||
bool isReleaseDateWithYear20(MACHINE_TYPES Model)
|
||||
XBool isReleaseDateWithYear20(MACHINE_TYPES Model)
|
||||
{
|
||||
switch ( Model )
|
||||
{
|
||||
@ -1598,11 +1598,11 @@ int compareBiosVersion(const XString8& version1, const XString8& version2)
|
||||
}
|
||||
}
|
||||
|
||||
bool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2)
|
||||
XBool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2)
|
||||
{
|
||||
return compareBiosVersion(version1, version2) <= 0;
|
||||
}
|
||||
bool isBiosVersionEquel(const XString8& version1, const XString8& version2)
|
||||
XBool isBiosVersionEquel(const XString8& version1, const XString8& version2)
|
||||
{
|
||||
return compareBiosVersion(version1, version2) == 0;
|
||||
}
|
||||
|
@ -196,21 +196,21 @@ extern PLATFORMDATA ApplePlatformData[];
|
||||
void SetDMISettingsForModel(MACHINE_TYPES Model, SETTINGS_DATA* settingsData, REFIT_CONFIG* liveConfig);
|
||||
MACHINE_TYPES GetModelFromString (const XString8& ProductName);
|
||||
|
||||
bool isReleaseDateWithYear20(MACHINE_TYPES Model);
|
||||
XBool isReleaseDateWithYear20(MACHINE_TYPES Model);
|
||||
XString8 GetReleaseDate (MACHINE_TYPES Model);
|
||||
uint8_t GetChassisTypeFromModel(MACHINE_TYPES Model);
|
||||
uint32_t GetFwFeaturesMaskFromModel(MACHINE_TYPES Model);
|
||||
uint32_t GetFwFeatures(MACHINE_TYPES Model);
|
||||
uint64_t GetExtFwFeatures(MACHINE_TYPES Model);
|
||||
uint64_t GetExtFwFeaturesMask(MACHINE_TYPES Model);
|
||||
bool GetMobile(MACHINE_TYPES Model);
|
||||
XBool GetMobile(MACHINE_TYPES Model);
|
||||
UINT64 GetPlatformFeature(MACHINE_TYPES Model);
|
||||
void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RBr[8]);
|
||||
void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, bool isMobile, char RPlt[8]);
|
||||
void getRBr(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RBr[8]);
|
||||
void getRPlt(MACHINE_TYPES Model, UINT32 CPUModel, XBool isMobile, char RPlt[8]);
|
||||
|
||||
int compareBiosVersion(const XString8& version1, const XString8& version2);
|
||||
bool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2);
|
||||
bool isBiosVersionEquel(const XString8& version1, const XString8& version2);
|
||||
XBool is2ndBiosVersionGreaterThan1st(const XString8& version1, const XString8& version2);
|
||||
XBool isBiosVersionEquel(const XString8& version1, const XString8& version2);
|
||||
|
||||
int compareReleaseDate(const XString8& date1, const XString8& date2);
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
XObjArray<TagArray> TagArray::tagsFree;
|
||||
|
||||
bool TagArray::operator == (const TagStruct& other) const
|
||||
XBool TagArray::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isArray() ) return false;
|
||||
if ( _arrayContent.size() != other.getArray()->arrayContent().size() ) {
|
||||
@ -60,7 +60,7 @@ bool TagArray::operator == (const TagStruct& other) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TagArray::debugIsEqual(const TagStruct& other, const XString8& label) const
|
||||
XBool TagArray::debugIsEqual(const TagStruct& other, const XString8& label) const
|
||||
{
|
||||
if ( !other.isArray() ) {
|
||||
MsgLog("counterpart of '%s' is not an array\n", label.c_str());
|
||||
|
@ -22,13 +22,13 @@ public:
|
||||
const TagArray& operator = (const TagArray&); // Can be defined if needed
|
||||
virtual ~TagArray() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual bool debugIsEqual(const TagStruct& other, const XString8& label) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
virtual XBool debugIsEqual(const TagStruct& other, const XString8& label) const;
|
||||
|
||||
virtual TagArray* getArray() { return this; }
|
||||
virtual const TagArray* getArray() const { return this; }
|
||||
|
||||
virtual bool isArray() const { return true; }
|
||||
virtual XBool isArray() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Array"_XS8; }
|
||||
static TagArray* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -71,7 +71,7 @@ void TagBool::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagBool::operator == (const TagStruct& other) const
|
||||
XBool TagBool::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isBool() ) return false;
|
||||
return value == other.getBool()->value;
|
||||
|
@ -13,7 +13,7 @@
|
||||
class TagBool : public TagStruct
|
||||
{
|
||||
static XObjArray<TagBool> tagsFree;
|
||||
bool value;
|
||||
XBool value;
|
||||
|
||||
public:
|
||||
|
||||
@ -22,12 +22,12 @@ public:
|
||||
const TagBool& operator = (const TagBool&); // Can be defined if needed
|
||||
virtual ~TagBool() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagBool* getBool() { return this; }
|
||||
virtual const TagBool* getBool() const { return this; }
|
||||
|
||||
virtual bool isBool() const { return true; }
|
||||
virtual XBool isBool() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Bool"_XS8; }
|
||||
static TagBool* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
@ -37,14 +37,14 @@ public:
|
||||
/*
|
||||
* getters and setters
|
||||
*/
|
||||
bool boolValue() const
|
||||
XBool boolValue() const
|
||||
{
|
||||
// if ( !isBool() ) panic("TagBool::boolValue() : !isBool() ");
|
||||
return value;
|
||||
}
|
||||
void setBoolValue(bool b)
|
||||
void setBoolValue(XBool b)
|
||||
{
|
||||
// if ( !isBool() ) panic("TagBool::setIntValue(bool) : !isBool() ");
|
||||
// if ( !isBool() ) panic("TagBool::setIntValue(XBool) : !isBool() ");
|
||||
value = b;
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ void TagData::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagData::operator == (const TagStruct& other) const
|
||||
XBool TagData::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isData() ) return false;
|
||||
if ( dataBuffer != other.getData()->dataBuffer ) return false;
|
||||
|
@ -23,12 +23,12 @@ public:
|
||||
const TagData& operator = (const TagData&); // Can be defined if needed
|
||||
virtual ~TagData() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagData* getData() { return this; }
|
||||
virtual const TagData* getData() const { return this; }
|
||||
|
||||
virtual bool isData() const { return true; }
|
||||
virtual XBool isData() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Data"_XS8; }
|
||||
static TagData* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -72,7 +72,7 @@ void TagDate::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagDate::operator == (const TagStruct& other) const
|
||||
XBool TagDate::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isDate() ) return false;
|
||||
return string == other.getDate()->string;
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
const TagDate& operator = (const TagDate&); // Can be defined if needed
|
||||
virtual ~TagDate() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagDate* getDate() { return this; }
|
||||
virtual const TagDate* getDate() const { return this; }
|
||||
|
||||
virtual bool isDict() const { return true; }
|
||||
virtual XBool isDict() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Dict"_XS8; }
|
||||
static TagDate* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -75,7 +75,7 @@ void TagDict::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagDict::operator == (const TagStruct& other) const
|
||||
XBool TagDict::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isDict() ) return false;
|
||||
if ( _dictContent.size() != other.getDict()->_dictContent.size() ) {
|
||||
@ -89,7 +89,7 @@ bool TagDict::operator == (const TagStruct& other) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TagDict::debugIsEqual(const TagStruct& other, const XString8& label) const
|
||||
XBool TagDict::debugIsEqual(const TagStruct& other, const XString8& label) const
|
||||
{
|
||||
if ( !other.isDict()) {
|
||||
MsgLog("counterpart of '%s' is not a dict\n", label.c_str());
|
||||
|
@ -22,13 +22,13 @@ public:
|
||||
const TagDict& operator = (const TagDict&); // Can be defined if needed
|
||||
virtual ~TagDict() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual bool debugIsEqual(const TagStruct& other, const XString8& label) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
virtual XBool debugIsEqual(const TagStruct& other, const XString8& label) const;
|
||||
|
||||
virtual TagDict* getDict() { return this; }
|
||||
virtual const TagDict* getDict() const { return this; }
|
||||
|
||||
virtual bool isDict() const { return true; }
|
||||
virtual XBool isDict() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Dict"_XS8; }
|
||||
static TagDict* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -73,7 +73,7 @@ void TagFloat::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagFloat::operator == (const TagStruct& other) const
|
||||
XBool TagFloat::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isFloat() ) return false;
|
||||
return value == other.getFloat()->value;
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
const TagFloat& operator = (const TagFloat&); // Can be defined if needed
|
||||
virtual ~TagFloat() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagFloat* getFloat() { return this; }
|
||||
virtual const TagFloat* getFloat() const { return this; }
|
||||
|
||||
virtual bool isFloat() const { return true; }
|
||||
virtual XBool isFloat() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Float"_XS8; }
|
||||
static TagFloat* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -73,7 +73,7 @@ void TagInt64::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagInt64::operator == (const TagStruct& other) const
|
||||
XBool TagInt64::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isInt64() ) return false;
|
||||
return value == other.getInt64()->value;
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
const TagInt64& operator = (const TagInt64&); // Can be defined if needed
|
||||
virtual ~TagInt64() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagInt64* getInt64() { return this; }
|
||||
virtual const TagInt64* getInt64() const { return this; }
|
||||
|
||||
virtual bool isInt64() const { return true; }
|
||||
virtual XBool isInt64() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Int64"_XS8; }
|
||||
static TagInt64* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -73,7 +73,7 @@ void TagKey::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagKey::operator == (const TagStruct& other) const
|
||||
XBool TagKey::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isKey() ) return false;
|
||||
return _string == other.getKey()->_string;
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
const TagKey& operator = (const TagKey&); // Can be defined if needed
|
||||
virtual ~TagKey() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagKey* getKey() { return this; }
|
||||
virtual const TagKey* getKey() const { return this; }
|
||||
|
||||
virtual bool isKey() const { return true; }
|
||||
virtual XBool isKey() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "Key"_XS8; }
|
||||
static TagKey* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -72,7 +72,7 @@ void TagString::FreeTag()
|
||||
tagsFree.AddReference(this, true);
|
||||
}
|
||||
|
||||
bool TagString::operator == (const TagStruct& other) const
|
||||
XBool TagString::operator == (const TagStruct& other) const
|
||||
{
|
||||
if ( !other.isString() ) return false;
|
||||
return _string == other.getString()->_string;
|
||||
|
@ -22,12 +22,12 @@ public:
|
||||
const TagString& operator = (const TagString&); // Can be defined if needed
|
||||
virtual ~TagString() { }
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const;
|
||||
virtual XBool operator == (const TagStruct& other) const;
|
||||
|
||||
virtual TagString* getString() { return this; }
|
||||
virtual const TagString* getString() const { return this; }
|
||||
|
||||
virtual bool isString() const { return true; }
|
||||
virtual XBool isString() const { return true; }
|
||||
virtual const XString8 getTypeAsXString8() const { return "String8"_XS8; }
|
||||
static TagString* getEmptyTag();
|
||||
virtual void FreeTag();
|
||||
|
@ -57,7 +57,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr);
|
||||
EFI_STATUS ParseTagFloat(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr);
|
||||
EFI_STATUS ParseTagData(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr);
|
||||
EFI_STATUS ParseTagDate(CHAR8* buffer, TagStruct* * tag, UINT32* lenPtr);
|
||||
EFI_STATUS ParseTagBoolean(TagStruct* * tag, bool value, UINT32* lenPtr);
|
||||
EFI_STATUS ParseTagBoolean(TagStruct* * tag, XBool value, UINT32* lenPtr);
|
||||
|
||||
EFI_STATUS XMLParseNextTag (CHAR8 *buffer, TagStruct**tag, UINT32 *lenPtr);
|
||||
|
||||
@ -165,7 +165,7 @@ EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CONST CHAR8* tag,UINT32* lenPtr);
|
||||
//}
|
||||
//
|
||||
|
||||
bool TagStruct::debugIsEqual(const TagStruct& other, const XString8& label) const
|
||||
XBool TagStruct::debugIsEqual(const TagStruct& other, const XString8& label) const
|
||||
{
|
||||
if ( *this != other ) {
|
||||
MsgLog("Difference at %s\n", label.c_str());
|
||||
@ -184,29 +184,29 @@ void TagStruct::printf(unsigned int ident) const
|
||||
}
|
||||
|
||||
// Convenience method
|
||||
bool TagStruct::isTrue() const
|
||||
XBool TagStruct::isTrue() const
|
||||
{
|
||||
if ( isBool() ) return getBool()->boolValue();
|
||||
return false;
|
||||
}
|
||||
bool TagStruct::isFalse() const
|
||||
XBool TagStruct::isFalse() const
|
||||
{
|
||||
if ( isBool() ) return !getBool()->boolValue();
|
||||
return false;
|
||||
}
|
||||
bool TagStruct::isTrueOrYy() const
|
||||
XBool TagStruct::isTrueOrYy() const
|
||||
{
|
||||
if ( isBool() ) return getBool()->boolValue();
|
||||
if ( isString() && getString()->stringValue().notEmpty() && (getString()->stringValue()[0] == 'y' || getString()->stringValue()[0] == 'Y') ) return true;
|
||||
return false;
|
||||
}
|
||||
bool TagStruct::isTrueOrYes() const
|
||||
XBool TagStruct::isTrueOrYes() const
|
||||
{
|
||||
if ( isBool() ) return getBool()->boolValue();
|
||||
if ( isString() && getString()->stringValue().isEqual("Yes"_XS8) ) return true;
|
||||
return false;
|
||||
}
|
||||
bool TagStruct::isFalseOrNn() const
|
||||
XBool TagStruct::isFalseOrNn() const
|
||||
{
|
||||
if ( isBool() ) return !getBool()->boolValue();
|
||||
if ( isString() && getString()->stringValue().notEmpty() && (getString()->stringValue()[0] == 'n' || getString()->stringValue()[0] == 'N') ) return true;
|
||||
@ -255,7 +255,7 @@ EFI_STATUS ParseXML(const CHAR8* buffer, TagDict** dict, size_t bufSize)
|
||||
}
|
||||
}
|
||||
buffer_start = configBuffer;
|
||||
while (TRUE)
|
||||
while (true)
|
||||
{
|
||||
Status = XMLParseNextTag(configBuffer + pos, &tag, &length);
|
||||
DBG("pos=%u\n", pos);
|
||||
@ -382,12 +382,12 @@ EFI_STATUS XMLParseNextTag(CHAR8* buffer, TagStruct** tag, UINT32* lenPtr)
|
||||
{
|
||||
Status = ParseTagDate(buffer + pos, tag, &length);
|
||||
}
|
||||
/***** FALSE ****/
|
||||
/***** false ****/
|
||||
else if (!strcmp(tagName, kXMLTagFalse))
|
||||
{
|
||||
Status = ParseTagBoolean(tag, false, &length);
|
||||
}
|
||||
/***** TRUE ****/
|
||||
/***** true ****/
|
||||
else if (!strcmp(tagName, kXMLTagTrue))
|
||||
{
|
||||
Status = ParseTagBoolean(tag, true, &length);
|
||||
@ -426,7 +426,7 @@ EFI_STATUS XMLParseNextTag(CHAR8* buffer, TagStruct** tag, UINT32* lenPtr)
|
||||
//==========================================================================
|
||||
// ParseTagList
|
||||
|
||||
EFI_STATUS __ParseTagList(bool isArray, CHAR8* buffer, TagStruct** tag, UINT32 empty, UINT32* lenPtr)
|
||||
EFI_STATUS __ParseTagList(XBool isArray, CHAR8* buffer, TagStruct** tag, UINT32 empty, UINT32* lenPtr)
|
||||
{
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINT32 pos;
|
||||
@ -453,7 +453,7 @@ EFI_STATUS __ParseTagList(bool isArray, CHAR8* buffer, TagStruct** tag, UINT32 e
|
||||
XObjArray<TagStruct>& tagList = *tagListPtr;
|
||||
|
||||
if (!empty) {
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
TagStruct* newDictOrArrayTag = NULL;
|
||||
Status = XMLParseNextTag(buffer + pos, &newDictOrArrayTag, &length);
|
||||
if (EFI_ERROR(Status)) {
|
||||
@ -558,7 +558,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagStruct** tag, UINT32* lenPtr)
|
||||
UINT32 length = 0;
|
||||
INTN integer;
|
||||
UINT32 size;
|
||||
BOOLEAN negative = FALSE;
|
||||
XBool negative = false;
|
||||
CHAR8* val = buffer;
|
||||
TagInt64* tmpTag;
|
||||
|
||||
@ -601,7 +601,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagStruct** tag, UINT32* lenPtr)
|
||||
}
|
||||
else if ( size ) { // Decimal value
|
||||
if (*val == '-') {
|
||||
negative = TRUE;
|
||||
negative = true;
|
||||
val++;
|
||||
size--;
|
||||
}
|
||||
@ -711,7 +711,7 @@ EFI_STATUS ParseTagDate(CHAR8* buffer, TagStruct* * tag,UINT32* lenPtr)
|
||||
//==========================================================================
|
||||
// ParseTagBoolean
|
||||
|
||||
EFI_STATUS ParseTagBoolean(TagStruct** tag, bool value, UINT32* lenPtr)
|
||||
EFI_STATUS ParseTagBoolean(TagStruct** tag, XBool value, UINT32* lenPtr)
|
||||
{
|
||||
TagBool* tmpTag;
|
||||
|
||||
@ -805,20 +805,20 @@ EFI_STATUS FixDataMatchingTag( CHAR8* buffer, CONST CHAR8* tag, UINT32* lenPtr)
|
||||
|
||||
|
||||
/*
|
||||
return TRUE if the property present && value = TRUE
|
||||
else return FALSE
|
||||
return true if the property present && value = true
|
||||
else return false
|
||||
*/
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsPropertyNotNullAndTrue(const TagStruct* Prop)
|
||||
{
|
||||
return Prop != NULL && Prop->isTrueOrYy();
|
||||
}
|
||||
|
||||
/*
|
||||
return TRUE if the property present && value = FALSE
|
||||
else return FALSE
|
||||
return true if the property present && value = false
|
||||
else return false
|
||||
*/
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsPropertyNotNullAndFalse(const TagStruct* Prop)
|
||||
{
|
||||
return Prop != NULL && Prop->isFalseOrNn();
|
||||
|
@ -50,9 +50,9 @@ public:
|
||||
// static TagStruct* getEmptyArrayTag();
|
||||
virtual void FreeTag() = 0;
|
||||
|
||||
virtual bool operator == (const TagStruct& other) const = 0;
|
||||
virtual bool operator != (const TagStruct& other) const { return !(*this == other); };
|
||||
virtual bool debugIsEqual(const TagStruct& other, const XString8& label) const;
|
||||
virtual XBool operator == (const TagStruct& other) const = 0;
|
||||
virtual XBool operator != (const TagStruct& other) const { return !(*this == other); };
|
||||
virtual XBool debugIsEqual(const TagStruct& other, const XString8& label) const;
|
||||
|
||||
virtual void sprintf(unsigned int ident, XString8* s) const = 0;
|
||||
void printf(unsigned int ident) const;
|
||||
@ -100,25 +100,25 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
virtual bool isDict() const { return false; }
|
||||
virtual bool isKey() const { return false; }
|
||||
virtual bool isString() const { return false; }
|
||||
virtual bool isInt64() const { return false; }
|
||||
virtual bool isFloat() const { return false; }
|
||||
virtual bool isBool() const { return false; }
|
||||
virtual bool isData() const { return false; }
|
||||
virtual bool isDate() const { return false; }
|
||||
virtual bool isArray() const { return false; }
|
||||
virtual XBool isDict() const { return false; }
|
||||
virtual XBool isKey() const { return false; }
|
||||
virtual XBool isString() const { return false; }
|
||||
virtual XBool isInt64() const { return false; }
|
||||
virtual XBool isFloat() const { return false; }
|
||||
virtual XBool isBool() const { return false; }
|
||||
virtual XBool isData() const { return false; }
|
||||
virtual XBool isDate() const { return false; }
|
||||
virtual XBool isArray() const { return false; }
|
||||
|
||||
virtual const XString8 getTypeAsXString8() const = 0;
|
||||
|
||||
|
||||
// Convenience method
|
||||
bool isTrue() const;
|
||||
bool isFalse() const;
|
||||
bool isTrueOrYy() const;
|
||||
bool isTrueOrYes() const;
|
||||
bool isFalseOrNn() const;
|
||||
XBool isTrue() const;
|
||||
XBool isFalse() const;
|
||||
XBool isTrueOrYy() const;
|
||||
XBool isTrueOrYes() const;
|
||||
XBool isFalseOrNn() const;
|
||||
};
|
||||
|
||||
#include "TagDict.h"
|
||||
@ -139,12 +139,12 @@ GetNextTag (
|
||||
UINT32 *length
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsPropertyNotNullAndTrue(
|
||||
const TagStruct* Prop
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
XBool
|
||||
IsPropertyNotNullAndFalse(
|
||||
const TagStruct* Prop
|
||||
);
|
||||
|
@ -94,9 +94,9 @@ UINT16 mHandle19;
|
||||
UINT16 mMemory17[MAX_RAM_SLOTS];
|
||||
UINT64 mInstalled[MAX_RAM_SLOTS];
|
||||
UINT64 mEnabled[MAX_RAM_SLOTS];
|
||||
BOOLEAN gMobile;
|
||||
XBool gMobile;
|
||||
UINT8 gBootStatus;
|
||||
BOOLEAN Once;
|
||||
XBool Once;
|
||||
|
||||
MEM_STRUCTURE gRAM;
|
||||
|
||||
@ -155,7 +155,7 @@ SMBIOS_TABLE_STRING SMBIOS_TABLE_TYPE4_STR_IDX[] = {
|
||||
/* Functions */
|
||||
|
||||
// validate the SMBIOS entry point structure
|
||||
BOOLEAN IsEntryPointStructureValid (IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure)
|
||||
XBool IsEntryPointStructureValid (IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure)
|
||||
{
|
||||
UINTN I;
|
||||
UINT8 Length;
|
||||
@ -163,7 +163,7 @@ BOOLEAN IsEntryPointStructureValid (IN SMBIOS_TABLE_ENTRY_POINT *EntryPointStruc
|
||||
UINT8 *BytePtr;
|
||||
|
||||
if (!EntryPointStructure)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
BytePtr = (UINT8*) EntryPointStructure;
|
||||
Length = EntryPointStructure->EntryPointLength;
|
||||
@ -462,7 +462,7 @@ void PatchTableType0(const SmbiosInjectedSettings& smbiosSettings)
|
||||
//dunno about latest version but there is a way to set good characteristics
|
||||
//if use patched AppleSMBIOS
|
||||
//----------------
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
|
||||
UniquifySmbiosTableStr(newSmbiosTable, SMBIOS_TABLE_TYPE0_STR_IDX);
|
||||
|
||||
@ -542,7 +542,7 @@ void PatchTableType1(const SmbiosInjectedSettings& smbiosSettings)
|
||||
UniquifySmbiosTableStr(newSmbiosTable, SMBIOS_TABLE_TYPE1_STR_IDX);
|
||||
|
||||
newSmbiosTable.Type1->WakeUpType = SystemWakeupTypePowerSwitch;
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
|
||||
EFI_GUID SmUUID;
|
||||
// macOs take all guid as BE guid, irrespective to the variant.
|
||||
@ -628,7 +628,7 @@ void PatchTableType2(const SmbiosInjectedSettings& smbiosSettings)
|
||||
if (smbiosSettings.BoardType == 11) {
|
||||
newSmbiosTable.Type2->FeatureFlag.Removable = 1;
|
||||
}
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
|
||||
UniquifySmbiosTableStr(newSmbiosTable, SMBIOS_TABLE_TYPE2_STR_IDX);
|
||||
|
||||
@ -664,7 +664,7 @@ DBG("%s : UpdateSmbiosString Version=BoardVersion=%s\n", __PRETTY_FUNCTION__, sm
|
||||
return;
|
||||
}
|
||||
|
||||
bool getMobileFromSmbios()
|
||||
XBool getMobileFromSmbios()
|
||||
{
|
||||
// System Chassis Information
|
||||
//
|
||||
@ -684,7 +684,7 @@ void GetTableType3(SmbiosDiscoveredSettings* smbiosSettings)
|
||||
SmbiosTable = GetSmbiosTableFromType (EntryPoint, EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, 0);
|
||||
if (SmbiosTable.Raw == NULL) {
|
||||
DBG("SmbiosTable: Type 3 (System Chassis Information) not found!\n");
|
||||
gMobile = FALSE; //default value
|
||||
gMobile = false; //default value
|
||||
return;
|
||||
}
|
||||
mHandle3 = SmbiosTable.Type3->Hdr.Handle;
|
||||
@ -722,7 +722,7 @@ void PatchTableType3(const SmbiosInjectedSettings& smbiosSettings)
|
||||
newSmbiosTable.Type3->NumberofPowerCords = 1;
|
||||
newSmbiosTable.Type3->ContainedElementCount = 0;
|
||||
newSmbiosTable.Type3->ContainedElementRecordLength = 0;
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
|
||||
UniquifySmbiosTableStr(newSmbiosTable, SMBIOS_TABLE_TYPE3_STR_IDX);
|
||||
|
||||
@ -847,7 +847,7 @@ void PatchTableType4(const SmbiosInjectedSettings& smbiosSettings)
|
||||
UniquifySmbiosTableStr(newSmbiosTable, SMBIOS_TABLE_TYPE4_STR_IDX);
|
||||
|
||||
// TODO: Set SmbiosTable.Type4->ProcessorFamily for all implemented CPU models
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
if (smbiosSettings.Model == CPU_MODEL_ATOM) {
|
||||
newSmbiosTable.Type4->ProcessorFamily = ProcessorFamilyIntelAtom;
|
||||
}
|
||||
@ -1043,7 +1043,7 @@ void PatchTableType7(const SmbiosInjectedSettings& smbiosSettings)
|
||||
// Handle = 0x0700 + CoreN<<2 + CacheN (4-level cache is supported
|
||||
// L1[CoreN] = Handle
|
||||
|
||||
BOOLEAN correctSD = FALSE;
|
||||
XBool correctSD = false;
|
||||
|
||||
//according to spec for Smbios v2.0 max handle is 0xFFFE, for v>2.0 (we made 2.6) max handle=0xFEFF.
|
||||
// Value 0xFFFF means no cache
|
||||
@ -1062,7 +1062,7 @@ void PatchTableType7(const SmbiosInjectedSettings& smbiosSettings)
|
||||
CopyMem((void*)newSmbiosTable.Type7, (void*)SmbiosTable.Type7, TableSize);
|
||||
correctSD = (newSmbiosTable.Type7->SocketDesignation == 0);
|
||||
CoreCache = newSmbiosTable.Type7->CacheConfiguration & 3;
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
|
||||
//SSocketD = "L1-Cache";
|
||||
if(correctSD) {
|
||||
@ -1123,7 +1123,7 @@ void PatchTableType9(const SmbiosInjectedSettings& smbiosSettings)
|
||||
DBG("SlotDevice[%hhu].SlotID = %hhd\n", Index, smbiosSettings.SlotDevices.getSlotForIndex(Index).SlotID);
|
||||
DBG("SlotDevice[%hhu].SlotType = %d\n", Index, smbiosSettings.SlotDevices.getSlotForIndex(Index).SlotType);
|
||||
DBG("SlotDevice[%hhu].SlotName = %s\n", Index, smbiosSettings.SlotDevices.getSlotForIndex(Index).SlotName.c_str());
|
||||
DBG("SlotDevice[%hhu].Valid = %d\n", Index, smbiosSettings.SlotDevices.isSlotForIndexValid(Index));
|
||||
DBG("SlotDevice[%hhu].Valid = %d\n", Index, (bool)smbiosSettings.SlotDevices.isSlotForIndexValid(Index));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1275,7 +1275,7 @@ void GetTableType17(SmbiosDiscoveredSettings* smbiosSettings)
|
||||
{
|
||||
// Memory Device
|
||||
//
|
||||
BOOLEAN Found;
|
||||
XBool Found;
|
||||
|
||||
// Get Table Type17 and count Size
|
||||
for (size_t Index = 0; Index < smbiosSettings->RamSlotCount; Index++) { //how many tables there may be?
|
||||
@ -1295,14 +1295,14 @@ void GetTableType17(SmbiosDiscoveredSettings* smbiosSettings)
|
||||
// be skipped where others may not but it seems easier
|
||||
// to just skip all entries that have an error - apianti
|
||||
// will try
|
||||
Found = FALSE;
|
||||
Found = false;
|
||||
for (INTN Index2 = 0; Index2 < 24; Index2++) {
|
||||
newSmbiosTable = GetSmbiosTableFromType (EntryPoint, EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION, Index2);
|
||||
if (newSmbiosTable.Raw == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (newSmbiosTable.Type18->Hdr.Handle == SmbiosTable.Type17->MemoryErrorInformationHandle) {
|
||||
Found = TRUE;
|
||||
Found = true;
|
||||
DBG("Found memory information in table 18/%lld, type=0x%X, operation=0x%X syndrome=0x%X\n", Index2,
|
||||
newSmbiosTable.Type18->ErrorType,
|
||||
newSmbiosTable.Type18->ErrorOperation,
|
||||
@ -1334,7 +1334,7 @@ void GetTableType17(SmbiosDiscoveredSettings* smbiosSettings)
|
||||
}
|
||||
// Determine if slot has size
|
||||
if (SmbiosTable.Type17->Size > 0) {
|
||||
gRAM.SMBIOS[Index].InUse = TRUE;
|
||||
gRAM.SMBIOS[Index].InUse = true;
|
||||
gRAM.SMBIOS[Index].ModuleSize = SmbiosTable.Type17->Size;
|
||||
if (SmbiosTable.Type17->Size == 0x7FFF) {
|
||||
gRAM.SMBIOS[Index].ModuleSize = SmbiosTable.Type17->ExtendedSize;
|
||||
@ -1342,7 +1342,7 @@ void GetTableType17(SmbiosDiscoveredSettings* smbiosSettings)
|
||||
}
|
||||
// Determine if module frequency is sane value
|
||||
if ((SmbiosTable.Type17->Speed > 0) && (SmbiosTable.Type17->Speed <= MAX_RAM_FREQUENCY)) {
|
||||
gRAM.SMBIOS[Index].InUse = TRUE;
|
||||
gRAM.SMBIOS[Index].InUse = true;
|
||||
gRAM.SMBIOS[Index].Frequency = SmbiosTable.Type17->Speed;
|
||||
if (SmbiosTable.Type17->Speed > gRAM.Frequency) {
|
||||
gRAM.Frequency = SmbiosTable.Type17->Speed;
|
||||
@ -1390,13 +1390,13 @@ void PatchTableType17(const SmbiosInjectedSettings& smbiosSettings)
|
||||
UINT8 channelMap[MAX_RAM_SLOTS];
|
||||
UINT8 expectedCount = 0;
|
||||
UINT8 channels = 2;
|
||||
BOOLEAN insertingEmpty = TRUE;
|
||||
BOOLEAN trustSMBIOS = ((gRAM.SPDInUse == 0) || smbiosSettings.TrustSMBIOS);
|
||||
BOOLEAN wrongSMBIOSBanks = FALSE;
|
||||
BOOLEAN isMacPro = FALSE;
|
||||
XBool insertingEmpty = true;
|
||||
XBool trustSMBIOS = ((gRAM.SPDInUse == 0) || smbiosSettings.TrustSMBIOS);
|
||||
XBool wrongSMBIOSBanks = false;
|
||||
XBool isMacPro = false;
|
||||
MACHINE_TYPES Model = GetModelFromString(smbiosSettings.ProductName);
|
||||
if ((Model == MacPro31) || (Model == MacPro41) || (Model == MacPro51) || (Model == MacPro61)) {
|
||||
isMacPro = TRUE;
|
||||
isMacPro = true;
|
||||
}
|
||||
// Inject user memory tables
|
||||
if (smbiosSettings.InjectMemoryTables)
|
||||
@ -1441,7 +1441,7 @@ DBG("gSettings.Smbios.Memory.SlotCounts=%d\n", smbiosSettings.Memory.SlotCounts)
|
||||
DBG("gSettings.Smbios.Memory.UserChannels=%d\n", smbiosSettings.Memory.UserChannels);
|
||||
for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) {
|
||||
DBG("gSettings.Smbios.Memory.User[%lld].Frequency=%d\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).Frequency);
|
||||
DBG("gSettings.Smbios.Memory.User[%lld].InUse=%d\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).InUse);
|
||||
DBG("gSettings.Smbios.Memory.User[%lld].InUse=%d\n", Index, (bool)smbiosSettings.Memory.getSlotInfoForSlotID(Index).InUse);
|
||||
DBG("gSettings.Smbios.Memory.User[%lld].ModuleSize=%d\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).ModuleSize);
|
||||
DBG("gSettings.Smbios.Memory.User[%lld].PartNo=%s\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).PartNo.c_str());
|
||||
DBG("gSettings.Smbios.Memory.User[%lld].SerialNo=%s\n", Index, smbiosSettings.Memory.getSlotInfoForSlotID(Index).SerialNo.c_str());
|
||||
@ -1460,7 +1460,7 @@ for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) {
|
||||
newSmbiosTable.Type17->DataWidth = 0xFFFF;
|
||||
newSmbiosTable.Type17->Hdr.Handle = (UINT16)(0x1100 + UserIndex);
|
||||
newSmbiosTable.Type17->FormFactor = (UINT8)(gMobile ? MemoryFormFactorSodimm : MemoryFormFactorDimm);
|
||||
newSmbiosTable.Type17->TypeDetail.Synchronous = TRUE;
|
||||
newSmbiosTable.Type17->TypeDetail.Synchronous = true;
|
||||
newSmbiosTable.Type17->DeviceSet = bank + 1;
|
||||
newSmbiosTable.Type17->MemoryArrayHandle = mHandle16;
|
||||
if (isMacPro) {
|
||||
@ -1536,11 +1536,11 @@ for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) {
|
||||
// Prefer the SPD information
|
||||
if (gRAM.SPDInUse > gRAM.SMBIOSInUse) {
|
||||
DBG("Not trusting SMBIOS because SPD reports more modules...\n");
|
||||
trustSMBIOS = FALSE;
|
||||
trustSMBIOS = false;
|
||||
} else if (gRAM.SPD[0].InUse || !gRAM.SMBIOS[0].InUse) {
|
||||
if (gRAM.SPDInUse > 1) {
|
||||
DBG("Not trusting SMBIOS because SPD reports different modules...\n");
|
||||
trustSMBIOS = FALSE;
|
||||
trustSMBIOS = false;
|
||||
} else if (gRAM.SMBIOSInUse == 1) {
|
||||
channels = 1;
|
||||
}
|
||||
@ -1554,16 +1554,16 @@ for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) {
|
||||
}
|
||||
} else {
|
||||
DBG("Not trusting SMBIOS because SPD reports only one module...\n");
|
||||
trustSMBIOS = FALSE;
|
||||
trustSMBIOS = false;
|
||||
}
|
||||
} else {
|
||||
DBG("Not trusting SMBIOS because SPD reports less modules...\n");
|
||||
trustSMBIOS = FALSE;
|
||||
trustSMBIOS = false;
|
||||
}
|
||||
} else if (gRAM.SPD[0].InUse != gRAM.SMBIOS[0].InUse) {
|
||||
// Never trust a sneaky SMBIOS!
|
||||
DBG("Not trusting SMBIOS because it's being sneaky...\n");
|
||||
trustSMBIOS = FALSE;
|
||||
trustSMBIOS = false;
|
||||
}
|
||||
} else if (gRAM.SMBIOSInUse == 1) {
|
||||
channels = 1;
|
||||
@ -1743,10 +1743,10 @@ for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) {
|
||||
newSmbiosTable.Type17->TotalWidth = 0xFFFF;
|
||||
newSmbiosTable.Type17->DataWidth = 0xFFFF;
|
||||
}
|
||||
Once = TRUE;
|
||||
Once = true;
|
||||
newSmbiosTable.Type17->Hdr.Handle = (UINT16)(0x1100 + Index);
|
||||
newSmbiosTable.Type17->FormFactor = (UINT8)(gMobile ? MemoryFormFactorSodimm : MemoryFormFactorDimm);
|
||||
newSmbiosTable.Type17->TypeDetail.Synchronous = TRUE;
|
||||
newSmbiosTable.Type17->TypeDetail.Synchronous = true;
|
||||
newSmbiosTable.Type17->DeviceSet = bank + 1;
|
||||
newSmbiosTable.Type17->MemoryArrayHandle = mHandle16;
|
||||
|
||||
@ -1828,7 +1828,7 @@ for (uint64_t Index = 0; Index < smbiosSettings.Memory.SlotCounts; Index++) {
|
||||
DBG("%s %s EMPTY\n", bankLocator.c_str(), deviceLocator.c_str());
|
||||
newSmbiosTable.Type17->MemoryType = 0; //MemoryTypeUnknown;
|
||||
} else {
|
||||
insertingEmpty = FALSE;
|
||||
insertingEmpty = false;
|
||||
DBG("%s %s %dMHz %dMB(Ext:%dMB)\n", bankLocator.c_str(), deviceLocator.c_str(), newSmbiosTable.Type17->Speed,
|
||||
newSmbiosTable.Type17->Size, newSmbiosTable.Type17->ExtendedSize);
|
||||
if (newSmbiosTable.Type17->Size == 0x7FFF) {
|
||||
@ -2226,7 +2226,7 @@ void FinalizeSmbios(const SmbiosInjectedSettings& smbiosSettings) //continue
|
||||
EFI_PEI_HOB_POINTERS HobStart;
|
||||
EFI_PHYSICAL_ADDRESS *Table = NULL;
|
||||
//UINTN TableLength = 0;
|
||||
// BOOLEAN FoundTable3 = FALSE;
|
||||
// XBool FoundTable3 = false;
|
||||
|
||||
// Get Hob List
|
||||
HobStart.Raw = (__typeof_am__(HobStart.Raw))GetHobList();
|
||||
@ -2240,7 +2240,7 @@ void FinalizeSmbios(const SmbiosInjectedSettings& smbiosSettings) //continue
|
||||
//TableLength = GET_GUID_HOB_DATA_SIZE (GuidHob);
|
||||
if (Table != NULL) {
|
||||
if (Index != 0) {
|
||||
// FoundTable3 = TRUE; //don't know how to use it. Real Mac have table3 in the format of table2
|
||||
// FoundTable3 = true; //don't know how to use it. Real Mac have table3 in the format of table2
|
||||
DBG("Found SMBIOS3 Table\n");
|
||||
}
|
||||
break;
|
||||
|
@ -25,14 +25,14 @@ static_assert(MAX_RAM_SLOTS < UINT8_MAX, "MAX_RAM_SLOTS < UINT8_MAX"); // Import
|
||||
|
||||
class RAM_SLOT_INFO {
|
||||
public:
|
||||
UINT64 Slot = UINT64();
|
||||
UINT32 ModuleSize = UINT32();
|
||||
UINT32 Frequency = UINT32();
|
||||
UINT64 Slot = UINT64();
|
||||
UINT32 ModuleSize = UINT32();
|
||||
UINT32 Frequency = UINT32();
|
||||
XString8 Vendor = XString8();
|
||||
XString8 PartNo = XString8();
|
||||
XString8 SerialNo = XString8();
|
||||
UINT8 Type = UINT8();
|
||||
bool InUse = bool();
|
||||
UINT8 Type = UINT8();
|
||||
XBool InUse = false;
|
||||
|
||||
RAM_SLOT_INFO() {}
|
||||
};
|
||||
@ -151,19 +151,19 @@ class SmbiosInjectedSettings
|
||||
XString8 ChassisAssetTag = XString8();
|
||||
XString8 FamilyName = XString8();
|
||||
XString8 SmUUID = XString8();
|
||||
bool NoRomInfo = 0;
|
||||
uint8_t EnabledCores = 0;
|
||||
bool TrustSMBIOS = 0;
|
||||
bool InjectMemoryTables = 0;
|
||||
uint8_t BoardType = 0;
|
||||
uint8_t ChassisType = 0;
|
||||
XBool NoRomInfo = false;
|
||||
uint8_t EnabledCores = 0;
|
||||
XBool TrustSMBIOS = false;
|
||||
XBool InjectMemoryTables = false;
|
||||
uint8_t BoardType = 0;
|
||||
uint8_t ChassisType = 0;
|
||||
|
||||
class SlotDevicesArrayClass : protected XObjArray<SLOT_DEVICE>
|
||||
{
|
||||
using super = XObjArray<SLOT_DEVICE>;
|
||||
public:
|
||||
void setEmpty() { super::setEmpty(); }
|
||||
void AddReference(SLOT_DEVICE* newElement, bool FreeIt) { super::AddReference(newElement, FreeIt); }
|
||||
void AddReference(SLOT_DEVICE* newElement, XBool FreeIt) { super::AddReference(newElement, FreeIt); }
|
||||
|
||||
const SLOT_DEVICE& getSlotForIndex(size_t Index) const {
|
||||
if ( Index >= MAX_RAM_SLOTS) {
|
||||
@ -185,7 +185,7 @@ class SmbiosInjectedSettings
|
||||
AddReference(slotDevice, true);
|
||||
return *slotDevice;
|
||||
}
|
||||
bool isSlotForIndexValid(uint8_t Index) const {
|
||||
XBool isSlotForIndexValid(uint8_t Index) const {
|
||||
if ( Index >= MAX_RAM_SLOTS) {
|
||||
log_technical_bug("%s : Index >= MAX_RAM_SLOTS", __PRETTY_FUNCTION__);
|
||||
}
|
||||
@ -205,11 +205,11 @@ class SmbiosInjectedSettings
|
||||
uint64_t ExtendedFirmwareFeaturesMask = 0;
|
||||
int8_t Attribute = 0;
|
||||
|
||||
bool KPDELLSMBIOS = 0;
|
||||
XBool KPDELLSMBIOS = false;
|
||||
|
||||
// CPU
|
||||
uint16_t CpuType = 0;
|
||||
bool SetTable132 = 0;
|
||||
XBool SetTable132 = false;
|
||||
uint16_t QPI = 0;
|
||||
|
||||
// from SmBios
|
||||
@ -242,7 +242,7 @@ extern APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable;
|
||||
|
||||
// TODO stop using globals.
|
||||
extern MEM_STRUCTURE gRAM;
|
||||
extern BOOLEAN gMobile;
|
||||
extern XBool gMobile;
|
||||
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ EFI_STATUS PrepatchSmbios(SmbiosDiscoveredSettings* smbiosSettings);
|
||||
void PatchSmbios(const SmbiosInjectedSettings& smbiosSettings);
|
||||
void FinalizeSmbios(const SmbiosInjectedSettings& smbiosSettings);
|
||||
|
||||
bool getMobileFromSmbios();
|
||||
XBool getMobileFromSmbios();
|
||||
XString8 getSmUUIDFromSmbios();
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
BOOLEAN smbIntel;
|
||||
XBool smbIntel;
|
||||
UINT8 smbPage;
|
||||
|
||||
CONST CHAR8 *spd_memory_types[] =
|
||||
@ -599,7 +599,7 @@ STATIC void read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did)
|
||||
UINT32 base, mmio, hostc;
|
||||
UINT16 Command;
|
||||
//RAM_SLOT_INFO* slot;
|
||||
//BOOLEAN fullBanks;
|
||||
//XBool fullBanks;
|
||||
UINT8* spdbuf;
|
||||
// UINT16 vid, did;
|
||||
|
||||
@ -645,7 +645,7 @@ STATIC void read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did)
|
||||
);
|
||||
|
||||
base &= 0xFFFE;
|
||||
smbIntel = TRUE;
|
||||
smbIntel = true;
|
||||
}
|
||||
else {
|
||||
/*Status = */PciIo->Pci.Read (
|
||||
@ -656,7 +656,7 @@ STATIC void read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did)
|
||||
&base
|
||||
);
|
||||
base &= 0xFFFC;
|
||||
smbIntel = FALSE;
|
||||
smbIntel = false;
|
||||
}
|
||||
/*Status = */PciIo->Pci.Read (
|
||||
PciIo,
|
||||
@ -843,12 +843,12 @@ STATIC void read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did)
|
||||
gRAM.SPD[i].PartNo.c_str(),
|
||||
gRAM.SPD[i].SerialNo.c_str());
|
||||
|
||||
gRAM.SPD[i].InUse = TRUE;
|
||||
gRAM.SPD[i].InUse = true;
|
||||
++(gRAM.SPDInUse);
|
||||
//}
|
||||
|
||||
// laptops sometimes show slot 0 and 2 with slot 1 empty when only 2 slots are presents so:
|
||||
//gDMI->DIMM[i]= (UINT32)((i>0 && gRAM->DIMM[1].InUse==FALSE && !fullBanks && TotalCount == 2)?mapping[i] : i); // for laptops case, mapping setup would need to be more generic than this
|
||||
//gDMI->DIMM[i]= (UINT32)((i>0 && gRAM->DIMM[1].InUse==false && !fullBanks && TotalCount == 2)?mapping[i] : i); // for laptops case, mapping setup would need to be more generic than this
|
||||
|
||||
//slot->spd = NULL;
|
||||
|
||||
|
@ -65,7 +65,7 @@ DBG("FixOwnership() -> begin\n");
|
||||
|
||||
UINTN isOSowned;
|
||||
UINTN isBIOSowned;
|
||||
BOOLEAN isOwnershipConflict;
|
||||
XBool isOwnershipConflict;
|
||||
|
||||
//
|
||||
// Find the usb host controller
|
||||
|
@ -21,17 +21,17 @@ extern "C" {
|
||||
// Keyboard input
|
||||
//
|
||||
|
||||
BOOLEAN ReadAllKeyStrokes(void)
|
||||
XBool ReadAllKeyStrokes(void)
|
||||
{
|
||||
BOOLEAN GotKeyStrokes;
|
||||
XBool GotKeyStrokes;
|
||||
EFI_STATUS Status;
|
||||
EFI_INPUT_KEY key;
|
||||
|
||||
GotKeyStrokes = FALSE;
|
||||
GotKeyStrokes = false;
|
||||
for (;;) {
|
||||
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &key);
|
||||
if (Status == EFI_SUCCESS) {
|
||||
GotKeyStrokes = TRUE;
|
||||
GotKeyStrokes = true;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@ -84,11 +84,11 @@ WaitForKeyPress(
|
||||
//void DebugPause(void)
|
||||
//{
|
||||
// // show console and wait for key
|
||||
// SwitchToText(FALSE);
|
||||
// SwitchToText(false);
|
||||
// PauseForKey(L"");
|
||||
//
|
||||
// // reset error flag
|
||||
// haveError = FALSE;
|
||||
// haveError = false;
|
||||
//}
|
||||
//#endif
|
||||
|
||||
@ -103,12 +103,12 @@ void EndlessIdleLoop(void)
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
XBool CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
{
|
||||
// CHAR16 ErrorName[64];
|
||||
|
||||
if (!EFI_ERROR(Status))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
MsgLog("Fatal Error: %s %ls\n", efiStrError(Status), where);
|
||||
|
||||
@ -116,19 +116,19 @@ BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_RED | EFI_BACKGROUND_BLACK);
|
||||
printf("Fatal Error: %s %ls\n", efiStrError(Status), where);
|
||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_LIGHTGRAY | EFI_BACKGROUND_BLACK);
|
||||
haveError = TRUE;
|
||||
haveError = true;
|
||||
|
||||
//gBS->Exit(ImageHandle, ExitStatus, ExitDataSize, ExitData);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOLEAN CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
XBool CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
{
|
||||
// CHAR16 ErrorName[64];
|
||||
|
||||
if (!EFI_ERROR(Status))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
MsgLog("Fatal Error: %s %ls\n", efiStrError(Status), where);
|
||||
|
||||
@ -136,9 +136,9 @@ BOOLEAN CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_RED | EFI_BACKGROUND_BLACK);
|
||||
printf("Error: %s %ls\n", efiStrError(Status), where);
|
||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_LIGHTGRAY | EFI_BACKGROUND_BLACK);
|
||||
haveError = TRUE;
|
||||
haveError = true;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -271,7 +271,7 @@ void EFIAPI DebugLog(IN INTN DebugMode, IN CONST CHAR8 *FormatString, ...)
|
||||
|
||||
// Print message to log buffer
|
||||
VA_START(Marker, FormatString);
|
||||
MemLogfVA(TRUE, DebugMode, FormatString, Marker);
|
||||
MemLogfVA(true, DebugMode, FormatString, Marker);
|
||||
VA_END(Marker);
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ void InitBooterLog(void)
|
||||
}
|
||||
|
||||
|
||||
EFI_STATUS SetupBooterLog(BOOLEAN AllowGrownSize)
|
||||
EFI_STATUS SetupBooterLog(XBool AllowGrownSize)
|
||||
{
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
CHAR8 *MemLogBuffer;
|
||||
@ -353,6 +353,6 @@ void EFIAPI DebugLogForOC(IN INTN DebugLevel, IN CONST CHAR8 *FormatString, ...)
|
||||
|
||||
// Print message to log buffer
|
||||
VA_START(Marker, FormatString);
|
||||
MemLogVA(TRUE, 1, FormatString, Marker);
|
||||
MemLogVA(true, 1, FormatString, Marker);
|
||||
VA_END(Marker);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ Headers collection for procedures
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <Library/printf_lite.h>
|
||||
#include "../cpp_foundation/XBool.h"
|
||||
#include "../cpp_foundation/XString.h"
|
||||
#include "../cpp_foundation/XArray.h"
|
||||
#include "../cpp_foundation/XObjArray.h"
|
||||
|
@ -34,7 +34,7 @@ static void panic_(const char* format, VA_LIST va)
|
||||
;
|
||||
|
||||
#ifdef CLOVER_BUILD
|
||||
extern void egSetGraphicsModeEnabled(BOOLEAN);
|
||||
extern void egSetGraphicsModeEnabled(XBool);
|
||||
extern const LString8 gBuildId;
|
||||
#endif
|
||||
|
||||
|
@ -52,7 +52,7 @@ PrintBytes(IN void *Bytes, IN UINTN Number)
|
||||
}
|
||||
}
|
||||
|
||||
bool gEnableCloverLog = false;
|
||||
XBool gEnableCloverLog = false;
|
||||
|
||||
// Changed MsgLog(...) it now calls this function
|
||||
// with DebugMode == 0. - apianti
|
||||
|
@ -21,7 +21,7 @@
|
||||
// Keyboard input
|
||||
//
|
||||
|
||||
BOOLEAN ReadAllKeyStrokes(void)
|
||||
XBool ReadAllKeyStrokes(void)
|
||||
{
|
||||
panic("not yet");
|
||||
}
|
||||
@ -52,12 +52,12 @@ void EndlessIdleLoop(void)
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
XBool CheckFatalError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
{
|
||||
panic("not yet");
|
||||
}
|
||||
|
||||
BOOLEAN CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
XBool CheckError(IN EFI_STATUS Status, IN CONST CHAR16 *where)
|
||||
{
|
||||
panic("not yet");
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ PrintBytes(IN void *Bytes, IN UINTN Number)
|
||||
}
|
||||
}
|
||||
|
||||
bool gEnableCloverLog = false;
|
||||
XBool gEnableCloverLog = false;
|
||||
|
||||
// Changed MsgLog(...) it now calls this function
|
||||
// with DebugMode == 0. - apianti
|
||||
|
@ -31,6 +31,10 @@
|
||||
|
||||
//#pragma clang diagnostic ignored "-Wc99-extensions"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include "../../cpp_foundation/XBool.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user