[PATCH 10/16] score: Introduce map priority scheduler operation

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Jun 21 14:02:52 UTC 2016



On 20/06/16 18:00, Gedare Bloom wrote:
>> diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h
>> >index 50061fb..fad7ecc 100644
>> >--- a/cpukit/score/include/rtems/score/schedulerimpl.h
>> >+++ b/cpukit/score/include/rtems/score/schedulerimpl.h
>> >@@ -420,6 +420,45 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Change_priority(
>> >  }
>> >
>> >  /**
>> >+ * @brief Maps a thread priority from the user domain to the scheduler domain.
>> >+ *
>> >+ * The mapping must be injective.  A scheduler domain value must exist for all
>> >+ * user domain values from 0 up to and including the maximum scheduler
>> >+ * priority.
>> >+ *
>> >+ * @param[in] scheduler The scheduler instance.
>> >+ * @param[in, out] priority The thread priority.
>> >+ *
>> >+ * @retval true The thread priority in the scheduler domain exists for the user
>> >+ *   specified thread priority.  In this case the corresponding thread priority
>> >+ *   of the scheduler domain is returned.
>> >+ * @retval false Otherwise.
>> >+ */
>> >+RTEMS_INLINE_ROUTINE bool _Scheduler_Map_priority(
>> >+  const Scheduler_Control *scheduler,
>> >+  Priority_Control        *priority
>> >+)
>> >+{
>> >+  return ( *scheduler->Operations.map_priority )( scheduler, priority );
>> >+}
>> >+
> I am a bit confused about why this function returns a bool. Usually I
> expect something that "maps" to return a mapped value. The @retval
> true is incomplete about "the corresponding thread priority of the
> scheduler domain is returned" and should indicate "is returned in
> @priority."

Thanks for the review. I will change it to return the priority directly 
and move the validation to a dedicated function, e.g. 
_POSIX_Priority_To_core() and a new _RTEMS_Priority_To_core().

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list