rtems_semaphore_obtain

Joel Sherrill joel.sherrill at oarcorp.com
Thu Mar 29 20:13:06 UTC 2007


Sergei Organov wrote:
> "Johan Zandin" <johan.zandin at space.se> writes:
> [...]
>   
>>        _Context_Switch( &executing->Registers, &heir->Registers );
>>
>>        executing = _Thread_Executing;
>>
>>        _ISR_Disable( level );         -----+
>>                                            |  Region where
>>     }                                      |  an occuring 
>>                                            |  interrupt
>>      _Thread_Dispatch_disable_level = 0;   |  causes problems
>>                                            |
>>      _ISR_Enable( level );            -----+
>>     
>
> But how interrupt can occur when it's disabled in this region?! If
> _ISR_Disable()/_ISR_Enable() don't work on your target, you have hard
> trouble anyway.
>   

They sent me their code privately and it IS NOT!!!!! a semaphore bug.  I can
duplicate it with events.

My suspicion based upon the trace and my investigation is that it is a 
SPARC
specific bug in the system call trap handler.  You have to make a system 
call
to disable interrupts on the SPARC and that code is getting interrupted.  My
memory says that we did a trap do it couldn't get interrupted.

The trap is occurring the "magic" state of Thread Dispatch from an ISR where
the code does some magic out of the ISR.  It is also possible that the 
CPU state is
not quite restored to the same state as when a thread executes and something
about the system call doesn't behave the same because of that.

I don't know for sure and have sent the test to Jiri Gaisler so he can give
advice.  He wrote the system call handler.

--joel
> -- Sergei.
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list