Date: Thu, 9 Oct 1997 10:27:02 +0200
From: Roman Hodek <rnhodek@faui22c.informatik.uni-erlangen.de>
To: linux-m68k@lists.linux-m68k.org
Subject: L68K: Lost kgdb patch
Sender: owner-linux-m68k@phil.uni-sb.de


These little kgdb modifications were included in my generic-logo patch
that didn't made it into the plain 2.1.57, but was reintroduced by
Geert's misc patch. Unforunately, he didn't also include the kgdb
stuff, so here it is again.

Summary:

 - Clear the framepointer in head.S so that gdb knows which frame is
   the topmost.

 - The 'kill' action in gdb best should reboot the machine.

Roman

------------------------------------------------------------------------------
diff -u --recursive --exclude-from=diff-excludes --new-file linux-2.1.55.orig/arch/m68k/kernel/head.S linux-2.1.55/arch/m68k/kernel/head.S
--- linux-2.1.55.orig/arch/m68k/kernel/head.S	Wed Jun 25 14:17:13 1997
+++ linux-2.1.55/arch/m68k/kernel/head.S	Thu Sep 25 22:35:51 1997
@@ -899,6 +899,7 @@
 /* jump to the kernel start */
 	putr()
 
+	subl	%a6,%a6		/* clear a6 for gdb */
 	jbsr	SYMBOL_NAME(start_kernel)
 
 /*
diff -u --recursive --exclude-from=diff-excludes --new-file linux-2.1.55.orig/arch/m68k/kernel/kgdb.c linux-2.1.55/arch/m68k/kernel/kgdb.c
--- linux-2.1.55.orig/arch/m68k/kernel/kgdb.c	Fri May 16 14:43:49 1997
+++ linux-2.1.55/arch/m68k/kernel/kgdb.c	Thu Sep 25 22:57:24 1997
@@ -1057,17 +1057,16 @@
 			return;
 
 			/*
-			 * kill the program
+			 * kill the program means reset the machine
 			 */
 		  case 'k' :
-			break;		/* do nothing */
-
-			/*
-			 * Reset the whole machine
-			 */
 		  case 'r':
-			if (mach_reset)
+			if (mach_reset) {
+				/* reply OK before actual reset */
+				strcpy(output_buffer,"OK");
+				putpacket(output_buffer);
 				(*mach_reset)();
+			}
 			else
 				strcpy(output_buffer,"E01");
 			break;

