diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-10 16:25:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-18 07:30:35 +0100 |
commit | 537f00ebe83370b8336361b8ae34d4a71e7023bb (patch) | |
tree | 6624d56181ff836c11162846074b6a841e3d0f9e | |
parent | powerpc: Use Per_CPU_Control::isr_dispatch_disable (diff) | |
download | rtems-537f00ebe83370b8336361b8ae34d4a71e7023bb.tar.bz2 |
score: Restrict task interrupt level to 0 on SMP
Update #2811.
-rw-r--r-- | cpukit/score/src/threadinitialize.c | 10 | ||||
-rw-r--r-- | testsuites/smptests/smpunsupported01/init.c | 18 |
2 files changed, 25 insertions, 3 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 2cbe13854c..9ae2acb9a0 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -60,8 +60,14 @@ bool _Thread_Initialize( Per_CPU_Control *cpu = _Per_CPU_Get_by_index( 0 ); #if defined( RTEMS_SMP ) - if ( rtems_configuration_is_smp_enabled() && !is_preemptible ) { - return false; + if ( rtems_configuration_is_smp_enabled() ) { + if ( !is_preemptible ) { + return false; + } + + if ( isr_level != 0 ) { + return false; + } } #endif diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c index 9d69b6bdc6..52c3181f70 100644 --- a/testsuites/smptests/smpunsupported01/init.c +++ b/testsuites/smptests/smpunsupported01/init.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2014 On-Line Applications Research Corporation (OAR). - * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013, 2016 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -41,6 +41,22 @@ static void test(void) &id ); rtems_test_assert(sc == RTEMS_UNSATISFIED); + + mode = RTEMS_INTERRUPT_LEVEL(1); + + if (mode != 0) { + sc = rtems_task_create( + rtems_build_name('T', 'A', 'S', 'K'), + RTEMS_MINIMUM_PRIORITY, + RTEMS_MINIMUM_STACK_SIZE, + mode, + RTEMS_DEFAULT_ATTRIBUTES, + &id + ); + rtems_test_assert(sc == RTEMS_UNSATISFIED); + } else { + puts("RTEMS_INTERRUPT_LEVEL(1) not supported on this platform"); + } } static void Init(rtems_task_argument arg) |