mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Rename cpuset_t to cpu_set_t which is the type used in some non-standard Linux/GNU interfaces. Move definitions of cpu_set_t to include/sys/types.h. Add prototypes for sched_setaffinity(), sched_getaffinity(), pthread_attr_setaffinity_np(), pthread_attr_getaffinity_np(), pthread_setaffinity_np(), and pthread_getaffinity_np(). No implementation is yet in place.
This commit is contained in:
@@ -290,6 +290,16 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr,
|
||||
int pthread_attr_getinheritsched(FAR const pthread_attr_t *attr,
|
||||
FAR int *inheritsched);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/* Set or obtain thread affinity attributes */
|
||||
|
||||
int pthread_attr_setaffinity_np(FAR pthread_attr_t *attr,
|
||||
size_t cpusetsize,
|
||||
FAR const cpu_set_t *cpuset);
|
||||
int pthread_attr_getaffinity_np(FAR const pthread_attr_t *attr,
|
||||
size_t cpusetsize, cpu_set_t *cpuset);
|
||||
#endif
|
||||
|
||||
/* Set or obtain the default stack size */
|
||||
|
||||
int pthread_attr_setstacksize(FAR pthread_attr_t *attr, long stacksize);
|
||||
@@ -346,6 +356,15 @@ int pthread_setschedparam(pthread_t thread, int policy,
|
||||
FAR const struct sched_param *param);
|
||||
int pthread_setschedprio(pthread_t thread, int prio);
|
||||
|
||||
/* Thread affinity */
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
|
||||
FAR const cpu_set_t *cpuset);
|
||||
int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize,
|
||||
FAR cpu_set_t *cpuset);
|
||||
#endif
|
||||
|
||||
/* Thread-specific Data Interfaces */
|
||||
|
||||
int pthread_key_create(FAR pthread_key_t *key,
|
||||
|
||||
Reference in New Issue
Block a user