diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-10 08:48:54 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-22 14:36:40 +0200 |
commit | 77ff5599e0d8e6d91190a379be21a332f83252b0 (patch) | |
tree | 339e28b236beb9e606322cb801d7340e2e44f8bf /cpukit/posix/src/psxpriorityisvalid.c | |
parent | score: Delete unused _Scheduler_Priority_compare() (diff) | |
download | rtems-77ff5599e0d8e6d91190a379be21a332f83252b0.tar.bz2 |
score: Introduce map priority scheduler operation
Introduce map/unmap priority scheduler operations to map thread priority
values from/to the user domain to/from the scheduler domain. Use the
map priority operation to validate the thread priority. The EDF
schedulers use this new operation to distinguish between normal
priorities and priorities obtain through a job release.
Update #2173.
Update #2556.
Diffstat (limited to 'cpukit/posix/src/psxpriorityisvalid.c')
-rw-r--r-- | cpukit/posix/src/psxpriorityisvalid.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cpukit/posix/src/psxpriorityisvalid.c b/cpukit/posix/src/psxpriorityisvalid.c index 22c4ac0b87..7c2300b4d6 100644 --- a/cpukit/posix/src/psxpriorityisvalid.c +++ b/cpukit/posix/src/psxpriorityisvalid.c @@ -19,6 +19,7 @@ #endif #include <rtems/posix/priorityimpl.h> +#include <rtems/score/schedulerimpl.h> int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler ) { @@ -44,5 +45,15 @@ Priority_Control _POSIX_Priority_To_core( *valid = ( posix_priority >= POSIX_SCHEDULER_MINIMUM_PRIORITY && core_posix_priority < scheduler->maximum_priority ); - return core_priority; + return _Scheduler_Map_priority( scheduler, core_priority ); +} + +int _POSIX_Priority_From_core( + const Scheduler_Control *scheduler, + Priority_Control core_priority +) +{ + core_priority = _Scheduler_Unmap_priority( scheduler, core_priority ); + + return (int) ( scheduler->maximum_priority - core_priority ); } |