summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-19 15:18:08 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-22 16:57:24 +0200
commiteb448eece9305b2bba641471a428af4dad97effc (patch)
treea91945c92a3676581af54b186a588bfab8894a4c
parentposix: Create timer implementation header (diff)
downloadrtems-eb448eece9305b2bba641471a428af4dad97effc.tar.bz2
posix: Create spinlock implementation header
Move implementation specific parts of spinlock.h and spinlock.inl into new header file spinlockimpl.h. The spinlock.h contains now only the application visible API.
-rw-r--r--cpukit/libcsupport/src/resource_snapshot.c2
-rw-r--r--cpukit/posix/Makefile.am2
-rw-r--r--cpukit/posix/include/rtems/posix/spinlock.h39
-rw-r--r--cpukit/posix/include/rtems/posix/spinlockimpl.h (renamed from cpukit/posix/inline/rtems/posix/spinlock.inl)45
-rw-r--r--cpukit/posix/preinstall.am8
-rw-r--r--cpukit/posix/src/pspin.c2
-rw-r--r--cpukit/posix/src/pspindestroy.c2
-rw-r--r--cpukit/posix/src/pspininit.c2
-rw-r--r--cpukit/posix/src/pspinlock.c2
-rw-r--r--cpukit/posix/src/pspinlocktranslatereturncode.c2
-rw-r--r--cpukit/posix/src/pspintrylock.c2
-rw-r--r--cpukit/posix/src/pspinunlock.c2
-rw-r--r--cpukit/sapi/src/posixapi.c2
13 files changed, 57 insertions, 55 deletions
diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c
index 48bbdc8306..3318d38ddd 100644
--- a/cpukit/libcsupport/src/resource_snapshot.c
+++ b/cpukit/libcsupport/src/resource_snapshot.c
@@ -39,7 +39,7 @@
#include <rtems/posix/pthreadimpl.h>
#include <rtems/posix/rwlockimpl.h>
#include <rtems/posix/semaphoreimpl.h>
- #include <rtems/posix/spinlock.h>
+ #include <rtems/posix/spinlockimpl.h>
#include <rtems/posix/timerimpl.h>
#endif
diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am
index 9bea73b56c..e7ec45f81c 100644
--- a/cpukit/posix/Makefile.am
+++ b/cpukit/posix/Makefile.am
@@ -52,9 +52,9 @@ include_rtems_posix_HEADERS += include/rtems/posix/barrierimpl.h
include_rtems_posix_HEADERS += include/rtems/posix/rwlock.h
include_rtems_posix_HEADERS += include/rtems/posix/rwlockimpl.h
include_rtems_posix_HEADERS += include/rtems/posix/spinlock.h
+include_rtems_posix_HEADERS += include/rtems/posix/spinlockimpl.h
include_rtems_posix_HEADERS += inline/rtems/posix/key.inl
-include_rtems_posix_HEADERS += inline/rtems/posix/spinlock.inl
## src
libposix_a_SOURCES += src/aio_cancel.c src/aio_error.c src/aio_fsync.c \
diff --git a/cpukit/posix/include/rtems/posix/spinlock.h b/cpukit/posix/include/rtems/posix/spinlock.h
index 34b04ebbc9..c27a8c1907 100644
--- a/cpukit/posix/include/rtems/posix/spinlock.h
+++ b/cpukit/posix/include/rtems/posix/spinlock.h
@@ -25,6 +25,9 @@
#ifndef _RTEMS_POSIX_SPINLOCK_H
#define _RTEMS_POSIX_SPINLOCK_H
+#include <rtems/score/object.h>
+#include <rtems/score/corespinlock.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -39,9 +42,6 @@ extern "C" {
*/
/**@{**/
-#include <rtems/score/object.h>
-#include <rtems/score/corespinlock.h>
-
/**
* This type defines the control block used to manage each spinlock.
*/
@@ -53,39 +53,6 @@ typedef struct {
CORE_spinlock_Control Spinlock;
} POSIX_Spinlock_Control;
-/**
- * The following defines the information control block used to manage
- * this class of objects.
- */
-
-POSIX_EXTERN Objects_Information _POSIX_Spinlock_Information;
-
-/**
- * @brief POSIX spinlock manager initialization.
- *
- * This routine performs the initialization necessary for this manager.
- */
-
-void _POSIX_Spinlock_Manager_initialization(void);
-
-/**
- * @brief Translate core spinlock status code.
- *
- * This routine translates SuperCore Spinlock status codes into the
- * corresponding POSIX ones.
- *
- * @param[in] the_spinlock_status is the SuperCore status.
- *
- * @return the corresponding POSIX status
- */
-int _POSIX_Spinlock_Translate_core_spinlock_return_code(
- CORE_spinlock_Status the_spinlock_status
-);
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/posix/spinlock.inl>
-#endif
-
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/posix/inline/rtems/posix/spinlock.inl b/cpukit/posix/include/rtems/posix/spinlockimpl.h
index b8ababda02..5853d45c82 100644
--- a/cpukit/posix/inline/rtems/posix/spinlock.inl
+++ b/cpukit/posix/include/rtems/posix/spinlockimpl.h
@@ -16,15 +16,46 @@
* http://www.rtems.com/license/LICENSE.
*/
-#ifndef _RTEMS_POSIX_SPINLOCK_H
-# error "Never use <rtems/posix/spinlock.inl> directly; include <rtems/posix/spinlock.h> instead."
-#endif
+#ifndef _RTEMS_POSIX_SPINLOCKIMPL_H
+#define _RTEMS_POSIX_SPINLOCKIMPL_H
-#ifndef _RTEMS_POSIX_SPINLOCK_INL
-#define _RTEMS_POSIX_SPINLOCK_INL
+#include <rtems/posix/spinlock.h>
#include <pthread.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The following defines the information control block used to manage
+ * this class of objects.
+ */
+
+POSIX_EXTERN Objects_Information _POSIX_Spinlock_Information;
+
+/**
+ * @brief POSIX spinlock manager initialization.
+ *
+ * This routine performs the initialization necessary for this manager.
+ */
+
+void _POSIX_Spinlock_Manager_initialization(void);
+
+/**
+ * @brief Translate core spinlock status code.
+ *
+ * This routine translates SuperCore Spinlock status codes into the
+ * corresponding POSIX ones.
+ *
+ * @param[in] the_spinlock_status is the SuperCore status.
+ *
+ * @return the corresponding POSIX status
+ */
+int _POSIX_Spinlock_Translate_core_spinlock_return_code(
+ CORE_spinlock_Status the_spinlock_status
+);
+
/**
* @brief Allocate a spinlock control block.
*
@@ -92,5 +123,9 @@ RTEMS_INLINE_ROUTINE bool _POSIX_Spinlock_Is_null (
return ( the_spinlock == NULL );
}
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* end of include file */
diff --git a/cpukit/posix/preinstall.am b/cpukit/posix/preinstall.am
index 7cb8ee8348..3ae3896ec9 100644
--- a/cpukit/posix/preinstall.am
+++ b/cpukit/posix/preinstall.am
@@ -152,11 +152,11 @@ $(PROJECT_INCLUDE)/rtems/posix/spinlock.h: include/rtems/posix/spinlock.h $(PROJ
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/spinlock.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/spinlock.h
+$(PROJECT_INCLUDE)/rtems/posix/spinlockimpl.h: include/rtems/posix/spinlockimpl.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/spinlockimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/spinlockimpl.h
+
$(PROJECT_INCLUDE)/rtems/posix/key.inl: inline/rtems/posix/key.inl $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/key.inl
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/key.inl
-
-$(PROJECT_INCLUDE)/rtems/posix/spinlock.inl: inline/rtems/posix/spinlock.inl $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/spinlock.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/spinlock.inl
endif
diff --git a/cpukit/posix/src/pspin.c b/cpukit/posix/src/pspin.c
index 27a897339e..a31cb5d24d 100644
--- a/cpukit/posix/src/pspin.c
+++ b/cpukit/posix/src/pspin.c
@@ -29,7 +29,7 @@
#include <rtems/system.h>
#include <rtems/config.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
/**
* @brief _POSIX_Spinlock_Manager_initialization
diff --git a/cpukit/posix/src/pspindestroy.c b/cpukit/posix/src/pspindestroy.c
index f7243540b6..4b8485074e 100644
--- a/cpukit/posix/src/pspindestroy.c
+++ b/cpukit/posix/src/pspindestroy.c
@@ -22,7 +22,7 @@
#include <errno.h>
#include <rtems/system.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
/**
* This directive allows a thread to delete a spinlock specified by
diff --git a/cpukit/posix/src/pspininit.c b/cpukit/posix/src/pspininit.c
index 164cb5039f..fc65177701 100644
--- a/cpukit/posix/src/pspininit.c
+++ b/cpukit/posix/src/pspininit.c
@@ -24,7 +24,7 @@
#include <errno.h>
#include <rtems/system.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
/*
* pthread_spinlock_init
diff --git a/cpukit/posix/src/pspinlock.c b/cpukit/posix/src/pspinlock.c
index 2f4bfffaa6..a48750f6d2 100644
--- a/cpukit/posix/src/pspinlock.c
+++ b/cpukit/posix/src/pspinlock.c
@@ -22,7 +22,7 @@
#include <errno.h>
#include <rtems/system.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
/**
* This directive allows a thread to wait at a spinlock.
diff --git a/cpukit/posix/src/pspinlocktranslatereturncode.c b/cpukit/posix/src/pspinlocktranslatereturncode.c
index ce133a40b7..a77284adef 100644
--- a/cpukit/posix/src/pspinlocktranslatereturncode.c
+++ b/cpukit/posix/src/pspinlocktranslatereturncode.c
@@ -23,7 +23,7 @@
#include <rtems/system.h>
#include <rtems/score/corespinlock.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
static int _POSIX_Spinlock_Return_codes[CORE_SPINLOCK_STATUS_LAST + 1] = {
0, /* CORE_SPINLOCK_SUCCESSFUL */
diff --git a/cpukit/posix/src/pspintrylock.c b/cpukit/posix/src/pspintrylock.c
index 7f7c6c17e1..0aa3aab7bb 100644
--- a/cpukit/posix/src/pspintrylock.c
+++ b/cpukit/posix/src/pspintrylock.c
@@ -22,7 +22,7 @@
#include <errno.h>
#include <rtems/system.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
/*
* pthread_spin_trylock
diff --git a/cpukit/posix/src/pspinunlock.c b/cpukit/posix/src/pspinunlock.c
index dc43d1d1c9..7e4e830024 100644
--- a/cpukit/posix/src/pspinunlock.c
+++ b/cpukit/posix/src/pspinunlock.c
@@ -24,7 +24,7 @@
#include <errno.h>
#include <rtems/system.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
/*
* pthread_spin_unlock
diff --git a/cpukit/sapi/src/posixapi.c b/cpukit/sapi/src/posixapi.c
index 6cdffa7a28..7563e82e0c 100644
--- a/cpukit/sapi/src/posixapi.c
+++ b/cpukit/sapi/src/posixapi.c
@@ -41,7 +41,7 @@
#include <rtems/posix/rwlockimpl.h>
#include <rtems/posix/timerimpl.h>
#include <rtems/posix/semaphoreimpl.h>
-#include <rtems/posix/spinlock.h>
+#include <rtems/posix/spinlockimpl.h>
#include <rtems/posix/time.h>
Objects_Information *_POSIX_Objects[ OBJECTS_POSIX_CLASSES_LAST + 1 ];