Create XBool to avoid nasty side effect when assigning int to bool.

This commit is contained in:
jief666 2021-09-28 11:28:45 +03:00
parent e1b8bda24f
commit 2c829b66cd
124 changed files with 1972 additions and 1840 deletions

View File

@ -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,7 @@
"-Wno-gnu-zero-variadic-macro-arguments",
"-Wignored-qualifiers",
"-Wreorder",
"-Wmissing-braces",
);
};
name = Debug;
@ -3355,6 +3366,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 +3420,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 +3433,7 @@
"-Wno-gnu-zero-variadic-macro-arguments",
"-Wignored-qualifiers",
"-Wreorder",
"-Wmissing-braces",
);
};
name = Release;

View File

@ -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 = (

View File

@ -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 ;
}

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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_ */

View File

@ -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;
}
}
}

View File

@ -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 (

View File

@ -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
@ -170,7 +170,7 @@ EFI_STATUS
CreateBootOptionDevicePath (
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
@ -999,7 +999,7 @@ EFI_STATUS
AddBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle,
IN CONST XStringW& FileName,
IN BOOLEAN UseShortForm,
IN XBool UseShortForm,
IN CONST CHAR16 *Description,
IN UINT8 *OptionalData,
IN UINTN OptionalDataSize,

View File

@ -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
@ -124,7 +124,7 @@ EFI_STATUS
AddBootOptionForFile (
IN EFI_HANDLE FileDeviceHandle,
IN CONST XStringW &FileName,
IN BOOLEAN UseShortForm,
IN XBool UseShortForm,
IN CONST CHAR16 *Description,
IN UINT8 *OptionalData,
IN UINTN OptionalDataSize,

View File

@ -36,11 +36,11 @@ GetModeImpl (
*Mode = CurrentMode;
if (GopUgaExists) {
*GopUgaExists = TRUE;
*GopUgaExists = true;
}
if (StdInLocked) {
*StdInLocked = FALSE;
*StdInLocked = false;
}
return EFI_SUCCESS;

View File

@ -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 = (XBool) (*PtrCurrentMTC == 0);
Record = NULL;
for (Link = GetFirstNode(Head); Link != Head; Link = GetNextNode(Head, Link)) {

View File

@ -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 &&

View File

@ -27,7 +27,7 @@ LogDataHub (
void
EFIAPI
SetupDataForOSX (BOOLEAN Hibernate);
SetupDataForOSX (XBool Hibernate);
#endif /* PLATFORM_DATAHUBCPU_H_ */

View File

@ -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;

View File

@ -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 (XBool)
((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 (XBool)
((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 (XBool)
((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;
}
}
@ -4272,7 +4272,7 @@ UINT32 FIXIDE (UINT8 *dsdt, UINT32 len)
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;

View File

@ -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;

View File

@ -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 {

View File

@ -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,8 +708,8 @@ 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;
@ -718,7 +718,7 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry)
// 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;
}

View File

@ -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
);

View File

@ -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");

View File

@ -10,16 +10,16 @@
bool 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;
}
}
@ -37,16 +37,16 @@ bool ABSTRACT_PATCH::IsPatchEnabledByBuildNumber(const XString8& Build)
bool 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;
}
}
@ -65,16 +65,16 @@ bool ABSTRACT_PATCH::IsPatchEnabled(const MacOsVersion& CurrOS)
//
//bool 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;
// }
// }

View File

@ -119,7 +119,7 @@ class KEXT_PATCH : public ABSTRACT_KEXT_OR_KERNEL_PATCH
using super = ABSTRACT_KEXT_OR_KERNEL_PATCH;
public:
XString8 Name = XString8();
bool IsPlistPatch = BOOLEAN();
bool IsPlistPatch = XBool();
virtual XString8 getName() const { return Name; }

View File

@ -76,12 +76,12 @@ void GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath)
EFI_FILE_INFO *PlugInEntry;
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);

View File

@ -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,7 +214,7 @@ LegacyBiosInt86 (
UINTN Status;
UINTN Eflags;
IA32_REGISTER_SET ThunkRegSet;
BOOLEAN Ret;
XBool Ret;
UINT16 *Stack16;
ZeroMem (&ThunkRegSet, sizeof (ThunkRegSet));
@ -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 = (XBool) (Regs->E.EFLAGS.Bits.CF == 1);
return Ret;
}
BOOLEAN
XBool
EFIAPI
LegacyBiosFarCall86 (
// IN EFI_LEGACY_BIOS_THUNK_PROTOCOL *This,
@ -314,7 +314,7 @@ LegacyBiosFarCall86 (
UINTN Status;
UINT32 Eflags;
IA32_REGISTER_SET ThunkRegSet;
BOOLEAN Ret;
XBool Ret;
UINT16 *Stack16;
// UINT16 BiosInt = 0x100;
EFI_TPL OriginalTpl;
@ -449,7 +449,7 @@ LegacyBiosFarCall86 (
CopyMem(&(Regs->E.EFLAGS), &(ThunkRegSet.E.EFLAGS), sizeof (UINT32));
Ret = (BOOLEAN) (Regs->E.EFLAGS.Bits.CF == 1);
Ret = (XBool) (Regs->E.EFLAGS.Bits.CF == 1);
// Connect VGA EFI Driver
BdsLibConnectAllDriversToAllControllers();

View File

@ -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,

View File

@ -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);
//

View File

@ -23,7 +23,7 @@ bootMBR (
EFI_STATUS
bootPBR (
IN REFIT_VOLUME *volume, BOOLEAN SataReset
IN REFIT_VOLUME *volume, XBool SataReset
);
EFI_STATUS

View File

@ -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;

View File

@ -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

View File

@ -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;
//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;
@ -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;
bool 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") ) {
@ -1946,8 +1946,8 @@ XStringW GetOSVersionKextsDir(const MacOsVersion& OSVersion)
// 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",

View File

@ -33,7 +33,7 @@
//};
extern CONST CHAR8 *AudioOutputNames[];
extern BOOLEAN gFirmwareClover;
extern XBool gFirmwareClover;
class HDA_OUTPUTS
@ -59,8 +59,8 @@ typedef struct {
//UINT16 Height;
CHAR8 Model[64];
CHAR8 Config[64];
BOOLEAN LoadVBios;
//BOOLEAN PatchVBios;
XBool LoadVBios;
//XBool PatchVBios;
UINTN Segment;
UINTN Bus;
UINTN Device;
@ -68,7 +68,7 @@ typedef struct {
EFI_HANDLE Handle;
UINT8 *Mmio;
UINT32 Connectors;
BOOLEAN ConnChanged;
XBool ConnChanged;
} GFX_PROPERTIES;
typedef struct {
@ -161,9 +161,9 @@ public:
UINT32 Length;
UINT64 TableId;
INPUT_ITEM MenuItem = INPUT_ITEM();
BOOLEAN OtherOS;
XBool OtherOS;
ACPI_DROP_TABLE() : Next(0), Signature(0), Length(0), TableId(0), OtherOS(0) {}
ACPI_DROP_TABLE() : Next(0), Signature(0), Length(0), TableId(0), OtherOS(false) {}
ACPI_DROP_TABLE(const ACPI_DROP_TABLE& other) = delete; // Can be defined if needed
const ACPI_DROP_TABLE& operator = ( const ACPI_DROP_TABLE & ) = delete; // Can be defined if needed
~ACPI_DROP_TABLE() {}
@ -177,7 +177,7 @@ class CUSTOM_LOADER_SUBENTRY;
//template<class C> class XmlArray;
//void CompareCustomSubEntries(const XString8& label, const XObjArray<CUSTOM_LOADER_SUBENTRY_SETTINGS>& olDCustomEntries, const XmlArray<GUI_Custom_SubEntry_Class>& newCustomEntries);
//BOOLEAN FillinCustomSubEntry(UINT8 parentType, IN OUT CUSTOM_LOADER_SUBENTRY_SETTINGS *Entry, const TagDict* DictPointer, IN BOOLEAN SubEntry);
//XBool FillinCustomSubEntry(UINT8 parentType, IN OUT CUSTOM_LOADER_SUBENTRY_SETTINGS *Entry, const TagDict* DictPointer, IN XBool SubEntry);
class CUSTOM_LOADER_SUBENTRY_SETTINGS
{
@ -219,7 +219,7 @@ public: // temporary, must be protected:
public:
// friend void ::CompareCustomSubEntries(const XString8& label, const XObjArray<CUSTOM_LOADER_SUBENTRY_SETTINGS>& olDCustomEntries, const XmlArray<GUI_Custom_SubEntry_Class>& newCustomEntries);
// friend BOOLEAN FillinCustomSubEntry(UINT8 parentType, IN OUT CUSTOM_LOADER_SUBENTRY_SETTINGS *Entry, const TagDict* DictPointer, IN BOOLEAN SubEntry);
// friend XBool FillinCustomSubEntry(UINT8 parentType, IN OUT CUSTOM_LOADER_SUBENTRY_SETTINGS *Entry, const TagDict* DictPointer, IN XBool SubEntry);
// friend class ::CUSTOM_LOADER_SUBENTRY;
};
@ -244,7 +244,7 @@ public:
class CUSTOM_LOADER_ENTRY_SETTINGS;
//
//void CompareCustomEntries(const XString8& label, const XObjArray<CUSTOM_LOADER_ENTRY_SETTINGS>& olDCustomEntries, const XmlArray<GUI_Custom_Entry_Class>& newCustomEntries);
//BOOLEAN FillinCustomEntry(IN OUT CUSTOM_LOADER_ENTRY_SETTINGS *Entry, const TagDict* DictPointer, IN BOOLEAN SubEntry);
//XBool FillinCustomEntry(IN OUT CUSTOM_LOADER_ENTRY_SETTINGS *Entry, const TagDict* DictPointer, IN XBool SubEntry);
extern const XString8 defaultInstallTitle;
extern const XString8 defaultRecoveryTitle;
@ -283,7 +283,7 @@ public:
XString8 FullTitle = XStringW();
XStringW Settings = XStringW(); // path of a config.plist that'll be read at the beginning of startloader
char32_t Hotkey = 0;
BOOLEAN CommonSettings = 0;
XBool CommonSettings = false;
// UINT8 Flags = 0;
bool Hidden = 0;
bool AlwaysHidden = 0;
@ -2623,7 +2623,7 @@ printf("%s", "");
//other
// UINT16 DropOEM_DSM; // not used anymore.
// BOOLEAN LpcTune; // never set to true.
// XBool LpcTune; // never set to true.
SETTINGS_DATA() {}
// SETTINGS_DATA(const SETTINGS_DATA& other) = delete; // Can be defined if needed
@ -2762,7 +2762,7 @@ extern INTN OldChosenTheme;
extern INTN OldChosenConfig;
extern INTN OldChosenDsdt;
extern UINTN OldChosenAudio;
extern BOOLEAN SavePreBootLog;
extern XBool SavePreBootLog;
extern UINT8 DefaultAudioVolume;
@ -2772,7 +2772,7 @@ extern UINT8 DefaultAudioVolume;
//extern UINTN NHDA;
//extern UINT16 gCPUtype;
extern SETTINGS_DATA gSettings;
extern BOOLEAN gFirmwareClover;
extern XBool gFirmwareClover;
extern DRIVERS_FLAGS gDriversFlags;
extern EFI_EDID_DISCOVERED_PROTOCOL *EdidDiscovered;
//extern UINT8 *gEDID;
@ -2781,7 +2781,7 @@ extern UINTN gEvent;
extern UINT16 gBacklightLevel;
//extern BOOLEAN defDSM;
//extern XBool defDSM;
//extern UINT16 dropDSM;
//extern TagDict* gConfigDict[];
@ -2797,8 +2797,8 @@ extern XObjArray<ACPI_PATCHED_AML> ACPIPatchedAML;
extern CHAR16 *IconFormat;
extern BOOLEAN ResumeFromCoreStorage;
//extern BOOLEAN gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here
extern XBool ResumeFromCoreStorage;
//extern XBool gRemapSmBiosIsRequire; // syscl: pass argument for Dell SMBIOS here
extern EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl;
@ -2811,12 +2811,12 @@ class REFIT_CONFIG
{
public:
UINTN DisableFlags = 0; //to disable some volume types (optical, firewire etc)
BOOLEAN Quiet = true;
BOOLEAN SpecialBootMode = false; // content of nvram var "aptiofixflag"
XBool Quiet = true;
XBool SpecialBootMode = false; // content of nvram var "aptiofixflag"
BOOLEAN gBootChanged = FALSE;
BOOLEAN gThemeChanged = FALSE;
BOOLEAN NeedPMfix = FALSE;
XBool gBootChanged = false;
XBool gThemeChanged = false;
XBool NeedPMfix = false;
ACPI_DROP_TABLE *ACPIDropTables = NULL;
UINT8 CustomLogoType = 0; // this will be initialized with gSettings.Boot.CustomBoot and set back to CUSTOM_BOOT_DISABLED if CustomLogo could not be loaded or decoded (see afterGetUserSettings)
@ -2827,8 +2827,8 @@ public:
UINT8 SecureBoot = 0;
UINT8 SecureBootSetupMode = 0;
BOOLEAN SetTable132 = 0;
BOOLEAN HWP = 0;
XBool SetTable132 = false;
XBool HWP = false;
bool EnableC6 = 0;
bool EnableC4 = 0;
@ -2862,8 +2862,8 @@ public:
XStringW BlockKexts = XStringW();
// KernelAndKextPatches
BOOLEAN KextPatchesAllowed = true;
BOOLEAN KernelPatchesAllowed = true; //From GUI: Only for user patches, not internal Clover
XBool KextPatchesAllowed = true;
XBool KernelPatchesAllowed = true; //From GUI: Only for user patches, not internal Clover
XString8 BiosVersionUsed = XString8();
XString8 EfiVersionUsed = XString8();
@ -2914,7 +2914,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *LoadedEntry);
void afterGetUserSettings(SETTINGS_DATA& gSettings);
XStringW
GetOtherKextsDir (BOOLEAN On);
GetOtherKextsDir (XBool On);
XStringW GetOSVersionKextsDir(const MacOsVersion& OSVersion);

View File

@ -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;
}

View File

@ -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_ */

View File

@ -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;

View File

@ -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;

View File

@ -40,7 +40,7 @@ inline bool 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

View File

@ -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) {

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -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;

View File

@ -27,7 +27,7 @@ FindCardWithIds (
// UINT32 SubId,
// UINT64 VideoRam,
// UINTN VideoPorts,
// BOOLEAN LoadVBios
// XBool LoadVBios
// );

View File

@ -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;
@ -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;
}

View File

@ -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;

View File

@ -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,7 +273,7 @@ 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)
@ -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) {

View File

@ -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
XBool 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);
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);

View File

@ -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

View File

@ -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;

View File

@ -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;
//}

View File

@ -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;
}

View File

@ -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 */

View File

@ -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;
@ -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;
@ -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 ... ",

View File

@ -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;

View File

@ -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;
@ -216,8 +216,8 @@ EFI_STATUS LOADER_ENTRY::LoadKext(const EFI_FILE *RootDir, const XString8& FileN
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() )

View File

@ -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;
}
@ -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)) {

View File

@ -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;
}

