Files
kernel/include/sys/panic.h
T
2019-10-12 13:40:48 +03:00

18 lines
435 B
C

/** vim: set ft=cpp.doxygen :
* @file sys/panic.h
* @brief Kernel assertion-testing and critical failure functions
*/
#pragma once
#include <stdarg.h>
#include <stdint.h>
#define panic(f, ...) panicf("[%s] " f, __func__, ##__VA_ARGS__)
#if defined(ARCH_AMD64)
#define __idle_halt() asm volatile ("cli; hlt")
#endif
#define panic_hlt() do { __idle_halt(); } while (1)
void panicf(const char *fmt, ...) __attribute__((noreturn));