summaryrefslogtreecommitdiff
path: root/src/boot/assert.c
blob: 661f7db873b231d10b770f47cec401095a438334 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include "libc64/sprintf.h"
#include "assert.h"
#include "fault.h"

NORETURN void __assert(const char* assertion, const char* file, int line) {
    char msg[256];

    osSyncPrintf("Assertion failed: %s, file %s, line %d, thread %d\n", assertion, file, line, osGetThreadId(NULL));
    sprintf(msg, "ASSERT: %s:%d(%d)", file, line, osGetThreadId(NULL));
    Fault_AddHungupAndCrashImpl(msg, assertion);
}