RTEMS CPU Kit with SuperCore  4.11.2
apimutex.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2008.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_SCORE_APIMUTEX_H
19 #define _RTEMS_SCORE_APIMUTEX_H
20 
21 #include <rtems/score/coremutex.h>
22 #include <rtems/score/object.h>
23 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 typedef struct {
45 
50 
57 
66 void _API_Mutex_Initialization( uint32_t maximum_mutexes );
67 
73 
80 
87 
94 
117 
118 static inline void _RTEMS_Lock_allocator( void )
119 {
120  _API_Mutex_Lock( _RTEMS_Allocator_Mutex );
121 }
122 
123 static inline void _RTEMS_Unlock_allocator( void )
124 {
125  _API_Mutex_Unlock( _RTEMS_Allocator_Mutex );
126 }
127 
128 static inline bool _RTEMS_Allocator_is_owner( void )
129 {
130  return _API_Mutex_Is_owner( _RTEMS_Allocator_Mutex );
131 }
132 
133 SCORE_EXTERN API_Mutex_Control *_Once_Mutex;
134 
135 static inline void _Once_Lock( void )
136 {
137  _API_Mutex_Lock( _Once_Mutex );
138 }
139 
140 static inline void _Once_Unlock( void )
141 {
142  _API_Mutex_Unlock( _Once_Mutex );
143 }
144 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 #endif
152 /* end of include file */
Constants and Structures Associated with the Object Handler.
void _API_Mutex_Allocate(API_Mutex_Control **mutex)
Allocates an API mutex from the inactive set and returns it in mutex.
Definition: apimutex.c:48
The following defines the Object Control Block used to manage each object local to this node...
Definition: object.h:232
SCORE_EXTERN API_Mutex_Control * _RTEMS_Allocator_Mutex
Memory allocation mutex.
Definition: apimutex.h:116
void _API_Mutex_Lock(API_Mutex_Control *mutex)
Acquires the specified API mutex.
Definition: apimutexlock.c:26
bool previous_thread_life_protection
The thread life protection state before the outer-most mutex obtain.
Definition: apimutex.h:55
void _API_Mutex_Initialization(uint32_t maximum_mutexes)
Initialization for the API Mutexe Handler.
Definition: apimutex.c:28
CORE_mutex_Control Mutex
Contains the SuperCore mutex information.
Definition: apimutex.h:49
Objects_Control Object
Allows each API Mutex to be a full-fledged RTEMS object.
Definition: apimutex.h:44
Control block used to manage each mutex.
Definition: coremutex.h:149
bool _API_Mutex_Is_owner(const API_Mutex_Control *mutex)
Checks if the specified API mutex is owned by the executing thread.
Definition: apimutexisowner.c:23
Control block used to manage each API mutex.
Definition: apimutex.h:40
void _API_Mutex_Unlock(API_Mutex_Control *mutex)
Releases the specified API mutex.
Definition: apimutexunlock.c:25
CORE Mutex API.
#define SCORE_EXTERN
The following ensures that all data is declared in the space of the initialization routine for either...
Definition: basedefs.h:81
Definition: mutex.h:5