Index: include/thread.hxx =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/include/thread.hxx,v retrieving revision 1.10 diff -u -r1.10 thread.hxx --- include/thread.hxx 23 May 2002 23:06:51 -0000 1.10 +++ include/thread.hxx 17 Jul 2003 07:32:20 -0000 @@ -75,6 +75,8 @@ class Cyg_HardwareThread { friend class Cyg_Scheduler; + + CYG_ADDRESS fc_static; // exception handler pointer for this thread protected: Index: include/thread.inl =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/include/thread.inl,v retrieving revision 1.15 diff -u -r1.15 thread.inl --- include/thread.inl 10 Feb 2003 22:02:16 -0000 1.15 +++ include/thread.inl 17 Jul 2003 07:32:20 -0000 @@ -269,6 +269,7 @@ CYG_ADDRESS s_base // stack base, NULL = allocate ) { + fc_static = NULL; entry_point = e_point; entry_data = e_data; #ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT Index: src/sched/sched.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/src/sched/sched.cxx,v retrieving revision 1.16 diff -u -r1.16 sched.cxx --- src/sched/sched.cxx 9 Aug 2002 17:13:28 -0000 1.16 +++ src/sched/sched.cxx 17 Jul 2003 07:32:20 -0000 @@ -83,6 +83,14 @@ # endif // trace implementation not ..._SIMPLE && not ..._FANCY #endif // CYGDBG_USE_TRACING +// During thread context switch we update the current exception +// function context. +extern "C" +{ +extern struct SjLj_Function_Context *fc_static; +} + + // ------------------------------------------------------------------------- // Static Cyg_Scheduler class members @@ -199,6 +207,9 @@ next->check_stack(); // before running it #endif + current->fc_static=(CYG_ADDRESS)fc_static; + fc_static=(struct SjLj_Function_Context *)next->fc_static; + // Switch contexts HAL_THREAD_SWITCH_CONTEXT( ¤t->stack_ptr, &next->stack_ptr );