Files
nt-lite/code/public/ntlite/ddk/debug.h
T

47 lines
1.6 KiB
C

// Public nt-lite DDK debugging declarations.
#pragma once
#include <stdint.h>
#include <ntlite/status.h>
#define KE_DEBUG_CONSOLE 0x00000001u
#define KE_DEBUG_SELFTEST 0x00000002u
#define KE_DEBUG_FILE_LOG 0x00000004u
#define KE_DEBUG_POOL_CANARY 0x00000008u
#define KE_DEBUG_POOL_POISON 0x00000010u
#define KE_DEBUG_POOL_QUARANTINE 0x00000020u
#define KE_DEBUG_POOL_CALLERS 0x00000040u
#define KE_DEBUG_DISPLAY_ASSERTS 0x00000080u
#define KE_DEBUG_DISPLAY_TRACE 0x00000100u
#define KE_DEBUG_INPUT_TRACE 0x00000200u
#define KE_DEBUG_VM_ASSERTS 0x00000400u
#define KE_DEBUG_SYSCALL_ASSERTS 0x00000800u
#define KE_DEBUG_LIST_CHECKS 0x00001000u
#define KE_DEBUG_AUDIO 0x00002000u
#define KE_DEBUG_AUDIO_SELFTEST 0x00004000u
// Driver-visible debug output service table passed through NTL_DDK.
typedef struct NTL_DDK_DEBUG {
void (*Print)(const char* fmt, ...);
uint32_t (*GetFlags)(void);
} NTL_DDK_DEBUG;
// Current fatal categories used by kernel-mode driver diagnostics.
typedef enum KE_PANIC_CODE {
KE_PANIC_CODE_GENERIC = 0,
KE_PANIC_CODE_FAULT = 1,
KE_PANIC_CODE_IRQL = 2,
KE_PANIC_CODE_SELFTEST = 3,
KE_PANIC_CODE_TRAP = 4,
KE_PANIC_CODE_DRIVER = 5,
KE_PANIC_CODE_INIT = 6,
KE_PANIC_CODE_SCHEDULER = 7,
} KE_PANIC_CODE;
// Emits a formatted debug message on the active kernel debug outputs.
__declspec(dllexport) void DbgPrint(const char* fmt, ...);
// Stops the system with a formatted diagnostic message.
__declspec(dllexport) _Noreturn void KePanic(int code, const char* fmt, ...);