Skip to content

Commit 528f8fa

Browse files
committed
2 parents edfb7ae + bfcba8e commit 528f8fa

8 files changed

Lines changed: 107 additions & 53 deletions

File tree

Application/OpenCore/OpenCore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ STATIC
4646
OC_GLOBAL_CONFIG
4747
mOpenCoreConfiguration;
4848

49-
STATIC
49+
//STATIC
5050
OC_STORAGE_CONTEXT
5151
mOpenCoreStorage;
5252

Include/Acidanthera/Library/OcMainLib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151

5252
#define OPEN_CORE_APP_PATH L"OpenCore.efi"
5353

54+
#ifndef CLOVER_BUILD
5455
#define OPEN_CORE_CONFIG_PATH L"config.plist"
5556
#define OPEN_CORE_IN_CLOVER_CONFIG_PATH L"config-oc.plist"
57+
#endif
5658

5759
#define OPEN_CORE_LOG_PREFIX_PATH L"opencore"
5860

Library/OcAcpiLib/AcpiParser.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ParseNameString (
101101
}
102102

103103
if (NamePathStart != NULL) {
104-
PRINT_ACPI_NAME ("Read name", *NamePathStart, *PathLength);
104+
// PRINT_ACPI_NAME ("Read name", *NamePathStart, *PathLength);
105105
}
106106

107107
CONTEXT_DECREASE_NESTING (Context);
@@ -320,7 +320,7 @@ ParseScopeOrDevice (
320320
Context->CurrentIdentifier = Context->PathStart;
321321
}
322322

323-
PRINT_ACPI_NAME ("Entered scope", ScopeNameStart, ScopeNameLength);
323+
// PRINT_ACPI_NAME ("Entered scope", ScopeNameStart, ScopeNameLength);
324324

