On Wed, Nov 20, 2013 at 3:42 AM, Sebastian Huber <sebastian.hu...@embedded-brains.de> wrote: > On 2013-11-19 18:36, Gedare Bloom wrote: >> >> On Tue, Nov 19, 2013 at 8:39 AM, Sebastian Huber [...] >>> >Two new functions should be added to alter and retrieve the processor >>> >affinity >>> >sets of threads. >>> > >>> > /** >>> > * @brief Sets the processor affinity set of a task. >>> > * >>> > * @param[in] task_id Identifier of the task. Use @ref RTEMS_SELF to >>> >select >>> > * the executing task. >>> > * @param[in] affinity_set_size Size of the specified affinity set in >>> >bytes. >>> > * This value must be positive. >>> > * @param[in] affinity_set The processor affinity set for the task. >>> > This >>> > * pointer must not be @c NULL. A set bit in the affinity set means >>> > that >>> >the >>> > * task can execute on this processor and an unset bit means the >>> > opposite. >>> > * >>> > * @retval RTEMS_SUCCESSFUL Successful operation. >>> > * @retval RTEMS_INVALID_ID Invalid task identifier. >>> > * @retval RTEMS_INVALID_CPU_SET Invalid processor affinity set. >>> > */ >>> > rtems_status_code rtems_task_set_affinity( >>> > rtems_id task_id, >>> > size_t affinity_set_size, >>> > const cpu_set_t *affinity_set >>> > ); >>> > >>> > /** >>> > * @brief Gets the processor affinity set of a task. >>> > * >>> > * @param[in] task_id Identifier of the task. Use @ref RTEMS_SELF to >>> >select >>> > * the executing task. >>> > * @param[in] affinity_set_size Size of the specified affinity set in >>> >bytes. >>> > * This value must be positive. >>> > * @param[out] affinity_set The processor affinity set of the task. >>> > This >>> > * pointer must not be @c NULL. A set bit in the affinity set means >>> > that >>> >the >>> > * task can execute on this processor and an unset bit means the >>> > opposite. >>> > * >>> > * @retval RTEMS_SUCCESSFUL Successful operation. >>> > * @retval RTEMS_INVALID_ID Invalid task identifier. >>> > * @retval RTEMS_INVALID_CPU_SET The affinity set is too small for the >>> > * processor affinity set of the task. >>> > */ >>> > rtems_status_code rtems_task_get_affinity( >>> > rtems_id task_id, >>> > size_t affinity_set_size, >>> > cpu_set_t *affinity_set >>> > ); >>> > >> >> These classic API set/get affinity functions seem reasonable. They >> mimic existing affinity interfaces nicely. Now users should do >> rtems_task_create(), rtems_task_set_affinity(), rtems_task_start() in >> order to specify the affinity of their tasks, correct? > > > Yes, after reading it again, should we use the naming of the Linux man page > > http://man7.org/linux/man-pages/man3/pthread_setaffinity_np.3.html > > affinity_set_size -> cpusetsize > affinity_set -> cpuset > > > ? > I wondered that myself when I read your description. I don't think it matters much, but the translation for programmers who already know the get/setaffinity() routines will be simpler if the parameter names match. At this stage, I would lean to making the parameter names similar to Linux, but with added underscores like we did for the type: cpu_set_size, cpu_set. (Basically just replace affinity with cpu).
-Gedare > -- > 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.hu...@embedded-brains.de > PGP : Public key available on request. > > Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. _______________________________________________ rtems-devel mailing list rtems-devel@rtems.org http://www.rtems.org/mailman/listinfo/rtems-devel