summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/gdb-stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/gdb-stub.c')
-rw-r--r--arch/mips/kernel/gdb-stub.c16
1 files changed, 12 insertions, 4 deletions
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 <linux/signal.h>
#include <linux/kernel.h>
-#include <asm/addrspace.h>
#include <asm/asm.h>
#include <asm/mipsregs.h>
-#include <asm/cache.h>
+#include <asm/segment.h>
+#include <asm/cachectl.h>
#include <asm/system.h>
#include <asm/gdb-stub.h>
@@ -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;