OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
OcLog.h
Go to the documentation of this file.
1
15#ifndef OC_LOG_PROTOCOL_H
16#define OC_LOG_PROTOCOL_H
17
18#include <Uefi.h>
19#include <Protocol/SimpleFileSystem.h>
20
24#define OC_LOG_REVISION 0x01000B
25
29#define OC_LOG_ENABLE BIT0
30#define OC_LOG_CONSOLE BIT1
31#define OC_LOG_DATA_HUB BIT2
32#define OC_LOG_SERIAL BIT3
33#define OC_LOG_VARIABLE BIT4
34#define OC_LOG_NONVOLATILE BIT5
35#define OC_LOG_FILE BIT6
36#define OC_LOG_UNSAFE BIT7
37#define OC_LOG_ALL_BITS (\
38 OC_LOG_ENABLE | OC_LOG_CONSOLE | \
39 OC_LOG_DATA_HUB | OC_LOG_SERIAL | \
40 OC_LOG_VARIABLE | OC_LOG_NONVOLATILE | \
41 OC_LOG_FILE | OC_LOG_UNSAFE )
42
46#define OC_LOG_PREFIX_CHAR_MAX 8U
47
48typedef UINT32 OC_LOG_OPTIONS;
49
53#define OC_LOG_PROTOCOL_GUID \
54 { 0xDBB6008F, 0x89E4, 0x4272, \
55 { 0x98, 0x81, 0xCE, 0x3A, 0xFD, 0x97, 0x24, 0xD0 } }
56
61
72typedef
73EFI_STATUS
74(EFIAPI *OC_LOG_ADD_ENTRY)(
75 IN OC_LOG_PROTOCOL *This,
76 IN UINTN ErrorLevel,
77 IN CONST CHAR8 *FormatString,
78 IN VA_LIST Marker
79 );
80
88typedef
89EFI_STATUS
90(EFIAPI *OC_LOG_RESET_TIMERS)(
91 IN OC_LOG_PROTOCOL *This
92 );
93
102typedef
103EFI_STATUS
104(EFIAPI *OC_LOG_GET_LOG)(
105 IN OC_LOG_PROTOCOL *This,
106 OUT CHAR8 **OcLogBuffer
107 );
108
118typedef
119EFI_STATUS
120(EFIAPI *OC_LOG_SAVE_LOG)(
121 IN OC_LOG_PROTOCOL *This,
122 IN UINT32 NonVolatile OPTIONAL,
123 IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL
124 );
125
144
146extern EFI_GUID gOcLogProtocolGuid;
147
148#endif // OC_LOG_PROTOCOL_H
DMG_FILEPATH_DEVICE_PATH FilePath
EFI_STATUS(EFIAPI * OC_LOG_ADD_ENTRY)(IN OC_LOG_PROTOCOL *This, IN UINTN ErrorLevel, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
Definition OcLog.h:74
UINT32 OC_LOG_OPTIONS
Definition OcLog.h:48
EFI_STATUS(EFIAPI * OC_LOG_RESET_TIMERS)(IN OC_LOG_PROTOCOL *This)
Definition OcLog.h:90
EFI_STATUS(EFIAPI * OC_LOG_SAVE_LOG)(IN OC_LOG_PROTOCOL *This, IN UINT32 NonVolatile OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *FilePath OPTIONAL)
Definition OcLog.h:120
EFI_GUID gOcLogProtocolGuid
A global variable storing the GUID of the OC_LOG_PROTOCOL.
EFI_STATUS(EFIAPI * OC_LOG_GET_LOG)(IN OC_LOG_PROTOCOL *This, OUT CHAR8 **OcLogBuffer)
Definition OcLog.h:104
OC_LOG_ADD_ENTRY AddEntry
A pointer to the AddEntry function.
Definition OcLog.h:132
UINTN DisplayLevel
The error level visible onscreen.
Definition OcLog.h:138
EFI_FILE_PROTOCOL * UnsafeLogFile
Log file, owned. Unsafe logging only.
Definition OcLog.h:142
UINT32 Revision
The revision of the installed protocol.
Definition OcLog.h:130
CHAR16 * FilePath
Log file path.
Definition OcLog.h:141
OC_LOG_RESET_TIMERS ResetTimers
A pointer to the ResetTimers function.
Definition OcLog.h:135
OC_LOG_SAVE_LOG SaveLog
A pointer to the SaveLog function.
Definition OcLog.h:134
OC_LOG_GET_LOG GetLog
A pointer to the GetLog function.
Definition OcLog.h:133
UINTN HaltLevel
The error level causing CPU dead loop.
Definition OcLog.h:139
UINT32 DisplayDelay
The delay after visible onscreen message in microseconds.
Definition OcLog.h:137
UINTN Reserved
Reserved for future extension.
Definition OcLog.h:131
EFI_FILE_PROTOCOL * FileSystem
Log file system root, not owned.
Definition OcLog.h:140
OC_LOG_OPTIONS Options
The current options of the installed protocol.
Definition OcLog.h:136