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

Joel Sherrill joel at rtems.org
Thu Dec 7 12:23:11 UTC 2017


On Dec 7, 2017 7:16 AM, "Sebastian Huber" <
sebastian.huber at embedded-brains.de> wrote:

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:


The Classic API says that timesliced tasks are preemptive and timesliced.
So even in smp, this combination of constants should be supported. It is
only setting no preempt that is wrong.

So they are not exactly the same.


  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.


This I agree with.



-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierst
<https://maps.google.com/?q=s+:+Dornierst&entry=gmail&source=g>r. 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20171207/cd5dfe48/attachment-0002.html>


More information about the devel mailing list