diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-25 10:12:39 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-29 10:33:37 +0100 |
commit | fe7aefd516baf9d44003ce47d9379a310ac4050e (patch) | |
tree | b8807eb5eb534889ec532f8b1f1e6db529ee4ab1 /cpukit/include | |
parent | posix: Provide shared memory objects by default (diff) | |
download | rtems-fe7aefd516baf9d44003ce47d9379a310ac4050e.tar.bz2 |
posix: Provide message queues by default
Update #2514.
Diffstat (limited to 'cpukit/include')
-rw-r--r-- | cpukit/include/rtems/confdefs.h | 52 | ||||
-rw-r--r-- | cpukit/include/rtems/score/coremsg.h | 26 |
2 files changed, 36 insertions, 42 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h index 78a73c8c4a..c2c6fe6507 100644 --- a/cpukit/include/rtems/confdefs.h +++ b/cpukit/include/rtems/confdefs.h @@ -33,6 +33,7 @@ #include <rtems/score/userextimpl.h> #include <rtems/score/wkspace.h> #include <rtems/posix/key.h> +#include <rtems/posix/mqueue.h> #include <rtems/posix/semaphore.h> #include <rtems/posix/shm.h> @@ -1937,6 +1938,10 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \ rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) #endif + #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \ + rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) + #endif #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \ rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) @@ -1961,10 +1966,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) #endif */ - #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) - #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \ - rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) - #endif #endif /* RTEMS_POSIX_API */ #endif /* CONFIGURE_UNLIMITED_OBJECTS */ @@ -2310,6 +2311,22 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; /** * This configuration parameter specifies the maximum number of + * POSIX API message queues. + */ +#ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES + #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 +#endif + +/* + * This macro is calculated to specify the memory required for + * POSIX API message queues. + */ +#define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ + _Configure_POSIX_Named_Object_RAM( \ + _message_queues, sizeof(POSIX_Message_queue_Control) ) + +/** + * This configuration parameter specifies the maximum number of * POSIX API semaphores. */ #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES @@ -2345,8 +2362,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #ifdef RTEMS_POSIX_API #include <sys/types.h> #include <signal.h> - #include <mqueue.h> - #include <rtems/posix/mqueue.h> #include <rtems/posix/psignal.h> #include <rtems/posix/pthread.h> #include <rtems/posix/threadsup.h> @@ -2391,22 +2406,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; _Configure_From_workspace( \ (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) ) - /** - * This configuration parameter specifies the maximum number of - * POSIX API message queues. - */ - #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES - #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 - #endif - - /* - * This macro is calculated to specify the memory required for - * POSIX API message queues. - */ - #define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ - _Configure_POSIX_Named_Object_RAM( \ - _message_queues, sizeof(POSIX_Message_queue_Control) ) - #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE #ifndef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT @@ -2545,8 +2544,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #define _CONFIGURE_MEMORY_FOR_POSIX \ (_CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) + \ - _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ - CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \ _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS)) #else /* @@ -2705,6 +2702,8 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; _CONFIGURE_MEMORY_FOR_POSIX_KEYS( \ _CONFIGURE_POSIX_KEYS, \ CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \ + _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ + CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \ _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \ _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \ @@ -3211,8 +3210,8 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #ifdef RTEMS_POSIX_API uint32_t POSIX_TIMERS; uint32_t POSIX_QUEUED_SIGNALS; - uint32_t POSIX_MESSAGE_QUEUES; #endif + uint32_t POSIX_MESSAGE_QUEUES; uint32_t POSIX_SEMAPHORES; uint32_t POSIX_SHMS; @@ -3259,9 +3258,9 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; _CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), +#endif _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), -#endif _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), _CONFIGURE_MEMORY_FOR_POSIX_SHMS( CONFIGURE_MAXIMUM_POSIX_SHMS ), @@ -3327,7 +3326,6 @@ extern rtems_initialization_tasks_table Initialization_tasks[]; #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ - (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) #error "CONFIGURATION ERROR: POSIX API support not configured!!" #endif diff --git a/cpukit/include/rtems/score/coremsg.h b/cpukit/include/rtems/score/coremsg.h index 8d25529fdc..e0a7e05bbf 100644 --- a/cpukit/include/rtems/score/coremsg.h +++ b/cpukit/include/rtems/score/coremsg.h @@ -38,14 +38,12 @@ extern "C" { */ /**@{*/ -#if defined(RTEMS_POSIX_API) - /** - * This macro is defined when an API is enabled that requires that the - * Message Queue Handler include support for priority based enqueuing - * of messages. - */ - #define RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY -#endif +/** + * This macro is defined when an API is enabled that requires that the + * Message Queue Handler include support for priority based enqueuing + * of messages. + */ +#define RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY #if defined(RTEMS_POSIX_API) /** @@ -56,13 +54,11 @@ extern "C" { #define RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION #endif -#if defined(RTEMS_POSIX_API) - /** - * This macro is defined when an API is enabled that requires the - * Message Queue Handler include support for blocking send operations. - */ - #define RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND -#endif +/** + * This macro is defined when an API is enabled that requires the + * Message Queue Handler include support for blocking send operations. + */ +#define RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND typedef struct CORE_message_queue_Control CORE_message_queue_Control; |