00001 00009 /* 00010 * COPYRIGHT (c) 1989-2008. 00011 * On-Line Applications Research Corporation (OAR). 00012 * 00013 * The license and distribution terms for this file may be 00014 * found in the file LICENSE in this distribution or at 00015 * http://www.rtems.com/license/LICENSE. 00016 * 00017 * $Id: apimutex.h,v 1.12 2008/01/29 23:58:17 joel Exp $ 00018 */ 00019 00020 #ifndef _RTEMS_SCORE_APIMUTEX_H 00021 #define _RTEMS_SCORE_APIMUTEX_H 00022 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 #include <rtems/score/coremutex.h> 00036 #include <rtems/score/isr.h> 00037 #include <rtems/score/object.h> 00038 00043 typedef struct { 00045 Objects_Control Object; 00047 CORE_mutex_Control Mutex; 00048 } API_Mutex_Control; 00049 00054 SCORE_EXTERN Objects_Information _API_Mutex_Information; 00055 00062 void _API_Mutex_Initialization( 00063 uint32_t maximum_mutexes 00064 ); 00065 00071 void _API_Mutex_Allocate( 00072 API_Mutex_Control **the_mutex 00073 ); 00074 00080 void _API_Mutex_Lock( 00081 API_Mutex_Control *the_mutex 00082 ); 00083 00089 void _API_Mutex_Unlock( 00090 API_Mutex_Control *the_mutex 00091 ); 00092 00101 SCORE_EXTERN API_Mutex_Control *_RTEMS_Allocator_Mutex; 00102 00108 #define _RTEMS_Lock_allocator() \ 00109 _API_Mutex_Lock( _RTEMS_Allocator_Mutex ) 00110 00116 #define _RTEMS_Unlock_allocator() \ 00117 _API_Mutex_Unlock( _RTEMS_Allocator_Mutex ) 00118 00119 /* 00120 * There are no inlines for this handler. 00121 */ 00122 00123 #ifndef __RTEMS_APPLICATION__ 00124 /* #include <rtems/score/apimutex.inl> */ 00125 #endif 00126 00127 #ifdef __cplusplus 00128 } 00129 #endif 00130 00133 #endif 00134 /* end of include file */
1.5.6