diff packages/hal/mips/arch/current/src/hal_misc.c @ 36:e97d78785e2d ecos-sw-1999-09-12

Merge from eCos master repository on 1999-09-12-15:40:34-BST
author jlarmour
date Sun, 12 Sep 1999 15:26:05 +0000
parents 4741a3c3496a
children e7ba79f6d3a8
line wrap: on
line diff
--- a/packages/hal/mips/arch/current/src/hal_misc.c
+++ b/packages/hal/mips/arch/current/src/hal_misc.c
@@ -68,6 +68,8 @@ externC void __handle_exception (void);
 
 externC HAL_SavedRegisters *_hal_registers;
 
+externC void *__mem_fault_handler;
+
 externC cyg_uint8 cyg_hal_mips_process_fpe( HAL_SavedRegisters *regs );
 
 externC void exception_handler(HAL_SavedRegisters *regs)
@@ -88,6 +90,13 @@ externC void exception_handler(HAL_Saved
 
 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
 
+    // If we caught an exception inside the stubs, see if we were expecting it
+    // and if so jump to the saved address
+    if (__mem_fault_handler) {
+        regs->pc = (CYG_ADDRWORD)__mem_fault_handler;
+        return; // Caught an exception inside stubs        
+    }
+
     // Set the pointer to the registers of the current exception
     // context. At entry the GDB stub will expand the
     // HAL_SavedRegisters structure into a (bigger) register array.