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 #include <rtems/score/mrsp.h>
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00060 typedef struct {
00062   Objects_Control          Object;
00063 
00069   rtems_attribute          attribute_set;
00070 
00080   union {
00085     CORE_mutex_Control     mutex;
00086 
00091     CORE_semaphore_Control semaphore;
00092 
00093 #if defined(RTEMS_SMP)
00094     MRSP_Control mrsp;
00095 #endif
00096   } Core_control;
00097 }   Semaphore_Control;
00098 
00110 rtems_status_code rtems_semaphore_create(
00111   rtems_name           name,
00112   uint32_t             count,
00113   rtems_attribute      attribute_set,
00114   rtems_task_priority  priority_ceiling,
00115   rtems_id            *id
00116 );
00117 
00136 rtems_status_code rtems_semaphore_ident(
00137   rtems_name    name,
00138   uint32_t      node,
00139   rtems_id     *id
00140 );
00141 
00154 rtems_status_code rtems_semaphore_delete(
00155   rtems_id   id
00156 );
00157 
00177 rtems_status_code rtems_semaphore_obtain(
00178   rtems_id       id,
00179   rtems_option   option_set,
00180   rtems_interval timeout
00181 );
00182 
00194 rtems_status_code rtems_semaphore_release(
00195   rtems_id   id
00196 );
00197 
00212 rtems_status_code rtems_semaphore_flush(
00213   rtems_id         id
00214 );
00215 
00250 rtems_status_code rtems_semaphore_set_priority(
00251   rtems_id             semaphore_id,
00252   rtems_id             scheduler_id,
00253   rtems_task_priority  new_priority,
00254   rtems_task_priority *old_priority
00255 );
00256 
00259 #ifdef __cplusplus
00260 }
00261 #endif
00262 
00263 #endif
00264 /*  end of include file */