diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-05-23 15:32:32 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-05-26 08:56:44 +0200 |
commit | d134adeba3abd0fef8ed2046cc5bf7f877d7a77c (patch) | |
tree | 4ad0cb5a60e30d196c21654213b953685ca5d3ce /cpukit/score/include/rtems/score/smpimpl.h | |
parent | bsp/gdbarmsim: Change syscall functions to not clash with RTEMS functions. (diff) | |
download | rtems-d134adeba3abd0fef8ed2046cc5bf7f877d7a77c.tar.bz2 |
score: Fix race condition in SMP startup
Do not use the Per_CPU_Control::started in
_SMP_Start_multitasking_on_secondary_processor() since this field may be
not up to date when a secondary processor reads it. Use the read-only
scheduler assignment instead.
Add a new fatal error SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR.
This prevents out-of-bounds access.
It is currently not possible to test these fatal errors. One option
would be to fake values of the _CPU_SMP_Get_current_processor(), but
unfortunately this function is inline on some architectures.
Diffstat (limited to 'cpukit/score/include/rtems/score/smpimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/smpimpl.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h index 3ee7aa25d0..70475ba22c 100644 --- a/cpukit/score/include/rtems/score/smpimpl.h +++ b/cpukit/score/include/rtems/score/smpimpl.h @@ -60,7 +60,8 @@ typedef enum { SMP_FATAL_MANDATORY_PROCESSOR_NOT_PRESENT, SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR, SMP_FATAL_START_OF_MANDATORY_PROCESSOR_FAILED, - SMP_FATAL_SHUTDOWN_RESPONSE + SMP_FATAL_SHUTDOWN_RESPONSE, + SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR } SMP_Fatal_code; static inline void _SMP_Fatal( SMP_Fatal_code code ) |