[Xenomai-git] Gilles Chanteperdrix : cobalt: move sched system calls to thread.c
Module: xenomai-forge Branch: master Commit: c2ed87ff63be419da0f5fa907051f2207ad26dd3 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=c2ed87ff63be419da0f5fa907051f2207ad26dd3 Author: Gilles Chanteperdrix Date: Wed Dec 7 21:25:19 2011 +0100 cobalt: move sched system calls to thread.c --- include/cobalt/pthread.h | 16 -- include/cobalt/sched.h | 18 -- kernel/cobalt/Makefile |1 - kernel/cobalt/sched.c| 515 - kernel/cobalt/syscall.c | 17 +- kernel/cobalt/thread.c | 633 -- kernel/cobalt/thread.h | 66 +++--- 7 files changed, 536 insertions(+), 730 deletions(-) diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h index b1bb2e1..3a39fbe 100644 --- a/include/cobalt/pthread.h +++ b/include/cobalt/pthread.h @@ -273,22 +273,6 @@ int pthread_attr_getaffinity_np(const pthread_attr_t *attr, int pthread_attr_setaffinity_np(pthread_attr_t *attr, xnarch_cpumask_t mask); -int pthread_getschedparam(pthread_t tid, - int *pol, - struct sched_param *par); - -int pthread_setschedparam(pthread_t tid, - int pol, - const struct sched_param *par); - -int pthread_getschedparam_ex(pthread_t tid, -int *pol, -struct sched_param_ex *par); - -int pthread_setschedparam_ex(pthread_t tid, -int pol, -const struct sched_param_ex *par); - int pthread_mutexattr_init(pthread_mutexattr_t *attr); int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); diff --git a/include/cobalt/sched.h b/include/cobalt/sched.h index 7a8f7a4..6083fb7 100644 --- a/include/cobalt/sched.h +++ b/include/cobalt/sched.h @@ -35,24 +35,6 @@ #define SCHED_OTHER 0 -struct timespec; - -#ifdef __cplusplus -extern "C" { -#endif - -int sched_yield(void); - -int sched_get_priority_min(int policy); - -int sched_get_priority_max(int policy); - -int sched_rr_get_interval(int pid, struct timespec *interval); - -#ifdef __cplusplus -} -#endif - #else /* !(__KERNEL__ || __XENO_SIM__) */ #include_next diff --git a/kernel/cobalt/Makefile b/kernel/cobalt/Makefile index 5edf552..9eda880 100644 --- a/kernel/cobalt/Makefile +++ b/kernel/cobalt/Makefile @@ -1,7 +1,6 @@ obj-$(CONFIG_XENOMAI) += nucleus/ rtdm/ xeno_cobalt.o xeno_cobalt-y := \ - sched.o \ thread_attr.o \ thread.o \ mutex_attr.o \ diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c deleted file mode 100644 index d7fcf9e..000 --- a/kernel/cobalt/sched.c +++ /dev/null @@ -1,515 +0,0 @@ -/* - * Written by Gilles Chanteperdrix . - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - * @ingroup posix_thread - * @defgroup posix_sched Threads scheduling services. - * - * Thread scheduling services. - * - * Xenomai POSIX skin supports the scheduling policies SCHED_FIFO, - * SCHED_RR, SCHED_SPORADIC, SCHED_OTHER and SCHED_COBALT. - * - * The SCHED_OTHER policy is mainly useful for user-space non-realtime - * activities that need to synchronize with real-time activities. - * - * The SCHED_RR round-robin time slice is configured with the @a - * xeno_posix module parameter @a time_slice. - * - * The SCHED_SPORADIC policy provides a mean to schedule aperiodic or - * sporadic threads in periodic-based systems. - * - * The scheduling policy and priority of a thread is set when creating - * a thread, by using thread creation attributes (see - * pthread_attr_setinheritsched(), pthread_attr_setschedpolicy() and - * pthread_attr_setschedparam()), or when the thread is already - * running by using the service pthread_setschedparam(). - * - * @see - * http://www.opengroup.org/onlinepubs/95399/functions/xsh_chap02_08.html#tag_02_08_04";> - * Specification. - * - *@{*/ - -#include "thread.h" - -/** - * Get minimum priority of the specified scheduling policy. - * - * This service returns the minimum priority of the scheduling policy @a - * policy. - * - * @param policy scheduling policy, one of SCHED_FIFO, SCHED_RR, - * SCHED_OTHER and SCHED_COBALT. - * - * @retval 0 on success; - * @retval -1 with @a errno set if: - * - EINVAL
[Xenomai-git] Gilles Chanteperdrix : cobalt: move sched system calls to thread.c
Module: xenomai-gch Branch: for-forge Commit: ec7cb152793ac701287295b616129dff67175b5b URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=ec7cb152793ac701287295b616129dff67175b5b Author: Gilles Chanteperdrix Date: Wed Dec 7 21:25:19 2011 +0100 cobalt: move sched system calls to thread.c --- include/cobalt/pthread.h | 16 -- include/cobalt/sched.h | 18 -- kernel/cobalt/Makefile |1 - kernel/cobalt/sched.c| 515 - kernel/cobalt/syscall.c | 17 +- kernel/cobalt/thread.c | 633 -- kernel/cobalt/thread.h | 66 +++--- 7 files changed, 536 insertions(+), 730 deletions(-) diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h index b1bb2e1..3a39fbe 100644 --- a/include/cobalt/pthread.h +++ b/include/cobalt/pthread.h @@ -273,22 +273,6 @@ int pthread_attr_getaffinity_np(const pthread_attr_t *attr, int pthread_attr_setaffinity_np(pthread_attr_t *attr, xnarch_cpumask_t mask); -int pthread_getschedparam(pthread_t tid, - int *pol, - struct sched_param *par); - -int pthread_setschedparam(pthread_t tid, - int pol, - const struct sched_param *par); - -int pthread_getschedparam_ex(pthread_t tid, -int *pol, -struct sched_param_ex *par); - -int pthread_setschedparam_ex(pthread_t tid, -int pol, -const struct sched_param_ex *par); - int pthread_mutexattr_init(pthread_mutexattr_t *attr); int pthread_mutexattr_destroy(pthread_mutexattr_t *attr); diff --git a/include/cobalt/sched.h b/include/cobalt/sched.h index 7a8f7a4..6083fb7 100644 --- a/include/cobalt/sched.h +++ b/include/cobalt/sched.h @@ -35,24 +35,6 @@ #define SCHED_OTHER 0 -struct timespec; - -#ifdef __cplusplus -extern "C" { -#endif - -int sched_yield(void); - -int sched_get_priority_min(int policy); - -int sched_get_priority_max(int policy); - -int sched_rr_get_interval(int pid, struct timespec *interval); - -#ifdef __cplusplus -} -#endif - #else /* !(__KERNEL__ || __XENO_SIM__) */ #include_next diff --git a/kernel/cobalt/Makefile b/kernel/cobalt/Makefile index 5edf552..9eda880 100644 --- a/kernel/cobalt/Makefile +++ b/kernel/cobalt/Makefile @@ -1,7 +1,6 @@ obj-$(CONFIG_XENOMAI) += nucleus/ rtdm/ xeno_cobalt.o xeno_cobalt-y := \ - sched.o \ thread_attr.o \ thread.o \ mutex_attr.o \ diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c deleted file mode 100644 index d7fcf9e..000 --- a/kernel/cobalt/sched.c +++ /dev/null @@ -1,515 +0,0 @@ -/* - * Written by Gilles Chanteperdrix . - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/** - * @ingroup posix_thread - * @defgroup posix_sched Threads scheduling services. - * - * Thread scheduling services. - * - * Xenomai POSIX skin supports the scheduling policies SCHED_FIFO, - * SCHED_RR, SCHED_SPORADIC, SCHED_OTHER and SCHED_COBALT. - * - * The SCHED_OTHER policy is mainly useful for user-space non-realtime - * activities that need to synchronize with real-time activities. - * - * The SCHED_RR round-robin time slice is configured with the @a - * xeno_posix module parameter @a time_slice. - * - * The SCHED_SPORADIC policy provides a mean to schedule aperiodic or - * sporadic threads in periodic-based systems. - * - * The scheduling policy and priority of a thread is set when creating - * a thread, by using thread creation attributes (see - * pthread_attr_setinheritsched(), pthread_attr_setschedpolicy() and - * pthread_attr_setschedparam()), or when the thread is already - * running by using the service pthread_setschedparam(). - * - * @see - * http://www.opengroup.org/onlinepubs/95399/functions/xsh_chap02_08.html#tag_02_08_04";> - * Specification. - * - *@{*/ - -#include "thread.h" - -/** - * Get minimum priority of the specified scheduling policy. - * - * This service returns the minimum priority of the scheduling policy @a - * policy. - * - * @param policy scheduling policy, one of SCHED_FIFO, SCHED_RR, - * SCHED_OTHER and SCHED_COBALT. - * - * @retval 0 on success; - * @retval -1 with @a errno set if: - * - EINVAL,