OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcLog.c File Reference
#include <Uefi.h>
#include <Guid/OcVariable.h>
#include <Protocol/OcLog.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/PrintLib.h>
#include <Library/OcDataHubLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcTimerLib.h>
#include <Library/OcVariableLib.h>
#include <Library/SerialPortLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include "OcLogInternal.h"

Go to the source code of this file.

Functions

STATIC CHAR8 * GetTiming (IN OC_LOG_PROTOCOL *This)
 
STATIC CHAR16 * GetLogPath (IN CONST CHAR16 *LogPrefixPath)
 
STATIC EFI_STATUS GetLogPrefix (IN CONST CHAR8 *FormattedString, OUT CHAR8 *Prefix)
 
STATIC BOOLEAN IsPrefixFiltered (IN CONST CHAR8 *FormattedString, IN CONST OC_FLEX_ARRAY *FlexFilters OPTIONAL, IN BOOLEAN BlacklistFiltering)
 
STATIC EFI_STATUS InternalLogAddEntry (IN OC_LOG_PRIVATE_DATA *Private, IN OC_LOG_PROTOCOL *OcLog, IN UINTN ErrorLevel, IN CONST OC_FLEX_ARRAY *FlexFilters OPTIONAL, IN BOOLEAN BlacklistFiltering, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
 
EFI_STATUS EFIAPI OcLogAddEntry (IN OC_LOG_PROTOCOL *OcLog, IN UINTN ErrorLevel, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
 
EFI_STATUS EFIAPI OcLogGetLog (IN OC_LOG_PROTOCOL *This, OUT CHAR8 **OcLogBuffer)
 
EFI_STATUS EFIAPI OcLogSaveLog (IN OC_LOG_PROTOCOL *This, IN UINT32 NonVolatile OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL)
 
EFI_STATUS EFIAPI OcLogResetTimers (IN OC_LOG_PROTOCOL *This)
 
OC_LOG_PROTOCOLInternalGetOcLog (VOID)
 
EFI_STATUS OcConfigureLogProtocol (IN OC_LOG_OPTIONS Options, IN CONST CHAR8 *LogModules, IN UINT32 DisplayDelay, IN UINTN DisplayLevel, IN UINTN HaltLevel, IN CONST CHAR16 *LogPrefixPath OPTIONAL, IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *LogFileSystem OPTIONAL)
 

Detailed Description

Copyright (C) 2016, 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 OcLog.c.

Function Documentation

◆ GetLogPath()

STATIC CHAR16 * GetLogPath ( IN CONST CHAR16 * LogPrefixPath)

Definition at line 102 of file OcLog.c.

◆ GetLogPrefix()

STATIC EFI_STATUS GetLogPrefix ( IN CONST CHAR8 * FormattedString,
OUT CHAR8 * Prefix )

Definition at line 145 of file OcLog.c.

◆ GetTiming()

STATIC CHAR8 * GetTiming ( IN OC_LOG_PROTOCOL * This)

Definition at line 43 of file OcLog.c.

◆ InternalGetOcLog()

OC_LOG_PROTOCOL * InternalGetOcLog ( VOID )

Definition at line 575 of file OcLog.c.

◆ InternalLogAddEntry()

STATIC EFI_STATUS InternalLogAddEntry ( IN OC_LOG_PRIVATE_DATA * Private,
IN OC_LOG_PROTOCOL * OcLog,
IN UINTN ErrorLevel,
IN CONST OC_FLEX_ARRAY *FlexFilters OPTIONAL,
IN BOOLEAN BlacklistFiltering,
IN CONST CHAR8 * FormatString,
IN VA_LIST Marker )

Definition at line 250 of file OcLog.c.

◆ IsPrefixFiltered()

STATIC BOOLEAN IsPrefixFiltered ( IN CONST CHAR8 * FormattedString,
IN CONST OC_FLEX_ARRAY *FlexFilters OPTIONAL,
IN BOOLEAN BlacklistFiltering )

Definition at line 205 of file OcLog.c.

◆ OcConfigureLogProtocol()

EFI_STATUS OcConfigureLogProtocol ( IN OC_LOG_OPTIONS Options,
IN CONST CHAR8 * LogModules,
IN UINT32 DisplayDelay,
IN UINTN DisplayLevel,
IN UINTN HaltLevel,
IN CONST CHAR16 *LogPrefixPath OPTIONAL,
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *LogFileSystem OPTIONAL )

Install or update the OcLog protocol with specified options.

Parameters
[in]OptionsLogging options.
[in]DisplayDelayDelay in microseconds after each log entry.
[in]DisplayLevelConsole visible error level.
[in]HaltLevelError level causing CPU halt.
[in]LogPrefixPathLog path (without timestamp).
[in]LogFileSystemLog filesystem, optional.

Note: If LogFileSystem is specified, and it is not writable, then the first writable file system is chosen.

Return values
EFI_SUCCESSThe entry point is executed successfully.

Definition at line 599 of file OcLog.c.

◆ OcLogAddEntry()

EFI_STATUS EFIAPI OcLogAddEntry ( IN OC_LOG_PROTOCOL * OcLog,
IN UINTN ErrorLevel,
IN CONST CHAR8 * FormatString,
IN VA_LIST Marker )

Definition at line 495 of file OcLog.c.

◆ OcLogGetLog()

EFI_STATUS EFIAPI OcLogGetLog ( IN OC_LOG_PROTOCOL * This,
OUT CHAR8 ** OcLogBuffer )

Definition at line 533 of file OcLog.c.

◆ OcLogResetTimers()

EFI_STATUS EFIAPI OcLogResetTimers ( IN OC_LOG_PROTOCOL * This)

Definition at line 567 of file OcLog.c.

◆ OcLogSaveLog()

EFI_STATUS EFIAPI OcLogSaveLog ( IN OC_LOG_PROTOCOL * This,
IN UINT32 NonVolatile OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL )

Definition at line 556 of file OcLog.c.