4.115
Last change
on this file since e239760 was
e239760,
checked in by Sebastian Huber <sebastian.huber@…>, on 04/29/14 at 14:09:35
|
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().
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2014 embedded brains GmbH. All rights reserved. |
---|
3 | * |
---|
4 | * embedded brains GmbH |
---|
5 | * Dornierstr. 4 |
---|
6 | * 82178 Puchheim |
---|
7 | * Germany |
---|
8 | * <rtems@embedded-brains.de> |
---|
9 | * |
---|
10 | * The license and distribution terms for this file may be |
---|
11 | * found in the file LICENSE in this distribution or at |
---|
12 | * http://www.rtems.org/license/LICENSE. |
---|
13 | */ |
---|
14 | |
---|
15 | #if HAVE_CONFIG_H |
---|
16 | #include "config.h" |
---|
17 | #endif |
---|
18 | |
---|
19 | #include <rtems/rtems/tasks.h> |
---|
20 | #include <rtems/score/schedulerimpl.h> |
---|
21 | |
---|
22 | rtems_status_code rtems_scheduler_ident( |
---|
23 | rtems_name name, |
---|
24 | rtems_id *id |
---|
25 | ) |
---|
26 | { |
---|
27 | rtems_status_code sc; |
---|
28 | |
---|
29 | if ( id != NULL ) { |
---|
30 | size_t n = _Scheduler_Count; |
---|
31 | size_t i; |
---|
32 | |
---|
33 | sc = RTEMS_INVALID_NAME; |
---|
34 | |
---|
35 | for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) { |
---|
36 | const Scheduler_Control *scheduler = &_Scheduler_Table[ i ]; |
---|
37 | |
---|
38 | if ( scheduler->name == name ) { |
---|
39 | if ( _Scheduler_Get_processor_count( scheduler ) > 0 ) { |
---|
40 | *id = _Scheduler_Build_id( i ); |
---|
41 | sc = RTEMS_SUCCESSFUL; |
---|
42 | } else { |
---|
43 | sc = RTEMS_UNSATISFIED; |
---|
44 | } |
---|
45 | } |
---|
46 | } |
---|
47 | } else { |
---|
48 | sc = RTEMS_INVALID_ADDRESS; |
---|
49 | } |
---|
50 | |
---|
51 | return sc; |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.