OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <IndustryStandard/AppleBootArgs.h>
#include <IndustryStandard/AppleEfiBootRtInfo.h>
#include <Library/OcAfterBootCompatLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcMemoryLib.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/OcFirmwareRuntime.h>
Go to the source code of this file.
Data Structures | |
struct | CALL_GATE_JUMP_ |
struct | RT_RELOC_PROTECT_INFO_ |
struct | RT_RELOC_PROTECT_DATA_ |
struct | UEFI_SERVICES_POINTERS_ |
struct | SERVICES_OVERRIDE_STATE_ |
struct | KERNEL_SUPPORT_STATE_ |
struct | SLIDE_SUPPORT_STATE_ |
struct | BOOT_COMPAT_CONTEXT_ |
Macros | |
#define | RT_RELOC_PROTECT_MAX_NUM ((UINTN) 64) |
#define | RT_DESC_ENTRY_NUM ((UINTN) 64) |
#define | KERNEL_STATIC_VADDR ((UINT64) 0xFFFFFF8000000000ULL) |
#define | KERNEL_HIB_VADDR ((UINTN) (0xFFFFFF8000100000ULL & MAX_UINTN)) |
#define | KERNEL_TEXT_VADDR ((UINTN) (0xFFFFFF8000200000ULL & MAX_UINTN)) |
#define | KERNEL_TEXT_VADDR_LEGACY 0x111000 |
#define | KERNEL_BASE_PADDR ((UINT32) (KERNEL_HIB_VADDR & MAX_UINT32)) |
#define | KERNEL_TEXT_PADDR ((UINT32) (KERNEL_TEXT_VADDR & MAX_UINT32)) |
#define | KERNEL_TEXT_PADDR_LEGACY (KERNEL_TEXT_VADDR_LEGACY) |
#define | SLIDE_GRANULARITY ((UINTN) SIZE_2MB) |
#define | TOTAL_SLIDE_NUM ((UINTN) 0x100) |
#define | SLIDE_ERRATA_NUM ((UINTN) 0x80) |
#define | SLIDE_ERRATA_SKIP_RANGE ((UINTN) 0x10200000) |
#define | ESTIMATED_KERNEL_SIZE ((UINTN) (200 * SIZE_1MB)) |
#define | ESTIMATED_CALL_GATE_SIZE 256 |
#define | CALL_GATE_JUMP_SIZE (sizeof (CALL_GATE_JUMP)) |
#define | CALL_GATE_MIN_SIZE (ESTIMATED_CALL_GATE_SIZE + CALL_GATE_JUMP_SIZE) |
Typedefs | |
typedef struct CALL_GATE_JUMP_ | CALL_GATE_JUMP |
typedef UINTN(EFIAPI * | KERNEL_CALL_GATE) (IN UINTN Arg1, IN UINTN Arg2) |
typedef UINTN(EFIAPI * | RELOCATION_CALL_GATE) (IN UINTN QWordCount, IN UINTN EntryPoint, IN EFI_PHYSICAL_ADDRESS Source, IN UINTN Args) |
typedef struct RT_RELOC_PROTECT_INFO_ | RT_RELOC_PROTECT_INFO |
typedef struct RT_RELOC_PROTECT_DATA_ | RT_RELOC_PROTECT_DATA |
typedef struct UEFI_SERVICES_POINTERS_ | UEFI_SERVICES_POINTERS |
typedef struct SERVICES_OVERRIDE_STATE_ | SERVICES_OVERRIDE_STATE |
typedef struct KERNEL_SUPPORT_STATE_ | KERNEL_SUPPORT_STATE |
typedef struct SLIDE_SUPPORT_STATE_ | SLIDE_SUPPORT_STATE |
typedef struct BOOT_COMPAT_CONTEXT_ | BOOT_COMPAT_CONTEXT |
Functions | |
STATIC_ASSERT (sizeof(CALL_GATE_JUMP)==7+14, "Invalid CALL_GATE_JUMP size") | |
BOOT_COMPAT_CONTEXT * | GetBootCompatContext (VOID) |
VOID | InstallServiceOverrides (IN OUT BOOT_COMPAT_CONTEXT *BootCompat) |
VOID | AppleMapPrepareMemoryPool (IN OUT BOOT_COMPAT_CONTEXT *BootCompat) |
VOID | AppleMapPrepareBooterState (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN OUT EFI_LOADED_IMAGE *LoadedImage, IN EFI_GET_MEMORY_MAP GetMemoryMap OPTIONAL) |
VOID | AppleMapPrepareKernelJump32 (IN OUT BOOT_COMPAT_CONTEXT *BootCompat) |
VOID | AppleMapPrepareKernelJump64 (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN EFI_PHYSICAL_ADDRESS CallGate, IN UINTN HookAddress) |
VOID | AppleMapPrepareForBooting (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN OUT VOID *BootArgs) |
VOID | AppleMapPrepareForHibernateWake (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN UINTN ImageHeaderPage) |
EFI_STATUS | AppleMapPrepareMemState (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN UINTN MemoryMapSize, IN UINTN DescriptorSize, IN UINT32 DescriptorVersion, IN EFI_MEMORY_DESCRIPTOR *MemoryMap) |
VOID | AsmAppleMapPrepareKernelState32 (VOID) |
UINTN EFIAPI | AppleMapPrepareKernelState32 (IN UINTN Args) |
EFI_STATUS EFIAPI | AppleMapPrepareKernelStateNew64 (IN UINTN SystemTable, IN OUT APPLE_EFI_BOOT_RT_KCG_ARGS *KcgArguments, IN KERNEL_CALL_GATE CallGate) |
UINTN EFIAPI | AppleMapPrepareKernelStateOld64 (IN UINTN Args, IN UINTN EntryPoint, IN KERNEL_CALL_GATE CallGate) |
VOID | AppleSlideUnlockForSafeMode (IN OUT UINT8 *ImageBase, IN UINTN ImageSize) |
EFI_STATUS | AppleSlideGetVariable (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN EFI_GET_VARIABLE GetVariable, IN EFI_GET_MEMORY_MAP GetMemoryMap OPTIONAL, IN OC_MEMORY_FILTER FilterMap OPTIONAL, IN VOID *FilterMapContext OPTIONAL, IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data) |
VOID | AppleSlideRestore (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN OUT OC_BOOT_ARGUMENTS *BootArgs) |
UINTN | AppleSlideGetRelocationSize (IN OUT BOOT_COMPAT_CONTEXT *BootCompat) |
EFI_STATUS | AppleRelocationAllocatePages (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN EFI_GET_MEMORY_MAP GetMemoryMap, IN EFI_ALLOCATE_PAGES AllocatePages, IN UINTN NumberOfPages, IN OUT EFI_PHYSICAL_ADDRESS *Memory) |
EFI_STATUS | AppleRelocationRelease (IN OUT BOOT_COMPAT_CONTEXT *BootCompat) |
EFI_STATUS | AppleRelocationVirtualize (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN OUT OC_BOOT_ARGUMENTS *BA) |
VOID | AppleRelocationRebase (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN OUT OC_BOOT_ARGUMENTS *BA) |
VOID | AppleRelocationCallGate64 (IN OUT UINTN *Args, IN BOOT_COMPAT_CONTEXT *BootCompat, IN KERNEL_CALL_GATE CallGate, IN UINTN *KcgArg1, IN UINTN KcgArg2) |
Copyright (C) 2019, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file BootCompatInternal.h.
#define CALL_GATE_JUMP_SIZE (sizeof (CALL_GATE_JUMP)) |
Size of jump from call gate inserted before Call Gate to jump to our code.
Definition at line 130 of file BootCompatInternal.h.
#define CALL_GATE_MIN_SIZE (ESTIMATED_CALL_GATE_SIZE + CALL_GATE_JUMP_SIZE) |
Definition at line 135 of file BootCompatInternal.h.
#define ESTIMATED_CALL_GATE_SIZE 256 |
Assume call gate (normally a little over 100 bytes) can be up to 256 bytes. It is allocated in its own page and is relocatable.
WARNING: Keep this in sync with RelocationCallGate assembly!
Definition at line 125 of file BootCompatInternal.h.
#define ESTIMATED_KERNEL_SIZE ((UINTN) (200 * SIZE_1MB)) |
Assume the kernel is roughly 128 MBs. And the recovery introduced with Big Sur has roughly 200 MBs. See 11.0b10 EB.MM.AKMR function (EfiBoot.MemoryMap.AllocateKernelMemoryRecovery), it has 0xC119 pages requested. This value is likely calculated from KC size.
Definition at line 117 of file BootCompatInternal.h.
#define KERNEL_BASE_PADDR ((UINT32) (KERNEL_HIB_VADDR & MAX_UINT32)) |
Kernel physical base address.
Definition at line 79 of file BootCompatInternal.h.
#define KERNEL_HIB_VADDR ((UINTN) (0xFFFFFF8000100000ULL & MAX_UINTN)) |
Kernel __HIB segment virtual address.
Definition at line 64 of file BootCompatInternal.h.
#define KERNEL_STATIC_VADDR ((UINT64) 0xFFFFFF8000000000ULL) |
Kernel static vaddr mapping base.
Definition at line 59 of file BootCompatInternal.h.
#define KERNEL_TEXT_PADDR ((UINT32) (KERNEL_TEXT_VADDR & MAX_UINT32)) |
Kernel __TEXT physical base address (macOS 10.6 and higher).
Definition at line 84 of file BootCompatInternal.h.
#define KERNEL_TEXT_PADDR_LEGACY (KERNEL_TEXT_VADDR_LEGACY) |
Kernel __TEXT physical base address (macOS 10.4 and 10.5).
Definition at line 89 of file BootCompatInternal.h.
#define KERNEL_TEXT_VADDR ((UINTN) (0xFFFFFF8000200000ULL & MAX_UINTN)) |
Kernel __TEXT segment virtual address (macOS 10.6 and higher).
Definition at line 69 of file BootCompatInternal.h.
#define KERNEL_TEXT_VADDR_LEGACY 0x111000 |
Kernel __TEXT segment virtual address (macOS 10.4 and 10.5).
Definition at line 74 of file BootCompatInternal.h.
#define RT_DESC_ENTRY_NUM ((UINTN) 64) |
Runtime descriptor number to virtualise. Currently hardocded for simplicity.
Definition at line 54 of file BootCompatInternal.h.
#define RT_RELOC_PROTECT_MAX_NUM ((UINTN) 64) |
Maximum number of supported runtime reloc protection areas. Currently hardocded for simplicity.
Definition at line 48 of file BootCompatInternal.h.
#define SLIDE_ERRATA_NUM ((UINTN) 0x80) |
Slide errate number to skip range from.
Definition at line 104 of file BootCompatInternal.h.
#define SLIDE_ERRATA_SKIP_RANGE ((UINTN) 0x10200000) |
Sandy/Ivy skip slide range for Intel HD graphics.
Definition at line 109 of file BootCompatInternal.h.
#define SLIDE_GRANULARITY ((UINTN) SIZE_2MB) |
Slide offset per slide entry
Definition at line 94 of file BootCompatInternal.h.
#define TOTAL_SLIDE_NUM ((UINTN) 0x100) |
Total possible number of KASLR slide offsets.
Definition at line 99 of file BootCompatInternal.h.
typedef struct BOOT_COMPAT_CONTEXT_ BOOT_COMPAT_CONTEXT |
Apple Boot Compatibility context.
typedef struct CALL_GATE_JUMP_ CALL_GATE_JUMP |
Command used to perform an absolute 64-bit jump from Call Gate to our code.
typedef UINTN(EFIAPI * KERNEL_CALL_GATE) (IN UINTN Arg1, IN UINTN Arg2) |
Kernel call gate prototype.
Definition at line 159 of file BootCompatInternal.h.
typedef struct KERNEL_SUPPORT_STATE_ KERNEL_SUPPORT_STATE |
Apple kernel support internal state..
typedef UINTN(EFIAPI * RELOCATION_CALL_GATE) (IN UINTN QWordCount, IN UINTN EntryPoint, IN EFI_PHYSICAL_ADDRESS Source, IN UINTN Args) |
Relocation call gate prototype.
Definition at line 169 of file BootCompatInternal.h.
typedef struct RT_RELOC_PROTECT_DATA_ RT_RELOC_PROTECT_DATA |
Preserved relocation entry list.
typedef struct RT_RELOC_PROTECT_INFO_ RT_RELOC_PROTECT_INFO |
Preserved relocation entry.
typedef struct SERVICES_OVERRIDE_STATE_ SERVICES_OVERRIDE_STATE |
UEFI services override internal state.
typedef struct SLIDE_SUPPORT_STATE_ SLIDE_SUPPORT_STATE |
Apple booter KASLR slide support internal state.
typedef struct UEFI_SERVICES_POINTERS_ UEFI_SERVICES_POINTERS |
UEFI Boot & Runtime Services original pointers.
VOID AppleMapPrepareBooterState | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN OUT EFI_LOADED_IMAGE * | LoadedImage, | ||
IN EFI_GET_MEMORY_MAP GetMemoryMap | OPTIONAL ) |
Prepare environment for Apple UEFI bootloader. See more details inside.
[in,out] | BootCompat | Boot compatibility context. |
[in,out] | LoadedImage | UEFI loaded image protocol instance. |
[in] | GetMemoryMap | Unmodified GetMemoryMap pointer, optional. |
Definition at line 542 of file KernelSupport.c.
VOID AppleMapPrepareForBooting | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN OUT VOID * | BootArgs ) |
Prepare environment for normal booting. Called when boot.efi jumps to kernel.
[in,out] | BootCompat | Boot compatibility context. |
[in,out] | BootArgs | Apple kernel boot arguments. |
Definition at line 325 of file KernelSupport.c.
VOID AppleMapPrepareForHibernateWake | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN UINTN | ImageHeaderPage ) |
Prepare environment for hibernate wake. Called when boot.efi jumps to kernel.
[in,out] | BootCompat | Boot compatibility context. |
[in,out] | ImageHeaderPage | Apple hibernate image page number. |
Definition at line 436 of file KernelSupport.c.
VOID AppleMapPrepareKernelJump32 | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat | ) |
Patch kernel entry point with KernelJump to later land in AppleMapPrepareKernelState.
[in,out] | BootCompat | Boot compatibility context. |
< mov bx, ds
< mov es, ebx
< mov ebp, eax
< call
Definition at line 36 of file KernelSupport32.c.
VOID AppleMapPrepareKernelJump64 | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN EFI_PHYSICAL_ADDRESS | CallGate, | ||
IN UINTN | HookAddress ) |
Patch kernel entry point with KernelJump to later land in AppleMapPrepareKernelState.
[in,out] | BootCompat | Boot compatibility context. |
[in] | CallGate | Kernel call gate address. |
[in] | HookAddress | The function address to jump to when entering the kernel call gate. |
Definition at line 36 of file KernelSupport64.c.
UINTN EFIAPI AppleMapPrepareKernelState32 | ( | IN UINTN | Args | ) |
Prepare environment for Apple kernel bootloader in boot or wake cases. This callback arrives when boot.efi jumps to kernel entry point. Should transfer control to restored kernel entry point with the same arguments.
[in] | Args | Case-specific kernel argument handle. |
Definition at line 114 of file KernelSupport32.c.
EFI_STATUS EFIAPI AppleMapPrepareKernelStateNew64 | ( | IN UINTN | SystemTable, |
IN OUT APPLE_EFI_BOOT_RT_KCG_ARGS * | KcgArguments, | ||
IN KERNEL_CALL_GATE | CallGate ) |
Prepare environment for Apple kernel bootloader in boot or wake cases. This callback arrives when boot.efi jumps to kernel call gate. Should transfer control to kernel call gate + CALL_GATE_JUMP_SIZE with the same arguments.
This uses the new (as of macOS 13 Developer Beta 1) prototype. This is due to EfiBootRt wrapping the actual kernel call gate.
[in] | SystemTable | A pointer to the EFI System Table. |
[in,out] | KcgArguments | Arguments to the kernel call gate. |
[in] | CallGate | The kernel call gate. |
EFI_ABORTED | The kernel could not be started. |
other | On success, this function does not return. |
Definition at line 135 of file KernelSupport64.c.
UINTN EFIAPI AppleMapPrepareKernelStateOld64 | ( | IN UINTN | Args, |
IN UINTN | EntryPoint, | ||
IN KERNEL_CALL_GATE | CallGate ) |
Prepare environment for Apple kernel bootloader in boot or wake cases. This callback arrives when boot.efi jumps to kernel call gate. Should transfer control to kernel call gate + CALL_GATE_JUMP_SIZE with the same arguments.
This uses the old (prior to macOS 13 Developer Beta 1) prototype.
[in] | Args | Case-specific kernel argument handle. |
[in] | EntryPoint | Case-specific kernel entry point. |
[in] | CallGate | The kernel call gate. |
Definition at line 152 of file KernelSupport64.c.
VOID AppleMapPrepareMemoryPool | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat | ) |
Prepare virtual memory management environment for later usage.
[in,out] | BootCompat | Boot compatibility context. |
Definition at line 518 of file KernelSupport.c.
EFI_STATUS AppleMapPrepareMemState | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN UINTN | MemoryMapSize, | ||
IN UINTN | DescriptorSize, | ||
IN UINT32 | DescriptorVersion, | ||
IN EFI_MEMORY_DESCRIPTOR * | MemoryMap ) |
Prepare memory state and perform virtual address translation.
[in,out] | BootCompat | Boot compatibility context. |
[in] | MemoryMapSize | SetVirtualAddresses memory map size argument. |
[in] | DescriptorSize | SetVirtualAddresses descriptor size argument. |
[in] | DescriptorVersion | SetVirtualAddresses descriptor version argument. |
[in] | MemoryMap | SetVirtualAddresses memory map argument. |
Definition at line 608 of file KernelSupport.c.
EFI_STATUS AppleRelocationAllocatePages | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN EFI_GET_MEMORY_MAP | GetMemoryMap, | ||
IN EFI_ALLOCATE_PAGES | AllocatePages, | ||
IN UINTN | NumberOfPages, | ||
IN OUT EFI_PHYSICAL_ADDRESS * | Memory ) |
Allocate memory from a relocation block when zero slide is unavailable. EfiLoaderData at address.
[in,out] | BootCompat | Boot compatibility context. |
[in] | GetMemoryMap | Unmodified GetMemoryMap pointer, optional. |
[in] | AllocatePages | Unmodified AllocatePages pointer. |
[in] | NumberOfPages | Number of pages to allocate. |
[in,out] | Memory | Memory address to allocate, may be updated. |
EFI_SUCCESS | on success. |
EFI_UNSUPPORTED | when zero slide is available. |
Definition at line 40 of file RelocationBlock.c.
VOID AppleRelocationCallGate64 | ( | IN OUT UINTN * | Args, |
IN BOOT_COMPAT_CONTEXT * | BootCompat, | ||
IN KERNEL_CALL_GATE | CallGate, | ||
IN UINTN * | KcgArg1, | ||
IN UINTN | KcgArg2 ) |
Boot Apple Kernel through relocation block.
[in,out] | Args | On input, the un-relocated kernel argument handle. On output, the relocated kernel argument handle. |
[in] | BootCompat | Boot compatibility context. |
[in] | CallGate | Kernel call gate address. |
[in] | KcgArg1 | Pointer to the first kernel call gate argument. |
[in] | KcgArg2 | Second kernel call gate argument. |
Definition at line 378 of file RelocationBlock.c.
VOID AppleRelocationRebase | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN OUT OC_BOOT_ARGUMENTS * | BA ) |
Transition from relocation block address space to normal low memory address space in the relevant XNU areas.
[in,out] | BootCompat | Boot compatibility context. |
[in,out] | BootArgs | Apple kernel boot arguments. |
Definition at line 253 of file RelocationBlock.c.
EFI_STATUS AppleRelocationRelease | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat | ) |
Release relocation block if present.
[in,out] | BootCompat | Boot compatibility context. |
EFI_SUCCESS | on success. |
EFI_UNSUPPORTED | when zero slide is available. |
Definition at line 125 of file RelocationBlock.c.
EFI_STATUS AppleRelocationVirtualize | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN OUT OC_BOOT_ARGUMENTS * | BA ) |
Transitions to virtual memory for the relocation block.
[in,out] | BootCompat | Boot compatibility context. |
[in,out] | BootArgs | Apple kernel boot arguments. |
Definition at line 154 of file RelocationBlock.c.
UINTN AppleSlideGetRelocationSize | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat | ) |
Get calculated relocation block size for booting with slide=0 (e.g. Safe Mode) or without KASLR (older macOS) when it is otherwise impossible.
[in,out] | BootCompat | Boot compatibility context. |
0 | otherwise. |
Definition at line 879 of file CustomSlide.c.
EFI_STATUS AppleSlideGetVariable | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN EFI_GET_VARIABLE | GetVariable, | ||
IN EFI_GET_MEMORY_MAP GetMemoryMap | OPTIONAL, | ||
IN OC_MEMORY_FILTER FilterMap | OPTIONAL, | ||
IN VOID *FilterMapContext | OPTIONAL, | ||
IN CHAR16 * | VariableName, | ||
IN EFI_GUID * | VendorGuid, | ||
OUT UINT32 *Attributes | OPTIONAL, | ||
IN OUT UINTN * | DataSize, | ||
OUT VOID * | Data ) |
Primary custom KASLR support handler. This gets called on every UEFI RuntimeServices GetVariable call and thus is useful to perform KASLR slide injection through boot-args.
[in,out] | BootCompat | Boot compatibility context. |
[in] | GetVariable | Original UEFI GetVariable service. |
[in] | GetMemoryMap | Unmodified GetMemoryMap pointer, optional. |
[in] | FilterMap | GetMemoryMap result filter, optional. |
[in] | FilterMapContext | FilterMap context, optional. |
[in] | VariableName | GetVariable variable name argument. |
[in] | VendorGuid | GetVariable vendor GUID argument. |
[out] | Attributes | GetVariable attributes argument. |
[in,out] | DataSize | GetVariable data size argument. |
[out] | Data | GetVariable data argument. |
GetVariable | status code. |
Definition at line 773 of file CustomSlide.c.
VOID AppleSlideRestore | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat, |
IN OUT OC_BOOT_ARGUMENTS * | BootArgs ) |
Ensures that the original csr-active-config is passed to the kernel, and removes customised slide value for security reasons.
[in,out] | BootCompat | Boot compatibility context. |
[in,out] | BootArgs | Apple kernel boot arguments. |
Definition at line 849 of file CustomSlide.c.
VOID AppleSlideUnlockForSafeMode | ( | IN OUT UINT8 * | ImageBase, |
IN UINTN | ImageSize ) |
Patch boot.efi to support random and passed slide values in safe mode.
[in,out] | ImageBase | Apple booter image base. |
[in] | ImageSize | Apple booter image size. |
Definition at line 609 of file CustomSlide.c.
VOID AsmAppleMapPrepareKernelState32 | ( | VOID | ) |
Assembly wrapper for AppleMapPrepareKernelState32. Used to convert calling conventions and fixup registers.
BOOT_COMPAT_CONTEXT * GetBootCompatContext | ( | VOID | ) |
Obtain Apple Boot Compatibility context. This function must only be called from wrapped services, where passing context arguments is not possible.
Apple | Boot Compatibility context (not null). |
Definition at line 90 of file OcAfterBootCompatLib.c.
VOID InstallServiceOverrides | ( | IN OUT BOOT_COMPAT_CONTEXT * | BootCompat | ) |
Install UEFI services overrides as necessary.
[in,out] | BootCompat | Boot compatibility context. |
Definition at line 1626 of file ServiceOverrides.c.
STATIC_ASSERT | ( | sizeof(CALL_GATE_JUMP) | = =7+14, |
"Invalid CALL_GATE_JUMP size" | ) |