OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OpenCoreMisc.c File Reference
#include <IndustryStandard/AppleCsrConfig.h>
#include <Library/OcMainLib.h>
#include <Guid/AppleVariable.h>
#include <Guid/OcVariable.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcAcpiLib.h>
#include <Library/OcAppleBootPolicyLib.h>
#include <Library/OcAppleDiskImageLib.h>
#include <Library/OcAudioLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcConsoleLib.h>
#include <Library/OcCpuLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcDeviceMiscLib.h>
#include <Library/OcLogAggregatorLib.h>
#include <Library/OcSmbiosLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcVariableLib.h>
#include <Library/PcdLib.h>
#include <Library/PrintLib.h>
#include <Library/SerialPortLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Protocol/OcInterface.h>
#include <ShimVars.h>

Go to the source code of this file.

Functions

STATIC VOID OcStoreLoadPath (IN EFI_DEVICE_PATH_PROTOCOL *LoadPath OPTIONAL)
 
STATIC EFI_STATUS ProduceDebugReport (IN EFI_HANDLE VolumeHandle)
 
STATIC EFI_STATUS EFIAPI OcToolLoadEntry (IN OC_STORAGE_CONTEXT *Storage, IN OC_BOOT_ENTRY *ChosenEntry, OUT VOID **Data, OUT UINT32 *DataSize, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *StorageHandle, OUT EFI_DEVICE_PATH_PROTOCOL **StoragePath, IN OC_DMG_LOADING_SUPPORT DmgLoading, OUT OC_APPLE_DISK_IMAGE_PRELOAD_CONTEXT *DmgPreloadContext, OUT VOID **CustomFreeContext)
 
STATIC VOID SavePanicLog (IN OC_STORAGE_CONTEXT *Storage)
 
CONST CHAR8 * OcMiscGetVersionString (VOID)
 
EFI_STATUS OcMiscEarlyInit (IN OC_STORAGE_CONTEXT *Storage, OUT OC_GLOBAL_CONFIG *Config, IN OC_RSA_PUBLIC_KEY *VaultKey OPTIONAL)
 
STATIC CHAR16 * BuildLauncherPath (IN CONST CHAR16 *RootPath, IN CONST CHAR8 *LauncherPath, OUT CONST CHAR16 **MatchSuffix)
 
VOID OcMiscMiddleInit (IN OC_STORAGE_CONTEXT *Storage, IN OC_GLOBAL_CONFIG *Config, IN CONST CHAR16 *RootPath, IN EFI_DEVICE_PATH_PROTOCOL *LoadPath, IN EFI_HANDLE StorageHandle, OUT UINT8 *Signature OPTIONAL)
 
EFI_STATUS OcMiscLateInit (IN OC_STORAGE_CONTEXT *Storage, IN OC_GLOBAL_CONFIG *Config)
 
VOID OcMiscLoadSystemReport (IN OC_GLOBAL_CONFIG *Config, IN EFI_HANDLE LoadHandle OPTIONAL)
 
VOID OcMiscBoot (IN OC_STORAGE_CONTEXT *Storage, IN OC_GLOBAL_CONFIG *Config, IN OC_PRIVILEGE_CONTEXT *Privilege OPTIONAL, IN OC_IMAGE_START StartImage, IN BOOLEAN CustomBootGuid, IN EFI_HANDLE LoadHandle)
 
VOID OcMiscUefiQuirksLoaded (IN OC_GLOBAL_CONFIG *Config)
 

Detailed Description

OpenCore driver.

Copyright (c) 2019, vit9696. 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 OpenCoreMisc.c.

Function Documentation

◆ BuildLauncherPath()

STATIC CHAR16 * BuildLauncherPath ( IN CONST CHAR16 * RootPath,
IN CONST CHAR8 * LauncherPath,
OUT CONST CHAR16 ** MatchSuffix )

Generates bootstrap path according to the BootProtect mode.

Parameters
[in]RootPathRoot load path.
[in]LauncherPathLauncher path to write, optional.
[out]MatchSuffixMatch suffix to optimise lookup.
Returns
BootProtect bitmask.

Definition at line 602 of file OpenCoreMisc.c.

◆ OcMiscBoot()

VOID OcMiscBoot ( IN OC_STORAGE_CONTEXT * Storage,
IN OC_GLOBAL_CONFIG * Config,
IN OC_PRIVILEGE_CONTEXT *Privilege OPTIONAL,
IN OC_IMAGE_START StartImage,
IN BOOLEAN CustomBootGuid,
IN EFI_HANDLE LoadHandle )

Load late miscellaneous support like boot screen config.

Parameters
[in]StorageOpenCore storage.
[in]ConfigOpenCore configuration.
[in]PrivilegeOpenCore privilege context.
[in]StartImageImage starting routine used.
[in]LoadHandleOpenCore loading handle.
[in]CustomBootGuidUse custom (gOcVendorVariableGuid) for Boot#### variables.

