text formatting

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2020-08-06 21:53:01 +03:00
parent 0724be965a
commit 76c0e3fe55
4 changed files with 16 additions and 32 deletions

View File

@ -440,20 +440,20 @@ VOID PatchAllTables()
}
if (NewTable->Signature == EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {
if (gSettings.PatchDsdtNum > 0) {
//DBG("Patching SSDT:\n");
UINT32 i;
CHAR8 OTID[9];
OTID[8] = 0;
CopyMem(OTID, &NewTable->OemTableId, 8);
DBG("Patching SSDT %s Length=%d\n", OTID, (INT32)Len);
DBG("Patching SSDTs: %d patches each\n", gSettings.PatchDsdtNum);
for (i = 0; i < gSettings.PatchDsdtNum; i++) {
// CHAR8 OTID[9];
// OTID[8] = 0;
// CopyMem(OTID, &NewTable->OemTableId, 8);
// DBG("Patching SSDT %s Length=%d\n", OTID, (INT32)Len);
for (UINT32 i = 0; i < gSettings.PatchDsdtNum; i++) {
if (!gSettings.PatchDsdtFind[i] || !gSettings.LenToFind[i]) {
continue;
}
DBG("%d. [%s]:", i, gSettings.PatchDsdtLabel[i]);
// DBG("%d. [%s]:", i, gSettings.PatchDsdtLabel[i]);
if (!gSettings.PatchDsdtMenuItem[i].BValue) {
DBG(" disabled\n");
// DBG(" disabled\n");
continue;
}
if (!gSettings.PatchDsdtTgt[i]) {

View File

@ -2176,7 +2176,7 @@ void LOADER_ENTRY::Get_PreLink()
DBG("PrelinkTextLoadCmdAddr = 0x%X, PrelinkTextAddr = 0x%X, PrelinkTextSize = 0x%X\n",
PrelinkTextLoadCmdAddr, PrelinkTextAddr, PrelinkTextSize);
UINT32 PrelinkTextAddr32 = (UINT32)(segCmd64->vmaddr - kernelvmAddr);
for (int j=0; j<20; ++j) {
for (int j=0; j<30; ++j) {
DBG("%02x", binary[PrelinkTextAddr32+j]);
}
DBG("\n");
@ -2248,7 +2248,7 @@ void LOADER_ENTRY::Get_PreLink()
sect = (struct section *)((UINT8*)segCmd + sectionIndex);
sectionIndex += sizeof(struct section);
if(strcmp(sect->sectname, kPrelinkInfoSection) == 0 && AsciiStrCmp(sect->segname, kPrelinkInfoSegment) == 0) {
if(strcmp(sect->sectname, kPrelinkInfoSection) == 0 && strcmp(sect->segname, kPrelinkInfoSegment) == 0) {
if (sect->size > 0) {
// PrelinkInfoAddr = sect->addr + KernelRelocBase
PrelinkInfoLoadCmdAddr = (UINT32)(UINTN)sect;
@ -2264,21 +2264,6 @@ void LOADER_ENTRY::Get_PreLink()
}
break;
case LC_SYMTAB:
symCmd = (struct symtab_command *)loadCommand;
// struct symtab_command {
// uint32_t cmd; /* LC_SYMTAB == 2 */
// uint32_t cmdsize; /* sizeof(struct symtab_command) */
// uint32_t symoff; /* symbol table offset */
// uint32_t nsyms; /* number of symbol table entries */
// uint32_t stroff; /* string table offset */
// uint32_t strsize; /* string table size in bytes */
// };
AddrVtable = symCmd->symoff;
SizeVtable = symCmd->nsyms;
NamesTable = symCmd->stroff;
DBG("SymTab: AddrVtable=0x%x SizeVtable=0x%x NamesTable=0x%x\n", AddrVtable, SizeVtable, NamesTable);
break;
#endif
default:
break;

View File

@ -298,7 +298,7 @@ VOID LOADER_ENTRY::AddKexts(CONST CHAR16 *SrcDir, CONST CHAR16 *Path, cpu_type_t
SIDELOAD_KEXT *CurrentPlugInKext;
EFI_STATUS Status;
MsgLog("Preparing kexts injection for arch=%ls from %ls\n", (archCpuType==CPU_TYPE_X86_64)?L"x86_64":(archCpuType==CPU_TYPE_I386)?L"i386":L"", SrcDir);
MsgLog("Preparing kexts injection from %ls\n", SrcDir);
CurrentKext = InjectKextList;
while (CurrentKext) {
// DBG(" current kext name=%ls path=%ls, match against=%ls\n", CurrentKext->FileName, CurrentKext->KextDirNameUnderOEMPath, Path);
@ -368,10 +368,10 @@ EFI_STATUS LOADER_ENTRY::LoadKexts()
// }
// if (Arch != NULL && StrnCmp(Arch,L"x86_64",StrLen(L"x86_64")) == 0) {
if (LoadOptions.contains("arch=x86_64")) {
if (LoadOptions.contains("arch=x86_64")) {
archCpuType = CPU_TYPE_X86_64;
// } else if (Arch != NULL && StrnCmp(Arch,L"i386",StrLen(L"i386")) == 0) {
} else if (LoadOptions.contains("arch=i386")) {
} else if (LoadOptions.contains("arch=i386")) {
archCpuType = CPU_TYPE_I386;
} else if (OSVersion != NULL) {
UINT64 os_version = AsciiOSVersionToUint64(OSVersion);
@ -386,8 +386,7 @@ EFI_STATUS LOADER_ENTRY::LoadKexts()
if ((KernelAndKextPatches != NULL) &&
(KernelAndKextPatches->NrForceKexts > 0) &&
(KernelAndKextPatches->ForceKexts != NULL)) {
INT32 i = 0;
for (; i < KernelAndKextPatches->NrForceKexts; ++i) {
for (INT32 i = 0; i < KernelAndKextPatches->NrForceKexts; ++i) {
MsgLog(" Force kext: %ls\n", KernelAndKextPatches->ForceKexts[i]);
if (Volume && Volume->RootDir) {
// Check if the entry is a directory

View File

@ -486,7 +486,7 @@ PLATFORMDATA ApplePlatformData[] =
//iMac17,1 / iMac (Retina 5K, 27-inch, Late 2015)
{ "iMac17,1", "IM171.88Z.F000.B00.2004240904", "178.0.0.0.0", "Mac-B809C3757DA9BB8D", // Intel Core i7-6700K @ 4.00 GHz
"iMac17,1", "1.0", "C02QFHACGG7L", "iMac-Aluminum", // i5: Mac-65CE76090165799A/Mac-DB15BD556843C820, i7: Mac-B809C3757DA9BB8D
{ 0x02, 0x33, 0x0f, 0, 0, 0x12 }, "j95j95am", "j95", 0xf0c008 }, //Note: why? i5: 2.33f12 but for i7: 2.34f3
{ 0x02, 0x34, 0x0f, 0, 0, 0x03 }, "j95j95am", "j95", 0xf0c008 }, //Note: why? i5: 2.33f12 but for i7: 2.34f3
//iMac18,1 / iMac (21.5-inch, 2017)
{ "iMac18,1", "IM181.88Z.F000.B00.2004240927", "183.0.0.0.0", "Mac-4B682C642B45593E", // Intel Core i5-7360U @ 2.30 GHz
"iMac", "1.0", "C02TDHACH7JY", "iMac-Aluminum",