summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/userextimpl.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-11 13:47:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-12 09:44:44 +0200
commite97b7c9a7af2f4e19a8bdeaf13033617f8c4c2b6 (patch)
tree579598cfce50f24f2d7450e0c54f1eea6de0a023 /cpukit/include/rtems/score/userextimpl.h
parentscore: Add _ISR_lock_Set_name() (diff)
downloadrtems-e97b7c9a7af2f4e19a8bdeaf13033617f8c4c2b6.tar.bz2
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.
Diffstat (limited to 'cpukit/include/rtems/score/userextimpl.h')
-rw-r--r--cpukit/include/rtems/score/userextimpl.h23
1 files changed, 9 insertions, 14 deletions
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
}
}