Module: xenomai-forge
Branch: master
Commit: cf934eeebb80afb4ae7154969f1499a538774f77
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=cf934eeebb80afb4ae7154969f1499a538774f77

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Jan 29 12:58:26 2012 +0100

cobalt: get rid of cobalt/posix.h

This was meant to be used internally, and should never have been
exposed as a public header. Applications should include the required
bits selectively, no through that kind of kitchen sink header.

---

 include/cobalt/Makefile.am |    1 -
 include/cobalt/Makefile.in |    1 -
 include/cobalt/posix.h     |   36 ------------------------------------
 include/cobalt/syscall.h   |    2 ++
 kernel/cobalt/clock.c      |    1 +
 kernel/cobalt/internal.h   |   17 +++++++++++++----
 kernel/cobalt/module.c     |    3 +--
 kernel/cobalt/mq.c         |    1 +
 kernel/cobalt/registry.h   |    2 --
 kernel/cobalt/sem.c        |    1 +
 kernel/cobalt/syscall.c    |    8 +-------
 kernel/cobalt/timer.c      |    1 +
 lib/cobalt/init.c          |    6 +++---
 13 files changed, 24 insertions(+), 56 deletions(-)

diff --git a/include/cobalt/Makefile.am b/include/cobalt/Makefile.am
index 7d02796..0b25901 100644
--- a/include/cobalt/Makefile.am
+++ b/include/cobalt/Makefile.am
@@ -5,7 +5,6 @@ includesub_HEADERS = \
        errno.h \
        fcntl.h \
        mqueue.h \
-       posix.h \
        pthread.h \
        sched.h \
        semaphore.h \
diff --git a/include/cobalt/Makefile.in b/include/cobalt/Makefile.in
index 1837351..401b806 100644
--- a/include/cobalt/Makefile.in
+++ b/include/cobalt/Makefile.in
@@ -284,7 +284,6 @@ includesub_HEADERS = \
        errno.h \
        fcntl.h \
        mqueue.h \
-       posix.h \
        pthread.h \
        sched.h \
        semaphore.h \
diff --git a/include/cobalt/posix.h b/include/cobalt/posix.h
deleted file mode 100644
index 92fa426..0000000
--- a/include/cobalt/posix.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2003 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.
- */
-
-#ifndef _COBALT_POSIX_H
-#define _COBALT_POSIX_H
-
-#define COBALT_SKIN_MAGIC           0x50534531
-
-#include <errno.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <semaphore.h>
-#include <mqueue.h>
-#include <time.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-
-#endif /* !_COBALT_POSIX_H */
diff --git a/include/cobalt/syscall.h b/include/cobalt/syscall.h
index 4325593..3e1415c 100644
--- a/include/cobalt/syscall.h
+++ b/include/cobalt/syscall.h
@@ -21,6 +21,8 @@
 
 #include <asm/xenomai/syscall.h>
 
+#define COBALT_SKIN_MAGIC           0x50534531
+
 #define sc_cobalt_thread_create         0
 #define sc_cobalt_thread_setschedparam  2
 #define sc_cobalt_sched_yield           3
diff --git a/kernel/cobalt/clock.c b/kernel/cobalt/clock.c
index 5303ee0..1fba783 100644
--- a/kernel/cobalt/clock.c
+++ b/kernel/cobalt/clock.c
@@ -52,6 +52,7 @@
 #include <asm-generic/xenomai/arith.h>
 #include <asm-generic/xenomai/system.h>
 #include "thread.h"
+#include "internal.h"
 
 /**
  * Read the host-synchronised realtime clock.
diff --git a/kernel/cobalt/internal.h b/kernel/cobalt/internal.h
index 27da84c..a56b749 100644
--- a/kernel/cobalt/internal.h
+++ b/kernel/cobalt/internal.h
@@ -19,15 +19,24 @@
 #ifndef _POSIX_INTERNAL_H
 #define _POSIX_INTERNAL_H
 
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <mqueue.h>
+#include <time.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
 #include <nucleus/pod.h>
 #include <nucleus/heap.h>
 #include <nucleus/ppd.h>
 #include <nucleus/select.h>
-#include <cobalt/posix.h>
-#include "registry.h"
-
-/* debug support */
 #include <nucleus/assert.h>
