RTEMS CPU Kit with SuperCore  4.11.3
muteximpl.h
Go to the documentation of this file.
1 
10 /* COPYRIGHT (c) 1989-2013.
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 #include <rtems/posix/mutex.h>
20 
21 #include <errno.h>
22 
23 #ifndef _RTEMS_POSIX_MUTEXIMPL_H
24 #define _RTEMS_POSIX_MUTEXIMPL_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
35 
40 
46 
53 
61 {
62  return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information );
63 }
64 
72  POSIX_Mutex_Control *the_mutex
73 )
74 {
75  _CORE_mutex_Destroy( &the_mutex->Mutex );
76  _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object );
77 }
78 
79 
87  pthread_mutex_t *mutex,
88  bool blocking,
89  Watchdog_Interval timeout
90 );
91 
115  CORE_mutex_Status the_mutex_status
116 )
117 {
118  /*
119  * Internal consistency check for bad status from SuperCore
120  */
121  #if defined(RTEMS_DEBUG)
122  if ( the_mutex_status > CORE_MUTEX_STATUS_LAST )
123  return EINVAL;
124  #endif
125  return _POSIX_Mutex_Return_codes[the_mutex_status];
126 }
127 
137  pthread_mutex_t *mutex,
138  Objects_Locations *location
139 );
140 
150  pthread_mutex_t *mutex,
151  Objects_Locations *location,
152  ISR_lock_Context *lock_context
153 );
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif
160 /* end of include file */
161 
RTEMS_INLINE_ROUTINE POSIX_Mutex_Control * _POSIX_Mutex_Allocate(void)
POSIX Mutex Allocate.
Definition: muteximpl.h:60
void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectfree.c:25
RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free(POSIX_Mutex_Control *the_mutex)
POSIX Mutex Free.
Definition: muteximpl.h:71
CORE Mutex Implementation.
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:101
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
Definition: mutex.h:43
POSIX_Mutex_Control * _POSIX_Mutex_Get_interrupt_disable(pthread_mutex_t *mutex, Objects_Locations *location, ISR_lock_Context *lock_context)
POSIX Mutex Get (Interrupt Disable)
Definition: mutexget.c:71
POSIX_EXTERN pthread_mutexattr_t _POSIX_Mutex_Default_attributes
The default mutex attributes structure.
Definition: muteximpl.h:39
const int _POSIX_Mutex_Return_codes[CORE_MUTEX_STATUS_LAST+1]
This array contains a mapping from Score Mutex return codes to POSIX return codes.
Definition: mutextranslatereturncode.c:23
POSIX MUTEX Support.
POSIX_Mutex_Control * _POSIX_Mutex_Get(pthread_mutex_t *mutex, Objects_Locations *location)
POSIX Mutex Get (Thread Dispatch Disable)
Definition: mutexget.c:58
CORE_mutex_Status
The possible Mutex handler return statuses.
Definition: coremuteximpl.h:52
The following defines the structure for the information used to manage each class of objects...
Definition: objectimpl.h:136
POSIX_EXTERN Objects_Information _POSIX_Mutex_Information
The following defines the information control block used to manage this class of objects.
Definition: muteximpl.h:34
int _POSIX_Mutex_Lock_support(pthread_mutex_t *mutex, bool blocking, Watchdog_Interval timeout)
POSIX Mutex Lock Support Method.
Definition: mutexlocksupp.c:38
RTEMS_INLINE_ROUTINE int _POSIX_Mutex_Translate_core_mutex_return_code(CORE_mutex_Status the_mutex_status)
Convert Score mutex status codes into POSIX status values.
Definition: muteximpl.h:114
uint32_t Watchdog_Interval
Type is used to specify the length of intervals.
Definition: watchdog.h:47
Objects_Locations
This enumerated type lists the locations which may be returned by _Objects_Get.
Definition: objectimpl.h:117
Local ISR lock context for acquire and release pairs.
Definition: isrlock.h:65
#define CORE_MUTEX_STATUS_LAST
The last status value.
Definition: coremuteximpl.h:99
Definition: mutex.h:5
#define POSIX_EXTERN
The following ensures that all data is declared in the space of the initialization routine for either...
Definition: basedefs.h:123
void _POSIX_Mutex_Manager_initialization(void)
POSIX Mutex Manager Initialization.
Definition: mutex.c:44