From 7cab594590002ff3737629b76083a298616b665a Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Tue, 10 Jul 2018 19:39:54 +0200 Subject: kern/panic: remove initialization operation Maintaining correct dependencies for the panic function is too complicated. It may be used very early, but would depend on the console, which is normally available quite late during initialization. Instead, the behavior of panic is now "best effort", i.e. if called at a time where it works, good, otherwise, the behavior is undefined, but should result in a freeze or a reset most of the time. --- kern/panic.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'kern/panic.h') diff --git a/kern/panic.h b/kern/panic.h index af858c74..2a25eb01 100644 --- a/kern/panic.h +++ b/kern/panic.h @@ -20,18 +20,15 @@ #include -#include - /* * Print the given message and halt the system immediately. + * + * If in doubt whether to call this function or not because of dependency + * issues, users are encouraged to call this function, even if it results + * in undefined behavior, because it should most likely cause a freeze or + * reset, which is considered better than a silent failure. */ noreturn void panic(const char *format, ...) __attribute__((format(printf, 1, 2))); -/* - * This init operation provides : - * - module fully initialized - */ -INIT_OP_DECLARE(panic_setup); - #endif /* KERN_PANIC_H */ -- cgit v1.2.3