diff packages/hal/powerpc/arch/current/include/hal_arch.h @ 818:c9e9d4163174

* include/hal_arch.h (HAL_THREAD_INIT_CONTEXT): Initialize what would be FP and LR in the previous stack frame to make GDB backtraces happy.
author jlarmour
date Sat, 08 Mar 2003 03:39:19 +0000
parents d2c90368aeef
children 9c818dd5d9fa
line wrap: on
line diff
--- a/packages/hal/powerpc/arch/current/include/hal_arch.h
+++ b/packages/hal/powerpc/arch/current/include/hal_arch.h
@@ -144,6 +144,8 @@ externC void cyg_hal_deliver_exception( 
                                  - CYGARC_PPC_STACK_FRAME_SIZE;               \
     register HAL_SavedRegisters *_regs_;                                      \
     int _i_;                                                                  \
+    ((CYG_WORD *)_sp_)[0] = 0;            /* Zero old FP and LR for EABI */   \
+    ((CYG_WORD *)_sp_)[1] = 0;            /* to make GDB backtraces sane */   \
     _regs_ = (HAL_SavedRegisters *)((_sp_) - sizeof(HAL_SavedRegisters));     \
     for( _i_ = 0; _i_ < 32; _i_++ ) (_regs_)->d[_i_] = (_id_)|_i_;            \
     (_regs_)->d[01] = (CYG_WORD)(_sp_);        /* SP = top of stack      */   \