OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleDebugLog.h File Reference

Go to the source code of this file.

Data Structures

struct  APPLE_DEBUG_LOG_PROTOCOL_
 

Macros

#define APPLE_DEBUG_LOG_PROTOCOL_GUID
 
#define APPLE_DEBUG_LOG_PROTOCOL_REVISION   0x10000
 
#define APPLE_DEBUG_LOG_PROTOCOL_FILESIZE   BASE_2MB
 
#define APPLE_DEBUG_LOG_PROTOCOL_FILENAME   L"\\EFI\\APPLE\\LOG\\BOOT-%u.LOG"
 
#define APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG   L"\\BOOTLOG"
 
#define APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG_OLD   L"\\BOOTLOG.OLD"
 

Typedefs

typedef struct APPLE_DEBUG_LOG_PROTOCOL_ APPLE_DEBUG_LOG_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * APPLE_DEBUG_LOG_PRINT) (IN CONST CHAR8 *Message)
 
typedef EFI_STATUS(EFIAPI * APPLE_DEBUG_LOG_EXTRACT_BUFFER) (IN OUT UINT32 *Position, IN OUT UINTN *BufferSize, OUT CHAR8 *Buffer OPTIONAL, OUT UINT32 *LostCharacters OPTIONAL)
 
typedef EFI_STATUS(EFIAPI * APPLE_DEBUG_LOG_WRITE_FILES) (VOID)
 
typedef VOID(EFIAPI * APPLE_DEBUG_LOG_SETUP_FILES) (VOID)
 

Variables

EFI_GUID gAppleDebugLogProtocolGuid
 

Detailed Description

Apple Debug Log protocol.

Copyright (C) 2020, 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 AppleDebugLog.h.

Macro Definition Documentation

◆ APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG

#define APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG   L"\\BOOTLOG"

Legacy boot.efi logfile.

Definition at line 44 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG_OLD

#define APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG_OLD   L"\\BOOTLOG.OLD"

Legacy previous boot.efi logfile.

Definition at line 49 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PROTOCOL_FILENAME

#define APPLE_DEBUG_LOG_PROTOCOL_FILENAME   L"\\EFI\\APPLE\\LOG\\BOOT-%u.LOG"

Logfile name on EFI system partition (indices 1~8).

Definition at line 39 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PROTOCOL_FILESIZE

#define APPLE_DEBUG_LOG_PROTOCOL_FILESIZE   BASE_2MB

Maximum logfile size.

Definition at line 34 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PROTOCOL_GUID

#define APPLE_DEBUG_LOG_PROTOCOL_GUID
Value:
{ 0xDDFA34FB, 0xFE1F, 0x48EA, \
{ 0xB2, 0x13, 0xFB, 0x4A, 0x4C, 0xD5, 0x7B, 0xE3 } }

Apple Debug Log protocol GUID. DDFA34FB-FE1F-48EA-B213-FB4A4CD57BE3

Definition at line 22 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PROTOCOL_REVISION

#define APPLE_DEBUG_LOG_PROTOCOL_REVISION   0x10000

Current supported revision.

Definition at line 29 of file AppleDebugLog.h.

Typedef Documentation

◆ APPLE_DEBUG_LOG_EXTRACT_BUFFER

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

Extract characters from the log buffer.

Parameters
[in,out]PositionStarting position for extraction.
[in,out]BufferSizeExtraction buffer size.
[out]BufferExtraction buffer, optional.
[out]LostCharactersAmount of characters that did not fit the buffer, optional.
  • Position is automatically updated to point to the end of the buffer if provided value is too large.
  • Position is automatically updated to point after extracted characters if Buffer is not NULL.
Return values
EFI_INVALID_PARAMETERif Position or BufferSize are NULL.
EFI_SUCCESSon successful extraction.
EFI_SUCCESSon reported size in BufferSize if Buffer is NULL.
EFI_END_OF_FILEon empty buffer.

Definition at line 88 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PRINT

typedef EFI_STATUS(EFIAPI * APPLE_DEBUG_LOG_PRINT) (IN CONST CHAR8 *Message)

Send debug message to the protocol.

Parameters
[in]MessageASCII message to log.
Return values
EFI_SUCCESSon success.

Definition at line 64 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_PROTOCOL

Apple Debug Log protocol structure forward declaration.

Definition at line 54 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_SETUP_FILES

typedef VOID(EFIAPI * APPLE_DEBUG_LOG_SETUP_FILES) (VOID)

Performs a one-time operation of setting up an event for EfiSimpleFileSystem protocol installation and triggering its handler for all currently present file systems.

Event handler is supposed to handle all ESP partitions:

  • Set modification time of APPLE_DEBUG_LOG_PROTOCOL_FILENAME to current if it is before 2000 year.
  • Remove APPLE_DEBUG_LOG_PROTOCOL_FILENAME created or modified more than a month ago.
  • Remove APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG and APPLE_DEBUG_LOG_PROTOCOL_BOOTLOG_OLD files if present.
  • Update logging partition to current handled partition.

Definition at line 132 of file AppleDebugLog.h.

◆ APPLE_DEBUG_LOG_WRITE_FILES

typedef EFI_STATUS(EFIAPI * APPLE_DEBUG_LOG_WRITE_FILES) (VOID)

Save debug log to 1st APPLE_DEBUG_LOG_PROTOCOL_FILENAME on logging partition. Saving debug log includes extracting all previously unsaved characters from the debug log buffer.

On first call this function performs log rotation:

  • 8th APPLE_DEBUG_LOG_PROTOCOL_FILENAME is removed.
  • APPLE_DEBUG_LOG_PROTOCOL_FILENAMEs from 1st to 7th are renamed to 2nd to 8th.

Truncated character amount is reflected in the log before writing to file.

Return values
EFI_SUCCESSon success.
EFI_UNSUPPORTEDif current TPL is above TPL_CALLBACK.
EFI_NOT_FOUNDon write failure.

Definition at line 112 of file AppleDebugLog.h.

Variable Documentation

◆ gAppleDebugLogProtocolGuid

EFI_GUID gAppleDebugLogProtocolGuid
extern