[PATCH] fix compiling warning

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 16 06:42:55 UTC 2023


On 13.01.23 10:49, Zhu Zhongjie wrote:
> diff --git a/cpukit/include/rtems/score/threaddispatch.h b/cpukit/include/rtems/score/threaddispatch.h
> index 589935823f..ce20378d02 100644
> --- a/cpukit/include/rtems/score/threaddispatch.h
> +++ b/cpukit/include/rtems/score/threaddispatch.h
> @@ -224,15 +224,11 @@ static inline Per_CPU_Control *_Thread_Dispatch_disable( void )
>     Per_CPU_Control  *cpu_self;
>     ISR_lock_Context  lock_context;
>   
> -#if defined( RTEMS_SMP ) || defined( RTEMS_PROFILING )
>     _ISR_lock_ISR_disable( &lock_context );
> -#endif
>   
>     cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
>   
> -#if defined( RTEMS_SMP ) || defined( RTEMS_PROFILING )
>     _ISR_lock_ISR_enable( &lock_context );
> -#endif
>   
>     return cpu_self;
>   }

In RTEMS_SMP configurations, you need the interrupt disable/enable to 
prevent that the executing thread suddenly moves from one processor to 
another while you increment the thread dispatch disable level which is a 
processor-specific variable.

In RTEMS_PROFILING configurations, you need the interrupt disable/enable 
to get consistent statistics.

In all other configurations, there is no need to disable/enable 
interrupts, so this patch would be a performance regression.

The warning needs to be fixed differently.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list