[rtems commit] score: Restrict task interrupt level to 0 on SMP
Sebastian Huber
sebh at rtems.org
Fri Nov 18 07:04:01 UTC 2016
Module: rtems
Branch: master
Commit: 537f00ebe83370b8336361b8ae34d4a71e7023bb
Changeset: http://git.rtems.org/rtems/commit/?id=537f00ebe83370b8336361b8ae34d4a71e7023bb
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Nov 10 16:25:41 2016 +0100
score: Restrict task interrupt level to 0 on SMP
Update #2811.
---
cpukit/score/src/threadinitialize.c | 10 ++++++++--
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 2cbe138..9ae2acb 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 9d69b6b..52c3181 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)
More information about the vc
mailing list