Refactor panic handler and assertion failed display functions

This commit is contained in:
EnderIce2
2024-04-01 21:04:45 +03:00
parent 87e263f5fe
commit e09d93e2bb
3 changed files with 24 additions and 16 deletions

View File

@ -39,10 +39,11 @@
#include "../../kernel.h"
extern const char *x86ExceptionMnemonics[];
extern void DisplayCrashScreen(CPU::ExceptionFrame *Frame);
extern bool UserModeExceptionHandler(CPU::ExceptionFrame *Frame);
extern void DisplayCrashScreen(CPU::ExceptionFrame *);
extern bool UserModeExceptionHandler(CPU::ExceptionFrame *);
extern void DisplayStackSmashing();
extern void DisplayBufferOverflow();
extern void DisplayAssertionFailed(const char *, int, const char *);
Video::Font *CrashFont = nullptr;
void *FbBeforePanic = nullptr;
@ -350,3 +351,10 @@ nsa __noreturn void HandleBufferOverflow()
DisplayBufferOverflow();
CPU::Stop();
}
EXTERNC nsa __noreturn void HandleAssertionFailed(const char *File, int Line,
const char *Expression)
{
DisplayAssertionFailed(File, Line, Expression);
CPU::Stop();
}