summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems
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 /cpukit/posix/include/rtems
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.
Diffstat (limited to '')
-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
2 files changed, 43 insertions, 41 deletions
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 */