summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests/spsysinit01/init.c
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2016-08-12 15:25:10 -0400
committerGedare Bloom <gedare@rtems.org>2017-01-13 11:17:30 -0500
commitba77628250ae7158db363fc0d7886ebd43e9cb69 (patch)
tree91a8a5b7d20399c69c5c88223a43ec681451996b /testsuites/sptests/spsysinit01/init.c
parentposix: fix typo in mmap arguments (diff)
downloadrtems-ba77628250ae7158db363fc0d7886ebd43e9cb69.tar.bz2
posix: shared memory support
Add POSIX shared memory manager (Shm). Includes a hook-based approach for the backing memory storage that defaults to the Workspace, and a test is provided using the heap. A test is also provided for the basic use of mmap'ing a shared memory object. This test currently fails at the mmap stage due to no support for mmap.
Diffstat (limited to 'testsuites/sptests/spsysinit01/init.c')
-rw-r--r--testsuites/sptests/spsysinit01/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index b81fbabbac..15072c3d20 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -43,6 +43,7 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/rwlockimpl.h>
#include <rtems/posix/semaphoreimpl.h>
+#include <rtems/posix/shmimpl.h>
#include <rtems/posix/timerimpl.h>
#endif /* RTEMS_POSIX_API */
#include <rtems/posix/keyimpl.h>
@@ -117,6 +118,8 @@ typedef enum {
POSIX_BARRIER_POST,
POSIX_RWLOCK_PRE,
POSIX_RWLOCK_POST,
+ POSIX_SHM_PRE,
+ POSIX_SHM_POST,
POSIX_CLEANUP_PRE,
POSIX_CLEANUP_POST,
#endif /* RTEMS_POSIX_API */
@@ -524,6 +527,18 @@ LAST(RTEMS_SYSINIT_POSIX_RWLOCK)
next_step(POSIX_RWLOCK_POST);
}
+FIRST(RTEMS_SYSINIT_POSIX_SHM)
+{
+ assert(_POSIX_Shm_Information.maximum == 0);
+ next_step(POSIX_SHM_PRE);
+}
+
+LAST(RTEMS_SYSINIT_POSIX_SHM)
+{
+ assert(_POSIX_Shm_Information.maximum != 0);
+ next_step(POSIX_SHM_POST);
+}
+
static size_t user_extensions_pre_posix_cleanup;
FIRST(RTEMS_SYSINIT_POSIX_CLEANUP)
@@ -752,6 +767,8 @@ static void *POSIX_Init(void *arg)
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 1
+#define CONFIGURE_MAXIMUM_POSIX_SHMS 1
+
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 1
#define CONFIGURE_MAXIMUM_POSIX_THREADS 1