View File

@ -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
);

View File

@ -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;

View File

@ -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);
@ -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--;
}
@ -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();

View File

@ -139,12 +139,12 @@ GetNextTag (
UINT32 *length
);
BOOLEAN
XBool
IsPropertyNotNullAndTrue(
const TagStruct* Prop
);
BOOLEAN
XBool
IsPropertyNotNullAndFalse(
const TagStruct* Prop
);

View File

@ -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);
@ -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) {
@ -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)
@ -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;

View File

@ -242,7 +242,7 @@ extern APPLE_SMBIOS_STRUCTURE_POINTER SmbiosTable;
// TODO stop using globals.
extern MEM_STRUCTURE gRAM;
extern BOOLEAN gMobile;
extern XBool gMobile;

View File

@ -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;

View File

@ -65,7 +65,7 @@ DBG("FixOwnership() -> begin\n");
UINTN isOSowned;
UINTN isBIOSowned;
BOOLEAN isOwnershipConflict;
XBool isOwnershipConflict;
//
// Find the usb host controller

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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"

View File

@ -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

View File

@ -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");
}

View File

@ -31,6 +31,10 @@
//#pragma clang diagnostic ignored "-Wc99-extensions"
#ifdef __cplusplus
#include "../../cpp_foundation/XBool.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -153,7 +153,7 @@ void ConfigManager::DiscoverDevices()
}
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;
DiscoveredSlotDeviceClass* SlotDevice = new DiscoveredSlotDeviceClass;
SlotDeviceArrayNonConst.AddReference(SlotDevice, true);
@ -161,7 +161,7 @@ void ConfigManager::DiscoverDevices()
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;
@ -173,7 +173,7 @@ void ConfigManager::DiscoverDevices()
DBG(" - GFX: Model=%s (Intel)\n", gfx->Model.c_str());
gfx->Ports = 1;
gfx->Connectors = (1 << GfxPropertiesArrayNonConst.size());
gfx->ConnChanged = FALSE;
gfx->ConnChanged = false;
break;
}
case 0x10de: {
@ -227,7 +227,7 @@ void ConfigManager::DiscoverDevices()
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;
@ -238,7 +238,7 @@ void ConfigManager::DiscoverDevices()
gfx->Model.S8Printf("pci%hx,%hx", Pci.Hdr.VendorId, Pci.Hdr.DeviceId);
gfx->Ports = 1;
gfx->Connectors = (1 << GfxPropertiesArrayNonConst.size());
gfx->ConnChanged = FALSE;
gfx->ConnChanged = false;
break;
}
@ -265,7 +265,7 @@ void ConfigManager::DiscoverDevices()
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;
@ -305,7 +305,7 @@ void ConfigManager::DiscoverDevices()
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;
@ -346,7 +346,7 @@ void ConfigManager::DiscoverDevices()
//
if ( Mmio != NULL ) {
UINTN Offset = 0;
BOOLEAN Swab = FALSE;
XBool Swab = false;
UINT32 Mac0, Mac4;
switch ( Vendor ) {
case 0x11ab: //Marvell Yukon
@ -372,7 +372,7 @@ void ConfigManager::DiscoverDevices()
break;
case 0x1969: //Atheros
Offset = L1C_STAD0;
Swab = TRUE;
Swab = true;
break;
case 0x8086: //Intel
if (PreviousVendor == Vendor) {
@ -420,7 +420,7 @@ void ConfigManager::DiscoverDevices()
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;
@ -448,7 +448,7 @@ void ConfigManager::DiscoverDevices()
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;
@ -713,10 +713,10 @@ void ConfigManager::applySettings() const
if ( gCPUStructure.Model >= CPU_MODEL_IVY_BRIDGE )
{
if ( !configPlist.ACPI.SSDT.Generate.getGeneratePStates().isDefined() )
gSettings.ACPI.SSDT.Generate.GeneratePStates = TRUE;
gSettings.ACPI.SSDT.Generate.GeneratePStates = true;
if ( !configPlist.ACPI.SSDT.Generate.getGenerateCStates().isDefined() )
gSettings.ACPI.SSDT.Generate.GenerateCStates = TRUE;
gSettings.ACPI.SSDT.Generate.GenerateCStates = true;
// backward compatibility, APFS, APLF, PluginType follow PStates
if ( !configPlist.ACPI.SSDT.Generate.getGenerateAPSN().isDefined() )
@ -729,7 +729,7 @@ void ConfigManager::applySettings() const
gSettings.ACPI.SSDT.Generate.GeneratePluginType = gSettings.ACPI.SSDT.Generate.GeneratePStates;
if ( !configPlist.ACPI.SSDT.getEnableC6().isDefined() )
gSettings.ACPI.SSDT._EnableC6 = TRUE;
gSettings.ACPI.SSDT._EnableC6 = true;
if ( !configPlist.ACPI.SSDT.getPluginType().isDefined() )
gSettings.ACPI.SSDT.PluginType = 1;
@ -855,7 +855,7 @@ void ConfigManager::applySettings() const
// to determine the use of Table 132
if ( gSettings.CPU.QPI )
{
GlobalConfig.SetTable132 = TRUE;
GlobalConfig.SetTable132 = true;
//DBG("QPI: use Table 132\n");
} else
{
@ -865,7 +865,7 @@ void ConfigManager::applySettings() const
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:

View File

@ -52,7 +52,7 @@ public:
EFI_HANDLE Handle = 0;
UINT8 *Mmio = 0;
UINT32 Connectors = 0;
BOOLEAN ConnChanged = 0;
XBool ConnChanged = false;
// ATTENTION : this is not discovered. This will be assigned once config plist is read.
bool LoadVBios = 0;

View File

@ -287,7 +287,7 @@ public:
const XStringW& dgetVolume() const { return Volume.isDefined() ? Volume.value() : NullXStringW; };
const XStringW& dgetPath() const { return Path.isDefined() ? Path.value() : NullXStringW; };
const XStringW& dgetSettings() const { return Settings.isDefined() ? Settings.value() : NullXStringW; };
BOOLEAN dgetCommonSettings() const { return CommonSettings.isDefined() ? CommonSettings.value() : false; };
XBool dgetCommonSettings() const { return CommonSettings.isDefined() ? CommonSettings.value() : false; };
const XString8& dgetAddArguments() const { return AddArguments.isDefined() ? AddArguments.value() : NullXString8; };
const undefinable_XString8 dgetArguments() const { return Arguments.isDefined() ? undefinable_XString8(Arguments.value()) : undefinable_XString8(); };
const XString8& dgetm_Title() const { return Title.isDefined() ? Title.value() : NullXString8; };

View File

@ -206,7 +206,7 @@ EFI_STATUS Self::_initialize()
//
// // Do this before the next check.
// if ( !m_CloverDirFullPath.startWith('\\') ) {
// //CHAR16* f = ConvertDevicePathToText(m_SelfLoadedImage->FilePath, TRUE, TRUE);
// //CHAR16* f = ConvertDevicePathToText(m_SelfLoadedImage->FilePath, true, true);
// //panic("Bad format for m_CloverDirFullPath(%ls). It must start with a '\\'.\nConvertDevicePathToText=%ls", m_CloverDirFullPath.wc_str(), f);
// //
// // Some firmware seems to not put a '\' at the begining. Do not panic anymore, just add it.

View File

@ -63,7 +63,7 @@ bool SelfOem::_checkOEMPath()
m_OemDir = NULL;
return false;
}
BOOLEAN res2 = FileExists(m_OemDir, SWPrintf("%s.plist", m_ConfName.c_str()));
XBool res2 = FileExists(m_OemDir, SWPrintf("%s.plist", m_ConfName.c_str()));
if ( !res2 ) {
DBG("_checkOEMPath looked for config file at '%ls\\%ls\\%s.plist'. File doesn't exist.\n", self.getCloverDirFullPath().wc_str(), m_OemPathRelToSelfDir.wc_str(), m_ConfName.c_str());
m_OemDir->Close(m_OemDir);

View File

@ -0,0 +1,55 @@
//
// XBool.hpp
// CloverX64
//
// Created by Jief on 27/09/2021.
//
#ifndef XBool_hpp
#define XBool_hpp
#include <XToolsConf.h>
#include "XToolsCommon.h"
class XBool;
template <class _Tp> struct _xtools__is_xbool_st : public _xtools__false_type {};
template <> struct _xtools__is_xbool_st<XBool> : public _xtools__true_type {};
#define is_xbool(x) _xtools__is_xbool_st<remove_const(x)>::value
class XBool
{
bool value;
public:
constexpr XBool() : value(false) {}
//explicit XBool(const bool other) { value = other; }
constexpr XBool(bool other) : value(other) {}
constexpr XBool(const XBool& other) : value(other.value) {}
template <typename T, enable_if( ! is_bool(T) && ! is_xbool(T) )>
XBool(T other) = delete;
~XBool() {};
XBool& operator= (const XBool& other) { value = other.value; return *this; }
XBool& operator= (const bool other) { value = other; return *this; }
template <typename T, enable_if( ! is_bool(T) && ! is_xbool(T) )>
XBool& operator= (const T other) = delete;
operator bool() const { return value; }
bool operator == (bool other) const { return value == other; }
bool operator == (XBool other) const { return value == other.value; }
template <typename T, enable_if( ! is_bool(T) && ! is_xbool(T) )>
bool operator == (T other) const = delete;
bool operator != (bool other) const { return value != other; }
bool operator != (XBool other) const { return value != other.value; }
template <typename T, enable_if( ! is_bool(T) && ! is_xbool(T) )>
bool operator != (XBool other) const = delete;
XBool& operator |= (bool other) { value |= other; return *this; }
XBool& operator |= (XBool other) { value |= other.value; return *this; }
template <typename T, enable_if( ! is_bool(T) && ! is_xbool(T) )>
XBool& operator |= (XBool other) = delete;
};
#endif /* XBool_hpp */

View File

@ -78,6 +78,9 @@ template <> struct _xtools__is_char_st<char16_t> : public
template <> struct _xtools__is_char_st<char32_t> : public _xtools__true_type {};
template <> struct _xtools__is_char_st<wchar_t> : public _xtools__true_type {};
template <class _Tp> struct _xtools__is_bool_st : public _xtools__false_type {};
template <> struct _xtools__is_bool_st<bool> : public _xtools__true_type {};
//
//// STRUCT TEMPLATE remove_reference
//template<class _Ty>
@ -178,6 +181,7 @@ struct _xtools__has_type_member<T, _xtools__void_t<typename T::char_t>> : _xtool
#define is_integral(x) _xtools__is_integral_st<remove_const(x)>::value
#define is_char(x) _xtools__is_char_st<remove_const(x)>::value
#define is_bool(x) _xtools__is_bool_st<remove_const(x)>::value
#define is_char_ptr(x) _xtools__is_char_ptr_st<typename _xtools__remove_const<x>::type>::value
#define enable_if_t(x) typename _xtools_enable_if_t<x>::type
#define enable_if(x) typename enable_if_type = typename _xtools_enable_if_t<x>::type

View File

@ -430,7 +430,7 @@ if ( xmlPath.contains("CsrActiveConfig") ) {
if ( valueLength >= 1 && ( (value[0] >= '0' && value[0] <= '9') || value[0] == '-' ) ) { // Decimal value
size_t idx = 0;
if (value[idx] == '-') {
negative = TRUE;
negative = true;
idx++;
}
for ( ; idx < valueLength; idx++)

View File

@ -3,7 +3,7 @@
#include "../cpp_foundation/XStringArray.h"
//
//static BOOLEAN IsOSValid_OLDOLD(const XString8& MatchOS, const XString8& CurrOS)
//static XBool IsOSValid_OLDOLD(const XString8& MatchOS, const XString8& CurrOS)
//{
// /* example for valid matches are:
// 10.7, only 10.7 (10.7.1 will be skipped)
@ -11,10 +11,10 @@
// 10.10.x (or 10.10.X), in this case is valid for all minor version of 10.10 (10.10.(0-9))
// */
//
// 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
// }
//
//// osToc = GetStrArraySeparatedByChar(MatchOS, '.');
@ -24,7 +24,7 @@
// if (macthOsToc.size() == 2) {
// if (currOStoc.size() == 2) {
// if ( macthOsToc[0] == currOStoc[0] && macthOsToc[1] == currOStoc[1]) {
// ret = TRUE;
// ret = true;
// }
// }
// } else if (macthOsToc.size() == 3) {
@ -32,20 +32,20 @@
// if ( macthOsToc[0] == currOStoc[0]
// && macthOsToc[1] == currOStoc[1]
// && macthOsToc[2] == currOStoc[2]) {
// ret = TRUE;
// ret = true;
// } else if ( macthOsToc[0] == currOStoc[0]
// && macthOsToc[1] == currOStoc[1]
// && macthOsToc[2].isEqualIC("x") ) {
// ret = TRUE;
// ret = true;
// }
// } else if (currOStoc.size() == 2) {
// if ( macthOsToc[0] == currOStoc[0]
// && macthOsToc[1] == currOStoc[1] ) {
// ret = TRUE;
// ret = true;
// } else if ( macthOsToc[0] == currOStoc[0]
// && macthOsToc[1] == currOStoc[1]
// && macthOsToc[2].isEqualIC("x") == 0 ) {
// ret = TRUE;
// ret = true;
// }
// }
// }
@ -62,10 +62,10 @@ static bool IsOSValid_OLD(const XString8& MatchOS, const XString8& CurrOS)
10.10.x (or 10.10.X), in this case is valid for all minor version of 10.10 (10.10.(0-9))
*/
bool ret = FALSE;
bool ret = false;
if (MatchOS.isEmpty() || CurrOS.isEmpty()) {
return TRUE; //undefined matched corresponds to old behavior
return true; //undefined matched corresponds to old behavior
}
// osToc = GetStrArraySeparatedByChar(MatchOS, '.');
@ -82,7 +82,7 @@ static bool IsOSValid_OLD(const XString8& MatchOS, const XString8& CurrOS)
if (osToc.size() == 2) {
if (currOStoc.size() == 2) {
if ( osToc[0] == currOStoc[0] && osToc[1] == currOStoc[1]) {
ret = TRUE;
ret = true;
}
}
} else if (osToc.size() == 3) {
@ -90,20 +90,20 @@ static bool IsOSValid_OLD(const XString8& MatchOS, const XString8& CurrOS)
if ( osToc[0] == currOStoc[0]
&& osToc[1] == currOStoc[1]
&& osToc[2] == currOStoc[2]) {
ret = TRUE;
ret = true;
} else if ( osToc[0] == currOStoc[0]
&& osToc[1] == currOStoc[1]
&& osToc[2].isEqualIC("x") ) {
ret = TRUE;
ret = true;
}
} else if (currOStoc.size() == 2) {
if ( osToc[0] == currOStoc[0]
&& osToc[1] == currOStoc[1] ) {
ret = TRUE;
ret = true;
} else if ( osToc[0] == currOStoc[0]
&& osToc[1] == currOStoc[1]
&& osToc[2].isEqualIC("x") == 0 ) {
ret = TRUE;
ret = true;
}
}
}

View File

@ -344,9 +344,9 @@ STATIC REFIT_SIMPLE_MENU_ENTRY_TAG NoMessageEntry(XStringW().takeValueFrom(L"N
//REFIT_MENU_SCREEN(UINTN ID, CONST CHAR16* Title, CONST CHAR16* TimeoutText, REFIT_ABSTRACT_MENU_ENTRY* entry1, REFIT_ABSTRACT_MENU_ENTRY* entry2)
STATIC REFIT_MENU_SCREEN YesNoMessageMenu(0, XStringW(), XStringW(), &YesMessageEntry, &NoMessageEntry);
// Display a yes/no prompt
BOOLEAN YesNoMessage(IN XStringW& Title, IN CONST XStringW& Message)
XBool YesNoMessage(IN XStringW& Title, IN CONST XStringW& Message)
{
BOOLEAN Result = FALSE;
XBool Result = false;
UINTN MenuExit;
CreateInfoLines(Message, &YesNoMessageMenu.InfoLines);
YesNoMessageMenu.Title = Title;
@ -356,7 +356,7 @@ BOOLEAN YesNoMessage(IN XStringW& Title, IN CONST XStringW& Message)
MenuExit = YesNoMessageMenu.RunMenu(&ChosenEntry);
if ( ChosenEntry != NULL && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG() && ChosenEntry->getREFIT_SIMPLE_MENU_ENTRY_TAG()->Tag == TAG_YES &&
((MenuExit == MENU_EXIT_ENTER) || (MenuExit == MENU_EXIT_DETAILS))) {
Result = TRUE;
Result = true;
MenuExit = MENU_EXIT_ENTER;
}
} while (MenuExit != MENU_EXIT_ENTER);
@ -364,34 +364,34 @@ BOOLEAN YesNoMessage(IN XStringW& Title, IN CONST XStringW& Message)
return Result;
}
// Ask user for file path from directory menu
BOOLEAN AskUserForFilePathFromDir(const CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume,
XBool AskUserForFilePathFromDir(const CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume,
const CHAR16 *ParentPath OPTIONAL, const EFI_FILE *Dir,
OUT EFI_DEVICE_PATH_PROTOCOL **Result)
{
//REFIT_MENU_SCREEN Menu = { 0, L"Please Select File...", NULL, 0, NULL, 0, NULL,
// 0, NULL, FALSE, FALSE, 0, 0, 0, 0, { 0, 0, 0, 0 }, NULL};
// 0, NULL, false, false, 0, 0, 0, 0, { 0, 0, 0, 0 }, NULL};
// Check parameters
if ((Volume == NULL) || (Dir == NULL) || (Result == NULL)) {
return FALSE;
return false;
}
// TODO: Generate directory menu
return FALSE;
return false;
}
#define TAG_OFFSET 1000
//STATIC REFIT_MENU_SCREEN InitialMenu = {0, L"Please Select File...", NULL, 0, NULL,
// 0, NULL, NULL, FALSE, FALSE, 0, 0, 0, 0,
// 0, NULL, NULL, false, false, 0, 0, 0, 0,
// { 0, 0, 0, 0 }, NULL};
//STATIC REFIT_MENU_SCREEN InitialMenu(0, L"Please Select File..."_XSW, XStringW());
// Ask user for file path from volumes menu
BOOLEAN AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result)
XBool AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result)
{
REFIT_MENU_SCREEN Menu(0, L"Please Select File..."_XSW, XStringW());
UINTN Index = 0, /*Count = 0,*/ MenuExit;
BOOLEAN Responded = FALSE;
XBool Responded = false;
if (Result == NULL) {
return FALSE;
return false;
}
// Create volume entries
for (Index = 0; Index < Volumes.size(); ++Index) {
@ -421,7 +421,7 @@ BOOLEAN AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVI
if (!AskUserForFilePathFromDir(Title, &Volumes[Index], NULL, Volumes[Index].RootDir, Result)) {
continue;
}
Responded = TRUE;
Responded = true;
}
}
break;
@ -432,11 +432,11 @@ BOOLEAN AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVI
}
// Ask user for file path
BOOLEAN AskUserForFilePath(IN CHAR16 *Title OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *Root OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result)
XBool AskUserForFilePath(IN CHAR16 *Title OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *Root OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result)
{
EFI_FILE *Dir = NULL;
if (Result == NULL) {
return FALSE;
return false;
}
if (Root != NULL) {
// Get the file path
@ -474,10 +474,10 @@ BOOLEAN AskUserForFilePath(IN CHAR16 *Title OPTIONAL, IN EFI_DEVICE_PATH_PROTOCO
FreePool(Info);
Dir->Close(Dir);
*Result = Root;
return TRUE;
return true;
} else {
// Ask user other wise
BOOLEAN Success = AskUserForFilePathFromDir(Title, Volume, FilePath, Dir, Result);
XBool Success = AskUserForFilePathFromDir(Title, Volume, FilePath, Dir, Result);
FreePool(Info);
Dir->Close(Dir);
return Success;

View File

@ -33,7 +33,7 @@ StrToLower (
void AlertMessage (IN const XStringW& Title, IN const XStringW& Message);
BOOLEAN
XBool
YesNoMessage (
IN CONST CHAR16 *Title,
IN CONST CHAR16 *Message);

View File

@ -48,13 +48,13 @@ const XIcon& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, const
// Ask user for file path from directory menu
BOOLEAN AskUserForFilePathFromDir(const CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume,
XBool AskUserForFilePathFromDir(const CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume,
const CHAR16 *ParentPath, const EFI_FILE *Dir,
OUT EFI_DEVICE_PATH_PROTOCOL **Result);
// Ask user for file path from volumes menu
BOOLEAN AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result);
XBool AskUserForFilePathFromVolumes(const CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result);
// Ask user for file path
BOOLEAN AskUserForFilePath(IN CHAR16 *Title OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *Root OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result);
XBool AskUserForFilePath(IN CHAR16 *Title OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *Root OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result);
// legacy
void ScanLegacy(void);
@ -63,7 +63,7 @@ void AddCustomLegacy(void);
// loader
void ScanLoader(void);
void AddCustomEntries(void);
BOOLEAN IsCustomBootEntry(IN LOADER_ENTRY *Entry);
XBool IsCustomBootEntry(IN LOADER_ENTRY *Entry);
// tool
void ScanTool(void);
@ -97,13 +97,13 @@ EFI_STATUS InstallSecureBoot(void);
void UninstallSecureBoot(void);
void EnableSecureBoot(void);
void DisableSecureBoot(void);
BOOLEAN ConfigureSecureBoot(void);
XBool ConfigureSecureBoot(void);
CONST CHAR16 *SecureBootPolicyToStr(IN UINTN Policy);
EFI_STATUS VerifySecureBootImage(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath);
UINTN QuerySecureBootUser(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath);
EFI_STATUS EnrollSecureBootKeys(IN void *AuthorizedDatabase,
IN UINTN AuthorizedDatabaseSize,
IN BOOLEAN WantDefaultKeys);
IN XBool WantDefaultKeys);
EFI_STATUS ClearSecureBootKeys(void);
// secure boot database
@ -123,7 +123,7 @@ EFI_STATUS ClearAuthorizedDatabase(void);
void *GetImageSignatureDatabase(IN void *FileBuffer,
IN UINT64 FileSize,
IN UINTN *DatabaseSize,
IN BOOLEAN HashIfNoDatabase);
IN XBool HashIfNoDatabase);
EFI_STATUS AppendImageDatabaseToAuthorizedDatabase(IN void *Database,
IN UINTN DatabaseSize);
EFI_STATUS RemoveImageDatabaseFromAuthorizedDatabase(IN void *Database,

View File

@ -57,7 +57,7 @@
//the function is not in the class and deals always with MainMenu
//I made args as pointers to have an ability to call with NULL
BOOLEAN AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& _LoaderTitle, IN REFIT_VOLUME *Volume, IN const XIcon* Image, IN const XIcon* DriveImage, IN char32_t Hotkey, IN BOOLEAN CustomEntry)
XBool AddLegacyEntry(IN const XStringW& FullTitle, IN const XStringW& _LoaderTitle, IN REFIT_VOLUME *Volume, IN const XIcon* Image, IN const XIcon* DriveImage, IN char32_t Hotkey, IN XBool CustomEntry)
{
LEGACY_ENTRY *Entry, *SubEntry;
REFIT_MENU_SCREEN *SubScreen;
@ -207,7 +207,7 @@ DBG(" Volume->LegacyOS->Name=%ls\n", Volume->LegacyOS->Name.wc_str());
void ScanLegacy(void)
{
UINTN VolumeIndex, VolumeIndex2;
BOOLEAN ShowVolume, HideIfOthersFound;
XBool ShowVolume, HideIfOthersFound;
REFIT_VOLUME *Volume;
DBG("Scanning legacy ...\n");
@ -243,20 +243,20 @@ void ScanLegacy(void)
continue;
}
// DBG("not hidden\n");
ShowVolume = FALSE;
HideIfOthersFound = FALSE;
ShowVolume = false;
HideIfOthersFound = false;
if (Volume->IsAppleLegacy) {
ShowVolume = TRUE;
HideIfOthersFound = TRUE;
ShowVolume = true;
HideIfOthersFound = true;
} else if (Volume->HasBootCode) {
ShowVolume = TRUE;
ShowVolume = true;
// DBG("Volume %d will be shown BlockIo=%X WholeIo=%X\n",
// VolumeIndex, Volume->BlockIO, Volume->WholeDiskBlockIO);
if ((Volume->WholeDiskBlockIO == 0) &&
Volume->BlockIOOffset == 0 /* &&
Volume->OSName == NULL */)
// this is a whole disk (MBR) entry; hide if we have entries for partitions
HideIfOthersFound = TRUE;
HideIfOthersFound = true;
// DBG("Hide it!\n");
}
if (HideIfOthersFound) {
@ -267,7 +267,7 @@ void ScanLegacy(void)
if (VolumeIndex2 != VolumeIndex &&
Volumes[VolumeIndex2].HasBootCode &&
Volumes[VolumeIndex2].WholeDiskBlockIO == Volume->BlockIO){
ShowVolume = FALSE;
ShowVolume = false;
// DBG("PBR volume at index %d\n", VolumeIndex2);
break;
}
@ -276,7 +276,7 @@ void ScanLegacy(void)
if (ShowVolume && (!Volume->Hidden)){
// DBG(" add legacy\n");
if (!AddLegacyEntry(L""_XSW, L""_XSW, Volume, NULL, NULL, 0, FALSE)) {
if (!AddLegacyEntry(L""_XSW, L""_XSW, Volume, NULL, NULL, 0, false)) {
DBG("...entry not added\n");
};
} else {
@ -289,7 +289,7 @@ void ScanLegacy(void)
void AddCustomLegacy(void)
{
UINTN VolumeIndex, VolumeIndex2;
BOOLEAN ShowVolume, HideIfOthersFound;
XBool ShowVolume, HideIfOthersFound;
REFIT_VOLUME *Volume;
XIcon MainIcon;
XIcon DriveIcon;
@ -338,17 +338,17 @@ void AddCustomLegacy(void)
continue;
}
ShowVolume = FALSE;
HideIfOthersFound = FALSE;
ShowVolume = false;
HideIfOthersFound = false;
if (Volume->IsAppleLegacy) {
ShowVolume = TRUE;
HideIfOthersFound = TRUE;
ShowVolume = true;
HideIfOthersFound = true;
} else if (Volume->HasBootCode) {
ShowVolume = TRUE;
ShowVolume = true;
if ((Volume->WholeDiskBlockIO == 0) &&
Volume->BlockIOOffset == 0) {
// this is a whole disk (MBR) entry; hide if we have entries for partitions
HideIfOthersFound = TRUE;
HideIfOthersFound = true;
}
}
if (HideIfOthersFound) {
@ -358,7 +358,7 @@ void AddCustomLegacy(void)
if (VolumeIndex2 != VolumeIndex &&
Volumes[VolumeIndex2].HasBootCode &&
Volumes[VolumeIndex2].WholeDiskBlockIO == Volume->BlockIO) {
ShowVolume = FALSE;
ShowVolume = false;
break;
}
}
@ -402,7 +402,7 @@ void AddCustomLegacy(void)
}
// Create a legacy entry for this volume
DBG("\n");
if (AddLegacyEntry(Custom.settings.FullTitle, Custom.settings.Title, Volume, &MainIcon, &DriveIcon, Custom.settings.Hotkey, TRUE))
if (AddLegacyEntry(Custom.settings.FullTitle, Custom.settings.Title, Volume, &MainIcon, &DriveIcon, Custom.settings.Hotkey, true))
{
// DBG("match!\n");
}

View File

@ -388,7 +388,7 @@ STATIC XString8Array LinuxKernelOptions(const EFI_FILE_PROTOCOL *Dir,
return CustomOptions;
}
STATIC BOOLEAN isFirstRootUUID(REFIT_VOLUME *Volume)
STATIC XBool isFirstRootUUID(REFIT_VOLUME *Volume)
{
UINTN VolumeIndex;
REFIT_VOLUME *scanedVolume;
@ -397,13 +397,13 @@ STATIC BOOLEAN isFirstRootUUID(REFIT_VOLUME *Volume)
scanedVolume = &Volumes[VolumeIndex];
if (scanedVolume == Volume)
return TRUE;
return true;
if (CompareGuid(&scanedVolume->RootUUID, &Volume->RootUUID))
return FALSE;
return false;
}
return TRUE;
return true;
}
//Set Entry->VolName to .disk_label.contentDetails if it exists
@ -902,7 +902,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
IN UINT8 CustomBoot,
IN const XImage& CustomLogo,
IN const KERNEL_AND_KEXT_PATCHES* Patches,
IN BOOLEAN CustomEntry)
IN XBool CustomEntry)
{
EFI_DEVICE_PATH *LoaderDevicePath;
XStringW LoaderDevicePathString;
@ -1136,7 +1136,7 @@ if ( Entry->APFSTargetUUID.startWith("99999999") ) {
}
}
BOOLEAN BootCampStyle = ThemeX.BootCampStyle;
XBool BootCampStyle = ThemeX.BootCampStyle;
if ( Entry->Title.isEmpty() && Entry->DisplayedVolName.isEmpty() ) {
XStringW BasenameXW = XStringW(Basename(Volume->DevicePathString.wc_str()));
@ -1235,7 +1235,7 @@ void LOADER_ENTRY::AddDefaultMenu()
// REFIT_VOLUME *Volume;
UINT64 VolumeSize;
EFI_GUID *Guid = NULL;
BOOLEAN KernelIs64BitOnly;
XBool KernelIs64BitOnly;
// UINT64 os_version = AsciiOSVersionToUint64(OSVersion);
constexpr LString8 quietLitteral = "quiet"_XS8;
@ -1343,8 +1343,8 @@ void LOADER_ENTRY::AddDefaultMenu()
}
} else if (LoaderType == OSTYPE_LINEFI) {
BOOLEAN Quiet = LoadOptions.contains(quietLitteral);
BOOLEAN WithSplash = LoadOptions.contains(splashLitteral);
XBool Quiet = LoadOptions.contains(quietLitteral);
XBool WithSplash = LoadOptions.contains(splashLitteral);
// default entry
SubEntry = getPartiallyDuplicatedEntry();
@ -1464,7 +1464,7 @@ LOADER_ENTRY* AddLoaderEntry(IN CONST XStringW& LoaderPath, IN CONST XString8Arr
// }
// }
Entry = CreateLoaderEntry(LoaderPath, LoaderOptions, FullTitle, LoaderTitle, Volume, Image, NULL, OSType, Flags, 0, MenuBackgroundPixel, CUSTOM_BOOT_DISABLED, NullXImage, NULL, FALSE);
Entry = CreateLoaderEntry(LoaderPath, LoaderOptions, FullTitle, LoaderTitle, Volume, Image, NULL, OSType, Flags, 0, MenuBackgroundPixel, CUSTOM_BOOT_DISABLED, NullXImage, NULL, false);
if (Entry != NULL) {
if ((Entry->LoaderType == OSTYPE_OSX) ||
(Entry->LoaderType == OSTYPE_OSX_INSTALLER ) ||
@ -1975,7 +1975,7 @@ void ScanLoader(void)
#if defined(ANDX86)
if (TRUE) { //gSettings.AndroidScan
if (true) { //gSettings.AndroidScan
// check for Android loaders
for (UINTN Index = 0; Index < AndroidEntryDataCount; ++Index) {
UINTN aIndex, aFound;
@ -2405,7 +2405,7 @@ STATIC void AddCustomSubEntry(REFIT_VOLUME *Volume,
Entry = CreateLoaderEntry(CustomPath, CustomOptions, Custom.getFullTitle(), Custom.getTitle(), Volume,
NULL, NULL,
parentType, newCustomFlags, 0, {0,0,0,0}, 0, NullXImage,
/*(KERNEL_AND_KEXT_PATCHES *)(((UINTN)Custom) + OFFSET_OF(CUSTOM_LOADER_ENTRY, KernelAndKextPatches))*/ NULL, TRUE);
/*(KERNEL_AND_KEXT_PATCHES *)(((UINTN)Custom) + OFFSET_OF(CUSTOM_LOADER_ENTRY, KernelAndKextPatches))*/ NULL, true);
if (Entry != NULL) {
// if ( Custom.settings.Settings.notEmpty() ) DBG("Custom settings: %ls.plist will %s be applied\n", Custom.settings.Settings.wc_str(), Custom.settings.CommonSettings?"not":"");
// if (!Custom.settings.CommonSettings) {
@ -2466,7 +2466,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
REFIT_DIR_ITER *Iter = &SIter;
CHAR16 PartUUID[40];
XStringW CustomPath = _CustomPath;
BOOLEAN FindCustomPath = (CustomPath.isEmpty());
XBool FindCustomPath = (CustomPath.isEmpty());
if ( SubMenu != NULL ) panic("Call AddCustomSubEntry instead");
@ -2667,7 +2667,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
// Check to make sure that this entry is not hidden or disabled by another custom entry
if (true) {
BOOLEAN BetterMatch = FALSE;
XBool BetterMatch = false;
for (size_t i = 0 ; i < GlobalConfig.CustomEntries.size() ; ++i ) {
CUSTOM_LOADER_ENTRY& CustomEntry = GlobalConfig.CustomEntries[i];
if ( CustomEntry.settings.Disabled ) continue; // before, disabled entries settings weren't loaded.
@ -2704,7 +2704,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
((1ull<<Volume->DiskKind) & Custom.settings.VolumeType) != 0);
} else {
// Better match
BetterMatch = TRUE;
BetterMatch = true;
}
// Duplicate volume match
} else if (Custom.settings.Path != CustomEntry.settings.Path) {
@ -2766,7 +2766,7 @@ STATIC void AddCustomEntry(IN UINTN CustomIndex,
Entry = CreateLoaderEntry(CustomPath, CustomOptions, Custom.settings.FullTitle, Custom.settings.dgetTitle(), Volume,
(Image.isEmpty() ? NULL : &Image), (DriveImage.isEmpty() ? NULL : &DriveImage),
Custom.settings.Type, newCustomFlags, Custom.settings.Hotkey, Custom.settings.BootBgColor, Custom.CustomLogoType, Custom.CustomLogoImage,
/*(KERNEL_AND_KEXT_PATCHES *)(((UINTN)Custom) + OFFSET_OF(CUSTOM_LOADER_ENTRY, KernelAndKextPatches))*/ NULL, TRUE);
/*(KERNEL_AND_KEXT_PATCHES *)(((UINTN)Custom) + OFFSET_OF(CUSTOM_LOADER_ENTRY, KernelAndKextPatches))*/ NULL, true);
if (Entry != NULL) {
if ( Custom.settings.Settings.notEmpty() ) {
DBG("Custom settings: %ls.plist will %s be applied\n", Custom.settings.Settings.wc_str(), Custom.settings.CommonSettings?"not":"");

View File

@ -72,7 +72,7 @@ static EFI_BOOT_SERVICES OldBootServices;
// The locked graphics collection
static LOCKED_GRAPHICS *LockedGraphics;
// The screen lock
static BOOLEAN ScreenIsLocked;
static XBool ScreenIsLocked;
static EFI_STATUS EFIAPI LockedGOPBlt(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta OPTIONAL)
{
@ -102,7 +102,7 @@ static EFI_STATUS EFIAPI LockedGOPQueryMode(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *Thi
static EFI_STATUS AddLockedGraphicsGOP(IN EFI_HANDLE Handle, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle, IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GOPInterface)
{
BOOLEAN Modify = TRUE;
XBool Modify = true;
LOCKED_GRAPHICS *Ptr = LockedGraphics;
if ((Handle == NULL) ||
(AgentHandle == NULL) ||
@ -121,7 +121,7 @@ static EFI_STATUS AddLockedGraphicsGOP(IN EFI_HANDLE Handle, IN EFI_HANDLE Agent
return EFI_SUCCESS;
}
if (Ptr->GOPInterface == GOPInterface) {
Modify = FALSE;
Modify = false;
}
Ptr = Ptr->Next;
}
@ -296,7 +296,7 @@ static EFI_STATUS RemoveLockedGraphicsUGA(IN EFI_HANDLE Handle, IN EFI_HANDLE Ag
static EFI_STATUS AddLockedGraphicsUGA(IN EFI_HANDLE Handle, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle, IN EFI_UGA_DRAW_PROTOCOL *UGAInterface)
{
BOOLEAN Modify = TRUE;
XBool Modify = true;
LOCKED_GRAPHICS *Ptr = LockedGraphics;
if ((Handle == NULL) ||
(AgentHandle == NULL) ||
@ -315,7 +315,7 @@ static EFI_STATUS AddLockedGraphicsUGA(IN EFI_HANDLE Handle, IN EFI_HANDLE Agent
return EFI_SUCCESS;
}
if (Ptr->UGAInterface == UGAInterface) {
Modify = FALSE;
Modify = false;
}
Ptr = Ptr->Next;
}
@ -489,7 +489,7 @@ EFI_STATUS LockBootScreen(void)
LockGraphicsGOP();
LockGraphicsUGA();
// Lock screen
ScreenIsLocked = TRUE;
ScreenIsLocked = true;
return EFI_SUCCESS;
}
@ -513,6 +513,6 @@ EFI_STATUS UnlockBootScreen(void)
// Restore locate handle, open and close protocol
CopyMem(gBS, &OldBootServices, sizeof(EFI_BOOT_SERVICES));
// Unlock
ScreenIsLocked = FALSE;
ScreenIsLocked = false;
return EFI_SUCCESS;
}

View File

@ -65,7 +65,7 @@ extern "C" {
void EnableSecureBoot(void)
{
EFI_STATUS Status = EFI_NOT_FOUND;
BOOLEAN WantDefaultKeys;
XBool WantDefaultKeys;
CONST CHAR16 *ErrorString = NULL;
UINTN CloverSignatureSize = 0;
void *CloverSignature = NULL;
@ -80,11 +80,11 @@ void EnableSecureBoot(void)
UINT32 AuthenticationStatus = 0;
UINTN FileSize = 0;
// Open the file buffer
void *FileBuffer = GetFileBufferByFilePath(FALSE, &self.getCloverDirFullDevicePath(), &FileSize, &AuthenticationStatus);
void *FileBuffer = GetFileBufferByFilePath(false, &self.getCloverDirFullDevicePath(), &FileSize, &AuthenticationStatus);
if (FileBuffer != NULL) {
if (FileSize > 0) {
// Retrieve the certificates
CloverSignature = GetImageSignatureDatabase(FileBuffer, FileSize, &CloverSignatureSize, FALSE);
CloverSignature = GetImageSignatureDatabase(FileBuffer, FileSize, &CloverSignatureSize, false);
if (CloverSignature != NULL) {
if (CloverSignatureSize > 0) {
// Found signature
@ -218,64 +218,64 @@ STATIC EFI_SECURITY_FILE_AUTHENTICATION_STATE gSecurityFileAuthentication;
STATIC EFI_SECURITY2_FILE_AUTHENTICATION gSecurity2FileAuthentication;
// Pre check the secure boot policy
STATIC BOOLEAN EFIAPI
STATIC XBool EFIAPI
PrecheckSecureBootPolicy(IN OUT EFI_STATUS *AuthenticationStatus,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
{
CHAR16 *DevicePathStr;
UINTN Index;
if ((AuthenticationStatus == NULL) || (DevicePath == NULL)) {
return FALSE;
return false;
}
switch (gSettings.Boot.SecureBootPolicy) {
case SECURE_BOOT_POLICY_ALLOW:
// Allow all images
*AuthenticationStatus = EFI_SUCCESS;
return TRUE;
return true;
case SECURE_BOOT_POLICY_WHITELIST:
// Check the white list for this image
DevicePathStr = FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL *)DevicePath);
if (DevicePathStr == NULL) {
return FALSE;
return false;
}
for (Index = 0; Index < gSettings.Boot.SecureBootWhiteList.size(); ++Index) {
if ((gSettings.Boot.SecureBootWhiteList[Index].notEmpty()) &&
(StriStr(DevicePathStr, gSettings.Boot.SecureBootWhiteList[Index].wc_str()) != NULL)) {
// White listed
*AuthenticationStatus = EFI_SUCCESS;
return TRUE;
return true;
}
}
return TRUE;
return true;
case SECURE_BOOT_POLICY_BLACKLIST:
// Check the black list for this image
DevicePathStr = FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL *)DevicePath);
if (DevicePathStr == NULL) {
return FALSE;
return false;
}
for (Index = 0; Index < gSettings.Boot.SecureBootBlackList.size(); ++Index) {
if ((gSettings.Boot.SecureBootBlackList[Index].notEmpty()) &&
(StriStr(DevicePathStr, gSettings.Boot.SecureBootBlackList[Index].wc_str()) != NULL)) {
// Black listed
return TRUE;
return true;
}
}
*AuthenticationStatus = EFI_SUCCESS;
return TRUE;
return true;
case SECURE_BOOT_POLICY_USER:
DevicePathStr = FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL *)DevicePath);
if (DevicePathStr == NULL) {
return FALSE;
return false;
}
// Check the black list for this image
for (Index = 0; Index < gSettings.Boot.SecureBootBlackList.size(); ++Index) {
if ((gSettings.Boot.SecureBootBlackList[Index].notEmpty()) &&
(StriStr(DevicePathStr, gSettings.Boot.SecureBootBlackList[Index].wc_str()) != NULL)) {
// Black listed
return TRUE;
return true;
}
}
// Check the white list for this image
@ -284,16 +284,16 @@ PrecheckSecureBootPolicy(IN OUT EFI_STATUS *AuthenticationSt
(StriStr(DevicePathStr, gSettings.Boot.SecureBootWhiteList[Index].wc_str()) != NULL)) {
// White listed
*AuthenticationStatus = EFI_SUCCESS;
return TRUE;
return true;
}
}
break;
}
return FALSE;
return false;
}
// Check the secure boot policy
STATIC BOOLEAN EFIAPI
STATIC XBool EFIAPI
CheckSecureBootPolicy(IN OUT EFI_STATUS *AuthenticationStatus,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN void *FileBuffer,
@ -313,12 +313,12 @@ CheckSecureBootPolicy(IN OUT EFI_STATUS *AuthenticationStatu
case SECURE_BOOT_POLICY_DENY:
default:
return TRUE;
return true;
case SECURE_BOOT_POLICY_INSERT:
// If this is forced mode then no insert
if (GlobalConfig.SecureBootSetupMode) {
return TRUE;
return true;
}
break;
}
@ -328,18 +328,18 @@ CheckSecureBootPolicy(IN OUT EFI_STATUS *AuthenticationStatu
// Insert image signature
AppendImageToAuthorizedDatabase(DevicePath, FileBuffer, FileSize);
*AuthenticationStatus = EFI_SUCCESS;
return TRUE;
return true;
case SECURE_BOOT_POLICY_ALLOW:
// Allow all images
*AuthenticationStatus = EFI_SUCCESS;
return TRUE;
return true;
case SECURE_BOOT_POLICY_DENY:
// Deny all images
return TRUE;
return true;
}
return FALSE;
return false;
}
@ -375,7 +375,7 @@ Internal2FileAuthentication(IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN void *FileBuffer,
IN UINTN FileSize,
IN BOOLEAN BootPolicy)
IN XBool BootPolicy)
{
EFI_STATUS Status = EFI_SECURITY_VIOLATION;
// Check secure boot policy

View File

@ -745,7 +745,7 @@ Failed:
void *GetImageSignatureDatabase(IN void *FileBuffer,
IN UINT64 FileSize,
IN UINTN *DatabaseSize,
IN BOOLEAN HashIfNoDatabase)
IN XBool HashIfNoDatabase)
{
UINTN Size = 0;
void *Database = NULL;

View File

@ -66,8 +66,8 @@ extern "C" {
#define DBG(...) DebugLog(DEBUG_SECURE_MENU, __VA_ARGS__)
#endif
extern BOOLEAN gGuiIsReady;
extern BOOLEAN gThemeNeedInit;
extern XBool gGuiIsReady;
extern XBool gThemeNeedInit;
// Add secure boot tool entry
void AddSecureBootTool(void)
@ -108,7 +108,7 @@ STATIC REFIT_SIMPLE_MENU_ENTRY_TAG QueryEntry[] = {
};
/*commented out to avoid warning: STATIC*/ REFIT_SIMPLE_MENU_ENTRY_TAG *QueryEntries[] = { QueryEntry, QueryEntry + 1, QueryEntry + 2 };
//STATIC REFIT_MENU_SCREEN QueryUserMenu = { 0, L"Secure Boot Authentication"_XSW, L""_XSW, 3, NULL, 2, QueryEntries,
// 0, NULL, NULL, FALSE, FALSE, 0, 0, 0, 0,
// 0, NULL, NULL, false, false, 0, 0, 0, 0,
// /* FILM_CENTRE, FILM_CENTRE,*/ { 0, 0, 0, 0 }, NULL };
STATIC REFIT_MENU_SCREEN QueryUserMenu = { 0, L"Secure Boot Authentication"_XSW, L""_XSW }; // TODO:add QueryEntries
@ -133,14 +133,14 @@ UINTN QuerySecureBootUser(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
DBG("VerifySecureBootImage: Query user for authentication action for %ls\n", QueryUserMenu.InfoLines[1].wc_str());
// Because we may
if (!gGuiIsReady) {
InitScreen(FALSE);
InitScreen(false);
if (gThemeNeedInit) {
UINTN Size = 0;
InitTheme((CHAR8*)GetNvramVariable(L"Clover.Theme", &gEfiAppleBootGuid, NULL, &Size));
ThemeX.ClearScreen();
gThemeNeedInit = FALSE;
gThemeNeedInit = false;
}
gGuiIsReady = TRUE;
gGuiIsReady = true;
}
// Run the query menu
do
@ -244,11 +244,11 @@ EFI_STATUS AppendImageToAuthorizedDatabase(IN CONST EFI_DEVICE_PATH_PROTOCOL *De
} else if ((FileBuffer == NULL) || (FileSize == 0)) {
// Load file by device path
UINT32 AuthenticationStatus = 0;
FileBuffer = GetFileBufferByFilePath(FALSE, DevicePath, &FileSize, &AuthenticationStatus);
FileBuffer = GetFileBufferByFilePath(false, DevicePath, &FileSize, &AuthenticationStatus);
if (FileBuffer) {
if (FileSize > 0) {
// Create image signature
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, TRUE);
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, true);
if (Database) {
// Add the image signature to database
if (EFI_ERROR(Status = AppendImageDatabaseToAuthorizedDatabase(Database, DatabaseSize))) {
@ -267,7 +267,7 @@ EFI_STATUS AppendImageToAuthorizedDatabase(IN CONST EFI_DEVICE_PATH_PROTOCOL *De
}
} else {
// Create image signature
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, TRUE);
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, true);
if (Database) {
// Add the image signature to database
if (EFI_ERROR(Status = AppendImageDatabaseToAuthorizedDatabase(Database, DatabaseSize))) {
@ -318,11 +318,11 @@ EFI_STATUS RemoveImageFromAuthorizedDatabase(IN CONST EFI_DEVICE_PATH_PROTOCOL *
} else if ((FileBuffer == NULL) || (FileSize == 0)) {
// Load file by device path
UINT32 AuthenticationStatus = 0;
FileBuffer = GetFileBufferByFilePath(FALSE, DevicePath, &FileSize, &AuthenticationStatus);
FileBuffer = GetFileBufferByFilePath(false, DevicePath, &FileSize, &AuthenticationStatus);
if (FileBuffer) {
if (FileSize > 0) {
// Create image signature
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, TRUE);
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, true);
if (Database) {
// Remove the image signature from database
if (EFI_ERROR(Status = RemoveImageDatabaseFromAuthorizedDatabase(Database, DatabaseSize))) {
@ -341,7 +341,7 @@ EFI_STATUS RemoveImageFromAuthorizedDatabase(IN CONST EFI_DEVICE_PATH_PROTOCOL *
}
} else {
// Create image signature
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, TRUE);
Database = GetImageSignatureDatabase(FileBuffer, FileSize, &DatabaseSize, true);
if (Database) {
// Remove the image signature from database
if (EFI_ERROR(Status = RemoveImageDatabaseFromAuthorizedDatabase(Database, DatabaseSize))) {
@ -386,7 +386,7 @@ STATIC REFIT_SIMPLE_MENU_ENTRY_TAG ClearImageSignatureEntry = { L"Clear image
STATIC REFIT_SIMPLE_MENU_ENTRY_TAG DisableSecureBootEntry = { L"Disable secure boot"_XSW, TAG_DISABLE, ActionEnter };
/*commented out to avoid warning: STATIC*/ REFIT_ABSTRACT_MENU_ENTRY *SecureBootEntries[] = { NULL, NULL, NULL, NULL, NULL, NULL };
//STATIC REFIT_MENU_SCREEN SecureBootMenu = { 0, L"Secure Boot Configuration"_XSW, NULL, 0, NULL, 0, SecureBootEntries,
// 0, NULL, NULL, FALSE, FALSE, 0, 0, 0, 0,
// 0, NULL, NULL, false, false, 0, 0, 0, 0,
// /* FILM_CENTRE, FILM_CENTRE,*/ { 0, 0, 0, 0 }, NULL };
STATIC REFIT_MENU_SCREEN SecureBootMenu = { 0, L"Secure Boot Configuration"_XSW, L""_XSW }; // TODO: what was this SecureBootEntries array.
@ -413,14 +413,14 @@ STATIC REFIT_SIMPLE_MENU_ENTRY_TAG SecureBootPolicyNameEntry[] = {
//STATIC REFIT_MENU_SCREEN SecureBootPolicyMenu = { 0, L"Secure Boot Policy", NULL, 0, NULL,
// sizeof(SecureBootPolicyEntries) / sizeof(REFIT_MENU_ENTRY *), SecureBootPolicyEntries,
// 0, NULL, NULL, FALSE, FALSE, 0, 0, 0, 0,
// 0, NULL, NULL, false, false, 0, 0, 0, 0,
// /* FILM_CENTRE, FILM_CENTRE,*/ { 0, 0, 0, 0 } , NULL };
STATIC REFIT_MENU_SCREEN SecureBootPolicyMenu = { 0, L"Secure Boot Policy"_XSW, L""_XSW }; // TODO: add entries from SecureBootPolicyEntries
// Configure secure boot
BOOLEAN ConfigureSecureBoot(void)
XBool ConfigureSecureBoot(void)
{
BOOLEAN StillConfiguring = TRUE;
XBool StillConfiguring = true;
do
{
UINTN MenuExit;
@ -510,21 +510,21 @@ BOOLEAN ConfigureSecureBoot(void)
DBG("User disabled secure boot\n");
DisableSecureBoot();
if (!GlobalConfig.SecureBoot) {
return TRUE;
return true;
}
AlertMessage(L"Disable Secure Boot"_XSW, L"Disabling secure boot failed!\nClover does not appear to own the PK"_XSW);
}
break;
default:
StillConfiguring = FALSE;
StillConfiguring = false;
break;
}
} else if (MenuExit == MENU_EXIT_ESCAPE) {
StillConfiguring = FALSE;
StillConfiguring = false;
}
} while (StillConfiguring);
return FALSE;
return false;
}
#endif // ENABLE_SECURE_BOOT

View File

@ -76,7 +76,7 @@ EFI_STATUS ClearSecureBootKeys(void)
// Enroll the secure boot keys
EFI_STATUS EnrollSecureBootKeys(IN void *AuthorizedDatabase,
IN UINTN AuthorizedDatabaseSize,
IN BOOLEAN WantDefaultKeys)
IN XBool WantDefaultKeys)
{
EFI_STATUS Status;

View File

@ -79,7 +79,7 @@
#define DBG(...) DebugLog(DEBUG_SCAN_TOOL, __VA_ARGS__)
#endif
STATIC BOOLEAN AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle,
STATIC XBool AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle,
IN REFIT_VOLUME *Volume, const XIcon& Image,
IN char32_t ShortcutLetter, IN CONST XString8Array& Options)
{
@ -87,7 +87,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *Full
// Check the loader exists
if ((LoaderPath.isEmpty()) || (Volume == NULL) || (Volume->RootDir == NULL) ||
!FileExists(Volume->RootDir, LoaderPath)) {
return FALSE;
return false;
}
// Allocate the entry
Entry = new REFIT_MENU_ENTRY_LOADER_TOOL;
@ -113,7 +113,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *Full
DBG("found tool %ls\n", LoaderPath.s());
MainMenu.AddMenuEntry(Entry, true);
return TRUE;
return true;
}
STATIC void AddCloverEntry(IN CONST XStringW& LoaderPath, IN CONST CHAR16 *LoaderTitle, IN REFIT_VOLUME *Volume)

View File

@ -163,7 +163,7 @@ void REFIT_MENU_SCREEN::DrawTextCorner(UINTN TextC, UINT8 Align)
// HIDEUI_ALL - included
((TextC == TEXT_CORNER_REVISION) && ((ThemeX.HideUIFlags & HIDEUI_FLAG_REVISION) != 0)) ||
((TextC == TEXT_CORNER_HELP) && ((ThemeX.HideUIFlags & HIDEUI_FLAG_HELP) != 0)) ||
((TextC == TEXT_CORNER_OPTIMUS) && (gSettings.GUI.ShowOptimus == FALSE))
((TextC == TEXT_CORNER_OPTIMUS) && (gSettings.GUI.ShowOptimus == false))
) {
return;
}
@ -212,7 +212,7 @@ void REFIT_MENU_SCREEN::DrawTextCorner(UINTN TextC, UINT8 Align)
DrawTextXY(Text, Xpos, UGAHeight - (INTN)(ThemeX.TextHeight * 1.5f), Align);
}
void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOLEAN selected, INTN XPos, INTN YPos)
void REFIT_MAINMENU_SCREEN::DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, XBool selected, INTN XPos, INTN YPos)
{
INTN MainSize = ThemeX.MainEntriesSize;
// XImage MainImage(MainSize, MainSize);
@ -371,7 +371,7 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
egGetScreenSize(&UGAWidth, &UGAHeight);
InitAnime();
SwitchToGraphicsAndClear();
//BltClearScreen(FALSE);
//BltClearScreen(false);
EntriesGap = (int)(ThemeX.TileXSpace * ThemeX.Scale);
EntriesWidth = ThemeX.row0TileSize;
@ -453,7 +453,7 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
for (INTN i = 0; i <= ScrollState.MaxIndex; i++) {
if (Entries[i].Row == 0) {
if ((i >= ScrollState.FirstVisible) && (i <= ScrollState.LastVisible)) {
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?true:false,
itemPosX[i - ScrollState.FirstVisible], row0PosY);
// draw static text for the boot options, BootCampStyle
@ -467,7 +467,7 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
}
}
} else {
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?true:false,
itemPosX[i], row1PosY);
}
}
@ -504,18 +504,18 @@ void REFIT_MAINMENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
case MENU_FUNCTION_PAINT_SELECTION:
HidePointer();
if (Entries[ScrollState.LastSelection].Row == 0) {
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], FALSE,
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], false,
itemPosX[ScrollState.LastSelection - ScrollState.FirstVisible], row0PosY);
} else {
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], FALSE,
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], false,
itemPosX[ScrollState.LastSelection], row1PosY);
}
if (Entries[ScrollState.CurrentSelection].Row == 0) {
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], true,
itemPosX[ScrollState.CurrentSelection - ScrollState.FirstVisible], row0PosY);
} else {
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], true,
itemPosX[ScrollState.CurrentSelection], row1PosY);
}
@ -574,7 +574,7 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH
egGetScreenSize(&UGAWidth, &UGAHeight); //do this when needed
InitAnime();
SwitchToGraphicsAndClear();
//BltClearScreen(FALSE);
//BltClearScreen(false);
//adjustable by theme.plist?
EntriesPosY = (int)(LAYOUT_Y_EDGE * ThemeX.Scale);
EntriesGap = (int)(ThemeX.TileYSpace * ThemeX.Scale);
@ -641,11 +641,11 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH
for (INTN i = 0; i <= ScrollState.MaxIndex; i++) {
if (Entries[i].Row == 0) {
if ((i >= ScrollState.FirstVisible) && (i <= ScrollState.LastVisible)) {
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?true:false,
itemPosX[i - ScrollState.FirstVisible], itemPosY[i - ScrollState.FirstVisible]);
}
} else { //row1
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?true:false,
itemPosX[i], itemPosY[i]);
}
}
@ -663,21 +663,21 @@ void REFIT_MAINMENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CH
case MENU_FUNCTION_PAINT_SELECTION:
HidePointer();
if (Entries[ScrollState.LastSelection].Row == 0) {
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], FALSE,
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], false,
itemPosX[ScrollState.LastSelection - ScrollState.FirstVisible],
itemPosY[ScrollState.LastSelection - ScrollState.FirstVisible]);
} else {
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], FALSE,
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], false,
itemPosX[ScrollState.LastSelection],
itemPosY[ScrollState.LastSelection]);
}
if (Entries[ScrollState.CurrentSelection].Row == 0) {
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], true,
itemPosX[ScrollState.CurrentSelection - ScrollState.FirstVisible],
itemPosY[ScrollState.CurrentSelection - ScrollState.FirstVisible]);
} else {
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], true,
itemPosX[ScrollState.CurrentSelection],
itemPosY[ScrollState.CurrentSelection]);
}

