OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Macros | |
#define | OC_CHAR_BIT 8 |
#define | SECONDS_TO_MICROSECONDS(x) |
#define | MS_TO_MICROSECONDS(x) |
#define | SECONDS_TO_NANOSECONDS(x) |
#define | MS_TO_NANOSECONDS(x) |
#define | _ASSERT_EQUALS(Expression, ExpectedValue) |
#define | ASSERT_EQUALS(Expression, ExpectedValue) |
Functions | |
BOOLEAN | FindPattern (IN CONST UINT8 *Pattern, IN CONST UINT8 *PatternMask OPTIONAL, IN CONST UINT32 PatternSize, IN CONST UINT8 *Data, IN UINT32 DataSize, IN OUT UINT32 *DataOff) |
UINT32 | ApplyPatch (IN CONST UINT8 *Pattern, IN CONST UINT8 *PatternMask OPTIONAL, IN CONST UINT32 PatternSize, IN CONST UINT8 *Replace, IN CONST UINT8 *ReplaceMask OPTIONAL, IN UINT8 *Data, IN UINT32 DataSize, IN UINT32 Count, IN UINT32 Skip) |
EFI_STATUS | GetArguments (OUT UINTN *Argc, OUT CHAR16 ***Argv) |
EFI_STATUS | OcUninstallAllProtocolInstances (EFI_GUID *Protocol) |
EFI_STATUS | OcHandleProtocolFallback (IN EFI_HANDLE Handle, IN EFI_GUID *Protocol, OUT VOID **Interface) |
UINTN | OcCountProtocolInstances (IN EFI_GUID *Protocol) |
VOID * | OcGetProtocol (IN EFI_GUID *Protocol, IN UINTN ErrorLevel, IN CONST CHAR8 *CallerName OPTIONAL, IN CONST CHAR8 *ProtocolName OPTIONAL) |
EFI_STATUS | OcLoadAndRunImage (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath OPTIONAL, IN VOID *Buffer OPTIONAL, IN UINTN BufferSize, OUT EFI_HANDLE *ImageHandle OPTIONAL, IN CHAR16 *OptionalData OPTIONAL) |
EFI_STATUS | OcReadApplePlatformFirstData (IN APPLE_PLATFORM_INFO_DATABASE_PROTOCOL *PlatformInfo, IN EFI_GUID *DataGuid, IN OUT UINT32 *Size, OUT VOID *Data) |
EFI_STATUS | OcReadApplePlatformFirstDataAlloc (IN APPLE_PLATFORM_INFO_DATABASE_PROTOCOL *PlatformInfo, IN EFI_GUID *DataGuid, OUT UINT32 *Size, OUT VOID **Data) |
EFI_STATUS | OcReadApplePlatformData (IN APPLE_PLATFORM_INFO_DATABASE_PROTOCOL *PlatformInfo, IN EFI_GUID *DataGuid, IN EFI_GUID *HobGuid, IN OUT UINT32 *Size, OUT VOID *Data) |
VOID | OcConsoleFlush (VOID) |
Copyright (C) 2016 - 2018, The HermitCrabs Lab. 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 OcMiscLib.h.
#define _ASSERT_EQUALS | ( | Expression, | |
ExpectedValue ) |
Internal worker macro that calls DebugPrint().
This macro calls DebugPrint(), passing in the filename, line number, an expression that failed the comparison with expected value, the expected value and the actual value.
Expression | Integer expression that evaluated to value different from Value (should be convertible to INTN) |
ExpectedValue | Expected value of the expression (should be convertible to INTN) |
Definition at line 234 of file OcMiscLib.h.
#define ASSERT_EQUALS | ( | Expression, | |
ExpectedValue ) |
Macro that calls DebugAssert() if the value of an expression differs from the expected value.
If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, then this macro evaluates the integer expression specified by Expression. If the value of Expression differs from ExpectedValue, then DebugPrint() is called passing in the source filename, source line number, Expression, its value and ExpectedValue; then ASSERT(FALSE) is called to cause a breakpoint, deadloop or no-op depending on PcdDebugProperyMask.
Expression | Integer expression (should be convertible to INTN). |
ExpectedValue | Expected value (should be convertible to INTN). |
Definition at line 259 of file OcMiscLib.h.
#define MS_TO_MICROSECONDS | ( | x | ) |
Definition at line 31 of file OcMiscLib.h.
#define MS_TO_NANOSECONDS | ( | x | ) |
Definition at line 37 of file OcMiscLib.h.
#define OC_CHAR_BIT 8 |
The size, in Bits, of one Byte.
Definition at line 25 of file OcMiscLib.h.
#define SECONDS_TO_MICROSECONDS | ( | x | ) |
Conversions to microseconds for use in e.g. gBS->Stall.
Definition at line 30 of file OcMiscLib.h.
#define SECONDS_TO_NANOSECONDS | ( | x | ) |
Conversions to nanoseconds for use in e.g. PciIo->PollMem.
Definition at line 36 of file OcMiscLib.h.
UINT32 ApplyPatch | ( | IN CONST UINT8 * | Pattern, |
IN CONST UINT8 *PatternMask | OPTIONAL, | ||
IN CONST UINT32 | PatternSize, | ||
IN CONST UINT8 * | Replace, | ||
IN CONST UINT8 *ReplaceMask | OPTIONAL, | ||
IN UINT8 * | Data, | ||
IN UINT32 | DataSize, | ||
IN UINT32 | Count, | ||
IN UINT32 | Skip ) |
Definition at line 106 of file DataPatcher.c.
BOOLEAN FindPattern | ( | IN CONST UINT8 * | Pattern, |
IN CONST UINT8 *PatternMask | OPTIONAL, | ||
IN CONST UINT32 | PatternSize, | ||
IN CONST UINT8 * | Data, | ||
IN UINT32 | DataSize, | ||
IN OUT UINT32 * | DataOff ) |
Definition at line 82 of file DataPatcher.c.
EFI_STATUS GetArguments | ( | OUT UINTN * | Argc, |
OUT CHAR16 *** | Argv ) |
Obtain application arguments.
[out] | Argc | Argument count. |
[out] | Argv | Argument list. |
EFI_SUCCESS | on success. |
Definition at line 25 of file ProtocolSupport.c.
VOID OcConsoleFlush | ( | VOID | ) |
Performs ConIn keyboard input flush.
Definition at line 13 of file ConsoleUtils.c.
UINTN OcCountProtocolInstances | ( | IN EFI_GUID * | Protocol | ) |
Count instances found under a specific protocol.
[in] | Protocol | Protocol to search for. |
Definition at line 149 of file ProtocolSupport.c.
VOID * OcGetProtocol | ( | IN EFI_GUID * | Protocol, |
IN UINTN | ErrorLevel, | ||
IN CONST CHAR8 *CallerName | OPTIONAL, | ||
IN CONST CHAR8 *ProtocolName | OPTIONAL ) |
Obtain protocol. If not obtained returns NULL, and optionally adds log message "[CallerName] cannot get protocol [ProtocolName] - %r".
[in] | Protocol | Protocol to search for. |
[in] | ErrorLevel | The error level of the debug log message to print if protocol not found. Send zero to generate no log message (caller becomes reponsible). |
[in] | CallerName | The caller name for the error message; should always be provided if ErrorLevel is non-zero; will work, but with less useful log output, if ommitted in that case. |
[in] | ProtocolName | The protocol name for the error message; optional, protocol GUID will be used as protocol name in error message when required, otherwise. |
Definition at line 179 of file ProtocolSupport.c.
EFI_STATUS OcHandleProtocolFallback | ( | IN EFI_HANDLE | Handle, |
IN EFI_GUID * | Protocol, | ||
OUT VOID ** | Interface ) |
Handle protocol on handle and fallback to any protocol when missing.
[in] | Handle | Handle to search for protocol. |
[in] | Protocol | Protocol to search for. |
[out] | Interface | Protocol interface if found. |
EFI_SUCCESS | on success. |
Definition at line 124 of file ProtocolSupport.c.
EFI_STATUS OcLoadAndRunImage | ( | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath | OPTIONAL, |
IN VOID *Buffer | OPTIONAL, | ||
IN UINTN | BufferSize, | ||
OUT EFI_HANDLE *ImageHandle | OPTIONAL, | ||
IN CHAR16 *OptionalData | OPTIONAL ) |
Run and execute image file from buffer.
[in] | DevicePath | Image device path, optional. |
[in] | Buffer | Buffer with image data, optional when DP is given. |
[in] | BufferSize | Image data size in the buffer. |
[out] | ImageHandle | Loaded image handle for drivers, optional. |
[out] | OptionalData | Data that is passed to the loaded image, optional. |
Definition at line 25 of file ImageRunner.c.
EFI_STATUS OcReadApplePlatformData | ( | IN APPLE_PLATFORM_INFO_DATABASE_PROTOCOL * | PlatformInfo, |
IN EFI_GUID * | DataGuid, | ||
IN EFI_GUID * | HobGuid, | ||
IN OUT UINT32 * | Size, | ||
OUT VOID * | Data ) |
Read data from Apple Platform Info protocol.
[in] | PlatformInfo | Apple Platform Info protocol. |
[in] | DataGuid | Resource GUID identifier. |
[in] | HobGuid | Hob GUID identifier. |
[in,out] | Size | Maximum size allowed, updated to actual size on success. |
[out] | Data | Data read from Apple Platform Info protocol. |
EFI_SUCCESS | on success. |
Definition at line 155 of file PlatformInfo.c.
EFI_STATUS OcReadApplePlatformFirstData | ( | IN APPLE_PLATFORM_INFO_DATABASE_PROTOCOL * | PlatformInfo, |
IN EFI_GUID * | DataGuid, | ||
IN OUT UINT32 * | Size, | ||
OUT VOID * | Data ) |
Read first data from Apple Platform Info protocol.
[in] | PlatformInfo | Apple Platform Info protocol. |
[in] | DataGuid | Resource GUID identifier. |
[in,out] | Size | Maximum size allowed, updated to actual size on success. |
[out] | Data | Data read from Apple Platform Info protocol. |
EFI_SUCCESS | on success. |
Definition at line 26 of file PlatformInfo.c.
EFI_STATUS OcReadApplePlatformFirstDataAlloc | ( | IN APPLE_PLATFORM_INFO_DATABASE_PROTOCOL * | PlatformInfo, |
IN EFI_GUID * | DataGuid, | ||
OUT UINT32 * | Size, | ||
OUT VOID ** | Data ) |
Read first data from Apple Platform Info protocol allocating memory from pool.
[in] | PlatformInfo | Apple Platform Info protocol. |
[in] | DataGuid | Resource GUID identifier. |
[out] | Size | Size of the entry. |
[out] | Data | Data read from Apple Platform Info protocol allocated from pool. |
EFI_SUCCESS | on success. |
Definition at line 91 of file PlatformInfo.c.
EFI_STATUS OcUninstallAllProtocolInstances | ( | EFI_GUID * | Protocol | ) |
Uninstall all protocols with the specified GUID.
[in] | Protocol | The published unique identifier of the protocol. It is the caller's responsibility to pass in a valid GUID. |
EFI_SUCCESS | on success. |
Definition at line 70 of file ProtocolSupport.c.