5
Last change
on this file since 2dd098a was
2dd098a,
checked in by Sebastian Huber <sebastian.huber@…>, on 10/31/16 at 07:33:11
|
score: Introduce Thread_Scheduler_control::home
Replace Thread_Scheduler_control::control and
Thread_Scheduler_control::own_control with new
Thread_Scheduler_control::home.
Update #2556.
|
-
Property mode set to
100644
|
File size:
999 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Returns the Appropriate Maximum for Scheduling policy |
---|
5 | * @ingroup POSIXAPI |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 |
---|
10 | * |
---|
11 | * COPYRIGHT (c) 1989-2007. |
---|
12 | * On-Line Applications Research Corporation (OAR). |
---|
13 | * |
---|
14 | * The license and distribution terms for this file may be |
---|
15 | * found in the file LICENSE in this distribution or at |
---|
16 | * http://www.rtems.org/license/LICENSE. |
---|
17 | */ |
---|
18 | |
---|
19 | #if HAVE_CONFIG_H |
---|
20 | #include "config.h" |
---|
21 | #endif |
---|
22 | |
---|
23 | #include <sched.h> |
---|
24 | |
---|
25 | #include <rtems/seterr.h> |
---|
26 | #include <rtems/posix/priorityimpl.h> |
---|
27 | #include <rtems/score/schedulerimpl.h> |
---|
28 | |
---|
29 | int sched_get_priority_max( |
---|
30 | int policy |
---|
31 | ) |
---|
32 | { |
---|
33 | const Scheduler_Control *scheduler; |
---|
34 | |
---|
35 | switch ( policy ) { |
---|
36 | case SCHED_OTHER: |
---|
37 | case SCHED_FIFO: |
---|
38 | case SCHED_RR: |
---|
39 | case SCHED_SPORADIC: |
---|
40 | break; |
---|
41 | |
---|
42 | default: |
---|
43 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
44 | } |
---|
45 | |
---|
46 | scheduler = _Thread_Scheduler_get_home( _Thread_Get_executing() ); |
---|
47 | return _POSIX_Priority_Get_maximum( scheduler ); |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.