X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fpanic.c;h=da4d6bac270e90dcdc0dfc6052dbb49f935cc981;hb=cadf1855e9f97d3f6857a168e1e7798fe27530a1;hp=623d1828259a9a4f1b9f7b6776bf0ea3b339c75d;hpb=58a3bb59973e33a428d72fa530a3d1d81feb0e8f;p=linux-2.6-omap-h63xx.git diff --git a/kernel/panic.c b/kernel/panic.c index 623d1828259..da4d6bac270 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -19,6 +19,7 @@ #include #include #include +#include int panic_on_oops; int tainted; @@ -56,14 +57,14 @@ EXPORT_SYMBOL(panic_blink); * * This function never returns. */ - + NORET_TYPE void panic(const char * fmt, ...) { long i; static char buf[1024]; va_list args; #if defined(CONFIG_S390) - unsigned long caller = (unsigned long) __builtin_return_address(0); + unsigned long caller = (unsigned long) __builtin_return_address(0); #endif /* @@ -128,7 +129,7 @@ NORET_TYPE void panic(const char * fmt, ...) } #endif #if defined(CONFIG_S390) - disabled_wait(caller); + disabled_wait(caller); #endif local_irq_enable(); for (i = 0;;) { @@ -148,25 +149,26 @@ EXPORT_SYMBOL(panic); * 'F' - Module has been forcibly loaded. * 'S' - SMP with CPUs not designed for SMP. * 'R' - User forced a module unload. - * 'M' - Machine had a machine check experience. + * 'M' - System experienced a machine check exception. * 'B' - System has hit bad_page. * 'U' - Userspace-defined naughtiness. * * The string is overwritten by the next call to print_taint(). */ - + const char *print_tainted(void) { static char buf[20]; if (tainted) { - snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c", + snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c", tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G', tainted & TAINT_FORCED_MODULE ? 'F' : ' ', tainted & TAINT_UNSAFE_SMP ? 'S' : ' ', tainted & TAINT_FORCED_RMMOD ? 'R' : ' ', - tainted & TAINT_MACHINE_CHECK ? 'M' : ' ', + tainted & TAINT_MACHINE_CHECK ? 'M' : ' ', tainted & TAINT_BAD_PAGE ? 'B' : ' ', - tainted & TAINT_USER ? 'U' : ' '); + tainted & TAINT_USER ? 'U' : ' ', + tainted & TAINT_DIE ? 'D' : ' '); } else snprintf(buf, sizeof(buf), "Not tainted"); @@ -264,6 +266,20 @@ void oops_enter(void) do_oops_enter_exit(); } +/* + * 64-bit random ID for oopses: + */ +static u64 oops_id; + +static int init_oops_id(void) +{ + if (!oops_id) + get_random_bytes(&oops_id, sizeof(oops_id)); + + return 0; +} +late_initcall(init_oops_id); + /* * Called when the architecture exits its oops handler, after printing * everything. @@ -271,6 +287,9 @@ void oops_enter(void) void oops_exit(void) { do_oops_enter_exit(); + init_oops_id(); + printk(KERN_WARNING "---[ end trace %016llx ]---\n", + (unsigned long long)oops_id); } #ifdef CONFIG_CC_STACKPROTECTOR