summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/schedulerdefaultpinunpindonothing.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-17 08:49:56 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-21 07:39:09 +0200
commit3291b2a7d558d2b4095cdb8abba84ff3ed0dc59b (patch)
tree0e59b5c5dc01cb1295fda33d1afdccf92f8b6533 /cpukit/score/src/schedulerdefaultpinunpindonothing.c
parentscore: Provide two thread pin/unpin defaults (diff)
downloadrtems-3291b2a7d558d2b4095cdb8abba84ff3ed0dc59b.tar.bz2
score: Ensure only one CPU if required
Issue the new fatal SMP error SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR if the system starts with not exactly one processor and an uniprocessor scheduler is configured.
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/schedulerdefaultpinunpindonothing.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/score/src/schedulerdefaultpinunpindonothing.c b/cpukit/score/src/schedulerdefaultpinunpindonothing.c
index f7bab4f661..f3ecb0b718 100644
--- a/cpukit/score/src/schedulerdefaultpinunpindonothing.c
+++ b/cpukit/score/src/schedulerdefaultpinunpindonothing.c
@@ -39,6 +39,9 @@
#endif
#include <rtems/score/scheduler.h>
+#include <rtems/score/interr.h>
+#include <rtems/score/smpimpl.h>
+#include <rtems/sysinit.h>
void _Scheduler_default_Pin_or_unpin_do_nothing(
const Scheduler_Control *scheduler,
@@ -52,3 +55,19 @@ void _Scheduler_default_Pin_or_unpin_do_nothing(
(void) node;
(void) cpu;
}
+
+static void _Scheduler_Ensure_exactly_one_processor( void )
+{
+ if ( _SMP_Get_processor_maximum() != 1 ) {
+ _Terminate(
+ RTEMS_FATAL_SOURCE_SMP,
+ SMP_FATAL_SCHEDULER_REQUIRES_EXACTLY_ONE_PROCESSOR
+ );
+ }
+}
+
+RTEMS_SYSINIT_ITEM(
+ _Scheduler_Ensure_exactly_one_processor,
+ RTEMS_SYSINIT_SCHEDULER,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);