--- zzzz-none-000/linux-2.6.28.10/kernel/panic.c 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/kernel/panic.c 2012-01-24 12:12:54.000000000 +0000 @@ -21,14 +21,21 @@ #include #include #include +#include +#include +#ifdef CONFIG_TFFS_PANIC_LOG +#include +unsigned int tffs_panic_log_suppress = 0; +EXPORT_SYMBOL(tffs_panic_log_suppress); +#endif /*--- #ifdef CONFIG_TFFS_PANIC_LOG ---*/ int panic_on_oops; static unsigned long tainted_mask; static int pause_on_oops; static int pause_on_oops_flag; static DEFINE_SPINLOCK(pause_on_oops_lock); -int panic_timeout; +int panic_timeout = 5; ATOMIC_NOTIFIER_HEAD(panic_notifier_list); @@ -60,6 +67,12 @@ #if defined(CONFIG_S390) unsigned long caller = (unsigned long) __builtin_return_address(0); #endif + extern void ar7wdt_hw_trigger(void); + ar7wdt_hw_trigger(); + + bust_spinlocks(1); + + dump_stack(); /* * It's possible to come here directly from a panic-assertion and not @@ -68,7 +81,6 @@ */ preempt_disable(); - bust_spinlocks(1); va_start(args, fmt); vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); @@ -90,7 +102,33 @@ */ smp_send_stop(); #endif - +#ifdef CONFIG_TFFS_PANIC_LOG + if(tffs_panic_log_suppress == 0) { + unsigned long printk_get_buffer(char **p_log_buf, unsigned long *p_log_end, unsigned long *p_anzahl); + char *buf; + unsigned long end; + unsigned long anzahl; + unsigned long len = printk_get_buffer(&buf, &end, &anzahl); + struct timespec uptime; + static char time_stamp_buf[sizeof("UPTIME: \n") + 10 + sizeof("PANIC LOG VERSION 2.0\n")]; + unsigned long time_stamp_buf_len; + + tffs_panic_log_suppress = 1; + tffs_panic_log_open(); + do_posix_clock_monotonic_gettime(&uptime); + monotonic_to_bootbased(&uptime); + time_stamp_buf_len = snprintf(time_stamp_buf, sizeof(time_stamp_buf), "UPTIME: %lu\nPANIC LOG VERSION 2.0\n", (unsigned long) uptime.tv_sec); + tffs_panic_log_write(time_stamp_buf, time_stamp_buf_len + 1); + + if(anzahl < len) { /*--- alles im Buffer ---*/ + tffs_panic_log_write(buf, anzahl); + } else { + tffs_panic_log_write(buf + end, len - end); + tffs_panic_log_write(buf, end); + } + tffs_panic_log_close(); + } +#endif /*--- #ifdef CONFIG_TFFS_PANIC_LOG ---*/ atomic_notifier_call_chain(&panic_notifier_list, 0, buf); if (!panic_blink)