20#include "pedigree/kernel/Log.h"
21#include "pedigree/kernel/machine/Machine.h"
22#include "pedigree/kernel/machine/Serial.h"
23#include "pedigree/kernel/panic.h"
24#include "pedigree/kernel/processor/Processor.h"
25#include "pedigree/kernel/utilities/StaticString.h"
27extern "C" void _assert(
bool b,
const char* file,
int line,
const char* func) {
33 if (Machine::instance().getNumSerial()) {
37 location.append(line, 10);
38 serial->write_str(
"\nASSERT: ");
39 serial->write_str(file);
40 serial->write_str(
":");
41 serial->write_str(location);
42 serial->write_str(
" in ");
43 serial->write_str(func);
44 serial->write_str(
"\n");
47 ERROR_NOLOCK(
"Assertion failed in file " << file);
48 ERROR_NOLOCK(
"In function '" << func <<
"'");
49 ERROR_NOLOCK(
"On line " <<
Dec << line <<
Hex <<
".");
52 ERROR_NOLOCK(
"You may not resume after a failed assertion.");
57 panic(
"assertion failed");
virtual Serial * getSerial(size_t n)=0
static size_t m_Initialised
void _assert(bool b, const char *file, int line, const char *func)
void EXPORTED_PUBLIC panic(const char *msg) NORETURN