[Bug 1868] LM32 interrupt handler is broken

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Mon Aug 1 11:20:03 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1868

Sebastian Huber <sebastian.huber at embedded-brains.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sebastian.huber at embedded-br
                   |                            |ains.de

--- Comment #2 from Sebastian Huber <sebastian.huber at embedded-brains.de> 2011-08-01 06:20:02 CDT ---
You should be careful with this sequence:

+    if( !_Thread_Dispatch_in_critical_section() )
+    {
+      if ( _Thread_Dispatch_necessary ) {
+        _CPU_ISR_Enable( level );
+        /* save off our stack frame so the context switcher can get to it */
+        _exception_stack_frame = ifr;
+        _Thread_Dispatch();
+        /* and make sure its clear in case we didn't dispatch. if we did, its
+         * already cleared */
+        _exception_stack_frame = NULL;
+        /* may have switched to another task and not return here immed. */
+        _CPU_ISR_Disable( level ); /* Keep _pairs_ of Enable/Disable */
+      }
+    }
+  }

Enabling the interrupts during the thread dispatch may lead to unlimited stack
usage.  On the PowerPC for example interrupts are disabled during a thread
dispatch initiated through an interrupt.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list