You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/09 13:34:58 UTC

[incubator-nuttx] branch master updated (cf1180e -> 934f468)

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from cf1180e  boards: sabre-6quad: Add QEMU instructions to README.txt
     new c34a73e  syscall: Expose sched_getaffinity and sched_setaffinity
     new ac53600  sched: Rename sched_cpu_count to sched_cpucount
     new 934f468  Run all .c and .h files in PR235 through tools/nxstyle.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 include/sched.h                  |  7 +++++--
 include/sys/syscall.h            | 11 +++++++----
 libs/libc/sched/sched_cpucount.c |  4 ++--
 syscall/syscall.csv              |  2 ++
 syscall/syscall_lookup.h         | 12 ++++++------
 syscall/syscall_stublookup.c     |  8 +++++++-
 6 files changed, 29 insertions(+), 15 deletions(-)


[incubator-nuttx] 01/03: syscall: Expose sched_getaffinity and sched_setaffinity

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit c34a73e78049d15cd82458faf71664c4415f8bb3
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Feb 9 15:38:50 2020 +0800

    syscall: Expose sched_getaffinity and sched_setaffinity
---
 include/sys/syscall.h        | 7 +++++--
 syscall/syscall.csv          | 2 ++
 syscall/syscall_lookup.h     | 3 +++
 syscall/syscall_stublookup.c | 5 +++++
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/include/sys/syscall.h b/include/sys/syscall.h
index ec5cbf5..4bf5d8b 100644
--- a/include/sys/syscall.h
+++ b/include/sys/syscall.h
@@ -81,9 +81,12 @@
 #define SYS_sched_setscheduler         (CONFIG_SYS_RESERVED + 10)
 #define SYS_sched_unlock               (CONFIG_SYS_RESERVED + 11)
 #define SYS_sched_yield                (CONFIG_SYS_RESERVED + 12)
+
 #ifdef CONFIG_SMP
-#  define SYS_sched_getcpu             (CONFIG_SYS_RESERVED + 13)
-#  define __SYS_set_errno              (CONFIG_SYS_RESERVED + 14)
+#  define SYS_sched_getaffinity        (CONFIG_SYS_RESERVED + 13)
+#  define SYS_sched_getcpu             (CONFIG_SYS_RESERVED + 14)
+#  define SYS_sched_setaffinity        (CONFIG_SYS_RESERVED + 15)
+#  define __SYS_set_errno              (CONFIG_SYS_RESERVED + 16)
 #else
 #  define __SYS_set_errno              (CONFIG_SYS_RESERVED + 13)
 #endif
diff --git a/syscall/syscall.csv b/syscall/syscall.csv
index 2f2c9e0..85ec82e 100644
--- a/syscall/syscall.csv
+++ b/syscall/syscall.csv
@@ -119,6 +119,7 @@
 "rewinddir","dirent.h","","void","FAR DIR*"
 "rmdir","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*"
 "rmmod","nuttx/module.h","defined(CONFIG_MODULE)","int","FAR void *"
+"sched_getaffinity","sched.h","defined(CONFIG_SMP)","int","pid_t","size_t","FAR cpu_set_t*"
 "sched_getcpu","sched.h","defined(CONFIG_SMP)","int"
 "sched_getparam","sched.h","","int","pid_t","struct sched_param*"
 "sched_getscheduler","sched.h","","int","pid_t"
@@ -126,6 +127,7 @@
 "sched_lock","sched.h","","int"
 "sched_lockcount","sched.h","","int32_t"
 "sched_rr_get_interval","sched.h","","int","pid_t","struct timespec*"
+"sched_setaffinity","sched.h","defined(CONFIG_SMP)","int","pid_t","size_t","FAR const cpu_set_t*"
 "sched_setparam","sched.h","","int","pid_t","const struct sched_param*"
 "sched_setscheduler","sched.h","","int","pid_t","int","const struct sched_param*"
 "sched_unlock","sched.h","","int"
diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h
index 00f7fb0..e4a48c0 100644
--- a/syscall/syscall_lookup.h
+++ b/syscall/syscall_lookup.h
@@ -57,8 +57,11 @@ SYSCALL_LOOKUP(sched_setparam,             2, STUB_sched_setparam)
 SYSCALL_LOOKUP(sched_setscheduler,         3, STUB_sched_setscheduler)
 SYSCALL_LOOKUP(sched_unlock,               0, STUB_sched_unlock)
 SYSCALL_LOOKUP(sched_yield,                0, STUB_sched_yield)
+
 #ifdef CONFIG_SMP
+SYSCALL_LOOKUP(sched_getaffinity,          3, STUB_sched_getaffinity)
 SYSCALL_LOOKUP(sched_getcpu,               0, STUB_sched_getcpu)
+SYSCALL_LOOKUP(sched_setaffinity,          3, STUB_sched_setaffinity)
 #endif
 
 SYSCALL_LOOKUP(set_errno,                  1, STUB_set_errno)
diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c
index 11276e7..70f8736 100644
--- a/syscall/syscall_stublookup.c
+++ b/syscall/syscall_stublookup.c
@@ -72,7 +72,12 @@ uintptr_t STUB_sched_setscheduler(int nbr, uintptr_t parm1, uintptr_t parm2,
             uintptr_t parm3);
 uintptr_t STUB_sched_unlock(int nbr);
 uintptr_t STUB_sched_yield(int nbr);
+
+uintptr_t STUB_sched_getaffinity(int nbr, uintptr_t parm1, uintptr_t parm2,
+            uintptr_t parm3);
 uintptr_t STUB_sched_getcpu(int nbr);
