From 143d287f11b523b2518936f3e2415d117aeaacc0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 21 Feb 2016 11:27:55 -0600 Subject: [PATCH] Fix some missing header file inclusions and a misplaced semi-colon from recent commits --- arch | 2 +- include/sched.h | 4 +++- libc/pthread/pthread_attrgetaffinity.c | 1 + libc/pthread/pthread_attrsetaffinity.c | 1 + libc/sched/sched_cpucount.c | 2 +- sched/pthread/pthread_create.c | 2 +- sched/task/task_setup.c | 4 ++-- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/arch b/arch index 15236a5b07..a5acac8e6a 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 15236a5b07c6f5d254ccdc8478c613a5c21e4296 +Subproject commit a5acac8e6adf2505c4e995797a203a0bc243f503 diff --git a/include/sched.h b/include/sched.h index 8733b8f46c..54501644bf 100644 --- a/include/sched.h +++ b/include/sched.h @@ -67,6 +67,7 @@ #define PTHREAD_KEYS_MAX CONFIG_NPTHREAD_KEYS /* CPU affinity mask helpers ***************************************************/ +/* These are not standard but are defined for Linux compatibility */ #ifdef CONFIG_SMP @@ -88,7 +89,7 @@ /* int CPU_COUNT(FAR const cpu_set_t *set); */ -#define CPU_COUNT(s) sched_cpu_count(s) +# define CPU_COUNT(s) sched_cpu_count(s) /* void CPU_AND(FAR cpu_set_t *destset, FAR const cpu_set_t *srcset1, * FAR const cpu_set_t *srcset2); @@ -112,6 +113,7 @@ # define CPU_EQUAL(s1,s2) (*(s2) == *(s2)) +/* REVISIT: Variably sized CPU sets are not supported */ /* FAR cpu_set_t *CPU_ALLOC(int num_cpus); */ # define CPU_ALLOC(n) (FAR cpu_set_t *)malloc(sizeof(cpu_set_t)); diff --git a/libc/pthread/pthread_attrgetaffinity.c b/libc/pthread/pthread_attrgetaffinity.c index f77d267cac..c13ee71d0b 100644 --- a/libc/pthread/pthread_attrgetaffinity.c +++ b/libc/pthread/pthread_attrgetaffinity.c @@ -40,6 +40,7 @@ #include #include #include +#include #include /**************************************************************************** diff --git a/libc/pthread/pthread_attrsetaffinity.c b/libc/pthread/pthread_attrsetaffinity.c index 200711dea1..0222dfdd7d 100644 --- a/libc/pthread/pthread_attrsetaffinity.c +++ b/libc/pthread/pthread_attrsetaffinity.c @@ -41,6 +41,7 @@ #include #include +#include #include /**************************************************************************** diff --git a/libc/sched/sched_cpucount.c b/libc/sched/sched_cpucount.c index 3a2be5b3cb..6bdac11117 100644 --- a/libc/sched/sched_cpucount.c +++ b/libc/sched/sched_cpucount.c @@ -62,7 +62,7 @@ * ****************************************************************************/ -int sched_cpu_count(FAR const cpu_set_t *set); +int sched_cpu_count(FAR const cpu_set_t *set) { int count; int cpu; diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index 52275b8e8d..0869c56ed8 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -412,7 +412,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, * parent thread's affinity mask. */ - if ( attr->affinity != 0) + if (attr->affinity != 0) { ptcb->cmn.affinity = attr->affinity; } diff --git a/sched/task/task_setup.c b/sched/task/task_setup.c index 619a81819d..6d0ea9c2b2 100644 --- a/sched/task/task_setup.c +++ b/sched/task/task_setup.c @@ -163,8 +163,8 @@ static int task_assignpid(FAR struct tcb_s *tcb) * None * * Assumptions: - * The parent of the new task is the task at the head of the ready-to-run - * list. + * The parent of the new task is the task at the head of the assigned task + * list for the current CPU. * ****************************************************************************/