5
Last change
on this file since d78d529 was
2612a0b,
checked in by Sebastian Huber <sebastian.huber@…>, on 11/02/16 at 05:36:13
|
score: Simplify _Scheduler_Get_by_id()
Avoid dead code in non-SMP configurations. Return scheduler identifier
independent of the current processor count of the scheduler via
rtems_scheduler_ident(), since this value may change during run-time.
Check the processor count in _Scheduler_Set() under scheduler lock
protection.
Update #2797.
|
-
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 | #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) |
---|
20 | |
---|
21 | #include <rtems/rtems/tasks.h> |
---|
22 | #include <rtems/score/cpusetimpl.h> |
---|
23 | #include <rtems/score/schedulerimpl.h> |
---|
24 | |
---|
25 | rtems_status_code rtems_scheduler_get_processor_set( |
---|
26 | rtems_id scheduler_id, |
---|
27 | size_t cpusetsize, |
---|
28 | cpu_set_t *cpuset |
---|
29 | ) |
---|
30 | { |
---|
31 | const Scheduler_Control *scheduler; |
---|
32 | |
---|
33 | if ( cpuset == NULL ) { |
---|
34 | return RTEMS_INVALID_ADDRESS; |
---|
35 | } |
---|
36 | |
---|
37 | scheduler = _Scheduler_Get_by_id( scheduler_id ); |
---|
38 | if ( scheduler == NULL ) { |
---|
39 | return RTEMS_INVALID_ID; |
---|
40 | } |
---|
41 | |
---|
42 | if ( !_CPU_set_Is_large_enough( cpusetsize ) ) { |
---|
43 | return RTEMS_INVALID_NUMBER; |
---|
44 | } |
---|
45 | |
---|
46 | _Scheduler_Get_processor_set( scheduler, cpusetsize, cpuset ); |
---|
47 | |
---|
48 | return RTEMS_SUCCESSFUL; |
---|
49 | } |
---|
50 | |
---|
51 | #endif /* defined(__RTEMS_HAVE_SYS_CPUSET_H__) */ |
---|
Note: See
TracBrowser
for help on using the repository browser.