2020-03-13 14:11:58 +01:00
|
|
|
/*
|
|
|
|
Headers collection for procedures
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BOOTLOG__H__
|
|
|
|
#define __BOOTLOG__H__
|
|
|
|
|
2021-09-28 10:28:45 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#include "../cpp_foundation/XBool.h"
|
|
|
|
#endif
|
|
|
|
|
2020-03-13 14:11:58 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2020-09-18 10:55:44 +02:00
|
|
|
#include <Uefi/UefiBaseType.h>
|
2020-10-03 19:02:31 +02:00
|
|
|
#include <Protocol/SimpleFileSystem.h> // for EFI_FILE*
|
2020-03-13 14:11:58 +01:00
|
|
|
|
2020-04-16 11:09:22 +02:00
|
|
|
|
|
|
|
//#define SAFE_LOG_SIZE 80
|
|
|
|
//#define MSG_LOG_SIZE (256 * 1024)
|
2020-10-17 15:01:33 +02:00
|
|
|
#define PREBOOT_LOG L"misc\\preboot.log"
|
|
|
|
#define LEGBOOT_LOG L"misc\\legacy_boot.log"
|
|
|
|
//#define BOOT_LOG_new L"misc\\boot.log"
|
|
|
|
//#define SYSTEM_LOG_new L"misc\\system.log"
|
|
|
|
#define DEBUG_LOG L"misc\\debug.log"
|
2020-10-03 19:02:31 +02:00
|
|
|
//#define PREWAKE_LOG L"misc\\prewake.log"
|
2020-04-16 11:09:22 +02:00
|
|
|
|
|
|
|
|
2021-04-05 14:00:17 +02:00
|
|
|
#ifndef DEBUG_ALL
|
|
|
|
#define MsgLog(...) DebugLog(1, __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define MsgLog(...) DebugLog(DEBUG_ALL, __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2020-04-16 11:09:22 +02:00
|
|
|
|
2020-10-03 19:02:31 +02:00
|
|
|
void
|
|
|
|
InitBooterLog (void);
|
2020-03-13 14:11:58 +01:00
|
|
|
|
2020-11-12 22:25:56 +01:00
|
|
|
void closeDebugLog(void);
|
2020-10-17 15:01:33 +02:00
|
|
|
|
2021-09-28 10:28:45 +02:00
|
|
|
#ifdef __cplusplus
|
2020-03-13 14:11:58 +01:00
|
|
|
EFI_STATUS
|
|
|
|
SetupBooterLog (
|
2021-09-28 10:28:45 +02:00
|
|
|
XBool AllowGrownSize
|
2020-03-13 14:11:58 +01:00
|
|
|
);
|
2021-09-28 10:28:45 +02:00
|
|
|
#endif
|
2020-03-13 14:11:58 +01:00
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
SaveBooterLog (
|
2020-10-03 19:02:31 +02:00
|
|
|
const EFI_FILE* BaseDir OPTIONAL,
|
|
|
|
const CHAR16 *FileName
|
2020-03-13 14:11:58 +01:00
|
|
|
);
|
|
|
|
|
2020-03-25 19:32:44 +01:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define __attribute__(x)
|
|
|
|
#endif
|
|
|
|
|
2020-10-03 19:02:31 +02:00
|
|
|
void
|
2020-03-13 14:11:58 +01:00
|
|
|
EFIAPI
|
|
|
|
DebugLog (
|
|
|
|
IN INTN DebugMode,
|
2020-03-26 13:59:20 +01:00
|
|
|
IN CONST CHAR8 *FormatString, ...) __attribute__((format(printf, 2, 3)));
|
2020-03-25 19:32:44 +01:00
|
|
|
|
2020-03-13 14:11:58 +01:00
|
|
|
|
2020-04-16 09:15:26 +02:00
|
|
|
/** Prints series of bytes. */
|
2020-10-03 19:02:31 +02:00
|
|
|
void
|
2020-04-16 09:15:26 +02:00
|
|
|
PrintBytes (
|
2020-10-03 19:02:31 +02:00
|
|
|
IN void *Bytes,
|
2020-04-16 09:15:26 +02:00
|
|
|
IN UINTN Number
|
|
|
|
);
|
|
|
|
|
2020-09-18 10:55:44 +02:00
|
|
|
|
2021-02-06 18:16:46 +01:00
|
|
|
void DbgHeader(CONST CHAR8 *str);
|
|
|
|
|
2020-09-18 10:55:44 +02:00
|
|
|
/*
|
|
|
|
* OpenCore
|
|
|
|
*/
|
|
|
|
// This use the EDK format
|
2020-10-03 19:02:31 +02:00
|
|
|
void EFIAPI DebugLogForOC(IN INTN DebugLevel, IN CONST CHAR8 *FormatString, ...);
|
2020-09-18 10:55:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2020-03-13 14:11:58 +01:00
|
|
|
#endif
|