From d5e073cde70211b2471e4366be397370e9f6ce48 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 11 Nov 2016 14:37:51 +0100 Subject: score: Allow interrupts during thread dispatch Use a processor-specific interrupt frame during context switches in case the executing thread is longer executes on the processor and the heir thread is about to start execution. During this period we must not use a thread stack for interrupt processing. Update #2809. --- cpukit/score/include/rtems/score/userextimpl.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cpukit/score/include/rtems/score/userextimpl.h') diff --git a/cpukit/score/include/rtems/score/userextimpl.h b/cpukit/score/include/rtems/score/userextimpl.h index e175c9f0a5..e6692c8749 100644 --- a/cpukit/score/include/rtems/score/userextimpl.h +++ b/cpukit/score/include/rtems/score/userextimpl.h @@ -261,8 +261,16 @@ static inline void _User_extensions_Thread_switch( const Chain_Node *node = _Chain_Immutable_first( chain ); if ( node != tail ) { - Per_CPU_Control *cpu_self = _Per_CPU_Get(); + Per_CPU_Control *cpu_self; +#if defined(RTEMS_SMP) + ISR_Level level; +#endif + + cpu_self = _Per_CPU_Get(); +#if defined(RTEMS_SMP) + _ISR_Local_disable( level ); +#endif _Per_CPU_Acquire( cpu_self ); while ( node != tail ) { @@ -275,6 +283,9 @@ static inline void _User_extensions_Thread_switch( } _Per_CPU_Release( cpu_self ); +#if defined(RTEMS_SMP) + _ISR_Local_enable( level ); +#endif } } -- cgit v1.2.3