View File

@ -81,7 +81,7 @@ public:
}
}
void DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOLEAN selected, INTN XPos, INTN YPos);
void DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, XBool selected, INTN XPos, INTN YPos);
void DrawMainMenuLabel(IN CONST XStringW& Text, IN INTN XPos, IN INTN YPos);
virtual void call_MENU_FUNCTION_INIT(IN CONST CHAR16 *ParamText) { MenuStyle(MENU_FUNCTION_INIT, ParamText); }

View File

@ -79,10 +79,10 @@
const CHAR16 ArrowUp[2] = { ARROW_UP, 0 }; //defined in Simple Text Out protocol
const CHAR16 ArrowDown[2] = { ARROW_DOWN, 0 };
//
//BOOLEAN MainAnime = FALSE;
//XBool MainAnime = false;
//
////TODO Scroll variables must be a part of REFIT_SCREEN
////BOOLEAN ScrollEnabled = FALSE;
////XBool ScrollEnabled = false;
//
static INTN ScrollbarYMovement;
//
@ -102,7 +102,7 @@ INTN MenuWidth , TimeoutPosY;
UINTN MenuMaxTextLen = 0;
INTN EntriesPosX, EntriesPosY;
BOOLEAN mGuiReady = FALSE;
XBool mGuiReady = false;
XPointer REFIT_MENU_SCREEN::mPointer;
@ -174,8 +174,8 @@ void REFIT_MENU_SCREEN::InitScroll(IN INTN ItemCount, IN UINTN MaxCount,
ScrollState.IsScrolling = (ScrollState.MaxFirstVisible > 0);
ScrollState.PaintAll = TRUE;
ScrollState.PaintSelection = FALSE;
ScrollState.PaintAll = true;
ScrollState.PaintSelection = false;
ScrollState.LastVisible = ScrollState.FirstVisible + ScrollState.MaxVisible;
@ -228,15 +228,15 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
if (ScrollState.CurrentSelection > 0) {
ScrollState.CurrentSelection --;
if (ScrollState.CurrentSelection < ScrollState.FirstVisible) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible = ScrollState.CurrentSelection;
}
if (ScrollState.CurrentSelection == ScrollState.MaxScroll) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
}
if ((ScrollState.CurrentSelection < ScrollState.MaxScroll) &&
(ScrollState.CurrentSelection > ScrollState.LastVisible)) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.LastVisible = ScrollState.CurrentSelection;
ScrollState.FirstVisible = ScrollState.LastVisible - ScrollState.MaxVisible;
}
@ -248,12 +248,12 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
ScrollState.CurrentSelection++;
if ((ScrollState.CurrentSelection > ScrollState.LastVisible) &&
(ScrollState.CurrentSelection <= ScrollState.MaxScroll)){
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible++;
CONSTRAIN_MAX(ScrollState.FirstVisible, ScrollState.MaxFirstVisible);
}
if (ScrollState.CurrentSelection == ScrollState.MaxScroll + 1) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
}
}
break;
@ -264,7 +264,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
ScrollState.CurrentSelection++;
ScrollState.FirstVisible++;
ScrollState.LastVisible++;
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
}
break;
@ -274,7 +274,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
ScrollState.CurrentSelection--;
ScrollState.FirstVisible--;
ScrollState.LastVisible--;
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
}
break;
@ -287,14 +287,14 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
ScrollState.CurrentSelection = 0; // move to first entry
} else {
if (ScrollState.FirstVisible > 0)
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.CurrentSelection -= ScrollState.MaxVisible; // move one page and scroll synchronously
ScrollState.FirstVisible -= ScrollState.MaxVisible;
}
CONSTRAIN_MIN(ScrollState.CurrentSelection, 0);
CONSTRAIN_MIN(ScrollState.FirstVisible, 0);
if (ScrollState.CurrentSelection < ScrollState.FirstVisible) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible = ScrollState.CurrentSelection;
}
}
@ -313,7 +313,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
ScrollState.CurrentSelection = ScrollState.MaxIndex; // move to last entry
} else {
// if (ScrollState.FirstVisible < ScrollState.MaxFirstVisible)
// ScrollState.PaintAll = TRUE;
// ScrollState.PaintAll = true;
ScrollState.CurrentSelection += ScrollState.MaxVisible; // move one page and scroll synchronously
ScrollState.FirstVisible += ScrollState.MaxVisible;
}
@ -321,11 +321,11 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
CONSTRAIN_MAX(ScrollState.FirstVisible, ScrollState.MaxFirstVisible);
if ((ScrollState.CurrentSelection > ScrollState.LastVisible) &&
(ScrollState.CurrentSelection <= ScrollState.MaxScroll)){
// ScrollState.PaintAll = TRUE;
// ScrollState.PaintAll = true;
ScrollState.FirstVisible+= ScrollState.MaxVisible;
CONSTRAIN_MAX(ScrollState.FirstVisible, ScrollState.MaxFirstVisible);
}
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
}
// DBG("after cur=%lld, maxInd=%lld, maxVis=%lld, First=%lld, maxFirst=%lld, lastVis=%lld, maxscr=%lld\n",
// ScrollState.CurrentSelection, ScrollState.MaxIndex, ScrollState.MaxVisible, ScrollState.FirstVisible,
@ -337,7 +337,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
if (ScrollState.CurrentSelection > 0) {
ScrollState.CurrentSelection = 0;
if (ScrollState.FirstVisible > 0) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible = 0;
}
}
@ -347,7 +347,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
if (ScrollState.CurrentSelection < ScrollState.MaxIndex) {
ScrollState.CurrentSelection = ScrollState.MaxIndex;
if (ScrollState.FirstVisible < ScrollState.MaxFirstVisible) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible = ScrollState.MaxFirstVisible;
}
}
@ -357,12 +357,12 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
// The caller has already updated CurrentSelection, but we may
// have to scroll to make it visible.
if (ScrollState.CurrentSelection < ScrollState.FirstVisible) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible = ScrollState.CurrentSelection; // - (ScrollState.MaxVisible >> 1);
CONSTRAIN_MIN(ScrollState.FirstVisible, 0);
} else if ((ScrollState.CurrentSelection > ScrollState.LastVisible) &&
(ScrollState.CurrentSelection <= ScrollState.MaxScroll)) {
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
ScrollState.FirstVisible = ScrollState.CurrentSelection - ScrollState.MaxVisible;
CONSTRAIN_MAX(ScrollState.FirstVisible, ScrollState.MaxFirstVisible);
}
@ -371,7 +371,7 @@ void REFIT_MENU_SCREEN::UpdateScroll(IN UINTN Movement)
}
if (!ScrollState.PaintAll && ScrollState.CurrentSelection != ScrollState.LastSelection)
ScrollState.PaintSelection = TRUE;
ScrollState.PaintSelection = true;
ScrollState.LastVisible = ScrollState.FirstVisible + ScrollState.MaxVisible;
//ycr.ru
@ -568,7 +568,7 @@ UINTN REFIT_MENU_SCREEN::InputDialog()
continue;
break;
case SCAN_F2:
SavePreBootLog = TRUE;
SavePreBootLog = true;
break;
//not used here
/* case SCAN_F6:
@ -641,7 +641,7 @@ UINTN REFIT_MENU_SCREEN::InputDialog()
switch (MenuExit) {
case MENU_EXIT_ENTER:
Item->Valid = TRUE;
Item->Valid = true;
ApplyInputs();
break;
@ -656,7 +656,7 @@ UINTN REFIT_MENU_SCREEN::InputDialog()
}
break;
}
Item->Valid = FALSE;
Item->Valid = false;
if (Item->SValue.notEmpty()) {
MsgLog("EDITED: %ls\n", Item->SValue.wc_str());
}
@ -701,7 +701,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
EFI_INPUT_KEY key;
// UINTN Index;
INTN ShortcutEntry;
BOOLEAN HaveTimeout = FALSE;
XBool HaveTimeout = false;
INTN TimeoutCountdown = 0;
UINTN MenuExit;
@ -733,7 +733,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
//no default - no timeout!
if ((*DefaultEntryIndex != -1) && (TimeoutSeconds > 0)) {
// DBG("have timeout\n");
HaveTimeout = TRUE;
HaveTimeout = true;
TimeoutCountdown = TimeoutSeconds;
}
MenuExit = 0;
@ -770,10 +770,10 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
// update the screen
if (ScrollState.PaintAll) {
call_MENU_FUNCTION_PAINT_ALL(NULL);
ScrollState.PaintAll = FALSE;
ScrollState.PaintAll = false;
} else if (ScrollState.PaintSelection) {
call_MENU_FUNCTION_PAINT_SELECTION(NULL);
ScrollState.PaintSelection = FALSE;
ScrollState.PaintSelection = false;
}
if (HaveTimeout) {
@ -783,14 +783,14 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
if (gEvent) { //for now used at CD eject.
MenuExit = MENU_EXIT_ESCAPE;
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
gEvent = 0; //to prevent looping
break;
}
key.UnicodeChar = 0;
key.ScanCode = 0;
if (!mGuiReady) {
mGuiReady = TRUE;
mGuiReady = true;
DBG("GUI ready\n");
}
@ -813,7 +813,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
case ActionSelect:
ScrollState.LastSelection = ScrollState.CurrentSelection;
ScrollState.CurrentSelection = mItemID;
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
HidePointer();
break;
case ActionEnter:
@ -823,7 +823,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
MenuExit = InputDialog();
} else if (Entries[mItemID].getREFIT_MENU_SWITCH()) {
MenuExit = InputDialog();
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
HidePointer();
} else if (!Entries[mItemID].getREFIT_INFO_DIALOG()) {
MenuExit = MENU_EXIT_ENTER;
@ -846,7 +846,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
MenuExit = InputDialog();
} else if (Entries[mItemID].getREFIT_MENU_SWITCH()) {
MenuExit = InputDialog();
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
HidePointer();
} else if (!Entries[mItemID].getREFIT_INFO_DIALOG()) {
MenuExit = MENU_EXIT_DETAILS;
@ -854,7 +854,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
break;
case ActionDeselect:
ScrollState.LastSelection = ScrollState.CurrentSelection;
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
HidePointer();
break;
case ActionFinish:
@ -885,7 +885,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
// the user pressed a key, cancel the timeout
call_MENU_FUNCTION_PAINT_TIMEOUT(L"");
HidePointer(); //ycr.ru
HaveTimeout = FALSE;
HaveTimeout = false;
}
mAction = ActionNone; //do action once
@ -926,7 +926,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
MenuExit = MENU_EXIT_HELP;
break;
case SCAN_F2:
SavePreBootLog = TRUE;
SavePreBootLog = true;
//let it be twice
Status = SaveBooterLog(&self.getCloverDir(), PREBOOT_LOG);
// Jief : don't write outside SelfDir
@ -941,7 +941,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
SaveOemTables();
break;
case SCAN_F5:
SaveOemDsdt(TRUE); //full patch
SaveOemDsdt(true); //full patch
break;
case SCAN_F6:
Status = egSaveFile(&self.getCloverDir(), VBIOS_BIN, (UINT8*)(UINTN)0xc0000, 0x20000);
@ -984,7 +984,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
case SCAN_F9:
SetNextScreenMode(1);
egGetScreenSize(&UGAWidth, &UGAHeight); //before init theme
GlobalConfig.gThemeChanged = TRUE;
GlobalConfig.gThemeChanged = true;
MenuExit = MENU_EXIT_ESCAPE; //to redraw screen
break;
case SCAN_F10:
@ -996,7 +996,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
break;
case SCAN_F12:
MenuExit = MENU_EXIT_EJECT;
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
break;
}
@ -1008,7 +1008,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
MenuExit = InputDialog();
} else if (Entries[ScrollState.CurrentSelection].getREFIT_MENU_SWITCH()){
MenuExit = InputDialog();
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
} else if (Entries[ScrollState.CurrentSelection].getREFIT_MENU_ENTRY_CLOVER()){
MenuExit = MENU_EXIT_DETAILS;
} else if (!Entries[ScrollState.CurrentSelection].getREFIT_INFO_DIALOG()) {
@ -1021,7 +1021,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFI
MenuExit = InputDialog();
} else if (Entries[ScrollState.CurrentSelection].getREFIT_MENU_SWITCH()){
MenuExit = InputDialog();
ScrollState.PaintAll = TRUE;
ScrollState.PaintAll = true;
HidePointer();
} else if (!Entries[ScrollState.CurrentSelection].getREFIT_INFO_DIALOG()) {
MenuExit = MENU_EXIT_DETAILS;
@ -1342,7 +1342,7 @@ INTN REFIT_MENU_SCREEN::DrawTextXY(IN const XStringW& Text, IN INTN XPos, IN INT
}
OldTextHeight = Height;
// TextBufferXY = egCreateFilledImage(TextWidth, Height, TRUE, &MenuBackgroundPixel);
// TextBufferXY = egCreateFilledImage(TextWidth, Height, true, &MenuBackgroundPixel);
TextBufferXY.setSizeInPixels(TextWidth, Height);
// TextBufferXY.Fill(MenuBackgroundPixel);
@ -1508,20 +1508,20 @@ void REFIT_MENU_SCREEN::ScrollingBar()
Total.CopyRect(ThemeX.Background, ScrollTotal.XPos, ScrollTotal.YPos);
if (!ThemeX.ScrollbarBackgroundImage.isEmpty()) {
for (INTN i = 0; i < ScrollbarBackground.Height; i+=ThemeX.ScrollbarBackgroundImage.GetHeight()) {
Total.Compose(ScrollbarBackground.XPos - ScrollTotal.XPos, ScrollbarBackground.YPos + i - ScrollTotal.YPos, ThemeX.ScrollbarBackgroundImage, FALSE);
Total.Compose(ScrollbarBackground.XPos - ScrollTotal.XPos, ScrollbarBackground.YPos + i - ScrollTotal.YPos, ThemeX.ScrollbarBackgroundImage, false);
}
}
Total.Compose(BarStart.XPos - ScrollTotal.XPos, BarStart.YPos - ScrollTotal.YPos, ThemeX.BarStartImage, FALSE);
Total.Compose(BarEnd.XPos - ScrollTotal.XPos, BarEnd.YPos - ScrollTotal.YPos, ThemeX.BarEndImage, FALSE);
Total.Compose(BarStart.XPos - ScrollTotal.XPos, BarStart.YPos - ScrollTotal.YPos, ThemeX.BarStartImage, false);
Total.Compose(BarEnd.XPos - ScrollTotal.XPos, BarEnd.YPos - ScrollTotal.YPos, ThemeX.BarEndImage, false);
if (!ThemeX.ScrollbarImage.isEmpty()) {
for (INTN i = 0; i < Scrollbar.Height; i+=ThemeX.ScrollbarImage.GetHeight()) {
Total.Compose(Scrollbar.XPos - ScrollTotal.XPos, Scrollbar.YPos + i - ScrollTotal.YPos, ThemeX.ScrollbarImage, FALSE);
Total.Compose(Scrollbar.XPos - ScrollTotal.XPos, Scrollbar.YPos + i - ScrollTotal.YPos, ThemeX.ScrollbarImage, false);
}
}
Total.Compose(UpButton.XPos - ScrollTotal.XPos, UpButton.YPos - ScrollTotal.YPos, ThemeX.UpButtonImage, FALSE);
Total.Compose(DownButton.XPos - ScrollTotal.XPos, DownButton.YPos - ScrollTotal.YPos, ThemeX.DownButtonImage, FALSE);
Total.Compose(ScrollStart.XPos - ScrollTotal.XPos, ScrollStart.YPos - ScrollTotal.YPos, ThemeX.ScrollStartImage, FALSE);
Total.Compose(ScrollEnd.XPos - ScrollTotal.XPos, ScrollEnd.YPos - ScrollTotal.YPos, ThemeX.ScrollEndImage, FALSE);
Total.Compose(UpButton.XPos - ScrollTotal.XPos, UpButton.YPos - ScrollTotal.YPos, ThemeX.UpButtonImage, false);
Total.Compose(DownButton.XPos - ScrollTotal.XPos, DownButton.YPos - ScrollTotal.YPos, ThemeX.DownButtonImage, false);
Total.Compose(ScrollStart.XPos - ScrollTotal.XPos, ScrollStart.YPos - ScrollTotal.YPos, ThemeX.ScrollStartImage, false);
Total.Compose(ScrollEnd.XPos - ScrollTotal.XPos, ScrollEnd.YPos - ScrollTotal.YPos, ThemeX.ScrollEndImage, false);
Total.Draw(ScrollTotal.XPos, ScrollTotal.YPos, ThemeX.ScrollWidth / 16.f); //ScrollWidth can be set in theme.plist but usually=16
}
/**
@ -1869,7 +1869,7 @@ void REFIT_MENU_SCREEN::AddMenuCheck(CONST CHAR8 *Text, UINTN Bit, INTN ItemNum)
}
void REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor)
void REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Line, XBool Cursor)
{
InputBootArgs->Title.takeValueFrom(Line);
if (Inx == 3 || Inx == 116) {
@ -1885,13 +1885,13 @@ void REFIT_MENU_SCREEN::AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootAr
AddMenuEntry(InputBootArgs, true);
}
void REFIT_MENU_SCREEN::AddMenuItemInput(INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor)
void REFIT_MENU_SCREEN::AddMenuItemInput(INTN Inx, CONST CHAR8 *Line, XBool Cursor)
{
REFIT_INPUT_DIALOG *InputBootArgs = new REFIT_INPUT_DIALOG;
AddMenuItem_(InputBootArgs, Inx, Line, Cursor);
}
void REFIT_MENU_SCREEN::AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Line, BOOLEAN Cursor)
void REFIT_MENU_SCREEN::AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Line, XBool Cursor)
{
REFIT_MENU_SWITCH *InputBootArgs = new REFIT_MENU_SWITCH;
AddMenuItem_(InputBootArgs, Inx, Line, Cursor);
@ -1914,7 +1914,7 @@ EFI_STATUS REFIT_MENU_SCREEN::CheckMouseEvent()
else if (mPointer.MouseInRect(&DownButton) && Event == LeftClick)
mAction = ActionScrollDown;
else if (mPointer.MouseInRect(&Scrollbar) && Event == LeftMouseDown) {
IsDragging = TRUE;
IsDragging = true;
Move = true;
// mAction = ActionMoveScrollbar;
ScrollbarYMovement = 0;
@ -1922,7 +1922,7 @@ EFI_STATUS REFIT_MENU_SCREEN::CheckMouseEvent()
ScrollbarOldPointerPlace.YPos = ScrollbarNewPointerPlace.YPos = mPointer.GetPlace().YPos;
}
else if (IsDragging && Event == LeftClick) {
IsDragging = FALSE;
IsDragging = false;
Move = true;
// mAction = ActionMoveScrollbar;
}

View File

@ -333,15 +333,15 @@ public:
XStringW ThemeName = XStringW(); //?
EG_RECT OldTextBufferRect = EG_RECT();
XImage OldTextBufferImage = XImage();
BOOLEAN isBootScreen = 0;
XBool isBootScreen = false;
FILM *FilmC = 0;
ACTION mAction = ActionNone;
UINTN mItemID = 0;
SCROLL_STATE ScrollState = {0,0,0,0,0,0,0,0,0,0,0};
BOOLEAN ScrollEnabled = 0;
SCROLL_STATE ScrollState = {0,0,0,0,0,0,0,0,false,false,false};
XBool ScrollEnabled = false;
INTN TextStyle = 0;
BOOLEAN IsDragging = 0;
XBool IsDragging = false;
//TODO scroll positions should depends on REFIT_SCREEN?
// Or it just currently calculated to be global variables?
@ -415,13 +415,13 @@ public:
EFI_STATUS WaitForInputEventPoll(UINTN TimeoutDefault);
//menu functions
void AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor);
void AddMenuItem_(REFIT_MENU_ENTRY_ITEM_ABSTRACT* InputBootArgs, INTN Inx, CONST CHAR8 *Title, XBool Cursor);
void AddMenuInfo_f(CONST char *format, ...) __attribute__((format(printf, 2, 3)));
void AddMenuInfoLine_f(CONST char *format, ...) __attribute__((format(printf, 2, 3)));
void AddMenuEntry(IN REFIT_ABSTRACT_MENU_ENTRY *Entry, bool freeIt);
void AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor);
void AddMenuItemSwitch(INTN Inx, CONST CHAR8 *Title, XBool Cursor);
void AddMenuCheck(CONST CHAR8 *Text, UINTN Bit, INTN ItemNum);
void AddMenuItemInput(INTN Inx, CONST CHAR8 *Title, BOOLEAN Cursor);
void AddMenuItemInput(INTN Inx, CONST CHAR8 *Title, XBool Cursor);
void FreeMenu();
INTN FindMenuShortcutEntry(IN char32_t Shortcut);
UINTN RunGenericMenu(IN OUT INTN *DefaultEntryIndex, OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry);

View File

@ -372,11 +372,11 @@ class REFIT_ABSTRACT_MENU_ENTRY
UINT32 NamesTable;
INT32 SegVAddr;
INT32 shift;
BOOLEAN PatcherInited;
BOOLEAN gSNBEAICPUFixRequire; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not
BOOLEAN gBDWEIOPCIFixRequire; // Broadwell-E IOPCIFamily fix require or not
BOOLEAN isKernelcache;
BOOLEAN is64BitKernel;
XBool PatcherInited;
XBool gSNBEAICPUFixRequire; // SandyBridge-E AppleIntelCpuPowerManagement patch require or not
XBool gBDWEIOPCIFixRequire; // Broadwell-E IOPCIFamily fix require or not
XBool isKernelcache;
XBool is64BitKernel;
UINT32 KernelSlide;
UINT32 KernelOffset;
// notes:
@ -426,15 +426,15 @@ class REFIT_ABSTRACT_MENU_ENTRY
UINT32 searchSectionByNum(UINT8 * Binary, UINT32 Num);
// void KernelAndKextsPatcherStart();
// void KernelAndKextPatcherInit();
BOOLEAN KernelUserPatch();
BOOLEAN KernelPatchPm();
BOOLEAN KernelLapicPatch_32();
BOOLEAN KernelLapicPatch_64();
BOOLEAN BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize);
XBool KernelUserPatch();
XBool KernelPatchPm();
XBool KernelLapicPatch_32();
XBool KernelLapicPatch_64();
XBool BooterPatch(IN UINT8 *BooterData, IN UINT64 BooterSize);
void EFIAPI KernelBooterExtensionsPatch();
BOOLEAN KernelPanicNoKextDump();
XBool KernelPanicNoKextDump();
void KernelCPUIDPatch();
BOOLEAN PatchCPUID(const UINT8* Location, INT32 LenLoc,
XBool PatchCPUID(const UINT8* Location, INT32 LenLoc,
const UINT8* Search4, const UINT8* Search10, const UINT8* ReplaceModel,
const UINT8* ReplaceExt, INT32 Len);
void KernelPatcher_32();
@ -452,7 +452,7 @@ class REFIT_ABSTRACT_MENU_ENTRY
EFI_STATUS LoadKext(const EFI_FILE *RootDir, const XString8& FileName, IN cpu_type_t archCpuType, IN OUT void *kext);
EFI_STATUS AddKext(const EFI_FILE *RootDir, const XString8& FileName, IN cpu_type_t archCpuType);
void LoadPlugInKexts(const EFI_FILE *RootDir, const XString8& DirName, IN cpu_type_t archCpuType, IN BOOLEAN Force);
void LoadPlugInKexts(const EFI_FILE *RootDir, const XString8& DirName, IN cpu_type_t archCpuType, IN XBool Force);
// void AddKexts(const XStringW& SrcDir, const XStringW& Path, cpu_type_t archCpuType);
void AddKextsFromDirInArray(const XString8& SrcDir, cpu_type_t archCpuType, XObjArray<SIDELOAD_KEXT>* kextArray);
void AddKextsInArray(XObjArray<SIDELOAD_KEXT>* kextArray);
@ -471,12 +471,12 @@ class REFIT_ABSTRACT_MENU_ENTRY
void DellSMBIOSPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize);
void SNBE_AICPUPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize);
void BDWE_IOPCIPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 InfoPlistSize);
BOOLEAN SandyBridgeEPM();
BOOLEAN HaswellEXCPM();
BOOLEAN HaswellLowEndXCPM();
BOOLEAN BroadwellEPM();
BOOLEAN KernelIvyBridgeXCPM();
BOOLEAN KernelIvyE5XCPM();
XBool SandyBridgeEPM();
XBool HaswellEXCPM();
XBool HaswellLowEndXCPM();
XBool BroadwellEPM();
XBool KernelIvyBridgeXCPM();
XBool KernelIvyE5XCPM();
void EightApplePatch(UINT8 *Driver, UINT32 DriverSize);
void Stall(int Pause) { if ( KernelAndKextPatches.KPDebug ) { gBS->Stall(Pause); } };
@ -487,10 +487,10 @@ class REFIT_ABSTRACT_MENU_ENTRY
LOADER_ENTRY* SubMenuKextInjectMgmt();
void DelegateKernelPatches();
BOOLEAN checkOSBundleRequired(const TagDict* dict);
XStringW getKextPlist(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, BOOLEAN* NoContents);
XBool checkOSBundleRequired(const TagDict* dict);
XStringW getKextPlist(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, XBool* NoContents);
TagDict* getInfoPlist(const XStringW& infoPlistPath);
XString8 getKextExecPath(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, TagDict* dict, BOOLEAN NoContents);
XString8 getKextExecPath(const XStringW& dirPath, const SIDELOAD_KEXT& KextEntry, TagDict* dict, XBool NoContents);
} ;

View File

@ -113,7 +113,7 @@ void DecodeOptions(REFIT_MENU_ITEM_BOOTNUM *Entry)
// Only for non-legacy entries, as LEGACY_ENTRY doesn't have OSVersion
if (GlobalConfig.OptionsBits & OPT_NVWEBON) {
if ( loaderEntry->macOSVersion >= MacOsVersion("10.12"_XS8) ) {
gSettings.SystemParameters.NvidiaWeb = TRUE;
gSettings.SystemParameters.NvidiaWeb = true;
} else {
//Entry->LoadOptions = loaderEntry->LoadOptions;
// Entry->LoadOptions = Split<XString8Array>(loaderEntry->LoadOptions.ConcatAll(" "_XS8).wc_str(), " ");
@ -122,7 +122,7 @@ void DecodeOptions(REFIT_MENU_ITEM_BOOTNUM *Entry)
}
if ((GlobalConfig.OptionsBits & OPT_NVWEBON) == 0) {
if ( loaderEntry->macOSVersion >= MacOsVersion("10.12"_XS8)) {
gSettings.SystemParameters.NvidiaWeb = FALSE;
gSettings.SystemParameters.NvidiaWeb = false;
} else {
//Entry->LoadOptions = loaderEntry->LoadOptions;
// Entry->LoadOptions = Split<XString8Array>(loaderEntry->LoadOptions.ConcatAll(" "_XS8).wc_str(), " ");

View File

@ -9,6 +9,7 @@
#define INCLUDE_PCI_H_
#include <stdint.h>
#include "../cpp_foundation/XBool.h"
/* PCI */
#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */
@ -35,19 +36,19 @@ typedef struct {
} pci_addr_t;
typedef union {
uint32_t addr = 0;
pci_addr_t bits;
uint32_t addr;
} pci_dev_t;
typedef struct pci_dt_t {
// EFI_PCI_IO_PROTOCOL *PciIo;
// PCI_TYPE00 Pci;
EFI_HANDLE DeviceHandle;
UINT8* regs;
pci_dev_t dev;
EFI_HANDLE DeviceHandle = NULL;
UINT8* regs = NULL;
pci_dev_t dev = pci_dev_t();
UINT16 vendor_id;
UINT16 device_id;
UINT16 vendor_id = 0;
UINT16 device_id = 0;
union {
struct {
@ -55,15 +56,15 @@ typedef struct pci_dt_t {
UINT16 device_id;
} subsys;
UINT32 subsys_id;
} subsys_id;
UINT8 revision;
UINT8 subclass;
UINT16 class_id;
} subsys_id_union = { {0, 0} };
UINT8 revision = 0;
UINT8 subclass = 0;
UINT16 class_id = 0;
struct pci_dt_t *parent;
struct pci_dt_t *children;
struct pci_dt_t *next;
BOOLEAN used;
struct pci_dt_t *parent = NULL;
struct pci_dt_t *children = NULL;
struct pci_dt_t *next = NULL;
XBool used = false;
} pci_dt_t;

Some files were not shown because too many files have changed in this diff Show More