[rtems commit] taskmode.c: Ensure all error checking is done before modifying executing

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Dec 7 12:15:58 UTC 2017


On 07/12/17 12:42, Joel Sherrill wrote:
> Other than fixing those tests for smp, is it bad to just say the 
> interrupt disable part of task mode isn't supported in smp?

Here the RTEMS_PREEMPT_MASK and RTEMS_INTERRUPT_MASK are not treated 
equally:

   if ( rtems_configuration_is_smp_enabled() ) {
     if ( mask & RTEMS_PREEMPT_MASK ) {
       if ( !_Modes_Is_preempt( mode_set ) ) {
         return RTEMS_NOT_IMPLEMENTED;
       }
     }

     if ( mask & RTEMS_INTERRUPT_MASK ) {
       return RTEMS_NOT_IMPLEMENTED;
     }
   }

rtems_task_mode(RTEMS_PREEMPT_MASK, RTEMS_PREEMPT, ...) is ok, but
rtems_task_mode(RTEMS_INTERRUPT_MASK, RTEMS_INTERRUPT_LEVEL(0), ...) is 
not ok?

The rtems_task_mode() looks pretty broken now. There should be no:

#if !defined( RTEMS_SMP )

A rtems_configuration_is_smp_enabled() inside a #if !defined( RTEMS_SMP) 
block makes no sense.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list