< Always true for entries

Definition at line 798 of file OpenCoreMisc.c.

◆ OcMiscEarlyInit()

EFI_STATUS OcMiscEarlyInit ( IN OC_STORAGE_CONTEXT * Storage,
OUT OC_GLOBAL_CONFIG * Config,
IN OC_RSA_PUBLIC_KEY *VaultKey OPTIONAL )

Load early miscellaneous support like configuration.

Parameters
[in]StorageOpenCore storage.
[out]ConfigOpenCore configuration.
[in]VaultKeyVault key.
Return values
EFI_SUCCESSwhen allowed to continue.

< Should be unreachable.

< Should be unreachable.

< Should be unreachable.

< Should be unreachable.

< Should be unreachable.

Definition at line 439 of file OpenCoreMisc.c.

◆ OcMiscGetVersionString()

CONST CHAR8 * OcMiscGetVersionString ( VOID )

Get human readable version string.

Return values
null-terminated7-bit ASCII version string.

Force the assertions in case we forget about them.

Definition at line 372 of file OpenCoreMisc.c.

◆ OcMiscLateInit()

EFI_STATUS OcMiscLateInit ( IN OC_STORAGE_CONTEXT * Storage,
IN OC_GLOBAL_CONFIG * Config )

Load late miscellaneous support like Apple hibernation or panic saving.

Parameters
[in]StorageOpenCore storage.
[in]ConfigOpenCore configuration.
Return values
EFI_SUCCESSon success, informational.

Definition at line 743 of file OpenCoreMisc.c.

◆ OcMiscLoadSystemReport()

VOID OcMiscLoadSystemReport ( IN OC_GLOBAL_CONFIG * Config,
IN EFI_HANDLE LoadHandle OPTIONAL )

Load system report.

Parameters
[in]LoadHandleOpenCore loading handle.
Return values
EFI_SUCCESSon success, informational.

Definition at line 787 of file OpenCoreMisc.c.

◆ OcMiscMiddleInit()

VOID OcMiscMiddleInit ( IN OC_STORAGE_CONTEXT * Storage,
IN OC_GLOBAL_CONFIG * Config,
IN CONST CHAR16 * RootPath,
IN EFI_DEVICE_PATH_PROTOCOL * LoadPath,
IN EFI_HANDLE StorageHandle,
OUT UINT8 *Signature OPTIONAL )

Load middle miscellaneous support like device path.

Parameters
[in]StorageOpenCore storage.
[in]ConfigOpenCore configuration.
[in]RootPathRoot load path (e.g. path to OC directory).
[in]LoadPathOpenCore loading device path (absolute).
[in]StorageHandleOpenCore storage loading handle (e.g. FS handle).
[out]SignatureOpenCore SHA-1 booter signature, optional.
Return values
EFI_SUCCESSon success, informational.

Definition at line 639 of file OpenCoreMisc.c.

◆ OcMiscUefiQuirksLoaded()

VOID OcMiscUefiQuirksLoaded ( IN OC_GLOBAL_CONFIG * Config)

Load miscellaneous support after UEFI quirks.

Parameters
[in]ConfigOpenCore configuration.

Definition at line 1053 of file OpenCoreMisc.c.

◆ OcStoreLoadPath()

STATIC VOID OcStoreLoadPath ( IN EFI_DEVICE_PATH_PROTOCOL *LoadPath OPTIONAL)

Definition at line 51 of file OpenCoreMisc.c.

◆ OcToolLoadEntry()

STATIC EFI_STATUS EFIAPI OcToolLoadEntry ( IN OC_STORAGE_CONTEXT * Storage,
IN OC_BOOT_ENTRY * ChosenEntry,
OUT VOID ** Data,
OUT UINT32 * DataSize,
OUT EFI_DEVICE_PATH_PROTOCOL ** DevicePath,
OUT EFI_HANDLE * StorageHandle,
OUT EFI_DEVICE_PATH_PROTOCOL ** StoragePath,
IN OC_DMG_LOADING_SUPPORT DmgLoading,
OUT OC_APPLE_DISK_IMAGE_PRELOAD_CONTEXT * DmgPreloadContext,
OUT VOID ** CustomFreeContext )

Definition at line 260 of file OpenCoreMisc.c.

◆ ProduceDebugReport()

STATIC EFI_STATUS ProduceDebugReport ( IN EFI_HANDLE VolumeHandle)

Definition at line 93 of file OpenCoreMisc.c.

◆ SavePanicLog()

STATIC VOID SavePanicLog ( IN OC_STORAGE_CONTEXT * Storage)

Definition at line 325 of file OpenCoreMisc.c.