RTEMS CPU Kit with SuperCore  4.10.99.0
rtems/score/coremsg.h
Go to the documentation of this file.
00001 
00010 /*
00011  *  COPYRIGHT (c) 1989-2009.
00012  *  On-Line Applications Research Corporation (OAR).
00013  *
00014  *  The license and distribution terms for this file may be
00015  *  found in the file LICENSE in this distribution or at
00016  *  http://www.rtems.org/license/LICENSE.
00017  */
00018 
00019 #ifndef _RTEMS_SCORE_COREMSG_H
00020 #define _RTEMS_SCORE_COREMSG_H
00021 
00022 #include <rtems/score/chain.h>
00023 #include <rtems/score/threadq.h>
00024 #include <rtems/score/watchdog.h>
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00040 #if defined(RTEMS_POSIX_API)
00041 
00046   #define RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY
00047 #endif
00048 
00049 #if defined(RTEMS_POSIX_API)
00050 
00055   #define RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION
00056 #endif
00057 
00058 #if defined(RTEMS_POSIX_API)
00059 
00063   #define RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND
00064 #endif
00065 
00075 typedef struct {
00077   size_t      size;
00079   uint32_t    buffer[1];
00080 } CORE_message_queue_Buffer;
00081 
00088 typedef struct {
00090   Chain_Node                 Node;
00091   #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
00092 
00093     int                        priority;
00094   #endif
00095 
00096   CORE_message_queue_Buffer  Contents;
00097 }   CORE_message_queue_Buffer_control;
00098 
00105 typedef enum {
00107   CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
00109   CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY
00110 }   CORE_message_queue_Disciplines;
00111 
00118 typedef struct {
00120   CORE_message_queue_Disciplines  discipline;
00121 }   CORE_message_queue_Attributes;
00122 
00123 #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
00124 
00131   typedef void (*CORE_message_queue_Notify_Handler)( void * );
00132 #endif
00133 
00140 typedef struct {
00144   Thread_queue_Control               Wait_queue;
00148   CORE_message_queue_Attributes      Attributes;
00152   uint32_t                           maximum_pending_messages;
00155   uint32_t                           number_of_pending_messages;
00159   size_t                             maximum_message_size;
00163   Chain_Control                      Pending_messages;
00168   CORE_message_queue_Buffer         *message_buffers;
00169   #if defined(RTEMS_SCORE_COREMSG_ENABLE_NOTIFICATION)
00170 
00173     CORE_message_queue_Notify_Handler  notify_handler;
00175     void                              *notify_argument;
00176   #endif
00177 
00180   Chain_Control                      Inactive_messages;
00181 }   CORE_message_queue_Control;
00182 
00185 #ifdef __cplusplus
00186 }
00187 #endif
00188 
00189 #endif
00190 /*  end of include file */