From e97b7c9a7af2f4e19a8bdeaf13033617f8c4c2b6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 11 Apr 2019 13:47:50 +0200 Subject: score: Use an ISR lock for Per_CPU_Control::Lock The use of a hand crafted lock for Per_CPU_Control::Lock was necessary at some point in the SMP support development, but it is no longer justified. --- cpukit/include/rtems/score/userextimpl.h | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'cpukit/include/rtems/score/userextimpl.h') diff --git a/cpukit/include/rtems/score/userextimpl.h b/cpukit/include/rtems/score/userextimpl.h index b781773863..851e28c179 100644 --- a/cpukit/include/rtems/score/userextimpl.h +++ b/cpukit/include/rtems/score/userextimpl.h @@ -261,34 +261,29 @@ static inline void _User_extensions_Thread_switch( node = _Chain_Immutable_first( chain ); if ( node != tail ) { - Per_CPU_Control *cpu_self; #if defined(RTEMS_SMP) - ISR_Level level; -#endif + ISR_lock_Context lock_context; + Per_CPU_Control *cpu_self; cpu_self = _Per_CPU_Get(); -#if defined(RTEMS_SMP) - _ISR_Local_disable( level ); -#endif - _Per_CPU_Acquire( cpu_self ); + _ISR_lock_ISR_disable( &lock_context ); + _Per_CPU_Acquire( cpu_self, &lock_context ); -#if defined(RTEMS_SMP) node = _Chain_Immutable_first( chain ); #endif while ( node != tail ) { - const User_extensions_Switch_control *extension = - (const User_extensions_Switch_control *) node; - - (*extension->thread_switch)( executing, heir ); + const User_extensions_Switch_control *extension; + extension = (const User_extensions_Switch_control *) node; node = _Chain_Immutable_next( node ); + (*extension->thread_switch)( executing, heir ); } - _Per_CPU_Release( cpu_self ); #if defined(RTEMS_SMP) - _ISR_Local_enable( level ); + _Per_CPU_Release( cpu_self, &lock_context ); + _ISR_lock_ISR_enable( &lock_context ); #endif } } -- cgit v1.2.3