summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-12-14 16:33:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-02-03 10:00:55 +0100
commit3015ed641a41059dec9abad1eb3872a006ee6324 (patch)
treee9c96626b291275184a46bc76506a3282c32e0dd /cpukit
parentOptional POSIX Mutex initialization (diff)
downloadrtems-3015ed641a41059dec9abad1eb3872a006ee6324.tar.bz2
Optional POSIX Message Queue initialization
Update #2408.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/posix/include/rtems/posix/mqueueimpl.h23
-rw-r--r--cpukit/posix/src/mqueue.c13
-rw-r--r--cpukit/sapi/src/posixapi.c2
-rw-r--r--cpukit/score/include/rtems/sysinit.h1
4 files changed, 15 insertions, 24 deletions
diff --git a/cpukit/posix/include/rtems/posix/mqueueimpl.h b/cpukit/posix/include/rtems/posix/mqueueimpl.h
index 90269bf57b..6646fa2c65 100644
--- a/cpukit/posix/include/rtems/posix/mqueueimpl.h
+++ b/cpukit/posix/include/rtems/posix/mqueueimpl.h
@@ -31,32 +31,13 @@ extern "C" {
* This defines the information control block used to manage
* this class of objects.
*/
-POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information;
+extern Objects_Information _POSIX_Message_queue_Information;
/**
* The is used to manage the set of "file descriptors" associated with
* the message queues.
*/
-POSIX_EXTERN Objects_Information _POSIX_Message_queue_Information_fds;
-
-/**
- * @brief Initialize message_queue manager related data structures.
- *
- * This routine performs the initialization necessary for this manager.
- *
- * @note The structure of the routines is identical to that of POSIX
- * Message_queues to leave the option of having unnamed message
- * queues at a future date. They are currently not part of the
- * POSIX standard but unnamed message_queues are. This is also
- * the reason for the apparently unnecessary tracking of
- * the process_shared attribute. [In addition to the fact that
- * it would be trivial to add pshared to the mq_attr structure
- * and have process private message queues.]
- *
- * @note This code ignores the O_RDONLY/O_WRONLY/O_RDWR flag at open time.
- *
- */
-void _POSIX_Message_queue_Manager_initialization(void);
+extern Objects_Information _POSIX_Message_queue_Information_fds;
/**
* @brief POSIX Message Queue Create Support
diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c
index 43878b708c..0f261f6947 100644
--- a/cpukit/posix/src/mqueue.c
+++ b/cpukit/posix/src/mqueue.c
@@ -28,10 +28,15 @@
#include <rtems/system.h>
#include <rtems/config.h>
+#include <rtems/sysinit.h>
#include <rtems/score/watchdog.h>
#include <rtems/seterr.h>
#include <rtems/posix/mqueueimpl.h>
+Objects_Information _POSIX_Message_queue_Information;
+
+Objects_Information _POSIX_Message_queue_Information_fds;
+
/*
* _POSIX_Message_queue_Manager_initialization
*
@@ -42,7 +47,7 @@
* Output parameters: NONE
*/
-void _POSIX_Message_queue_Manager_initialization(void)
+static void _POSIX_Message_queue_Manager_initialization(void)
{
_Objects_Initialize_information(
&_POSIX_Message_queue_Information, /* object information table */
@@ -76,3 +81,9 @@ void _POSIX_Message_queue_Manager_initialization(void)
#endif
);
}
+
+RTEMS_SYSINIT_ITEM(
+ _POSIX_Message_queue_Manager_initialization,
+ RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/sapi/src/posixapi.c b/cpukit/sapi/src/posixapi.c
index da2b42b56c..8d99678196 100644
--- a/cpukit/sapi/src/posixapi.c
+++ b/cpukit/sapi/src/posixapi.c
@@ -33,7 +33,6 @@
#include <rtems/config.h>
#include <rtems/posix/barrierimpl.h>
#include <rtems/posix/config.h>
-#include <rtems/posix/mqueueimpl.h>
#include <rtems/posix/priorityimpl.h>
#include <rtems/posix/psignalimpl.h>
#include <rtems/posix/rwlockimpl.h>
@@ -61,7 +60,6 @@ void _POSIX_API_Initialize(void)
_POSIX_Key_Manager_initialization();
#ifdef RTEMS_POSIX_API
- _POSIX_Message_queue_Manager_initialization();
_POSIX_Semaphore_Manager_initialization();
_POSIX_Timer_Manager_initialization();
_POSIX_Barrier_Manager_initialization();
diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h
index 1ca95a154d..bce999e60b 100644
--- a/cpukit/score/include/rtems/sysinit.h
+++ b/cpukit/score/include/rtems/sysinit.h
@@ -46,6 +46,7 @@ extern "C" {
#define RTEMS_SYSINIT_POSIX_THREADS 000361
#define RTEMS_SYSINIT_POSIX_CONDITION_VARIABLE 000362
#define RTEMS_SYSINIT_POSIX_MUTEX 000363
+#define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE 000364
#define RTEMS_SYSINIT_POSIX_CLEANUP 00036a
#define RTEMS_SYSINIT_IDLE_THREADS 000380
#define RTEMS_SYSINIT_BSP_LIBC 000400