2021-02-14 11:01:52 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-02-14 11:01:52 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-05-03 02:39:47 +03:00
|
|
|
#include <AK/Format.h>
|
|
|
|
|
2021-02-14 11:01:52 +03:00
|
|
|
namespace Kernel {
|
|
|
|
|
2022-04-01 20:58:27 +03:00
|
|
|
[[noreturn]] void __panic(char const* file, unsigned int line, char const* function);
|
2021-02-14 11:01:52 +03:00
|
|
|
|
|
|
|
#define PANIC(...) \
|
|
|
|
do { \
|
2021-04-16 22:58:51 +03:00
|
|
|
critical_dmesgln("KERNEL PANIC! :^("); \
|
|
|
|
critical_dmesgln(__VA_ARGS__); \
|
2021-02-14 11:01:52 +03:00
|
|
|
__panic(__FILE__, __LINE__, __PRETTY_FUNCTION__); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
}
|