summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-29 16:09:35 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-05 08:26:27 +0200
commite239760f6a6a5e31331487548d56c4a7581ed7cc (patch)
treef8f80f50df7562c7bb2209747c8544589212f45f /cpukit/rtems
parentdoc: Add SMP glossary (diff)
downloadrtems-e239760f6a6a5e31331487548d56c4a7581ed7cc.tar.bz2
score: SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORS
Avoid the SMP_FATAL_SCHEDULER_WITHOUT_PROCESSORS fatal error and make it a run-time error in rtems_scheduler_ident() and _Scheduler_Get_by_id().
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/include/rtems/rtems/tasks.h2
-rw-r--r--cpukit/rtems/src/schedulerident.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/tasks.h b/cpukit/rtems/include/rtems/rtems/tasks.h
index a9016ce3f3..43e8c8ac9d 100644
--- a/cpukit/rtems/include/rtems/rtems/tasks.h
+++ b/cpukit/rtems/include/rtems/rtems/tasks.h
@@ -597,6 +597,8 @@ rtems_id rtems_task_self(void);
* @retval RTEMS_SUCCESSFUL Successful operation.
* @retval RTEMS_INVALID_ADDRESS The @a id parameter is @c NULL.
* @retval RTEMS_INVALID_NAME Invalid scheduler name.
+ * @retval RTEMS_UNSATISFIED A scheduler with this name exists, but the
+ * processor set of this scheduler is empty.
*/
rtems_status_code rtems_scheduler_ident(
rtems_name name,
diff --git a/cpukit/rtems/src/schedulerident.c b/cpukit/rtems/src/schedulerident.c
index d9e913c946..ee18af009e 100644
--- a/cpukit/rtems/src/schedulerident.c
+++ b/cpukit/rtems/src/schedulerident.c
@@ -33,9 +33,15 @@ rtems_status_code rtems_scheduler_ident(
sc = RTEMS_INVALID_NAME;
for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) {
- if ( _Scheduler_Table[ i ].name == name ) {
- *id = _Scheduler_Build_id( i );
- sc = RTEMS_SUCCESSFUL;
+ const Scheduler_Control *scheduler = &_Scheduler_Table[ i ];
+
+ if ( scheduler->name == name ) {
+ if ( _Scheduler_Get_processor_count( scheduler ) > 0 ) {
+ *id = _Scheduler_Build_id( i );
+ sc = RTEMS_SUCCESSFUL;
+ } else {
+ sc = RTEMS_UNSATISFIED;
+ }
}
}
} else {