From 7206675c40394c78a90e74812bbdbf8cf3cca1be Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 25 Mar 1997 23:40:36 +0000 Subject: Import of Linux/MIPS 2.1.14.2 --- arch/mips/kernel/gdb-stub.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'arch/mips/kernel/gdb-stub.c') diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c index 9a3240152..13bf353ff 100644 --- a/arch/mips/kernel/gdb-stub.c +++ b/arch/mips/kernel/gdb-stub.c @@ -68,10 +68,10 @@ #include #include -#include #include #include -#include +#include +#include #include #include @@ -326,7 +326,10 @@ static struct hard_trap_info void set_debug_traps(void) { struct hard_trap_info *ht; + unsigned long flags; + unsigned char c; + save_flags(flags); cli(); for (ht = hard_trap_info; ht->tt && ht->signo; ht++) set_except_vector(ht->tt, trap_low); @@ -334,9 +337,14 @@ void set_debug_traps(void) * 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 +613,7 @@ void handle_exception (struct gdb_regs *regs) * NB: We flush both caches, just to be sure... */ - cacheflush((void *)KSEG0, KSEG1-KSEG0, CF_BCACHE|CF_ALL); + flush_cache_all(); return; /* NOTREACHED */ break; -- cgit v1.2.3