OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OpenCoreKernelPatch.c
Go to the documentation of this file.
1
15#include <Base.h>
16
17#include <Library/OcMainLib.h>
18
19#include <Library/BaseLib.h>
20#include <Library/DebugLib.h>
21#include <Library/MemoryAllocationLib.h>
24#include <Library/OcMiscLib.h>
26#include <Library/OcStringLib.h>
28#include <Library/PcdLib.h>
29#include <Library/PrintLib.h>
30#include <Library/UefiBootServicesTableLib.h>
31
32EFI_STATUS
34 IN KERNEL_QUIRK_NAME Quirk,
35 IN KERNEL_CACHE_TYPE CacheType,
36 IN UINT32 DarwinVersion,
37 IN OUT VOID *Context,
38 IN OUT PATCHER_CONTEXT *KernelPatcher
39 )
40{
41 //
42 // Apply kernel quirks to kernel, kext patches to context.
43 //
44 if (Context == NULL) {
45 ASSERT (KernelPatcher != NULL);
46 return KernelApplyQuirk (Quirk, KernelPatcher, DarwinVersion);
47 }
48
49 if (CacheType == CacheTypeCacheless) {
50 return CachelessContextAddQuirk (Context, Quirk);
51 }
52
53 if (CacheType == CacheTypeMkext) {
54 return MkextContextApplyQuirk (Context, Quirk, DarwinVersion);
55 }
56
57 if (CacheType == CacheTypePrelinked) {
58 return PrelinkedContextApplyQuirk (Context, Quirk, DarwinVersion);
59 }
60
61 return EFI_UNSUPPORTED;
62}
63
70UINTN
72 VOID
73 );
74
75VOID
77 IN OC_GLOBAL_CONFIG *Config,
78 IN OC_CPU_INFO *CpuInfo,
79 IN UINT32 DarwinVersion,
80 IN BOOLEAN Is32Bit,
81 IN KERNEL_CACHE_TYPE CacheType,
82 IN VOID *Context,
83 IN OUT UINT8 *Kernel,
84 IN UINT32 Size
85 )
86{
87 EFI_STATUS Status;
88 PATCHER_CONTEXT KernelPatcher;
89 UINT32 Index;
91 OC_KERNEL_PATCH_ENTRY *UserPatch;
92 CONST CHAR8 *Target;
93 CONST CHAR8 *Comment;
94 CONST CHAR8 *Arch;
95 UINT32 MaxKernel;
96 UINT32 MinKernel;
97 BOOLEAN IsKernelPatch;
98 UINTN RegisterBase;
99 UINT32 RegisterStride;
100
101 IsKernelPatch = Context == NULL;
102
103 if (IsKernelPatch) {
104 ASSERT (Kernel != NULL);
105
107 &KernelPatcher,
108 Kernel,
109 Size,
110 Is32Bit
111 );
112
113 if (EFI_ERROR (Status)) {
114 DEBUG ((DEBUG_ERROR, "OC: Kernel patcher kernel init failure - %r\n", Status));
115 return;
116 }
117 }
118
119 //
120 // Handle Quirks/Emulate here...
121 //
122 if (!IsKernelPatch) {
123 if (Config->Kernel.Quirks.AppleCpuPmCfgLock) {
124 OcKernelApplyQuirk (KernelQuirkAppleCpuPmCfgLock, CacheType, DarwinVersion, Context, NULL);
125 }
126
127 if (Config->Kernel.Quirks.ExternalDiskIcons) {
128 OcKernelApplyQuirk (KernelQuirkExternalDiskIcons, CacheType, DarwinVersion, Context, NULL);
129 }
130
131 if (Config->Kernel.Quirks.ThirdPartyDrives) {
132 OcKernelApplyQuirk (KernelQuirkThirdPartyDrives, CacheType, DarwinVersion, Context, NULL);
133 }
134
135 if (Config->Kernel.Quirks.XhciPortLimit) {
136 OcKernelApplyQuirk (KernelQuirkXhciPortLimit1, CacheType, DarwinVersion, Context, NULL);
137 OcKernelApplyQuirk (KernelQuirkXhciPortLimit2, CacheType, DarwinVersion, Context, NULL);
138 OcKernelApplyQuirk (KernelQuirkXhciPortLimit3, CacheType, DarwinVersion, Context, NULL);
139 }
140
141 if (Config->Kernel.Quirks.DisableIoMapper) {
142 OcKernelApplyQuirk (KernelQuirkDisableIoMapper, CacheType, DarwinVersion, Context, NULL);
143 }
144
145 if (Config->Kernel.Quirks.DisableIoMapperMapping) {
146 OcKernelApplyQuirk (KernelQuirkDisableIoMapperMapping, CacheType, DarwinVersion, Context, NULL);
147 }
148
149 if (Config->Kernel.Quirks.DisableRtcChecksum) {
150 OcKernelApplyQuirk (KernelQuirkDisableRtcChecksum, CacheType, DarwinVersion, Context, NULL);
151 }
152
153 if (Config->Kernel.Quirks.IncreasePciBarSize) {
154 OcKernelApplyQuirk (KernelQuirkIncreasePciBarSize, CacheType, DarwinVersion, Context, NULL);
155 }
156
157 if (Config->Kernel.Quirks.CustomSmbiosGuid) {
158 OcKernelApplyQuirk (KernelQuirkCustomSmbiosGuid1, CacheType, DarwinVersion, Context, NULL);
159 OcKernelApplyQuirk (KernelQuirkCustomSmbiosGuid2, CacheType, DarwinVersion, Context, NULL);
160 }
161
162 if (Config->Kernel.Quirks.ExtendBTFeatureFlags) {
163 OcKernelApplyQuirk (KernelQuirkExtendBTFeatureFlags, CacheType, DarwinVersion, Context, NULL);
164 }
165
166 if (Config->Kernel.Quirks.ForceAquantiaEthernet) {
167 OcKernelApplyQuirk (KernelQuirkForceAquantiaEthernet, CacheType, DarwinVersion, Context, NULL);
168 }
169
170 if (Config->Kernel.Quirks.ForceSecureBootScheme) {
171 OcKernelApplyQuirk (KernelQuirkForceSecureBootScheme, CacheType, DarwinVersion, Context, NULL);
172 }
173
174 if (Config->Kernel.Emulate.DummyPowerManagement) {
175 MaxKernel = OcParseDarwinVersion (OC_BLOB_GET (&Config->Kernel.Emulate.MaxKernel));
176 MinKernel = OcParseDarwinVersion (OC_BLOB_GET (&Config->Kernel.Emulate.MinKernel));
177 if (OcMatchDarwinVersion (DarwinVersion, MinKernel, MaxKernel)) {
178 OcKernelApplyQuirk (KernelQuirkDummyPowerManagement, CacheType, DarwinVersion, Context, NULL);
179 } else {
180 DEBUG ((
181 DEBUG_INFO,
182 "OC: %a patcher skips DummyPowerManagement patch due to version %u <= %u <= %u\n",
183 PRINT_KERNEL_CACHE_TYPE (CacheType),
184 MinKernel,
185 DarwinVersion,
186 MaxKernel
187 ));
188 }
189 }
190
191 //
192 // Ignore timeout -1.
193 //
194 if (Config->Kernel.Quirks.SetApfsTrimTimeout >= 0) {
195 PatchSetApfsTimeout ((UINT32)Config->Kernel.Quirks.SetApfsTrimTimeout);
196 OcKernelApplyQuirk (KernelQuirkSetApfsTrimTimeout, CacheType, DarwinVersion, Context, NULL);
197 }
198 } else {
199 if (Config->Kernel.Quirks.AppleXcpmCfgLock) {
200 OcKernelApplyQuirk (KernelQuirkAppleXcpmCfgLock, CacheType, DarwinVersion, NULL, &KernelPatcher);
201 }
202
203 if (Config->Kernel.Quirks.AppleXcpmExtraMsrs) {
204 OcKernelApplyQuirk (KernelQuirkAppleXcpmExtraMsrs, CacheType, DarwinVersion, NULL, &KernelPatcher);
205 }
206
207 if (Config->Kernel.Quirks.AppleXcpmForceBoost) {
208 OcKernelApplyQuirk (KernelQuirkAppleXcpmForceBoost, CacheType, DarwinVersion, NULL, &KernelPatcher);
209 }
210
211 //
212 // Only apply the patch when Misc->Serial->Custom is set (i.e. Override).
213 //
214 if (Config->Misc.Serial.Override && Config->Kernel.Quirks.CustomPciSerialDevice) {
215 RegisterBase = GetSerialRegisterBase ();
216 RegisterStride = PatchPcdGet32 (PcdSerialRegisterStride);
217 if ( (((RegisterBase != 0) && (RegisterStride != 0)))
218 && ((RegisterBase != 0x3F8U) || (RegisterStride != 1)))
219 {
220 PatchSetPciSerialDevice (RegisterBase, RegisterStride);
221 OcKernelApplyQuirk (KernelQuirkCustomPciSerialDevice, CacheType, DarwinVersion, NULL, &KernelPatcher);
222 } else {
223 DEBUG ((DEBUG_INFO, "OC: Aborting patching PciSerialDevice because RegisterBase is zero/default value!\n"));
224 }
225 }
226
227 if (Config->Kernel.Quirks.PanicNoKextDump) {
228 OcKernelApplyQuirk (KernelQuirkPanicNoKextDump, CacheType, DarwinVersion, NULL, &KernelPatcher);
229 }
230
231 if ( (Config->Kernel.Emulate.Cpuid1Data[0] != 0)
232 || (Config->Kernel.Emulate.Cpuid1Data[1] != 0)
233 || (Config->Kernel.Emulate.Cpuid1Data[2] != 0)
234 || (Config->Kernel.Emulate.Cpuid1Data[3] != 0))
235 {
236 MaxKernel = OcParseDarwinVersion (OC_BLOB_GET (&Config->Kernel.Emulate.MaxKernel));
237 MinKernel = OcParseDarwinVersion (OC_BLOB_GET (&Config->Kernel.Emulate.MinKernel));
238 if (OcMatchDarwinVersion (DarwinVersion, MinKernel, MaxKernel)) {
240 &KernelPatcher,
241 CpuInfo,
242 Config->Kernel.Emulate.Cpuid1Data,
243 Config->Kernel.Emulate.Cpuid1Mask,
244 DarwinVersion
245 );
246 } else {
247 DEBUG ((
248 DEBUG_INFO,
249 "OC: %a patcher skips kernel CPUID patch due to version %u <= %u <= %u\n",
250 PRINT_KERNEL_CACHE_TYPE (CacheType),
251 MinKernel,
252 DarwinVersion,
253 MaxKernel
254 ));
255 }
256 }
257
258 if (Config->Kernel.Quirks.LapicKernelPanic) {
259 OcKernelApplyQuirk (KernelQuirkLapicKernelPanic, CacheType, DarwinVersion, NULL, &KernelPatcher);
260 }
261
262 if (Config->Kernel.Quirks.PowerTimeoutKernelPanic) {
263 OcKernelApplyQuirk (KernelQuirkPowerTimeoutKernelPanic, CacheType, DarwinVersion, NULL, &KernelPatcher);
264 }
265
266 if (Config->Kernel.Quirks.DisableLinkeditJettison) {
267 OcKernelApplyQuirk (KernelQuirkSegmentJettison, CacheType, DarwinVersion, NULL, &KernelPatcher);
268 }
269
270 if (Config->Kernel.Quirks.LegacyCommpage) {
271 OcKernelApplyQuirk (KernelQuirkLegacyCommpage, CacheType, DarwinVersion, NULL, &KernelPatcher);
272 }
273
274 if (Config->Kernel.Quirks.ProvideCurrentCpuInfo) {
275 PatchProvideCurrentCpuInfo (&KernelPatcher, CpuInfo, DarwinVersion);
276 }
277 }
278
279 for (Index = 0; Index < Config->Kernel.Patch.Count; ++Index) {
280 UserPatch = Config->Kernel.Patch.Values[Index];
281 Target = OC_BLOB_GET (&UserPatch->Identifier);
282
283 if (!UserPatch->Enabled || ((AsciiStrCmp (Target, "kernel") == 0) != IsKernelPatch)) {
284 continue;
285 }
286
287 Comment = OC_BLOB_GET (&UserPatch->Comment);
288 Arch = OC_BLOB_GET (&UserPatch->Arch);
289 MaxKernel = OcParseDarwinVersion (OC_BLOB_GET (&UserPatch->MaxKernel));
290 MinKernel = OcParseDarwinVersion (OC_BLOB_GET (&UserPatch->MinKernel));
291
292 if (AsciiStrCmp (Arch, Is32Bit ? "x86_64" : "i386") == 0) {
293 DEBUG ((
294 DEBUG_INFO,
295 "OC: %a patcher skips %a (%a) patch at %u due to arch %a != %a\n",
296 PRINT_KERNEL_CACHE_TYPE (CacheType),
297 Target,
298 Comment,
299 Index,
300 Arch,
301 Is32Bit ? "i386" : "x86_64"
302 ));
303 continue;
304 }
305
306 if (!OcMatchDarwinVersion (DarwinVersion, MinKernel, MaxKernel)) {
307 DEBUG ((
308 DEBUG_INFO,
309 "OC: %a patcher skips %a (%a) patch at %u due to version %u <= %u <= %u\n",
310 PRINT_KERNEL_CACHE_TYPE (CacheType),
311 Target,
312 Comment,
313 Index,
314 MinKernel,
315 DarwinVersion,
316 MaxKernel
317 ));
318 continue;
319 }
320
321 //
322 // Ignore patch if:
323 // - There is nothing to replace.
324 // - We have neither symbolic base, nor find data.
325 // - Find and replace mismatch in size.
326 // - Mask and ReplaceMask mismatch in size when are available.
327 //
328 if ( (UserPatch->Replace.Size == 0)
329 || ((OC_BLOB_GET (&UserPatch->Base)[0] == '\0') && (UserPatch->Find.Size != UserPatch->Replace.Size))
330 || ((UserPatch->Mask.Size > 0) && (UserPatch->Find.Size != UserPatch->Mask.Size))
331 || ((UserPatch->ReplaceMask.Size > 0) && (UserPatch->Find.Size != UserPatch->ReplaceMask.Size)))
332 {
333 DEBUG ((DEBUG_ERROR, "OC: Kernel patch %u for %a (%a) is borked\n", Index, Target, Comment));
334 continue;
335 }
336
337 ZeroMem (&Patch, sizeof (Patch));
338
339 if (OC_BLOB_GET (&UserPatch->Comment)[0] != '\0') {
340 Patch.Comment = OC_BLOB_GET (&UserPatch->Comment);
341 }
342
343 if (OC_BLOB_GET (&UserPatch->Base)[0] != '\0') {
344 Patch.Base = OC_BLOB_GET (&UserPatch->Base);
345 }
346
347 if (UserPatch->Find.Size > 0) {
348 Patch.Find = OC_BLOB_GET (&UserPatch->Find);
349 }
350
351 Patch.Replace = OC_BLOB_GET (&UserPatch->Replace);
352
353 if (UserPatch->Mask.Size > 0) {
354 Patch.Mask = OC_BLOB_GET (&UserPatch->Mask);
355 }
356
357 if (UserPatch->ReplaceMask.Size > 0) {
358 Patch.ReplaceMask = OC_BLOB_GET (&UserPatch->ReplaceMask);
359 }
360
361 Patch.Size = UserPatch->Replace.Size;
362 Patch.Count = UserPatch->Count;
363 Patch.Skip = UserPatch->Skip;
364 Patch.Limit = UserPatch->Limit;
365
366 if (IsKernelPatch) {
367 Status = PatcherApplyGenericPatch (&KernelPatcher, &Patch);
368 } else {
369 if (CacheType == CacheTypeCacheless) {
370 Status = CachelessContextAddPatch (Context, Target, &Patch);
371 } else if (CacheType == CacheTypeMkext) {
372 Status = MkextContextApplyPatch (Context, Target, &Patch);
373 } else if (CacheType == CacheTypePrelinked) {
374 Status = PrelinkedContextApplyPatch (Context, Target, &Patch);
375 } else {
376 Status = EFI_UNSUPPORTED;
377 }
378 }
379
380 DEBUG ((
381 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
382 "OC: %a patcher result %u for %a (%a) - %r\n",
383 PRINT_KERNEL_CACHE_TYPE (CacheType),
384 Index,
385 Target,
386 Comment,
387 Status
388 ));
389 }
390}
391
392VOID
394 IN OC_GLOBAL_CONFIG *Config,
395 IN UINT32 DarwinVersion,
396 IN BOOLEAN Is32Bit,
397 IN KERNEL_CACHE_TYPE CacheType,
398 IN VOID *Context
399 )
400{
401 EFI_STATUS Status;
402 UINT32 Index;
403 OC_KERNEL_BLOCK_ENTRY *Kext;
404 CONST CHAR8 *Target;
405 CONST CHAR8 *Comment;
406 CONST CHAR8 *Arch;
407 CONST CHAR8 *Strategy;
408 BOOLEAN Exclude;
409 UINT32 MaxKernel;
410 UINT32 MinKernel;
411
412 for (Index = 0; Index < Config->Kernel.Block.Count; ++Index) {
413 Kext = Config->Kernel.Block.Values[Index];
414
415 if (!Kext->Enabled) {
416 continue;
417 }
418
419 Target = OC_BLOB_GET (&Kext->Identifier);
420 Comment = OC_BLOB_GET (&Kext->Comment);
421 Arch = OC_BLOB_GET (&Kext->Arch);
422 Strategy = OC_BLOB_GET (&Kext->Strategy);
423 MaxKernel = OcParseDarwinVersion (OC_BLOB_GET (&Kext->MaxKernel));
424 MinKernel = OcParseDarwinVersion (OC_BLOB_GET (&Kext->MinKernel));
425
426 if (AsciiStrCmp (Arch, Is32Bit ? "x86_64" : "i386") == 0) {
427 DEBUG ((
428 DEBUG_INFO,
429 "OC: %a blocker skips %a (%a) block at %u due to arch %a != %a\n",
430 PRINT_KERNEL_CACHE_TYPE (CacheType),
431 Target,
432 Comment,
433 Index,
434 Arch,
435 Is32Bit ? "i386" : "x86_64"
436 ));
437 continue;
438 }
439
440 if (!OcMatchDarwinVersion (DarwinVersion, MinKernel, MaxKernel)) {
441 DEBUG ((
442 DEBUG_INFO,
443 "OC: %a blocker skips %a (%a) block at %u due to version %u <= %u <= %u\n",
444 PRINT_KERNEL_CACHE_TYPE (CacheType),
445 Target,
446 Comment,
447 Index,
448 MinKernel,
449 DarwinVersion,
450 MaxKernel
451 ));
452 continue;
453 }
454
455 Exclude = AsciiStrCmp (Strategy, "Exclude") == 0;
456 //
457 // TODO: Implement cacheless and mkext exclusion if possible.
458 //
459 if (CacheType == CacheTypeCacheless) {
460 Status = CachelessContextBlock (Context, Target, Exclude);
461 } else if (CacheType == CacheTypeMkext) {
462 Status = MkextContextBlock (Context, Target, Exclude);
463 } else if (CacheType == CacheTypePrelinked) {
464 Status = PrelinkedContextBlock (Context, Target, Exclude);
465 } else {
466 Status = EFI_UNSUPPORTED;
467 }
468
469 DEBUG ((
470 EFI_ERROR (Status) ? DEBUG_WARN : DEBUG_INFO,
471 "OC: %a blocker (%a) result %u for %a (%a) - %r\n",
472 PRINT_KERNEL_CACHE_TYPE (CacheType),
473 Exclude ? "Exclude" : "Disable",
474 Index,
475 Target,
476 Comment,
477 Status
478 ));
479 }
480}
DMG_SIZE_DEVICE_PATH Size
EFI_STATUS PrelinkedContextApplyPatch(IN OUT PRELINKED_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN PATCHER_GENERIC_PATCH *Patch)
EFI_STATUS MkextContextApplyQuirk(IN OUT MKEXT_CONTEXT *Context, IN KERNEL_QUIRK_NAME Quirk, IN UINT32 KernelVersion)
enum KERNEL_CACHE_TYPE_ KERNEL_CACHE_TYPE
VOID PatchSetApfsTimeout(IN UINT32 Timeout)
EFI_STATUS KernelApplyQuirk(IN KERNEL_QUIRK_NAME Name, IN OUT PATCHER_CONTEXT *Patcher OPTIONAL, IN UINT32 KernelVersion)
EFI_STATUS MkextContextBlock(IN OUT MKEXT_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN BOOLEAN Exclude)
EFI_STATUS PrelinkedContextBlock(IN OUT PRELINKED_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN BOOLEAN Exclude)
VOID PatchSetPciSerialDevice(IN UINTN RegisterBase, IN UINT32 RegisterStride)
#define PRINT_KERNEL_CACHE_TYPE(a)
EFI_STATUS CachelessContextAddQuirk(IN OUT CACHELESS_CONTEXT *Context, IN KERNEL_QUIRK_NAME Quirk)
EFI_STATUS MkextContextApplyPatch(IN OUT MKEXT_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN PATCHER_GENERIC_PATCH *Patch)
BOOLEAN OcMatchDarwinVersion(IN UINT32 CurrentVersion OPTIONAL, IN UINT32 MinVersion OPTIONAL, IN UINT32 MaxVersion OPTIONAL)
EFI_STATUS PrelinkedContextApplyQuirk(IN OUT PRELINKED_CONTEXT *Context, IN KERNEL_QUIRK_NAME Quirk, IN UINT32 KernelVersion)
EFI_STATUS PatcherApplyGenericPatch(IN OUT PATCHER_CONTEXT *Context, IN PATCHER_GENERIC_PATCH *Patch)
EFI_STATUS PatchProvideCurrentCpuInfo(IN OUT PATCHER_CONTEXT *Patcher, IN OC_CPU_INFO *CpuInfo, IN UINT32 KernelVersion)
@ CacheTypeMkext
@ CacheTypePrelinked
@ CacheTypeCacheless
UINT32 OcParseDarwinVersion(IN CONST CHAR8 *String)
EFI_STATUS CachelessContextAddPatch(IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN PATCHER_GENERIC_PATCH *Patch)
EFI_STATUS CachelessContextBlock(IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN BOOLEAN Exclude)
KERNEL_QUIRK_NAME
@ KernelQuirkDisableRtcChecksum
@ KernelQuirkPanicNoKextDump
@ KernelQuirkCustomSmbiosGuid1
@ KernelQuirkForceSecureBootScheme
@ KernelQuirkPowerTimeoutKernelPanic
@ KernelQuirkLapicKernelPanic
@ KernelQuirkCustomSmbiosGuid2
@ KernelQuirkAppleCpuPmCfgLock
@ KernelQuirkAppleXcpmExtraMsrs
@ KernelQuirkAppleXcpmForceBoost
@ KernelQuirkXhciPortLimit2
@ KernelQuirkSetApfsTrimTimeout
@ KernelQuirkThirdPartyDrives
@ KernelQuirkDisableIoMapperMapping
@ KernelQuirkAppleXcpmCfgLock
@ KernelQuirkDummyPowerManagement
@ KernelQuirkDisableIoMapper
@ KernelQuirkLegacyCommpage
@ KernelQuirkExternalDiskIcons
@ KernelQuirkXhciPortLimit1
@ KernelQuirkExtendBTFeatureFlags
@ KernelQuirkForceAquantiaEthernet
@ KernelQuirkXhciPortLimit3
@ KernelQuirkSegmentJettison
@ KernelQuirkIncreasePciBarSize
@ KernelQuirkCustomPciSerialDevice
EFI_STATUS PatcherInitContextFromBuffer(IN OUT PATCHER_CONTEXT *Context, IN OUT UINT8 *Buffer, IN UINT32 BufferSize, IN BOOLEAN Use32Bit)
EFI_STATUS PatchKernelCpuId(IN OUT PATCHER_CONTEXT *Patcher, IN OC_CPU_INFO *CpuInfo, IN UINT32 *Data, IN UINT32 *DataMask, IN UINT32 KernelVersion)
#define OC_BLOB_GET(Blob)
VOID OcKernelApplyPatches(IN OC_GLOBAL_CONFIG *Config, IN OC_CPU_INFO *CpuInfo, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit, IN KERNEL_CACHE_TYPE CacheType, IN VOID *Context, IN OUT UINT8 *Kernel, IN UINT32 Size)
VOID OcKernelBlockKexts(IN OC_GLOBAL_CONFIG *Config, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit, IN KERNEL_CACHE_TYPE CacheType, IN VOID *Context)
EFI_STATUS OcKernelApplyQuirk(IN KERNEL_QUIRK_NAME Quirk, IN KERNEL_CACHE_TYPE CacheType, IN UINT32 DarwinVersion, IN OUT VOID *Context, IN OUT PATCHER_CONTEXT *KernelPatcher)
UINTN GetSerialRegisterBase(VOID)
Definition UserMisc.c:697
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define ASSERT(x)
Definition coder.h:55