OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/OcAppleKernelLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcVirtualFsLib.h>
#include "CachelessInternal.h"
#include "MkextInternal.h"
#include "PrelinkedInternal.h"
Go to the source code of this file.
Functions | |
STATIC VOID | FreeBuiltInKext (IN BUILTIN_KEXT *BuiltinKext) |
STATIC EFI_STATUS | AddKextDependency (IN OUT LIST_ENTRY *Dependencies, IN CONST CHAR8 *Identifier) |
STATIC EFI_STATUS | AddKextDependencies (IN OUT LIST_ENTRY *Dependencies, IN XML_NODE *InfoPlistLibraries) |
STATIC EFI_STATUS | ScanExtensions (IN OUT CACHELESS_CONTEXT *Context, IN EFI_FILE_PROTOCOL *File, IN CONST CHAR16 *FilePath, IN BOOLEAN ReadPlugins) |
STATIC PATCHED_KEXT * | LookupPatchedKextForIdentifier (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier) |
STATIC BUILTIN_KEXT * | LookupBuiltinKextForIdentifier (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier) |
STATIC BUILTIN_KEXT * | LookupBuiltinKextForPlistPath (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR16 *PlistPath) |
STATIC BUILTIN_KEXT * | LookupBuiltinKextForBinaryPath (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR16 *BinaryPath) |
STATIC EFI_STATUS | ScanDependencies (IN OUT CACHELESS_CONTEXT *Context, IN CHAR8 *Identifier) |
STATIC EFI_STATUS | InternalAddPatchedKext (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier, OUT PATCHED_KEXT **Kext) |
STATIC EFI_STATUS | InternalAddKextPatch (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN PATCHER_GENERIC_PATCH *Patch OPTIONAL, IN KERNEL_QUIRK_NAME QuirkName) |
EFI_STATUS | CachelessContextInit (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR16 *FileName, IN EFI_FILE_PROTOCOL *ExtensionsDir, IN UINT32 KernelVersion, IN BOOLEAN Is32Bit) |
VOID | CachelessContextFree (IN OUT CACHELESS_CONTEXT *Context) |
EFI_STATUS | CachelessContextAddKext (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *InfoPlist, IN UINT32 InfoPlistSize, IN UINT8 *Executable OPTIONAL, IN UINT32 ExecutableSize OPTIONAL, OUT CHAR8 BundleVersion[MAX_INFO_BUNDLE_VERSION_KEY_SIZE] OPTIONAL) |
EFI_STATUS | CachelessContextForceKext (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier) |
EFI_STATUS | CachelessContextAddPatch (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN PATCHER_GENERIC_PATCH *Patch) |
EFI_STATUS | CachelessContextAddQuirk (IN OUT CACHELESS_CONTEXT *Context, IN KERNEL_QUIRK_NAME Quirk) |
EFI_STATUS | CachelessContextBlock (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR8 *Identifier, IN BOOLEAN Exclude) |
EFI_STATUS | CachelessContextOverlayExtensionsDir (IN OUT CACHELESS_CONTEXT *Context, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | CachelessContextPerformInject (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR16 *FileName, OUT EFI_FILE_PROTOCOL **File) |
EFI_STATUS | CachelessContextHookBuiltin (IN OUT CACHELESS_CONTEXT *Context, IN CONST CHAR16 *FileName, IN EFI_FILE_PROTOCOL *File, OUT EFI_FILE_PROTOCOL **VirtualFile) |
Cacheless boot (S/L/E) support.
Copyright (c) 2020, Goldfish64. 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 CachelessContext.c.
STATIC EFI_STATUS AddKextDependencies | ( | IN OUT LIST_ENTRY * | Dependencies, |
IN XML_NODE * | InfoPlistLibraries ) |
Definition at line 112 of file CachelessContext.c.
STATIC EFI_STATUS AddKextDependency | ( | IN OUT LIST_ENTRY * | Dependencies, |
IN CONST CHAR8 * | Identifier ) |
Definition at line 75 of file CachelessContext.c.
EFI_STATUS CachelessContextAddKext | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | InfoPlist, | ||
IN UINT32 | InfoPlistSize, | ||
IN UINT8 *Executable | OPTIONAL, | ||
IN UINT32 ExecutableSize | OPTIONAL, | ||
OUT CHAR8 BundleVersion | OPTIONAL[MAX_INFO_BUNDLE_VERSION_KEY_SIZE] ) |
Add kext to cacheless context to be injected later on.
[in,out] | Context | Cacheless context. |
[in] | InfoPlist | Kext Info.plist. |
[in] | InfoPlistSize | Kext Info.plist size. |
[in] | Executable | Kext executable, optional. |
[in] | ExecutableSize | Kext executable size, optional. |
[out] | BundleVersion | Kext bundle version, optionally set on request. |
Definition at line 807 of file CachelessContext.c.
EFI_STATUS CachelessContextAddPatch | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier, | ||
IN PATCHER_GENERIC_PATCH * | Patch ) |
Add patch to cacheless context to be applied later on.
[in,out] | Context | Cacheless context. |
[in] | Identifier | Kext bundle identifier. |
[in] | Patch | Patch to apply. |
Definition at line 1077 of file CachelessContext.c.
EFI_STATUS CachelessContextAddQuirk | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN KERNEL_QUIRK_NAME | Quirk ) |
Add kernel quirk to cacheless context to be applied later on.
[in,out] | Context | Cacheless context. |
[in] | Quirk | Quirk to apply. |
Definition at line 1091 of file CachelessContext.c.
EFI_STATUS CachelessContextBlock | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier, | ||
IN BOOLEAN | Exclude ) |
Add block request to cacheless context to be applied later on.
[in,out] | Context | Cacheless context. |
[in] | Identifier | Kext bundle identifier. |
[in] | Exclude | TRUE to exclude kext from cacheless context. |
Definition at line 1102 of file CachelessContext.c.
EFI_STATUS CachelessContextForceKext | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier ) |
Force built-in kext to load.
[in,out] | Context | Cacheless context. |
[in] | Identifier | Kext bundle identifier. |
Definition at line 1065 of file CachelessContext.c.
VOID CachelessContextFree | ( | IN OUT CACHELESS_CONTEXT * | Context | ) |
Frees cacheless context.
[in,out] | Context | Cacheless context. |
Definition at line 734 of file CachelessContext.c.
EFI_STATUS CachelessContextHookBuiltin | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR16 * | FileName, | ||
IN EFI_FILE_PROTOCOL * | File, | ||
OUT EFI_FILE_PROTOCOL ** | VirtualFile ) |
Apply patches to built-in kexts.
[in,out] | Context | Prelinked context. |
[in] | FileName | Filename of kext file to be injected. |
[in] | File | EFI_FILE_PROTOCOL instance of kext file. |
[out] | VirtualFile | Newly created virtualised EFI_FILE_PROTOCOL instance. |
Definition at line 1390 of file CachelessContext.c.
EFI_STATUS CachelessContextInit | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR16 * | FileName, | ||
IN EFI_FILE_PROTOCOL * | ExtensionsDir, | ||
IN UINT32 | KernelVersion, | ||
IN BOOLEAN | Is32Bit ) |
Initializes cacheless context for later modification. Must be freed with CachelessContextFree on success.
[in,out] | Context | Cacheless context. |
[in] | FileName | Extensions directory filename. |
[in] | ExtensionsDir | Extensions directory EFI_FILE_PROTOCOL. |
[in] | KernelVersion | Current kernel version. |
[in] | Is32Bit | TRUE if booting in 32-bit kernel mode. |
Definition at line 706 of file CachelessContext.c.
EFI_STATUS CachelessContextOverlayExtensionsDir | ( | IN OUT CACHELESS_CONTEXT * | Context, |
OUT EFI_FILE_PROTOCOL ** | File ) |
Creates virtual directory overlay EFI_FILE_PROTOCOL from cacheless context.
[in,out] | Context | Cacheless context. |
[out] | File | The virtual directory instance. |
Definition at line 1128 of file CachelessContext.c.
EFI_STATUS CachelessContextPerformInject | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR16 * | FileName, | ||
OUT EFI_FILE_PROTOCOL ** | VirtualFile ) |
Perform kext injection.
[in,out] | Context | Prelinked context. |
[in] | FileName | Filename of kext file to be injected. |
[out] | VirtualFile | Newly created virtualised EFI_FILE_PROTOCOL instance. |
Definition at line 1211 of file CachelessContext.c.
STATIC VOID FreeBuiltInKext | ( | IN BUILTIN_KEXT * | BuiltinKext | ) |
Definition at line 35 of file CachelessContext.c.
STATIC EFI_STATUS InternalAddKextPatch | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier, | ||
IN PATCHER_GENERIC_PATCH *Patch | OPTIONAL, | ||
IN KERNEL_QUIRK_NAME | QuirkName ) |
Definition at line 650 of file CachelessContext.c.
STATIC EFI_STATUS InternalAddPatchedKext | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier, | ||
OUT PATCHED_KEXT ** | Kext ) |
Definition at line 620 of file CachelessContext.c.
STATIC BUILTIN_KEXT * LookupBuiltinKextForBinaryPath | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR16 * | BinaryPath ) |
Definition at line 549 of file CachelessContext.c.
STATIC BUILTIN_KEXT * LookupBuiltinKextForIdentifier | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier ) |
Definition at line 501 of file CachelessContext.c.
STATIC BUILTIN_KEXT * LookupBuiltinKextForPlistPath | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR16 * | PlistPath ) |
Definition at line 525 of file CachelessContext.c.
STATIC PATCHED_KEXT * LookupPatchedKextForIdentifier | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CONST CHAR8 * | Identifier ) |
Definition at line 477 of file CachelessContext.c.
STATIC EFI_STATUS ScanDependencies | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN CHAR8 * | Identifier ) |
Definition at line 575 of file CachelessContext.c.
STATIC EFI_STATUS ScanExtensions | ( | IN OUT CACHELESS_CONTEXT * | Context, |
IN EFI_FILE_PROTOCOL * | File, | ||
IN CONST CHAR16 * | FilePath, | ||
IN BOOLEAN | ReadPlugins ) |
Definition at line 140 of file CachelessContext.c.