linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] M68k show_stack() portability and cleanup patch
@ 2003-07-26 14:51 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2003-07-26 14:51 UTC (permalink / raw)
  To: Linus Torvalds, Alan Cox; +Cc: Linux Kernel Development, Geert Uytterhoeven

M68k: show_stack() portability and cleanup patch:
  - Add a task pointer argument to show_stack() and pass NULL as the first
    argument where needed
  - Remove show_trace_task()

--- linux-2.6.x/arch/m68k/kernel/traps.c	Tue Mar 25 10:06:08 2003
+++ linux-m68k-2.6.x/arch/m68k/kernel/traps.c	Thu Jun 26 11:22:53 2003
@@ -852,11 +852,6 @@
 	printk("\n");
 }
 
-void show_trace_task(struct task_struct *tsk)
-{
-	show_trace((unsigned long *)tsk->thread.esp0);
-}
-
 void show_registers(struct pt_regs *regs)
 {
 	struct frame *fp = (struct frame *)regs;
@@ -915,7 +910,7 @@
 	default:
 	    printk("\n");
 	}
-	show_stack((unsigned long *)addr);
+	show_stack(NULL, (unsigned long *)addr);
 
 	printk("Code: ");
 	for (i = 0; i < 10; i++)
@@ -923,13 +918,17 @@
 	printk ("\n");
 }
 
-extern void show_stack(unsigned long *stack)
+extern void show_stack(struct task_struct *task, unsigned long *stack)
 {
 	unsigned long *endstack;
 	int i;
 
-	if (!stack)
-		stack = (unsigned long *)&stack;
+	if (!stack) {
+		if (task)
+			stack = (unsigned long *)task->thread.esp0;
+		else
+			stack = (unsigned long *)&stack;
+	}
 	endstack = (unsigned long *)(((unsigned long)stack + THREAD_SIZE - 1) & -THREAD_SIZE);
 
 	printk("Stack from %08lx:", (unsigned long)stack);
@@ -1124,7 +1123,7 @@
 
 	printk("Process %s (pid: %d, stackpage=%08lx)\n",
 		current->comm, current->pid, PAGE_SIZE+(unsigned long)current);
-	show_stack((unsigned long *)fp);
+	show_stack(NULL, (unsigned long *)fp);
 	do_exit(SIGSEGV);
 }
 

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-26 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-26 14:51 [PATCH] M68k show_stack() portability and cleanup patch Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).