| 10 | extern "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 | } |
nothing calls this directly
no test coverage detected