patch-2.1.44 linux/arch/mips/kernel/gdb-stub.c

Next file: linux/arch/mips/kernel/head.S
Previous file: linux/arch/mips/kernel/gdb-low.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.43/linux/arch/mips/kernel/gdb-stub.c linux/arch/mips/kernel/gdb-stub.c
@@ -11,6 +11,8 @@
  *  Send complaints, suggestions etc. to <andy@waldorf-gmbh.de>
  *
  *  Copyright (C) 1995 Andreas Busse
+ *
+ * $Id: gdb-stub.c,v 1.4 1997/06/30 15:52:25 ralf Exp $
  */
 
 /*
@@ -70,7 +72,6 @@
 
 #include <asm/asm.h>
 #include <asm/mipsregs.h>
-#include <asm/segment.h>
 #include <asm/cachectl.h>
 #include <asm/system.h>
 #include <asm/gdb-stub.h>
@@ -326,7 +327,10 @@
 void set_debug_traps(void)
 {
 	struct hard_trap_info *ht;
+	unsigned long flags;
+	unsigned char c;
 
+	save_and_cli(flags);
 	for (ht = hard_trap_info; ht->tt && ht->signo; ht++)
 		set_except_vector(ht->tt, trap_low);
   
@@ -334,9 +338,14 @@
 	 * In case GDB is started before us, ack any packets
 	 * (presumably "$?#xx") sitting there.
 	 */
+	while((c = getDebugChar()) != '$');
+	while((c = getDebugChar()) != '#');
+	c = getDebugChar(); /* eat first csum byte */
+	c = getDebugChar(); /* eat second csum byte */
+	putDebugChar('+'); /* ack it */
 
-	putDebugChar ('+');
 	initialized = 1;
+	restore_flags(flags);
 
 	breakpoint();
 }
@@ -605,7 +614,7 @@
 			 * NB: We flush both caches, just to be sure...
 			 */
 
-			sys_cacheflush((void *)KSEG0,KSEG1-KSEG0,BCACHE);
+			flush_cache_all();
 			return;
 			/* NOTREACHED */
 			break;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov