diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-06-28 08:30:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-06-28 08:30:11 +0200 |
commit | 5803f3738f8f97c2188bd36274e60602af515e7f (patch) | |
tree | c1af13d31586640d1e239396216f315adda42ad0 /cpukit/include | |
parent | arm: Return the current handler from arm_cp15_set_exception_handler (diff) | |
download | rtems-5803f3738f8f97c2188bd36274e60602af515e7f.tar.bz2 |
score: Add and use _Thread_Get_unmapped_priority().
Add and use _Thread_Get_unmapped_real_priority().
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/capture.h | 5 | ||||
-rw-r--r-- | cpukit/include/rtems/score/schedulerimpl.h | 30 | ||||
-rw-r--r-- | cpukit/include/rtems/score/schedulernodeimpl.h | 30 | ||||
-rw-r--r-- | cpukit/include/rtems/score/threadimpl.h | 28 |
4 files changed, 60 insertions, 33 deletions
diff --git a/cpukit/include/rtems/capture.h b/cpukit/include/rtems/capture.h index 7a313b3b8b..c37d652211 100644 --- a/cpukit/include/rtems/capture.h +++ b/cpukit/include/rtems/capture.h @@ -34,7 +34,6 @@ #include <rtems.h> #include <rtems/rtems/tasksimpl.h> -#include <rtems/score/schedulerimpl.h> #include <string.h> @@ -890,7 +889,7 @@ rtems_capture_task_start_priority (rtems_tcb* tcb) static inline rtems_task_priority rtems_capture_task_real_priority (rtems_tcb* tcb) { - return SCHEDULER_PRIORITY_UNMAP (tcb->Real_priority.priority); + return _Thread_Get_unmapped_real_priority (tcb); } /** @@ -905,7 +904,7 @@ rtems_capture_task_real_priority (rtems_tcb* tcb) static inline rtems_task_priority rtems_capture_task_curr_priority (rtems_tcb* tcb) { - return SCHEDULER_PRIORITY_UNMAP (_Thread_Get_priority (tcb)); + return _Thread_Get_unmapped_priority (tcb); } /** diff --git a/cpukit/include/rtems/score/schedulerimpl.h b/cpukit/include/rtems/score/schedulerimpl.h index bdd10b9535..dcc81fcbbf 100644 --- a/cpukit/include/rtems/score/schedulerimpl.h +++ b/cpukit/include/rtems/score/schedulerimpl.h @@ -40,36 +40,6 @@ extern "C" { */ /** - * @brief Maps a priority value to support the append indicator. - */ -#define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 ) - -/** - * @brief Returns the plain priority value. - */ -#define SCHEDULER_PRIORITY_UNMAP( priority ) ( ( priority ) >> 1 ) - -/** - * @brief Clears the priority append indicator bit. - */ -#define SCHEDULER_PRIORITY_PURIFY( priority ) \ - ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) ) - -/** - * @brief Returns the priority control with the append indicator bit set. - */ -#define SCHEDULER_PRIORITY_APPEND( priority ) \ - ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG ) - -/** - * @brief Returns true, if the item should be appended to its priority group, - * otherwise returns false and the item should be prepended to its priority - * group. - */ -#define SCHEDULER_PRIORITY_IS_APPEND( priority ) \ - ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 ) - -/** * @brief Initializes the scheduler to the policy chosen by the user. * * This routine initializes the scheduler to the policy chosen by the user diff --git a/cpukit/include/rtems/score/schedulernodeimpl.h b/cpukit/include/rtems/score/schedulernodeimpl.h index 94cb3d6270..675fb0efda 100644 --- a/cpukit/include/rtems/score/schedulernodeimpl.h +++ b/cpukit/include/rtems/score/schedulernodeimpl.h @@ -51,6 +51,36 @@ extern "C" { #define SCHEDULER_PRIORITY_APPEND_FLAG 1 /** + * @brief Maps a priority value to support the append indicator. + */ +#define SCHEDULER_PRIORITY_MAP( priority ) ( ( priority ) << 1 ) + +/** + * @brief Returns the plain priority value. + */ +#define SCHEDULER_PRIORITY_UNMAP( priority ) ( ( priority ) >> 1 ) + +/** + * @brief Clears the priority append indicator bit. + */ +#define SCHEDULER_PRIORITY_PURIFY( priority ) \ + ( ( priority ) & ~( (Priority_Control) SCHEDULER_PRIORITY_APPEND_FLAG ) ) + +/** + * @brief Returns the priority control with the append indicator bit set. + */ +#define SCHEDULER_PRIORITY_APPEND( priority ) \ + ( ( priority ) | SCHEDULER_PRIORITY_APPEND_FLAG ) + +/** + * @brief Returns true, if the item should be appended to its priority group, + * otherwise returns false and the item should be prepended to its priority + * group. + */ +#define SCHEDULER_PRIORITY_IS_APPEND( priority ) \ + ( ( ( priority ) & SCHEDULER_PRIORITY_APPEND_FLAG ) != 0 ) + +/** * @brief Initializes a node. * * @param scheduler The scheduler for the initialization of @a node. diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h index 490c7c83e0..2e41b80bd4 100644 --- a/cpukit/include/rtems/score/threadimpl.h +++ b/cpukit/include/rtems/score/threadimpl.h @@ -1601,6 +1601,34 @@ RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_priority( } /** + * @brief Returns the unmapped priority of the thread. + * + * @param the_thread The thread of which to get the unmapped priority. + * + * @return The unmapped priority of the thread. + */ +RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_priority( + const Thread_Control *the_thread +) +{ + return SCHEDULER_PRIORITY_UNMAP( _Thread_Get_priority( the_thread ) ); +} + +/** + * @brief Returns the unmapped real priority of the thread. + * + * @param the_thread The thread of which to get the unmapped real priority. + * + * @return The unmapped real priority of the thread. + */ +RTEMS_INLINE_ROUTINE Priority_Control _Thread_Get_unmapped_real_priority( + const Thread_Control *the_thread +) +{ + return SCHEDULER_PRIORITY_UNMAP( the_thread->Real_priority.priority ); +} + +/** * @brief Acquires the thread wait default lock inside a critical section * (interrupts disabled). * |