From 1a4eac500c9a2942f4aff7e27ccdfae3b99c4cb9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 15 Jun 2016 16:31:33 +0200 Subject: posix: Generalize _POSIX_Priority_To_core() Move POSIX API priority validation into _POSIX_Priority_To_core(). --- cpukit/posix/include/rtems/posix/priorityimpl.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'cpukit/posix/include/rtems') diff --git a/cpukit/posix/include/rtems/posix/priorityimpl.h b/cpukit/posix/include/rtems/posix/priorityimpl.h index d06b600f04..ae2e763fba 100644 --- a/cpukit/posix/include/rtems/posix/priorityimpl.h +++ b/cpukit/posix/include/rtems/posix/priorityimpl.h @@ -51,7 +51,8 @@ extern "C" { int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler ); /** - * @brief Check if POSIX priority is valid. + * @brief Converts the POSIX API priority to the corresponding SuperCore + * priority and validates it. * * According to POSIX, numerically higher values represent higher priorities. * Thus, SuperCore has priorities run in the opposite sense of the POSIX API. @@ -65,14 +66,17 @@ int _POSIX_Priority_Get_maximum( const Scheduler_Control *scheduler ); * having N priorities. * * @param[in] scheduler The scheduler instance. - * @param[in] priority The POSIX API priority to test. + * @param[in] priority The POSIX API priority to convert and validate. + * @param[out] valid Indicates if the POSIX API priority is valid and a + * corresponding SuperCore priority in the specified scheduler instance + * exists. * - * @retval true The priority is valid. - * @retval false Otherwise. + * @return The corresponding SuperCore priority. */ -bool _POSIX_Priority_Is_valid( +Priority_Control _POSIX_Priority_To_core( const Scheduler_Control *scheduler, - int priority + int priority, + bool *valid ); /** -- cgit v1.2.3