+#include <cobalt/syscall.h>
+#include "registry.h"
 
 #ifndef CONFIG_XENO_OPT_DEBUG_POSIX
 #define CONFIG_XENO_OPT_DEBUG_POSIX 0
diff --git a/kernel/cobalt/module.c b/kernel/cobalt/module.c
index 9e1a74d..a9858c4 100644
--- a/kernel/cobalt/module.c
+++ b/kernel/cobalt/module.c
@@ -45,8 +45,6 @@
  *
  */
 
-#include <cobalt/syscall.h>
-#include <cobalt/posix.h>
 #include "internal.h"
 #include "cond.h"
 #include "mutex.h"
@@ -56,6 +54,7 @@
 #include "timer.h"
 #include "registry.h"
 #include "monitor.h"
+#include "internal.h"
 
 MODULE_DESCRIPTION("POSIX/COBALT interface");
 MODULE_AUTHOR("gilles.chanteperd...@xenomai.org");
diff --git a/kernel/cobalt/mq.c b/kernel/cobalt/mq.c
index 9cf731e..db473d0 100644
--- a/kernel/cobalt/mq.c
+++ b/kernel/cobalt/mq.c
@@ -36,6 +36,7 @@
 #include "thread.h"            /* errno. */
 #include "timer.h"
 #include "mq.h"
+#include "internal.h"
 
 /* Temporary definitions. */
 struct cobalt_mq {
diff --git a/kernel/cobalt/registry.h b/kernel/cobalt/registry.h
index 3ae9435..dba9040 100644
--- a/kernel/cobalt/registry.h
+++ b/kernel/cobalt/registry.h
@@ -3,8 +3,6 @@
 
 #include <stdarg.h>
 #include <nucleus/queue.h>
-#include <nucleus/synch.h>
-#include <cobalt/posix.h>
 
 #define COBALT_MAXNAME 64
 
diff --git a/kernel/cobalt/sem.c b/kernel/cobalt/sem.c
index c3e28c1..13cbd30 100644
--- a/kernel/cobalt/sem.c
+++ b/kernel/cobalt/sem.c
@@ -36,6 +36,7 @@
 #include "registry.h"  /* For named semaphores. */
 #include "thread.h"
 #include "sem.h"
+#include "internal.h"
 
 #define SEM_NAMED    0x80000000
 
diff --git a/kernel/cobalt/syscall.c b/kernel/cobalt/syscall.c
index 309191b..6a6eb43 100644
--- a/kernel/cobalt/syscall.c
+++ b/kernel/cobalt/syscall.c
@@ -22,23 +22,17 @@
 
 #include <linux/types.h>
 #include <linux/err.h>
-#include <asm/xenomai/wrappers.h>
-#include <nucleus/ppd.h>
-#include <nucleus/sys_ppd.h>
-#include <nucleus/assert.h>
-#include <cobalt/syscall.h>
-#include <cobalt/posix.h>
 #include "thread.h"
 #include "mutex.h"
 #include "cond.h"
 #include "mq.h"
-#include "registry.h"  /* For COBALT_MAXNAME. */
 #include "sem.h"
 #include "timer.h"
 #include "monitor.h"
 #include "sched.h"
 #include "clock.h"
 #include <rtdm/rtdm_driver.h>
+
 #define RTDM_FD_MAX CONFIG_XENO_OPT_RTDM_FILDES
 
 int cobalt_muxid;
diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c
index 844ebbf..651f6b8 100644
--- a/kernel/cobalt/timer.c
+++ b/kernel/cobalt/timer.c
@@ -26,6 +26,7 @@
 #include "thread.h"
 #include "timer.h"
 #include "sem.h"
+#include "internal.h"
 
 #define COBALT_TIMER_MAX  128
 
diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c
index 037a5ce..f34cb88 100644
--- a/lib/cobalt/init.c
+++ b/lib/cobalt/init.c
@@ -16,6 +16,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
+#include <sys/types.h>
+#include <sys/mman.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -23,11 +25,9 @@
 #include <signal.h>
 #include <limits.h>
 #include <unistd.h>
-#include <sys/types.h>
 #include <nucleus/heap.h>
-#include <cobalt/posix.h>
-#include <cobalt/syscall.h>
 #include <rtdm/syscall.h>
+#include <cobalt/syscall.h>
 #include <kernel/cobalt/mutex.h>
 #include <rtdk.h>
 #include <asm/xenomai/bits/bind.h>


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to