summaryrefslogtreecommitdiff
path: root/kern/debug.h
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-10-01 13:25:22 +0200
committerJustus Winter <justus@gnupg.org>2016-10-01 15:51:26 +0200
commitf025f685e965ac9ee1cd35ff3636c8554d9939d2 (patch)
treedc5126b12ed850de99875272f112d0e2b0a11243 /kern/debug.h
parentc81df8d61ed024b253334076041917b2c8fcf55e (diff)
kern: Improve assertions and panics.
* kern/assert.h (Assert): Add function argument. (assert): Supply function argument. * kern/debug.c (Assert): Add function argument. Unify message format. (panic): Rename to 'Panic', add location information. * kern/debug.h (panic): Rename, and add a macro version that supplies the location. * linux/dev/include/linux/kernel.h: Use the new panic macro.
Diffstat (limited to 'kern/debug.h')
-rw-r--r--kern/debug.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/kern/debug.h b/kern/debug.h
index 6c8977b8..1a5cd07c 100644
--- a/kern/debug.h
+++ b/kern/debug.h
@@ -60,7 +60,11 @@
extern void log (int level, const char *fmt, ...);
extern void panic_init(void);
-extern void panic (const char *s, ...) __attribute__ ((noreturn));
+extern void Panic (const char *file, int line, const char *fun,
+ const char *s, ...)
+ __attribute__ ((noreturn, format (printf, 4, 5)));
+#define panic(s, ...) \
+ Panic (__FILE__, __LINE__, __FUNCTION__, s, ##__VA_ARGS__)
extern void SoftDebugger (const char *message);
extern void Debugger (const char *message) __attribute__ ((noreturn));