diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-26 21:20:31 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-02 07:46:15 +0200 |
commit | c8982e5f6a4857444676165deab1e08dc91a6847 (patch) | |
tree | 9862d54650522b55afac8a4e1b84ab078a69dff5 /testsuites | |
parent | rtems: Avoid Giant lock for message queues (diff) | |
download | rtems-c8982e5f6a4857444676165deab1e08dc91a6847.tar.bz2 |
posix: Simplify message queues
The mq_open() function returns a descriptor to a POSIX message queue
object identified by a name. This is similar to sem_open(). In
contrast to the POSIX semaphore the POSIX message queues use a separate
object for the descriptor. This extra object is superfluous, since the
object identifier can be used directly for this purpose, just like for
the semaphores.
Update #2702.
Update #2555.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/psxtests/psxconfig01/init.c | 5 | ||||
-rw-r--r-- | testsuites/psxtests/psxmsgq04/init.c | 1 | ||||
-rw-r--r-- | testsuites/psxtmtests/psxtmmq01/init.c | 1 | ||||
-rw-r--r-- | testsuites/sptests/spthreadq01/init.c | 16 |
4 files changed, 1 insertions, 22 deletions
diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c index b4c555e836..1edd9ba9d8 100644 --- a/testsuites/psxtests/psxconfig01/init.c +++ b/testsuites/psxtests/psxconfig01/init.c @@ -130,7 +130,6 @@ const char rtems_test_name[] = "PSXCONFIG 1"; #endif #ifdef POSIX_MQ_COUNT - #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS POSIX_MQ_COUNT #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES POSIX_MQ_COUNT #define POSIX_MQ_0_COUNT 2 @@ -501,10 +500,6 @@ static rtems_task Init(rtems_task_argument argument) } rtems_resource_snapshot_take(&snapshot); rtems_test_assert( - snapshot.posix_api.active_message_queue_descriptors - == CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS - ); - rtems_test_assert( snapshot.posix_api.active_message_queues == CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ); diff --git a/testsuites/psxtests/psxmsgq04/init.c b/testsuites/psxtests/psxmsgq04/init.c index 7086cbe035..f1e1c968c0 100644 --- a/testsuites/psxtests/psxmsgq04/init.c +++ b/testsuites/psxtests/psxmsgq04/init.c @@ -137,7 +137,6 @@ void *POSIX_Init( #define CONFIGURE_MAXIMUM_POSIX_THREADS 1 #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1 -#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 2 #define CONFIGURE_POSIX_INIT_THREAD_TABLE diff --git a/testsuites/psxtmtests/psxtmmq01/init.c b/testsuites/psxtmtests/psxtmmq01/init.c index aacd968882..a5ed4fcf39 100644 --- a/testsuites/psxtmtests/psxtmmq01/init.c +++ b/testsuites/psxtmtests/psxtmmq01/init.c @@ -301,7 +301,6 @@ void *POSIX_Init( #define CONFIGURE_MAXIMUM_POSIX_THREADS 1 #define CONFIGURE_POSIX_INIT_THREAD_TABLE #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 2 -#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 2 #define CONFIGURE_INIT diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c index fb2be649b5..cb8d495e79 100644 --- a/testsuites/sptests/spthreadq01/init.c +++ b/testsuites/sptests/spthreadq01/init.c @@ -25,8 +25,6 @@ #include <semaphore.h> #include <string.h> #include <pthread.h> - - #include <rtems/posix/mqueueimpl.h> #endif const char rtems_test_name[] = "SPTHREADQ 1"; @@ -121,9 +119,6 @@ static void posix_worker(test_context *ctx) int rv; int eno; char buf[1]; - POSIX_Message_queue_Control_fd *the_mq_fd; - Objects_Locations location; - ISR_lock_Context lock_context; wake_up_master(ctx); rtems_test_assert(get_wait_id(ctx) == ctx->psem); @@ -161,15 +156,7 @@ static void posix_worker(test_context *ctx) rtems_test_assert(eno == 0); wake_up_master(ctx); - the_mq_fd = _POSIX_Message_queue_Get_fd_interrupt_disable( - ctx->pmq, - &location, - &lock_context - ); - _ISR_lock_ISR_enable(&lock_context); - rtems_test_assert(the_mq_fd != NULL); - rtems_test_assert(location == OBJECTS_LOCAL); - rtems_test_assert(get_wait_id(ctx) == the_mq_fd->Queue->Object.id); + rtems_test_assert(get_wait_id(ctx) == ctx->pmq); buf[0] = 'x'; rv = mq_send(ctx->pmq, &buf[0], sizeof(buf), 0); @@ -397,7 +384,6 @@ static rtems_task Init( #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1 #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 1 #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 1 - #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 1 #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ (2 * CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(1, 1)) #else |