/* * Copyright (C) 2020-2022 The opuntiaOS Project Authors. * + Contributed by Nikita Melekhin * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef _KERNEL_LIBKERN_KASSERT_H #define _KERNEL_LIBKERN_KASSERT_H #include #include #include #include #include #define ASSERT(x) \ if (unlikely(!(x))) { \ log("Kernel assertion failed: %s, function %s, file %s:%d\n", #x, __func__, __FILE__, __LINE__); \ extern int dump_kernel(const char* err); \ dump_kernel(NULL); \ system_stop(); \ } void kpanic(const char* msg) NORETURN; void kpanic_tf(const char* err_msg, trapframe_t* tf) NORETURN; #endif // _KERNEL_LIBKERN_KASSERT_H