diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-07-29 03:10:57 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-07-29 03:10:57 +0000 |
commit | bd07ce2b9b05b4bdd9310a5e80bca1769076c26e (patch) | |
tree | ef3bc8db87fc5488eb88b8f68d4f5334ab3bc522 | |
parent | ecfe89622d91d2325a2904c0582e29b57711f45b (diff) |
Make the remote kernel debugging support compile again. Not tested,
though.
-rw-r--r-- | arch/mips/kernel/gdb-low.S | 14 | ||||
-rw-r--r-- | arch/mips/kernel/gdb-stub.c | 99 |
2 files changed, 59 insertions, 54 deletions
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S index 6657bd77c..9a19d63ad 100644 --- a/arch/mips/kernel/gdb-low.S +++ b/arch/mips/kernel/gdb-low.S @@ -40,7 +40,7 @@ sw v0,GDB_FR_REG2(sp) /* - * first save the CP0 and special registers + * First save the CP0 and special registers */ mfc0 v0,CP0_STATUS @@ -98,7 +98,7 @@ /* * Followed by the floating point registers */ - mfc0 v0,CP0_STATUS /* check if the FPU is enabled */ + mfc0 v0,CP0_STATUS /* FPU enabled? */ srl v0,v0,16 andi v0,v0,(ST0_CU1 >> 16) @@ -148,7 +148,7 @@ sw v0,GDB_FR_FIR(sp) /* - * current stack frame ptr + * Current stack frame ptr */ 2: @@ -178,7 +178,7 @@ .set at /* - * continue with the higher level handler + * Continue with the higher level handler */ move a0,sp @@ -187,7 +187,7 @@ nop /* - * restore all writable registers, in reverse order + * Restore all writable registers, in reverse order */ .set noat @@ -298,9 +298,9 @@ lw $1,GDB_FR_REG1(sp) lw sp,GDB_FR_REG29(sp) /* Deallocate stack */ + .set mips3 eret + .set mips0 .set at .set reorder END(trap_low) - -/* end of file gdb-low.S */ diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c index adbb750d8..b327e3f37 100644 --- a/arch/mips/kernel/gdb-stub.c +++ b/arch/mips/kernel/gdb-stub.c @@ -12,7 +12,7 @@ * * Copyright (C) 1995 Andreas Busse * - * $Id: gdb-stub.c,v 1.2 1997/06/28 23:26:24 ralf Exp $ + * $Id: gdb-stub.c,v 1.2 1997/07/01 08:59:06 ralf Exp $ */ /* @@ -67,12 +67,14 @@ */ #include <linux/string.h> -#include <linux/signal.h> #include <linux/kernel.h> +#include <linux/signal.h> +#include <linux/sched.h> +#include <linux/mm.h> #include <asm/asm.h> #include <asm/mipsregs.h> -#include <asm/cachectl.h> +#include <asm/pgtable.h> #include <asm/system.h> #include <asm/gdb-stub.h> @@ -98,13 +100,11 @@ extern void adel(void); static void getpacket(char *buffer); static void putpacket(char *buffer); -static void set_mem_fault_trap(int enable); static int computeSignal(int tt); static int hex(unsigned char ch); static int hexToInt(char **ptr, int *intValue); static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault); void handle_exception(struct gdb_regs *regs); -static void show_gdbregs(struct gdb_regs *regs); /* * BUFMAX defines the maximum number of characters in inbound/outbound buffers @@ -241,6 +241,21 @@ static void putpacket(char *buffer) */ static volatile int mem_err = 0; + +#if 0 +static void set_mem_fault_trap(int enable) +{ + mem_err = 0; + +#if 0 + if (enable) + exceptionHandler(9, fltr_set_mem_err); + else + exceptionHandler(9, trap_low); +#endif +} +#endif /* dead code */ + /* * Convert the memory pointed to by mem into hex, placing result in buf. * Return a pointer to the last char put in buf (null), in case of mem fault, @@ -362,19 +377,6 @@ extern void fltr_set_mem_err(void) /* FIXME: Needs to be written... */ } - -static void set_mem_fault_trap(int enable) -{ - mem_err = 0; - -#if 0 - if (enable) - exceptionHandler(9, fltr_set_mem_err); - else - exceptionHandler(9, trap_low); -#endif -} - /* * Convert the MIPS hardware trap type code to a unix signal number. */ @@ -415,6 +417,38 @@ static int hexToInt(char **ptr, int *intValue) return (numChars); } + +#if 0 +/* + * Print registers (on target console) + * Used only to debug the stub... + */ +void show_gdbregs(struct gdb_regs * regs) +{ + /* + * Saved main processor registers + */ + printk("$0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + regs->reg0, regs->reg1, regs->reg2, regs->reg3, + regs->reg4, regs->reg5, regs->reg6, regs->reg7); + printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + regs->reg8, regs->reg9, regs->reg10, regs->reg11, + regs->reg12, regs->reg13, regs->reg14, regs->reg15); + printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + regs->reg16, regs->reg17, regs->reg18, regs->reg19, + regs->reg20, regs->reg21, regs->reg22, regs->reg23); + printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + regs->reg24, regs->reg25, regs->reg26, regs->reg27, + regs->reg28, regs->reg29, regs->reg30, regs->reg31); + + /* + * Saved cp0 registers + */ + printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n", + regs->cp0_epc, regs->cp0_status, regs->cp0_cause); +} +#endif /* dead code */ + /* * This function does all command processing for interfacing to gdb. It * returns 1 if you should skip the instruction at the trap address, 0 @@ -726,32 +760,3 @@ void adel(void) lw $9,0($8) "); } - -/* - * Print registers (on target console) - * Used only to debug the stub... - */ -void show_gdbregs(struct gdb_regs * regs) -{ - /* - * Saved main processor registers - */ - printk("$0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->reg0, regs->reg1, regs->reg2, regs->reg3, - regs->reg4, regs->reg5, regs->reg6, regs->reg7); - printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->reg8, regs->reg9, regs->reg10, regs->reg11, - regs->reg12, regs->reg13, regs->reg14, regs->reg15); - printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->reg16, regs->reg17, regs->reg18, regs->reg19, - regs->reg20, regs->reg21, regs->reg22, regs->reg23); - printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", - regs->reg24, regs->reg25, regs->reg26, regs->reg27, - regs->reg28, regs->reg29, regs->reg30, regs->reg31); - - /* - * Saved cp0 registers - */ - printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n", - regs->cp0_epc, regs->cp0_status, regs->cp0_cause); -} |