RTEMS CPU Kit with SuperCore  4.10.99.0
rtems/rtems/sem.h
Go to the documentation of this file.
00001 
00022 /* COPYRIGHT (c) 1989-2008.
00023  * On-Line Applications Research Corporation (OAR).
00024  *
00025  * The license and distribution terms for this file may be
00026  * found in the file LICENSE in this distribution or at
00027  * http://www.rtems.org/license/LICENSE.
00028  */
00029 
00030 #ifndef _RTEMS_RTEMS_SEM_H
00031 #define _RTEMS_RTEMS_SEM_H
00032 
00033 #include <rtems/rtems/types.h>
00034 #include <rtems/rtems/options.h>
00035 #include <rtems/rtems/support.h>
00036 #include <rtems/rtems/tasks.h>
00037 #include <rtems/rtems/attr.h>
00038 #include <rtems/score/coremutex.h>
00039 #include <rtems/score/object.h>
00040 #include <rtems/score/coresem.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00059 typedef struct {
00061   Objects_Control          Object;
00062 
00068   rtems_attribute          attribute_set;
00069 
00079   union {
00084     CORE_mutex_Control     mutex;
00085 
00090     CORE_semaphore_Control semaphore;
00091   } Core_control;
00092 }   Semaphore_Control;
00093 
00105 rtems_status_code rtems_semaphore_create(
00106   rtems_name           name,
00107   uint32_t             count,
00108   rtems_attribute      attribute_set,
00109   rtems_task_priority  priority_ceiling,
00110   rtems_id            *id
00111 );
00112 
00131 rtems_status_code rtems_semaphore_ident(
00132   rtems_name    name,
00133   uint32_t      node,
00134   rtems_id     *id
00135 );
00136 
00149 rtems_status_code rtems_semaphore_delete(
00150   rtems_id   id
00151 );
00152 
00172 rtems_status_code rtems_semaphore_obtain(
00173   rtems_id       id,
00174   rtems_option   option_set,
00175   rtems_interval timeout
00176 );
00177 
00189 rtems_status_code rtems_semaphore_release(
00190   rtems_id   id
00191 );
00192 
00207 rtems_status_code rtems_semaphore_flush(
00208   rtems_id         id
00209 );
00210 
00213 #ifdef __cplusplus
00214 }
00215 #endif
00216 
00217 #endif
00218 /*  end of include file */