OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcAppleLog.c File Reference
#include <Uefi.h>
#include <IndustryStandard/ApplePerfData.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcMiscLib.h>
#include "OcLogInternal.h"

Go to the source code of this file.

Functions

STATIC EFI_STATUS EFIAPI AppleDebugLogPrintToOcLog (IN OC_LOG_PROTOCOL *OcLog, IN CONST CHAR8 *Format,...)
 
STATIC EFI_STATUS EFIAPI AppleDebugLogPrint (IN CONST CHAR8 *Message)
 
STATIC EFI_STATUS EFIAPI AppleDebugLogExtractBuffer (IN OUT UINT32 *Position, IN OUT UINTN *BufferSize, OUT CHAR8 *Buffer OPTIONAL, OUT UINT32 *LostCharacters OPTIONAL)
 
STATIC EFI_STATUS EFIAPI AppleDebugLogWriteFiles (VOID)
 
STATIC VOID EFIAPI AppleDebugLogSetupFiles (VOID)
 
APPLE_DEBUG_LOG_PROTOCOLOcAppleDebugLogInstallProtocol (IN BOOLEAN Reinstall)
 
VOID OcAppleDebugLogConfigure (IN BOOLEAN Enable)
 
VOID OcAppleDebugLogPerfAllocated (IN OUT VOID *PerfBuffer, IN UINTN PerfBufferSize)
 

Variables

STATIC BOOLEAN mAppleDebugLogEnable
 
STATIC CHAR8 mCurrentBuffer [1024]
 
STATIC APPLE_PERF_DATAmApplePerfBuffer
 
STATIC UINTN mApplePerfBufferSize
 
STATIC UINT32 mApplePerfDumped
 
STATIC APPLE_DEBUG_LOG_PROTOCOL mAppleDebugLogProtocol
 

Detailed Description

Copyright (C) 2020, 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 OcAppleLog.c.

Function Documentation

◆ AppleDebugLogExtractBuffer()

STATIC EFI_STATUS EFIAPI AppleDebugLogExtractBuffer ( IN OUT UINT32 * Position,
IN OUT UINTN * BufferSize,
OUT CHAR8 *Buffer OPTIONAL,
OUT UINT32 *LostCharacters OPTIONAL )

Definition at line 203 of file OcAppleLog.c.

◆ AppleDebugLogPrint()

STATIC EFI_STATUS EFIAPI AppleDebugLogPrint ( IN CONST CHAR8 * Message)

Definition at line 76 of file OcAppleLog.c.

◆ AppleDebugLogPrintToOcLog()

STATIC EFI_STATUS EFIAPI AppleDebugLogPrintToOcLog ( IN OC_LOG_PROTOCOL * OcLog,
IN CONST CHAR8 * Format,
... )

Definition at line 50 of file OcAppleLog.c.

◆ AppleDebugLogSetupFiles()

STATIC VOID EFIAPI AppleDebugLogSetupFiles ( VOID )

Definition at line 232 of file OcAppleLog.c.

◆ AppleDebugLogWriteFiles()

STATIC EFI_STATUS EFIAPI AppleDebugLogWriteFiles ( VOID )

Definition at line 219 of file OcAppleLog.c.

◆ OcAppleDebugLogConfigure()

VOID OcAppleDebugLogConfigure ( IN BOOLEAN Enable)

Configure Apple Debug Log protocol.

Parameters
[in]EnableEnable logging to OcLog.

Definition at line 295 of file OcAppleLog.c.

◆ OcAppleDebugLogInstallProtocol()

APPLE_DEBUG_LOG_PROTOCOL * OcAppleDebugLogInstallProtocol ( IN BOOLEAN Reinstall)

Install and initialise the Apple Debug Log protocol.

Parameters
[in]ReinstallReplace any installed protocol.
Returns
Installed or located protocol.
Return values
NULLThere was an error locating or installing the protocol.

Definition at line 252 of file OcAppleLog.c.

◆ OcAppleDebugLogPerfAllocated()

VOID OcAppleDebugLogPerfAllocated ( IN OUT VOID * PerfBuffer,
IN UINTN PerfBufferSize )

Configure Apple performance log location.

Parameters
[in,out]PerfBufferPerformance buffer location.
[in]PerfBufferSizePerformance buffer size.

Definition at line 303 of file OcAppleLog.c.

Variable Documentation

◆ mAppleDebugLogEnable

STATIC BOOLEAN mAppleDebugLogEnable

Definition at line 29 of file OcAppleLog.c.

◆ mAppleDebugLogProtocol

STATIC APPLE_DEBUG_LOG_PROTOCOL mAppleDebugLogProtocol
Initial value:
= {
.ExtractBuffer = AppleDebugLogExtractBuffer,
.WriteFiles = AppleDebugLogWriteFiles,
}
#define APPLE_DEBUG_LOG_PROTOCOL_REVISION
STATIC VOID EFIAPI AppleDebugLogSetupFiles(VOID)
Definition OcAppleLog.c:232
STATIC EFI_STATUS EFIAPI AppleDebugLogPrint(IN CONST CHAR8 *Message)
Definition OcAppleLog.c:76
STATIC EFI_STATUS EFIAPI AppleDebugLogWriteFiles(VOID)
Definition OcAppleLog.c:219
STATIC EFI_STATUS EFIAPI AppleDebugLogExtractBuffer(IN OUT UINT32 *Position, IN OUT UINTN *BufferSize, OUT CHAR8 *Buffer OPTIONAL, OUT UINT32 *LostCharacters OPTIONAL)
Definition OcAppleLog.c:203

Definition at line 243 of file OcAppleLog.c.

◆ mApplePerfBuffer

STATIC APPLE_PERF_DATA* mApplePerfBuffer

Definition at line 37 of file OcAppleLog.c.

◆ mApplePerfBufferSize

STATIC UINTN mApplePerfBufferSize

Definition at line 41 of file OcAppleLog.c.

◆ mApplePerfDumped

STATIC UINT32 mApplePerfDumped

Definition at line 45 of file OcAppleLog.c.

◆ mCurrentBuffer

STATIC CHAR8 mCurrentBuffer[1024]

Definition at line 33 of file OcAppleLog.c.