Blown Stack in ISR, i960

Ian Lance Taylor ian at zembu.com
Tue Jan 25 17:47:14 UTC 2000


   Date: Tue, 25 Jan 2000 18:19:38 +0100 (MET)
   From: Gerwin Pfab <pb at schenk.isar.de>

   BUT: every call to rtems_task_resume() decrements
   Thread_dispatch_disable_level and will (when 0 is reached) call
   ThreadDispatch() (and _Context_Switch()) and therefore make the Context
   Switch on the Interrupt stack. So the task that Context_Switch switches to
   now runs with the Interrupt Stack????!

   What is wrong with this scenario or is this really possible?

What's wrong with that scenario is that rtems_task_resume calls
_Thread_Get, and _Thread_Get calls _Thread_Disable_dispatch.  The call
to _Thread_Enable_dispatch in rtems_task_resume enables the
dispatching which it just disabled.  If dispatching was already
disabled when the call started, it remains disabled.

Ian



More information about the users mailing list