summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/apimutex.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-24 13:50:54 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-07-26 11:55:47 +0200
commita2e3f33f39e6898c2e2886216fe671b29a93d643 (patch)
treed304dc7fe4fcf0dcb42a61b8ba99b2c698d8454f /cpukit/score/src/apimutex.c
parentInclude missing <rtems/score/threaddispatch.h> (diff)
downloadrtems-a2e3f33f39e6898c2e2886216fe671b29a93d643.tar.bz2
score: Create object implementation header
Move implementation specific parts of object.h and object.inl into new header file objectimpl.h. The object.h contains now only the application visible API.
Diffstat (limited to 'cpukit/score/src/apimutex.c')
-rw-r--r--cpukit/score/src/apimutex.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/cpukit/score/src/apimutex.c b/cpukit/score/src/apimutex.c
index bc72c91e7c..555292d539 100644
--- a/cpukit/score/src/apimutex.c
+++ b/cpukit/score/src/apimutex.c
@@ -1,7 +1,7 @@
/**
* @file
- *
- * @brief Initialization for the API Mutexe Handler.
+ *
+ * @brief Initialization and Allocation for API Mutex Handler
*
* @ingroup ScoreAPIMutex
*/
@@ -19,8 +19,11 @@
#include "config.h"
#endif
-#include <rtems/system.h>
#include <rtems/score/apimutex.h>
+#include <rtems/score/coremuteximpl.h>
+#include <rtems/score/objectimpl.h>
+
+static Objects_Information _API_Mutex_Information;
void _API_Mutex_Initialization(
uint32_t maximum_mutexes
@@ -41,3 +44,25 @@ void _API_Mutex_Initialization(
#endif
);
}
+
+void _API_Mutex_Allocate(
+ API_Mutex_Control **the_mutex
+)
+{
+ API_Mutex_Control *mutex;
+
+ CORE_mutex_Attributes attr = {
+ CORE_MUTEX_NESTING_ACQUIRES,
+ false,
+ CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT,
+ 0
+ };
+
+ mutex = (API_Mutex_Control *) _Objects_Allocate( &_API_Mutex_Information );
+
+ _CORE_mutex_Initialize( &mutex->Mutex, NULL, &attr, CORE_MUTEX_UNLOCKED );
+
+ _Objects_Open_u32( &_API_Mutex_Information, &mutex->Object, 1 );
+
+ *the_mutex = mutex;
+}