OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
KernelSupport64.c File Reference
#include "../BootCompatInternal.h"
#include <Guid/OcVariable.h>
#include <IndustryStandard/AppleHibernate.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcDeviceTreeLib.h>
#include <Library/OcMachoLib.h>
#include <Library/OcMemoryLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcStringLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>

Go to the source code of this file.

Functions

VOID AppleMapPrepareKernelJump64 (IN OUT BOOT_COMPAT_CONTEXT *BootCompat, IN EFI_PHYSICAL_ADDRESS CallGate, IN UINTN HookAddress)
 
STATIC UINTN EFIAPI AppleMapPrepareKernelStateWorker64 (IN UINTN *Args, IN UINTN EntryPoint, IN KERNEL_CALL_GATE CallGate, IN UINTN *Arg1, IN UINTN Arg2)
 
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)
 

Detailed Description

Copyright (C) 2019-2024, 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 KernelSupport64.c.

Function Documentation

◆ AppleMapPrepareKernelJump64()

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.

Parameters
[in,out]BootCompatBoot compatibility context.
[in]CallGateKernel call gate address.
[in]HookAddressThe function address to jump to when entering the kernel call gate.

Definition at line 36 of file KernelSupport64.c.

◆ AppleMapPrepareKernelStateNew64()

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.

Parameters
[in]SystemTableA pointer to the EFI System Table.
[in,out]KcgArgumentsArguments to the kernel call gate.
[in]CallGateThe kernel call gate.
Return values
EFI_ABORTEDThe kernel could not be started.
otherOn success, this function does not return.

Definition at line 135 of file KernelSupport64.c.

◆ AppleMapPrepareKernelStateOld64()

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.

Parameters
[in]ArgsCase-specific kernel argument handle.
[in]EntryPointCase-specific kernel entry point.
[in]CallGateThe kernel call gate.
Returns
Case-specific value if any.

Definition at line 152 of file KernelSupport64.c.

◆ AppleMapPrepareKernelStateWorker64()

STATIC UINTN EFIAPI AppleMapPrepareKernelStateWorker64 ( IN UINTN * Args,
IN UINTN EntryPoint,
IN KERNEL_CALL_GATE CallGate,
IN UINTN * Arg1,
IN UINTN Arg2 )

Definition at line 93 of file KernelSupport64.c.