From c51eff25b8c4b8115859dd7b5a4c11207540756c Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sat, 13 Apr 2013 15:13:56 +0200 Subject: kern/panic: restrict handling to the first panic Multiple panics occurring on different processors will usually produce unhelpful traces. Also, the first is commonly the most important, often being the same as the others, or more directly related to the root cause of the problem. --- kern/panic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'kern/panic.c') diff --git a/kern/panic.c b/kern/panic.c index f9c3f59e..bccf632b 100644 --- a/kern/panic.c +++ b/kern/panic.c @@ -19,13 +19,23 @@ #include #include +#include #include #include +static unsigned long panic_done; + void panic(const char *format, ...) { va_list list; + unsigned long already_done; + + already_done = atomic_swap(&panic_done, 1); + + if (already_done) + for (;;) + cpu_idle(); cpu_intr_disable(); cpu_halt_broadcast(); -- cgit v1.2.3