File tree Expand file tree Collapse file tree 5 files changed +39
-8
lines changed
Include/Acidanthera/Library Expand file tree Collapse file tree 5 files changed +39
-8
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ OpenCore Changelog
17
17
- Fixed assertions caused by unaligned file path access in DEBUG builds
18
18
- Renamed ` ConfigValidity ` utility to ` ocvalidate ` for consistency
19
19
- Added ` GlobalConnect ` for APFS loading to workaround older firmware issues
20
+ - Added 11.0 support for ` AvoidRuntimeDefrag ` Booter quirk
20
21
21
22
#### v0.5.9
22
23
- Added full HiDPI support in OpenCanopy
Original file line number Diff line number Diff line change @@ -1035,14 +1035,15 @@ OcGetAppleBootLoadedImage (
1035
1035
by other libraries, so values are often pointers to original fields.
1036
1036
**/
1037
1037
typedef struct OC_BOOT_ARGUMENTS_ {
1038
- UINT32 * MemoryMap ;
1039
- UINT32 * MemoryMapSize ;
1040
- UINT32 * MemoryMapDescriptorSize ;
1041
- UINT32 * MemoryMapDescriptorVersion ;
1042
- CHAR8 * CommandLine ;
1043
- UINT32 * DeviceTreeP ;
1044
- UINT32 * DeviceTreeLength ;
1045
- UINT32 * CsrActiveConfig ;
1038
+ UINT32 * MemoryMap ;
1039
+ UINT32 * MemoryMapSize ;
1040
+ UINT32 * MemoryMapDescriptorSize ;
1041
+ UINT32 * MemoryMapDescriptorVersion ;
1042
+ CHAR8 * CommandLine ;
1043
+ UINT32 * DeviceTreeP ;
1044
+ UINT32 * DeviceTreeLength ;
1045
+ UINT32 * CsrActiveConfig ;
1046
+ EFI_SYSTEM_TABLE * SystemTable ;
1046
1047
} OC_BOOT_ARGUMENTS ;
1047
1048
1048
1049
/**
Original file line number Diff line number Diff line change @@ -256,6 +256,10 @@ typedef struct KERNEL_SUPPORT_STATE_ {
256
256
///
257
257
UINTN SysTableRtAreaSize ;
258
258
///
259
+ /// Physical configuration table location.
260
+ ///
261
+ EFI_CONFIGURATION_TABLE * ConfigurationTable ;
262
+ ///
259
263
/// Virtual memory mapper context.
260
264
///
261
265
OC_VMEM_CONTEXT VmContext ;
Original file line number Diff line number Diff line change @@ -381,6 +381,25 @@ AppleMapPrepareForBooting (
381
381
DescriptorSize ,
382
382
MemoryMap
383
383
);
384
+
385
+ //
386
+ // On native Macs due to EfiBoot defragmentation it is guaranteed that
387
+ // VADDR % BASE_1GB == PADDR. macOS 11 started to rely on this in
388
+ // acpi_count_enabled_logical_processors, which needs to access MADT (APIC)
389
+ // ACPI table, and does that through ConfigurationTables.
390
+ //
391
+ // The simplest approach is to just copy the table, so that it is accessible
392
+ // at both actual mapping and 1:1 defragmented mapping. This should be safe,
393
+ // as the memory for 1:1 defragmented mapping is reserved by EfiBoot in the
394
+ // first place and is otherwise stolen anyway.
395
+ //
396
+ if (BootCompat -> KernelState .ConfigurationTable != NULL ) {
397
+ CopyMem (
398
+ (VOID * ) ((UINTN ) BA .SystemTable -> ConfigurationTable & (BASE_1GB - 1 )),
399
+ BootCompat -> KernelState .ConfigurationTable ,
400
+ sizeof (* BootCompat -> KernelState .ConfigurationTable ) * BA .SystemTable -> NumberOfTableEntries
401
+ );
402
+ }
384
403
}
385
404
}
386
405
@@ -545,6 +564,10 @@ AppleMapPrepareBooterState (
545
564
gST ,
546
565
gST -> Hdr .HeaderSize
547
566
);
567
+ //
568
+ // Remember physical configuration table location.
569
+ //
570
+ BootCompat -> KernelState .ConfigurationTable = gST -> ConfigurationTable ;
548
571
}
549
572
550
573
//
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ OcParseBootArgs (
45
45
46
46
Arguments -> DeviceTreeP = & BA1 -> deviceTreeP ;
47
47
Arguments -> DeviceTreeLength = & BA1 -> deviceTreeLength ;
48
+ Arguments -> SystemTable = (EFI_SYSTEM_TABLE * )(UINTN ) BA1 -> efiSystemTable ;
48
49
} else {
49
50
//
50
51
// Lion and newer
@@ -58,6 +59,7 @@ OcParseBootArgs (
58
59
59
60
Arguments -> DeviceTreeP = & BA2 -> deviceTreeP ;
60
61
Arguments -> DeviceTreeLength = & BA2 -> deviceTreeLength ;
62
+ Arguments -> SystemTable = (EFI_SYSTEM_TABLE * )(UINTN ) BA2 -> efiSystemTable ;
61
63
62
64
if (BA2 -> flags & kBootArgsFlagCSRActiveConfig ) {
63
65
Arguments -> CsrActiveConfig = & BA2 -> csrActiveConfig ;
You can’t perform that action at this time.
0 commit comments