Module: xenomai-jki Branch: for-upstream Commit: a56854a75ca8ecfb813d8abd22f5a3df80981835 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=a56854a75ca8ecfb813d8abd22f5a3df80981835
Author: Jan Kiszka <jan.kis...@siemens.com> Date: Wed Sep 1 17:46:32 2010 +0200 Use kernel panic() in xnarch_halt() The kernel is quit good in getting last messages out even on fatal errors - we just need to give it a chance. Switch to standard panic() for 2.6 kernels, keep existing pattern for 2.4 which does not export it. Signed-off-by: Jan Kiszka <jan.kis...@siemens.com> --- include/asm-generic/system.h | 6 +----- include/asm-generic/wrappers.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index 6349f74..bcfe5c4 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -304,11 +304,7 @@ static inline unsigned long long xnarch_get_clock_freq(void) rthal_emergency_console(); \ if (atomic_read(&nklock.owner) == xnarch_current_cpu()) \ xnlock_clear_irqoff(&nklock); \ - xnarch_logerr("fatal: %s\n", emsg); \ - show_stack(NULL,NULL); \ - xnarch_trace_panic_dump(); \ - for (;;) \ - cpu_relax(); \ + wrap_panic(emsg); \ } while(0) static inline int xnarch_setimask (int imask) diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h index e706f68..ad85659 100644 --- a/include/asm-generic/wrappers.h +++ b/include/asm-generic/wrappers.h @@ -351,6 +351,15 @@ static inline void *kzalloc(size_t size, int flags) return ptr; } +#define wrap_panic(emsg) \ + do { \ + xnarch_logerr("fatal: %s\n", emsg); \ + show_stack(NULL,NULL); \ + xnarch_trace_panic_dump(); \ + for (;;) \ + cpu_relax(); \ + } while (0) + #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ #define compat_module_param_array(name, type, count, perm) \ @@ -615,4 +624,6 @@ static inline void wrap_proc_dir_entry_owner(struct proc_dir_entry *entry) raw_spin_unlock_irqrestore(&rthal_irq_descp(irq)->lock, flags) #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) */ +#define wrap_panic(emsg) panic("%s\n", emsg) + #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */ _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git