[Xenomai-git] Philippe Gerum : cobalt/posix: group init work
Module: xenomai-3 Branch: master Commit: 376fdf23b322f96cf3e4be343e88a1292b0eb08f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=376fdf23b322f96cf3e4be343e88a1292b0eb08f Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 10:53:18 2015 +0100 cobalt/posix: group init work --- kernel/cobalt/posix/Makefile |1 - kernel/cobalt/posix/init.c| 49 - kernel/cobalt/posix/process.c | 39 kernel/cobalt/posix/thread.c |2 +- 4 files changed, 26 insertions(+), 65 deletions(-) diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile index 2ac92ff..278e833 100644 --- a/kernel/cobalt/posix/Makefile +++ b/kernel/cobalt/posix/Makefile @@ -4,7 +4,6 @@ xenomai-y :=\ clock.o \ cond.o \ event.o \ - init.o \ io.o\ memory.o\ monitor.o \ diff --git a/kernel/cobalt/posix/init.c b/kernel/cobalt/posix/init.c deleted file mode 100644 index bc446d8..000 --- a/kernel/cobalt/posix/init.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Written by Gilles Chanteperdrix gilles.chanteperd...@xenomai.org. - * - * 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. - */ - -#include linux/init.h -#include linux/module.h -#include internal.h -#include thread.h -#include sched.h -#include cond.h -#include mutex.h -#include sem.h -#include mqueue.h -#include signal.h -#include timer.h -#include monitor.h -#include event.h - -LIST_HEAD(cobalt_thread_list); - -struct cobalt_resources cobalt_global_resources = { - .condq = LIST_HEAD_INIT(cobalt_global_resources.condq), - .mutexq = LIST_HEAD_INIT(cobalt_global_resources.mutexq), - .semq = LIST_HEAD_INIT(cobalt_global_resources.semq), - .monitorq = LIST_HEAD_INIT(cobalt_global_resources.monitorq), - .eventq = LIST_HEAD_INIT(cobalt_global_resources.eventq), - .schedq = LIST_HEAD_INIT(cobalt_global_resources.schedq), -}; - -__init int cobalt_init(void) -{ - cobalt_time_slice = CONFIG_XENO_OPT_RR_QUANTUM * 1000; - - return cobalt_process_init(); -} diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 06ff84f..9d93e43 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -85,6 +85,17 @@ struct xnthread_personality *cobalt_personalities[NR_PERSONALITIES]; static struct xnsynch yield_sync; +LIST_HEAD(cobalt_thread_list); + +struct cobalt_resources cobalt_global_resources = { + .condq = LIST_HEAD_INIT(cobalt_global_resources.condq), + .mutexq = LIST_HEAD_INIT(cobalt_global_resources.mutexq), + .semq = LIST_HEAD_INIT(cobalt_global_resources.semq), + .monitorq = LIST_HEAD_INIT(cobalt_global_resources.monitorq), + .eventq = LIST_HEAD_INIT(cobalt_global_resources.eventq), + .schedq = LIST_HEAD_INIT(cobalt_global_resources.schedq), +}; + static unsigned __attribute__((pure)) process_hash_crunch(struct mm_struct *mm) { unsigned long hash = ((unsigned long)mm - PAGE_OFFSET) / sizeof(*mm); @@ -1371,7 +1382,20 @@ static void cobalt_process_detach(void *arg) */ } -int cobalt_process_init(void) +struct xnthread_personality cobalt_personality = { + .name = cobalt, + .magic = 0, + .ops = { + .attach_process = cobalt_process_attach, + .detach_process = cobalt_process_detach, + .map_thread = cobalt_thread_map, + .exit_thread = cobalt_thread_exit, + .finalize_thread = cobalt_thread_finalize, + }, +}; +EXPORT_SYMBOL_GPL(cobalt_personality); + +__init int cobalt_init(void) { unsigned int i, size; int ret; @@ -1431,16 +1455,3 @@ fail_debug: return ret; } - -struct xnthread_personality cobalt_personality = { - .name = cobalt, - .magic = 0, - .ops = { - .attach_process = cobalt_process_attach, - .detach_process = cobalt_process_detach, - .map_thread = cobalt_thread_map, - .exit_thread = cobalt_thread_exit, - .finalize_thread = cobalt_thread_finalize, - }, -}; -EXPORT_SYMBOL_GPL(cobalt_personality); diff --git a/kernel/cobalt/posix/thread.c
[Xenomai-git] Philippe Gerum : cobalt/posix: group init work
Module: xenomai-3 Branch: next Commit: 376fdf23b322f96cf3e4be343e88a1292b0eb08f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=376fdf23b322f96cf3e4be343e88a1292b0eb08f Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 10:53:18 2015 +0100 cobalt/posix: group init work --- kernel/cobalt/posix/Makefile |1 - kernel/cobalt/posix/init.c| 49 - kernel/cobalt/posix/process.c | 39 kernel/cobalt/posix/thread.c |2 +- 4 files changed, 26 insertions(+), 65 deletions(-) diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile index 2ac92ff..278e833 100644 --- a/kernel/cobalt/posix/Makefile +++ b/kernel/cobalt/posix/Makefile @@ -4,7 +4,6 @@ xenomai-y :=\ clock.o \ cond.o \ event.o \ - init.o \ io.o\ memory.o\ monitor.o \ diff --git a/kernel/cobalt/posix/init.c b/kernel/cobalt/posix/init.c deleted file mode 100644 index bc446d8..000 --- a/kernel/cobalt/posix/init.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Written by Gilles Chanteperdrix gilles.chanteperd...@xenomai.org. - * - * 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. - */ - -#include linux/init.h -#include linux/module.h -#include internal.h -#include thread.h -#include sched.h -#include cond.h -#include mutex.h -#include sem.h -#include mqueue.h -#include signal.h -#include timer.h -#include monitor.h -#include event.h - -LIST_HEAD(cobalt_thread_list); - -struct cobalt_resources cobalt_global_resources = { - .condq = LIST_HEAD_INIT(cobalt_global_resources.condq), - .mutexq = LIST_HEAD_INIT(cobalt_global_resources.mutexq), - .semq = LIST_HEAD_INIT(cobalt_global_resources.semq), - .monitorq = LIST_HEAD_INIT(cobalt_global_resources.monitorq), - .eventq = LIST_HEAD_INIT(cobalt_global_resources.eventq), - .schedq = LIST_HEAD_INIT(cobalt_global_resources.schedq), -}; - -__init int cobalt_init(void) -{ - cobalt_time_slice = CONFIG_XENO_OPT_RR_QUANTUM * 1000; - - return cobalt_process_init(); -} diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 06ff84f..9d93e43 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -85,6 +85,17 @@ struct xnthread_personality *cobalt_personalities[NR_PERSONALITIES]; static struct xnsynch yield_sync; +LIST_HEAD(cobalt_thread_list); + +struct cobalt_resources cobalt_global_resources = { + .condq = LIST_HEAD_INIT(cobalt_global_resources.condq), + .mutexq = LIST_HEAD_INIT(cobalt_global_resources.mutexq), + .semq = LIST_HEAD_INIT(cobalt_global_resources.semq), + .monitorq = LIST_HEAD_INIT(cobalt_global_resources.monitorq), + .eventq = LIST_HEAD_INIT(cobalt_global_resources.eventq), + .schedq = LIST_HEAD_INIT(cobalt_global_resources.schedq), +}; + static unsigned __attribute__((pure)) process_hash_crunch(struct mm_struct *mm) { unsigned long hash = ((unsigned long)mm - PAGE_OFFSET) / sizeof(*mm); @@ -1371,7 +1382,20 @@ static void cobalt_process_detach(void *arg) */ } -int cobalt_process_init(void) +struct xnthread_personality cobalt_personality = { + .name = cobalt, + .magic = 0, + .ops = { + .attach_process = cobalt_process_attach, + .detach_process = cobalt_process_detach, + .map_thread = cobalt_thread_map, + .exit_thread = cobalt_thread_exit, + .finalize_thread = cobalt_thread_finalize, + }, +}; +EXPORT_SYMBOL_GPL(cobalt_personality); + +__init int cobalt_init(void) { unsigned int i, size; int ret; @@ -1431,16 +1455,3 @@ fail_debug: return ret; } - -struct xnthread_personality cobalt_personality = { - .name = cobalt, - .magic = 0, - .ops = { - .attach_process = cobalt_process_attach, - .detach_process = cobalt_process_detach, - .map_thread = cobalt_thread_map, - .exit_thread = cobalt_thread_exit, - .finalize_thread = cobalt_thread_finalize, - }, -}; -EXPORT_SYMBOL_GPL(cobalt_personality); diff --git a/kernel/cobalt/posix/thread.c