summaryrefslogtreecommitdiff
path: root/tools/include/linux/panic.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2024-04-16 14:04:59 -0700
committerAndrew Morton <akpm@linux-foundation.org>2024-04-16 14:04:59 -0700
commit640958fde130acfea98f539dfd4de6a9e72cf012 (patch)
treec122cb130940b99f79e9b21cdc00c7437afd98ce /tools/include/linux/panic.h
parent4e2e3612922529f03a6fb380d416ba8c968b34cc (diff)
parent0bbac3facb5d6cc0171c45c9873a2dc96bea9680 (diff)
Merge branch 'master' into mm-stable
Diffstat (limited to 'tools/include/linux/panic.h')
-rw-r--r--tools/include/linux/panic.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/include/linux/panic.h b/tools/include/linux/panic.h
new file mode 100644
index 000000000000..9c8f17a41ce8
--- /dev/null
+++ b/tools/include/linux/panic.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TOOLS_LINUX_PANIC_H
+#define _TOOLS_LINUX_PANIC_H
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static inline void panic(const char *fmt, ...)
+{
+ va_list argp;
+
+ va_start(argp, fmt);
+ vfprintf(stderr, fmt, argp);
+ va_end(argp);
+ exit(-1);
+}
+
+#endif