> -----Original Message----- > From: ged...@gwmail.gwu.edu [mailto:ged...@gwmail.gwu.edu] On > Behalf Of Gedare Bloom > Sent: Tuesday, March 25, 2014 7:08 AM > To: Sebastian Huber > Cc: Jennifer Averett; RTEMS Devel > Subject: Re: [PATCH 01/10] score: Add get/set affinity to Scheduler > Framework. > > On Tue, Mar 25, 2014 at 3:20 AM, Sebastian Huber > <sebastian.hu...@embedded-brains.de> wrote: > > On 2014-03-24 19:39, Jennifer wrote: > >> > >> @@ -184,6 +205,43 @@ void _Scheduler_default_Start_idle( > >> Per_CPU_Control *processor > >> ); > >> > >> +#if defined(__RTEMS_HAVE_SYS_CPUSET_H__) && > defined(RTEMS_SMP) > >> + > >> + /** > >> + * @brief Get affinity for the default scheduler. > >> + * > >> + * @param[in] thread The associated thread. > >> + * @param[in] cpusetsize The size of the cpuset. > >> + * @param[out] cpuset Affinity set containing all CPUs. > >> + * > >> + * @retval 0 Successfully got cpuset > >> + * @retval -1 The cpusetsize is invalid for the system > >> + */ > >> + int _Scheduler_default_Get_affinity( > >> + Thread_Control *thread, > >> + size_t cpusetsize, > >> + cpu_set_t *cpuset > >> + ); > >> + > >> + /** > >> + * @brief Set affinity for the default scheduler. > >> + * > >> + * @param[in] thread The associated thread. > >> + * @param[in] cpusetsize The size of the cpuset. > >> + * @param[in] cpuset Affinity new affinity set. > >> + * > >> + * @retval 0 Successful > >> + * > >> + * This method always returns successful and does not save > >> + * the cpuset. > >> + */ > >> + int _Scheduler_default_Set_affinity( > >> + Thread_Control *thread, > >> + size_t cpusetsize, > >> + cpu_set_t *cpuset > >> + ); > >> +#endif > > > > > > I would rather use bool or an enum for the return status instead of > > this int. > > > > The default set affinity operation should accept only CPU sets that > > specify the complete set of available processors, e.g. for a three > > processor system it should be bits 0, 1, and 2 set, all other bits > > cleared (e.g. (1 << CPU > > count) - 1). > > > > The default get affinity operation should return the CPU sets > > reflecting all available processors. > > > I agree with the logic for the defaults Sebastian suggests.
Actually no scheduler should be allowed to set the affinity to A cpu that the system doesn't support. Currently those checks are called from the API methods. > > -- > > 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 _______________________________________________ rtems-devel mailing list rtems-devel@rtems.org http://www.rtems.org/mailman/listinfo/rtems-devel