summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-27 15:08:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-05 14:29:02 +0200
commitde59c065c57cb8526662ee6da28a57ad16fdde66 (patch)
tree21f4a2adbd58f65f722051bca435572fbf5dcf05 /cpukit/score
parentposix: Implement self-contained POSIX condvar (diff)
downloadrtems-de59c065c57cb8526662ee6da28a57ad16fdde66.tar.bz2
posix: Implement self-contained POSIX mutex
POSIX mutexes are now available in all configurations and no longer depend on --enable-posix. Update #2514. Update #3112.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/Makefile.am1
-rw-r--r--cpukit/score/include/rtems/score/muteximpl.h37
-rw-r--r--cpukit/score/include/rtems/score/objectimpl.h1
-rw-r--r--cpukit/score/include/rtems/sysinit.h1
-rw-r--r--cpukit/score/preinstall.am4
-rw-r--r--cpukit/score/src/mutex.c11
6 files changed, 43 insertions, 12 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 86af199ec3..7a200707b2 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -54,6 +54,7 @@ include_rtems_score_HEADERS += include/rtems/score/isrlock.h
include_rtems_score_HEADERS += include/rtems/score/freechain.h
include_rtems_score_HEADERS += include/rtems/score/mrsp.h
include_rtems_score_HEADERS += include/rtems/score/mrspimpl.h
+include_rtems_score_HEADERS += include/rtems/score/muteximpl.h
include_rtems_score_HEADERS += include/rtems/score/object.h
include_rtems_score_HEADERS += include/rtems/score/objectimpl.h
include_rtems_score_HEADERS += include/rtems/score/onceimpl.h
diff --git a/cpukit/score/include/rtems/score/muteximpl.h b/cpukit/score/include/rtems/score/muteximpl.h
new file mode 100644
index 0000000000..5fd4f5e8be
--- /dev/null
+++ b/cpukit/score/include/rtems/score/muteximpl.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, 2017 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_MUTEXIMPL_H
+#define _RTEMS_SCORE_MUTEXIMPL_H
+
+#include <rtems/score/threadqimpl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct {
+ Thread_queue_Syslock_queue Queue;
+} Mutex_Control;
+
+typedef struct {
+ Mutex_Control Mutex;
+ unsigned int nest_level;
+} Mutex_recursive_Control;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_SCORE_MUTEXIMPL_H */
diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h
index 435e82cc45..0338a481ea 100644
--- a/cpukit/score/include/rtems/score/objectimpl.h
+++ b/cpukit/score/include/rtems/score/objectimpl.h
@@ -87,7 +87,6 @@ typedef enum {
OBJECTS_POSIX_KEYS = 2,
OBJECTS_POSIX_INTERRUPTS = 3,
OBJECTS_POSIX_MESSAGE_QUEUES = 5,
- OBJECTS_POSIX_MUTEXES = 6,
OBJECTS_POSIX_SEMAPHORES = 7,
OBJECTS_POSIX_TIMERS = 9,
OBJECTS_POSIX_SHMS = 12
diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h
index 595629fd04..7ab3d0b631 100644
--- a/cpukit/score/include/rtems/sysinit.h
+++ b/cpukit/score/include/rtems/sysinit.h
@@ -47,7 +47,6 @@ extern "C" {
#define RTEMS_SYSINIT_CLASSIC_BARRIER 00034a
#define RTEMS_SYSINIT_POSIX_SIGNALS 000360
#define RTEMS_SYSINIT_POSIX_THREADS 000361
-#define RTEMS_SYSINIT_POSIX_MUTEX 000363
#define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE 000364
#define RTEMS_SYSINIT_POSIX_SEMAPHORE 000365
#define RTEMS_SYSINIT_POSIX_TIMER 000366
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 0e05b5548e..2d7d5a2859 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -184,6 +184,10 @@ $(PROJECT_INCLUDE)/rtems/score/mrspimpl.h: include/rtems/score/mrspimpl.h $(PROJ
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/mrspimpl.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/mrspimpl.h
+$(PROJECT_INCLUDE)/rtems/score/muteximpl.h: include/rtems/score/muteximpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/muteximpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/muteximpl.h
+
$(PROJECT_INCLUDE)/rtems/score/object.h: include/rtems/score/object.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/object.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/object.h
diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c
index 5916119f02..2a116c4602 100644
--- a/cpukit/score/src/mutex.c
+++ b/cpukit/score/src/mutex.c
@@ -20,16 +20,12 @@
#include <errno.h>
#include <rtems/score/assert.h>
+#include <rtems/score/muteximpl.h>
#include <rtems/score/threadimpl.h>
-#include <rtems/score/threadqimpl.h>
#include <rtems/score/todimpl.h>
#define MUTEX_TQ_OPERATIONS &_Thread_queue_Operations_priority_inherit
-typedef struct {
- Thread_queue_Syslock_queue Queue;
-} Mutex_Control;
-
RTEMS_STATIC_ASSERT(
offsetof( Mutex_Control, Queue )
== offsetof( struct _Mutex_Control, _Queue ),
@@ -41,11 +37,6 @@ RTEMS_STATIC_ASSERT(
MUTEX_CONTROL_SIZE
);
-typedef struct {
- Mutex_Control Mutex;
- unsigned int nest_level;
-} Mutex_recursive_Control;
-
RTEMS_STATIC_ASSERT(
offsetof( Mutex_recursive_Control, Mutex )
== offsetof( struct _Mutex_recursive_Control, _Mutex ),