From ade173922b55bcfe9fe5b8030541a48cbcc1dad6 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 5 Aug 2009 15:29:19 +0000 Subject: 2009-08-05 Joel Sherrill * posix/include/rtems/posix/config.h, posix/src/mqueue.c, sapi/include/confdefs.h: Add configuration of posix message queue file descriptors as separate entity. --- cpukit/ChangeLog | 6 ++++++ cpukit/posix/include/rtems/posix/config.h | 1 + cpukit/posix/src/mqueue.c | 2 +- cpukit/sapi/include/confdefs.h | 26 +++++++++++++++++++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index a9ec7efda1..741029a4ff 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2009-08-05 Joel Sherrill + + * posix/include/rtems/posix/config.h, posix/src/mqueue.c, + sapi/include/confdefs.h: Add configuration of posix message queue + file descriptors as separate entity. + 2009-08-05 Joel Sherrill * rtems/include/rtems/rtems/region.h: Use new name. diff --git a/cpukit/posix/include/rtems/posix/config.h b/cpukit/posix/include/rtems/posix/config.h index 402d023bac..b6ad91fb34 100644 --- a/cpukit/posix/include/rtems/posix/config.h +++ b/cpukit/posix/include/rtems/posix/config.h @@ -52,6 +52,7 @@ typedef struct { int maximum_timers; int maximum_queued_signals; int maximum_message_queues; + int maximum_message_queue_descriptors; int maximum_semaphores; int maximum_barriers; int maximum_rwlocks; diff --git a/cpukit/posix/src/mqueue.c b/cpukit/posix/src/mqueue.c index 5ae45f9b47..5229bd4d67 100644 --- a/cpukit/posix/src/mqueue.c +++ b/cpukit/posix/src/mqueue.c @@ -73,7 +73,7 @@ void _POSIX_Message_queue_Manager_initialization(void) &_POSIX_Message_queue_Information_fds, OBJECTS_POSIX_API, OBJECTS_POSIX_MESSAGE_QUEUE_FDS, - Configuration_POSIX_API.maximum_message_queues, + Configuration_POSIX_API.maximum_message_queue_descriptors, sizeof( POSIX_Message_queue_Control_fd ), /* size of this object's control block */ true, /* true if names for this object are strings */ diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index c8f5c57d5d..cee0a90e2a 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -26,7 +26,7 @@ */ /* - * COPYRIGHT (c) 1989-2008. + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -1089,10 +1089,22 @@ rtems_fs_init_functions_t rtems_fs_init_helper = #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0 + #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 0 + #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_mqueue_fds) 0 #else #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ _Configure_POSIX_Named_Object_RAM( \ _message_queues, sizeof(POSIX_Message_queue_Control) ) + + /* default to same number */ + #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS + #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \ + CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES + #endif + + #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_mqueue_fds) \ + _Configure_POSIX_Named_Object_RAM( \ + _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) ) #endif #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES @@ -1842,6 +1854,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper = CONFIGURE_MAXIMUM_POSIX_TIMERS, CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, + CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS, CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, CONFIGURE_MAXIMUM_POSIX_BARRIERS, CONFIGURE_MAXIMUM_POSIX_RWLOCKS, @@ -2029,6 +2042,7 @@ rtems_fs_init_functions_t rtems_fs_init_helper = (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ + (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ @@ -2102,5 +2116,15 @@ rtems_fs_init_functions_t rtems_fs_init_helper = #error "Maximum priority configured higher than supported by target." #endif +/* + * If you have fewer POSIX Message Queue Descriptors than actual + * POSIX Message Queues, then you will not be able to open all the + * queues. + */ +#if (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS < \ + CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + #error "Fewer POSIX Message Queue descriptors than Queues!" +#endif + #endif /* end of include file */ -- cgit v1.2.3