325325
while (Context->CurrentOpcode < ScopeEnd) {
326326
Status = InternalAcpiParseTerm (
@@ -333,7 +333,7 @@ ParseScopeOrDevice (
333333
}
334334
}
335335

336-
PRINT_ACPI_NAME ("Left scope", ScopeNameStart, ScopeNameLength);
336+
// PRINT_ACPI_NAME ("Left scope", ScopeNameStart, ScopeNameLength);
337337

338338
Context->CurrentIdentifier = CurrentPath;
339339
CONTEXT_DECREASE_NESTING (Context);
@@ -1737,7 +1737,7 @@ InternalAcpiParseTerm (
17371737
ASSERT (Result != NULL);
17381738
CONTEXT_INCREASE_NESTING (Context);
17391739

1740-
DEBUG ((DEBUG_VERBOSE, "Opcode: %x\n", Context->CurrentOpcode[0]));
1740+
// DEBUG ((DEBUG_VERBOSE, "Opcode: %x\n", Context->CurrentOpcode[0]));
17411741

17421742
switch (Context->CurrentOpcode[0]) {
17431743
case AML_ALIAS_OP: // Alias

Library/OcAcpiLib/AcpiParser.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ typedef struct {
5656
Print new entry name.
5757
**/
5858
#define CONTEXT_ENTER(Context, Name) \
59-
DEBUG (( \
60-
DEBUG_VERBOSE, \
61-
"%a 0x%x (looking for %c%c%c%c)\n", \
62-
(Name), \
63-
(UINT32) ((Context)->CurrentOpcode - (Context)->TableStart), \
64-
((CHAR8 *) (Context)->CurrentIdentifier)[3], \
65-
((CHAR8 *) (Context)->CurrentIdentifier)[2], \
66-
((CHAR8 *) (Context)->CurrentIdentifier)[1], \
67-
((CHAR8 *) (Context)->CurrentIdentifier)[0] \
68-
));
59+
// DEBUG (( \
60+
// DEBUG_VERBOSE, \
61+
// "%a 0x%x (looking for %c%c%c%c)\n", \
62+
// (Name), \
63+
// (UINT32) ((Context)->CurrentOpcode - (Context)->TableStart), \
64+
// ((CHAR8 *) (Context)->CurrentIdentifier)[3], \
65+
// ((CHAR8 *) (Context)->CurrentIdentifier)[2], \
66+
// ((CHAR8 *) (Context)->CurrentIdentifier)[1], \
67+
// ((CHAR8 *) (Context)->CurrentIdentifier)[0] \
68+
// ));
6969

7070
#define PRINT_ACPI_NAME(Str, Name, Length) \
7171
DEBUG (( \

Library/OcAfterBootCompatLib/ServiceOverrides.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ OcAllocatePages (
518518
);
519519
}
520520

521-
DEBUG ((DEBUG_VERBOSE, "OCABC: AllocPages %u 0x%Lx (%u) - %r\n", Type, *Memory, NumberOfPages, Status));
521+
// DEBUG ((DEBUG_VERBOSE, "OCABC: AllocPages %u 0x%Lx (%u) - %r\n", Type, *Memory, NumberOfPages, Status));
522522

523523
if (!EFI_ERROR (Status)) {
524524
FixRuntimeAttributes (BootCompat, MemoryType);

Library/OcMainLib/OpenCoreKernel.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,11 @@ OcKernelFileOpen (
13521352

13531353
DEBUG ((DEBUG_INFO, "OC: Prelinked status - %r\n", PrelinkedStatus));
13541354

1355+
#ifdef JIEF_DEBUG
1356+
// extern OC_STORAGE_CONTEXT mOpenCoreStorage;
1357+
// OcSetFileData(mOpenCoreStorage.Storage, L"kernel_cl_jief", Kernel, KernelSize);
1358+
#endif
1359+
13551360
Status = OcGetFileModificationTime (*NewHandle, &ModificationTime);
13561361
if (EFI_ERROR (Status)) {
13571362
ZeroMem (&ModificationTime, sizeof (ModificationTime));

Library/OcMainLib/OpenCoreMisc.c

Lines changed: 82 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ OcStoreLoadPath (
8787
));
8888
}
8989

90-
#ifndef CLOVER_BUILD
90+
//#ifndef CLOVER_BUILD
9191
STATIC
9292
EFI_STATUS
9393
ProduceDebugReport (
@@ -98,9 +98,10 @@ ProduceDebugReport (
9898
EFI_FILE_PROTOCOL *Fs;
9999
EFI_FILE_PROTOCOL *SysReport;
100100
EFI_FILE_PROTOCOL *SubReport;
101-
OC_CPU_INFO CpuInfo;
101+
// OC_CPU_INFO CpuInfo;
102102

103-
OcCpuScanProcessor (&CpuInfo);
103+
// OcCpuScanProcessor (&CpuInfo);
104+
DEBUG ((DEBUG_INFO, "OC: ProduceDebugReport\n"));
104105

105106
if (VolumeHandle != NULL) {
106107
Fs = OcLocateRootVolume (VolumeHandle, NULL);
@@ -173,35 +174,35 @@ ProduceDebugReport (
173174

174175
DEBUG ((DEBUG_INFO, "OC: SMBIOS dumping - %r\n", Status));
175176

176-
Status = OcSafeFileOpen (
177-
SysReport,
178-
&SubReport,
179-
L"Audio",
180-
EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
181-
EFI_FILE_DIRECTORY
182-
);
183-
if (!EFI_ERROR (Status)) {
184-
DEBUG ((DEBUG_INFO, "OC: Dumping audio for report...\n"));
185-
Status = OcAudioDump (SubReport);
186-
SubReport->Close (SubReport);
187-
}
188-
189-
DEBUG ((DEBUG_INFO, "OC: Audio dumping - %r\n", Status));
190-
191-
Status = OcSafeFileOpen (
192-
SysReport,
193-
&SubReport,
194-
L"CPU",
195-
EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
196-
EFI_FILE_DIRECTORY
197-
);
198-
if (!EFI_ERROR (Status)) {
199-
DEBUG ((DEBUG_INFO, "OC: Dumping CPUInfo for report...\n"));
200-
Status = OcCpuInfoDump (&CpuInfo, SubReport);
201-
SubReport->Close (SubReport);
202-
}
203-
204-
DEBUG ((DEBUG_INFO, "OC: CPUInfo dumping - %r\n", Status));
177+
// Status = OcSafeFileOpen (
178+
// SysReport,
179+
// &SubReport,
180+
// L"Audio",
181+
// EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
182+
// EFI_FILE_DIRECTORY
183+
// );
184+
// if (!EFI_ERROR (Status)) {
185+
// DEBUG ((DEBUG_INFO, "OC: Dumping audio for report...\n"));
186+
// Status = OcAudioDump (SubReport);
187+
// SubReport->Close (SubReport);
188+
// }
189+
//
190+
// DEBUG ((DEBUG_INFO, "OC: Audio dumping - %r\n", Status));
191+
192+
// Status = OcSafeFileOpen (
193+
// SysReport,
194+
// &SubReport,
195+
// L"CPU",
196+
// EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
197+
// EFI_FILE_DIRECTORY
198+
// );
199+
// if (!EFI_ERROR (Status)) {
200+
// DEBUG ((DEBUG_INFO, "OC: Dumping CPUInfo for report...\n"));
201+
// Status = OcCpuInfoDump (&CpuInfo, SubReport);
202+
// SubReport->Close (SubReport);
203+
// }
204+
//
205+
// DEBUG ((DEBUG_INFO, "OC: CPUInfo dumping - %r\n", Status));
205206

206207
Status = OcSafeFileOpen (
207208
SysReport,
@@ -239,6 +240,7 @@ ProduceDebugReport (
239240
return EFI_SUCCESS;
240241
}
241242

243+
#ifndef CLOVER_BUILD
242244
STATIC
243245
EFI_STATUS
244246
EFIAPI
@@ -437,7 +439,7 @@ ClOcReadConfigurationFile(
437439

438440
ConfigData = OcStorageReadFileUnicode (
439441
Storage,
440-
OPEN_CORE_CONFIG_PATH,
442+
configPath,
441443
&ConfigDataSize
442444
);
443445

@@ -479,9 +481,9 @@ OcMiscEarlyInit (
479481
OCS_VAULT_MODE Vault;
480482
UINTN PciDeviceInfoSize;
481483

484+
#ifndef CLOVER_BUILD
482485
DEBUG ((DEBUG_WARN, "OC: config %s\n", OPEN_CORE_CONFIG_PATH));
483486

484-
#ifndef CLOVER_BUILD
485487
ConfigData = OcStorageReadFileUnicode (
486488
Storage,
487489
OPEN_CORE_IN_CLOVER_CONFIG_PATH,
@@ -708,6 +710,48 @@ OcMiscMiddleInit (
708710
BOOLEAN HasShortLauncher;
709711
BOOLEAN HasSystemLauncher;
710712

713+
714+
DEBUG((DEBUG_INFO, "UEFI Quirks\n"));
715+
DEBUG((DEBUG_INFO, "EBSD %d TST %d AHS %d DSP %d EVA %d EV %d FUS %d IIFR %d RGB %d RUPR %d RUO %d ROR %d RBVR %d SRP %d UFC %d FOWF %d\n",
716+
Config->Uefi.Quirks.ExitBootServicesDelay,
717+
Config->Uefi.Quirks.TscSyncTimeout,
718+
Config->Uefi.Quirks.ActivateHpetSupport,
719+
Config->Uefi.Quirks.DisableSecurityPolicy,
720+
Config->Uefi.Quirks.EnableVectorAcceleration,
721+
Config->Uefi.Quirks.EnableVmx,
722+
Config->Uefi.Quirks.ForgeUefiSupport,
723+
Config->Uefi.Quirks.IgnoreInvalidFlexRatio,
724+
Config->Uefi.Quirks.ResizeGpuBars,
725+
Config->Uefi.Quirks.ResizeUsePciRbIo,
726+
Config->Uefi.Quirks.ReleaseUsbOwnership,
727+
Config->Uefi.Quirks.ReloadOptionRoms,
728+
Config->Uefi.Quirks.RequestBootVarRouting,
729+
Config->Uefi.Quirks.ShimRetainProtocol,
730+
Config->Uefi.Quirks.UnblockFsConnect,
731+
Config->Uefi.Quirks.ForceOcWriteFlash));
732+
733+
DEBUG((DEBUG_INFO, "Kernel quirks\n"));
734+
DEBUG((DEBUG_INFO, "ACPCL %d AXCL %d AXEM %d AXFB %d CSG %d DIM %d DLJ %d DRC %d DPM %d EBTFF %d EDI %d FAI %d IPBS %d LKP %d PNKD %d PTKP %d TPD %d XPL %d PCC %d\n",
735+
Config->Kernel.Quirks.AppleCpuPmCfgLock,
736+
Config->Kernel.Quirks.AppleXcpmCfgLock,
737+
Config->Kernel.Quirks.AppleXcpmExtraMsrs,
738+
Config->Kernel.Quirks.AppleXcpmForceBoost,
739+
Config->Kernel.Quirks.CustomSmbiosGuid,
740+
Config->Kernel.Quirks.DisableIoMapper,
741+
Config->Kernel.Quirks.DisableLinkeditJettison,
742+
Config->Kernel.Quirks.DisableRtcChecksum,
743+
Config->Kernel.Emulate.DummyPowerManagement,
744+
Config->Kernel.Quirks.ExtendBTFeatureFlags,
745+
Config->Kernel.Quirks.ExternalDiskIcons,
746+
Config->Kernel.Quirks.IncreasePciBarSize,
747+
Config->Kernel.Quirks.ForceAquantiaEthernet,
748+
Config->Kernel.Quirks.LapicKernelPanic,
749+
Config->Kernel.Quirks.PanicNoKextDump,
750+
Config->Kernel.Quirks.PowerTimeoutKernelPanic,
751+
Config->Kernel.Quirks.ThirdPartyDrives,
752+
Config->Kernel.Quirks.XhciPortLimit,
753+
Config->Kernel.Quirks.ProvideCurrentCpuInfo));
754+
711755
if ((Config->Misc.Security.ExposeSensitiveData & OCS_EXPOSE_BOOT_PATH) != 0) {
712756
OcStoreLoadPath (LoadPath);
713757
}
@@ -833,18 +877,21 @@ OcMiscLateInit (
833877
return EFI_SUCCESS;
834878
}
835879

836-
#ifndef CLOVER_BUILD
880+
//#ifndef CLOVER_BUILD
837881
VOID
838882
OcMiscLoadSystemReport (
839883
IN OC_GLOBAL_CONFIG *Config,
840884
IN EFI_HANDLE LoadHandle OPTIONAL
841885
)
842886
{
887+
DEBUG ((DEBUG_INFO, "ProduceDebugReport1 LoadHandle=%d\n", LoadHandle!=NULL));
843888
if ((LoadHandle != NULL) && Config->Misc.Debug.SysReport) {
889+
DEBUG ((DEBUG_INFO, "ProduceDebugReport\n"));
844890
ProduceDebugReport (LoadHandle);
845891
}
846892
}
847893

894+
#ifndef CLOVER_BUILD
848895
VOID
849896
OcMiscBoot (
850897
IN OC_STORAGE_CONTEXT *Storage,

Library/OcMainLib/OpenCoreUefi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ OcExitBootServicesHandler (
337337
IN VOID *Context
338338
)
339339
{
340-
#ifndef CLOVER_BUILD
340+
//#ifndef CLOVER_BUILD
341341
EFI_STATUS Status;
342342
OC_GLOBAL_CONFIG *Config;
343343

@@ -378,7 +378,7 @@ OcExitBootServicesHandler (
378378
if (Config->Uefi.Quirks.ExitBootServicesDelay > 0) {
379379
gBS->Stall (Config->Uefi.Quirks.ExitBootServicesDelay);
380380
}
381-
#endif
381+
//#endif
382382
}
383383

384384
STATIC

0 commit comments

Comments
 (0)