From 6953e68e51ce02dcfdb83a8a9033f962ae64c97d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 8 Feb 2002 23:27:26 +0000 Subject: 2002-02-08 Joel Sherrill * mips-stub.c (handle_exception): Prototype changed to be an RTEMS entry point. Added comments about possible need to flush cache. (mips_gdb_stub_install): New routine. --- c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog | 6 ++++++ c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c | 25 ++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) (limited to 'c/src/lib') diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog b/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog index 1fd3679b3f..3ee2b5418a 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog +++ b/c/src/lib/libbsp/mips/shared/gdbstub/ChangeLog @@ -1,3 +1,9 @@ +2002-02-08 Joel Sherrill + + * mips-stub.c (handle_exception): Prototype changed to be an RTEMS + entry point. Added comments about possible need to flush cache. + (mips_gdb_stub_install): New routine. + 2002-02-08 Joel Sherrill * Makefile, stubinit.S, r46kstub.ld, ioaddr.h: Removed as unused diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c index 5eb8b78355..6ff496a050 100644 --- a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c +++ b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c @@ -779,8 +779,7 @@ computeSignal (void) * it figures out why it was activated and tells gdb, and then it * reacts to gdb's requests. */ -void -handle_exception (CPU_Interrupt_frame *frame) +void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame) { int host_has_detached = 0; int sigval; @@ -906,5 +905,27 @@ handle_exception (CPU_Interrupt_frame *frame) /* reply to the request */ putpacket (outBuffer); } + + /* + * The original code did this in the assembly wrapper. We should consider + * doing it here before we return. + * + * On exit from the exception handler invalidate each line in the I-cache + * and write back each dirty line in the D-cache. This needs to be done + * before the target program is resumed in order to ensure that software + * breakpoints and downloaded code will actually take effect. + */ + return; } + +void mips_gdb_stub_install(void) +{ + rtems_isr_entry old; + + rtems_interrupt_catch( (rtems_isr_entry) handle_exception, MIPS_EXCEPTION_SYSCALL, &old ); + /* rtems_interrupt_catch( handle_exception, MIPS_EXCEPTION_BREAK, &old ); */ + + /* get the attention of gdb */ + mips_break(); +} -- cgit v1.2.3