[PATCH] dump_stack() for sparc32
While debugging a new ALSA driver I found that dump_stack() has not been
implemented for sparc32. This patch adds the function, and is a direct copy
of the sparc64 code.
Before patch:
ALSA sound/core/pcm_lib.c:141: BUG: stream = 0, pos = 0xfa0, buffer size = 0xfa0, period size = 0x3e8
This architecture does not implement dump_stack()
After patch:
ALSA sound/core/pcm_lib.c:141: BUG: stream = 0, pos = 0xfa0, buffer size = 0xfa0, period size = 0x3e8
[fe354a00 : transmission_complete_intr+0xf0/0x100 [snd_sun_dbri] ] [fe354be8 : dbri_process_one_interrupt+0x110/0x1e4 [snd_sun_dbri] ] [fe354d04 : dbri_process_interrupt_buffer+0x48/0x78 [snd_sun_dbri] ] [fe354e1c : snd_dbri_interrupt+0xe8/0xfc [snd_sun_dbri] ] [f0014588 : handler_irq+0x7c/0xe4 ] [f0011db4 : patch_handler_irq+0x0/0x24 ] [f0015770 : cpu_idle+0xf0/0x110 ] [f000e02c : rest_init+0x18/0x28 ] [f01b4f84 : _etext+0x63314/0x79dc4 ] [f01b4790 : _etext+0x62b20/0x79dc4 ] [00000000 : 0x0 ]
Best regards,
Martin
Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>
--- 2.6.8/arch/sparc/kernel/process.c.orig 2004-09-16 12:25:44.000000000 +0100
+++ 2.6.8/arch/sparc/kernel/process.c 2004-09-16 12:27:48.000000000 +0100
@@ -336,6 +336,17 @@
printk("\n");
}
+void dump_stack(void)
+{
+ unsigned long *ksp;
+
+ __asm__ __volatile__("mov %%fp, %0"
+ : "=r" (ksp));
+ show_stack(current, ksp);
+}
+
+EXPORT_SYMBOL(dump_stack);
+
/*
* Note: sparc64 has a pretty intricated thread_saved_pc, check it out.
*/
Reply to: