diff packages/hal/powerpc/arch/current/src/hal_misc.c @ 38:e7ba79f6d3a8 ecos-sw-1999-09-23

Merge from eCos master repository on 1999-09-23-20:10:25-BST
author jlarmour
date Thu, 23 Sep 1999 19:52:27 +0000
parents e97d78785e2d
children 797268ecc331
line wrap: on
line diff
--- a/packages/hal/powerpc/arch/current/src/hal_misc.c
+++ b/packages/hal/powerpc/arch/current/src/hal_misc.c
@@ -103,11 +103,20 @@ externC void __handle_exception (void);
 
 externC HAL_SavedRegisters *_hal_registers;
 
+externC void *__mem_fault_handler;
+
 void
 cyg_hal_exception_handler(HAL_SavedRegisters *regs)
 {
 #ifdef 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.