+uintptr_t STUB_sched_setaffinity(int nbr, uintptr_t parm1, uintptr_t parm2,
+            uintptr_t parm3);
 
 uintptr_t STUB_set_errno(int nbr, uintptr_t parm1);
 uintptr_t STUB_uname(int nbr, uintptr_t parm1);


[incubator-nuttx] 02/03: sched: Rename sched_cpu_count to sched_cpucount

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit ac53600e440e5f4796c5586ca3789f7d6e269569
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Feb 9 15:42:11 2020 +0800

    sched: Rename sched_cpu_count to sched_cpucount
---
 include/sched.h                  | 2 +-
 libs/libc/sched/sched_cpucount.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/sched.h b/include/sched.h
index 06dc6db..a182dd6 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -265,7 +265,7 @@ int    sched_rr_get_interval(pid_t pid, FAR struct timespec *interval);
 int    sched_setaffinity(pid_t pid, size_t cpusetsize,
                          FAR const cpu_set_t *mask);
 int    sched_getaffinity(pid_t pid, size_t cpusetsize, FAR cpu_set_t *mask);
-int    sched_cpu_count(FAR const cpu_set_t *set);
+int    sched_cpucount(FAR const cpu_set_t *set);
 int    sched_getcpu(void);
 #endif /* CONFIG_SMP */
 
diff --git a/libs/libc/sched/sched_cpucount.c b/libs/libc/sched/sched_cpucount.c
index 635215f..c18576a 100644
--- a/libs/libc/sched/sched_cpucount.c
+++ b/libs/libc/sched/sched_cpucount.c
@@ -48,7 +48,7 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name:  sched_cpu_count
+ * Name:  sched_cpucount
  *
  * Description:
  *   Return the number of bits set in the 'set'.  This could be improved by
@@ -62,7 +62,7 @@
  *
  ****************************************************************************/
 
-int sched_cpu_count(FAR const cpu_set_t *set)
+int sched_cpucount(FAR const cpu_set_t *set)
 {
   int count;
   int cpu;


[incubator-nuttx] 03/03: Run all .c and .h files in PR235 through tools/nxstyle.

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 934f468e4a37fa7fe4114bdd64de9f03fafdb912
Author: Gregory Nutt <gn...@nuttx.org>
AuthorDate: Sun Feb 9 07:32:52 2020 -0600

    Run all .c and .h files in PR235 through tools/nxstyle.
---
 include/sched.h              | 5 ++++-
 include/sys/syscall.h        | 4 ++--
 syscall/syscall_lookup.h     | 9 +++------
 syscall/syscall_stublookup.c | 3 ++-
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/include/sched.h b/include/sched.h
index a182dd6..a420383 100644
--- a/include/sched.h
+++ b/include/sched.h
@@ -52,6 +52,7 @@
 /********************************************************************************
  * Pre-processor Definitions
  ********************************************************************************/
+
 /* Task Management Definitions **************************************************/
 
 /* POSIX-like scheduling policies */
@@ -81,7 +82,8 @@
 
 #define PTHREAD_KEYS_MAX          CONFIG_NPTHREAD_KEYS
 
-/* CPU affinity mask helpers ***************************************************/
+/* CPU affinity mask helpers ****************************************************/
+
 /* These are not standard but are defined for Linux compatibility */
 
 #ifdef CONFIG_SMP
@@ -129,6 +131,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/include/sys/syscall.h b/include/sys/syscall.h
index 4bf5d8b..8f643cf 100644
--- a/include/sys/syscall.h
+++ b/include/sys/syscall.h
@@ -2,7 +2,7 @@
  * include/sys/syscall.h
  * This file contains the system call numbers.
  *
- *   Copyright (C) 2011-2019 Gregory Nutt. All rights reserved.
+ *   Copyright (C) 2011-2019, 2020 Gregory Nutt. All rights reserved.
  *   Author: Gregory Nutt <gn...@nuttx.org>
  *
  * Redistribution and use in source and binary forms, with or without
@@ -636,7 +636,7 @@ EXTERN const uintptr_t g_stublookup[SYS_nsyscalls];
 EXTERN const uint8_t g_funcnparms[SYS_nsyscalls];
 
 /****************************************************************************
- * Public Functions
+ * Public Function Prototypes
  ****************************************************************************/
 
 #undef EXTERN
diff --git a/syscall/syscall_lookup.h b/syscall/syscall_lookup.h
index e4a48c0..b42f465 100644
--- a/syscall/syscall_lookup.h
+++ b/syscall/syscall_lookup.h
@@ -408,16 +408,13 @@ SYSCALL_LOOKUP(up_assert,                  2, STUB_up_assert)
 #endif
 
 /* The following is defined only if entropy pool random number generator
- * is enabled. */
+ * is enabled.
+ */
 
 #ifdef CONFIG_CRYPTO_RANDOM_POOL
   SYSCALL_LOOKUP(getrandom,               2, STUB_getrandom)
 #endif
 
 /****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Public Functions
+ * Public Function Prototypes
  ****************************************************************************/
diff --git a/syscall/syscall_stublookup.c b/syscall/syscall_stublookup.c
index 70f8736..4ef7e56 100644
--- a/syscall/syscall_stublookup.c
+++ b/syscall/syscall_stublookup.c
@@ -426,7 +426,8 @@ uintptr_t STUB_prctl(int nbr, uintptr_t parm1, uintptr_t parm2,
             uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);
 
 /* The following is defined only if entropy pool random number generator
- * is enabled. */
+ * is enabled.
+ */
 
 uintptr_t STUB_getrandom(int nbr, uintptr_t parm1, uintptr_t parm2);