summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/sparc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-08 10:11:13 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-08 13:02:40 +0200
commit11b05f11d4d6d61717e345d20f492977b95ab131 (patch)
tree5f5bd2a21ea205ea0700d44718de7fcac8234fe7 /cpukit/score/cpu/sparc
parentdoc: Use @dfn for glossary terms (diff)
downloadrtems-11b05f11d4d6d61717e345d20f492977b95ab131.tar.bz2
score: Fix CPU context usage on SMP
We must not alter the is executing indicator in _CPU_Context_Initialize() since this would cause an invalid state during a self restart. The is executing indicator must be valid at creation time since otherwise _Thread_Kill_zombies() uses an undefined value for not started threads. This could result in a system life lock.
Diffstat (limited to 'cpukit/score/cpu/sparc')
-rw-r--r--cpukit/score/cpu/sparc/cpu.c4
-rw-r--r--cpukit/score/cpu/sparc/rtems/score/cpu.h16
2 files changed, 14 insertions, 6 deletions
diff --git a/cpukit/score/cpu/sparc/cpu.c b/cpukit/score/cpu/sparc/cpu.c
index d05c511162..ee0d622067 100644
--- a/cpukit/score/cpu/sparc/cpu.c
+++ b/cpukit/score/cpu/sparc/cpu.c
@@ -330,10 +330,6 @@ void _CPU_Context_Initialize(
*/
the_context->isr_dispatch_disable = 0;
-#if defined(RTEMS_SMP)
- the_context->is_executing = false;
-#endif
-
if ( tls_area != NULL ) {
void *tcb = _TLS_TCB_after_TLS_block_initialize( tls_area );
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index 7bcdbd9b37..b931d2f103 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -488,8 +488,20 @@ typedef struct {
(_context)->o6_sp
#ifdef RTEMS_SMP
- #define _CPU_Context_Get_is_executing( _context ) \
- (_context)->is_executing
+ static inline bool _CPU_Context_Get_is_executing(
+ const Context_Control *context
+ )
+ {
+ return context->is_executing;
+ }
+
+ static inline void _CPU_Context_Set_is_executing(
+ Context_Control *context,
+ bool is_executing
+ )
+ {
+ context->is_executing = is_executing;
+ }
#endif
#endif /* ASM */