MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / KernelAssertionFailed

Function KernelAssertionFailed

Kernel/src/assert.cpp:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10extern "C"{
11
12 [[noreturn]] void KernelAssertionFailed(const char* msg, const char* file, int line){
13 asm("cli");
14
15 APIC::Local::SendIPI(0, ICR_DSH_OTHER /* Send to all other processors except us */, ICR_MESSAGE_TYPE_FIXED, IPI_HALT);
16
17 unlockSerial();
18 Log::Error("Kernel Assertion Failed (%s) - file: %s, line: %d", msg, file, line);
19
20 uint64_t rbp = 0;
21 asm("mov %%rbp, %0" : "=r"(rbp));
22 PrintStackTrace(rbp);
23
24 char buf[16];
25 itoa(line, buf, 10);
26
27 const char* panic[] = {"Kernel Assertion Failed", msg, "File: ", file, "Line:", buf};
28 KernelPanic(panic, 6);
29
30 asm("hlt");
31 }
32
33}

Callers

nothing calls this directly

Calls 6

SendIPIFunction · 0.85
unlockSerialFunction · 0.85
ErrorFunction · 0.85
PrintStackTraceFunction · 0.85
KernelPanicFunction · 0.85
itoaFunction · 0.70

Tested by

no test coverage detected