_Internal_error_Occurred from rtems_semaphore_obtain in rtems_termios_write

Kenneth J. Peters Kenneth.J.Peters at jpl.nasa.gov
Wed Aug 30 20:58:35 UTC 2006


Of course, as soon as I sent to the list, I found more info. I see 
now that the magic "18" corresponds to RTEMS_CALLED_FROM_ISR from 
cpukit/rtems/include/rtems/rtems/status.h
and from doc/porting/interrupts.t I see that 
_Thread_Dispatch_disable_level is basically saying I'm in a trap 
somewhere.

It still seems to me that _CORE_mutex_Seize should use a defined 
value, either from the RTEMS status values or from the internal 
errors list. Those two lists of values do not agree at all entries.

Ken

>I'm getting _Internal_error_Occurred called from 
>rtems_semaphore_obtain in rtems_termios_write.
>
>Sparc erc32-based BSP on custom hardware.
>
>Two issues:
>
>1. The _Internal_error_Occurred call is actually in 
>cpukit/score/include/rtems/score/coremutex.h
>and is just called with a hardcoded number, not an 
>Internal_errors_Core_list enum item from 
>cpukit/score/include/rtems/score/interr.h
>
>>#define _CORE_mutex_Seize( \
>>   _the_mutex, _id, _wait, _timeout, _level ) \
>>   do { \
>>     if ( _Thread_Dispatch_disable_level \
>>         && (_wait) \
>>         && (_System_state_Get() >= SYSTEM_STATE_BEGIN_MULTITASKING ) \
>>        ) { \
>>         _Internal_error_Occurred( \
>>                             INTERNAL_ERROR_CORE, \
>>                             FALSE, \
>>                             18 /* called from wrong environment */); \
>>     } \
>
>Seems like this error code should be in the 
>Internal_errors_Core_list enum . I don't know if there are any other 
>hardcoded error values elsewhere.
>
>2. I have not traced all through my code yet, or created a simple 
>example. It could be that I am just doing something stupid like 
>accidentally trying to print in a trap handler. However, if some 
>kernel expert can explain a little about 
>_Thread_Dispatch_disable_level, that might help me figure out what's 
>going on. I am in multitasking when the error occurs, and the obtain 
>call is with RTEMS_WAIT, so those make general sense to me.
>
>Ken Peters
>Ken.Peters at jpl.nasa.gov




More information about the users mailing list