00001 00008 /* 00009 * COPYRIGHT (c) 1989-2006. 00010 * On-Line Applications Research Corporation (OAR). 00011 * 00012 * The license and distribution terms for this file may be 00013 * found in the file LICENSE in this distribution or at 00014 * http://www.rtems.com/license/LICENSE. 00015 * 00016 * $Id: mpci.h,v 1.23 2007/12/03 22:23:13 joel Exp $ 00017 */ 00018 00019 #ifndef _RTEMS_SCORE_MPCI_H 00020 #define _RTEMS_SCORE_MPCI_H 00021 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 #include <rtems/score/mppkt.h> 00038 #include <rtems/score/states.h> 00039 #include <rtems/score/thread.h> 00040 #include <rtems/score/threadq.h> 00041 #include <rtems/score/tqdata.h> 00042 #include <rtems/score/watchdog.h> 00043 #include <rtems/score/coresem.h> 00044 00048 #define MPCI_ALL_NODES 0 00049 00056 #define MPCI_DEFAULT_TIMEOUT 0xFFFFFFFF 00057 00061 typedef void MPCI_Entry; 00062 00067 typedef MPCI_Entry ( *MPCI_initialization_entry )( void ); 00068 00074 typedef MPCI_Entry ( *MPCI_get_packet_entry )( 00075 MP_packet_Prefix ** 00076 ); 00077 00084 typedef MPCI_Entry ( *MPCI_return_packet_entry )( 00085 MP_packet_Prefix * 00086 ); 00087 00094 typedef MPCI_Entry ( *MPCI_send_entry )( 00095 uint32_t, 00096 MP_packet_Prefix * 00097 ); 00098 00106 typedef MPCI_Entry ( *MPCI_receive_entry )( 00107 MP_packet_Prefix ** 00108 ); 00109 00118 typedef struct { 00120 uint32_t default_timeout; 00125 uint32_t maximum_packet_size; 00127 MPCI_initialization_entry initialization; 00129 MPCI_get_packet_entry get_packet; 00131 MPCI_return_packet_entry return_packet; 00133 MPCI_send_entry send_packet; 00135 MPCI_receive_entry receive_packet; 00136 } MPCI_Control; 00137 00142 typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * ); 00143 00148 typedef enum { 00149 MPCI_PACKETS_SYSTEM_VERIFY = 0 00150 } MPCI_Internal_Remote_operations; 00151 00156 typedef struct { 00158 MP_packet_Prefix Prefix; 00160 MPCI_Internal_Remote_operations operation; 00164 uint32_t maximum_nodes; 00168 uint32_t maximum_global_objects; 00169 } MPCI_Internal_packet; 00170 00174 SCORE_EXTERN CORE_semaphore_Control _MPCI_Semaphore; 00175 00180 SCORE_EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads; 00181 00186 SCORE_EXTERN MPCI_Control *_MPCI_table; 00187 00194 SCORE_EXTERN Thread_Control *_MPCI_Receive_server_tcb; 00195 00200 SCORE_EXTERN MPCI_Packet_processor 00201 _MPCI_Packet_processors[MP_PACKET_CLASSES_LAST+1]; 00202 00212 void _MPCI_Handler_initialization( 00213 MPCI_Control *users_mpci_table, 00214 uint32_t timeout_status 00215 ); 00216 00220 void _MPCI_Create_server( void ); 00221 00226 void _MPCI_Initialization ( void ); 00227 00237 void _MPCI_Register_packet_processor( 00238 MP_packet_Classes the_class, 00239 MPCI_Packet_processor the_packet_processor 00240 00241 ); 00242 00251 MP_packet_Prefix *_MPCI_Get_packet ( void ); 00252 00259 void _MPCI_Return_packet ( 00260 MP_packet_Prefix *the_packet 00261 ); 00262 00270 void _MPCI_Send_process_packet ( 00271 uint32_t destination, 00272 MP_packet_Prefix *the_packet 00273 ); 00274 00288 uint32_t _MPCI_Send_request_packet ( 00289 uint32_t destination, 00290 MP_packet_Prefix *the_packet, 00291 States_Control extra_state 00292 ); 00293 00301 void _MPCI_Send_response_packet ( 00302 uint32_t destination, 00303 MP_packet_Prefix *the_packet 00304 ); 00305 00312 MP_packet_Prefix *_MPCI_Receive_packet ( void ); 00313 00324 Thread_Control *_MPCI_Process_response ( 00325 MP_packet_Prefix *the_packet 00326 ); 00327 00333 Thread _MPCI_Receive_server( 00334 uint32_t ignored 00335 ); 00336 00340 void _MPCI_Announce ( void ); 00341 00348 void _MPCI_Internal_packets_Send_process_packet ( 00349 MPCI_Internal_Remote_operations operation 00350 ); 00351 00376 void _MPCI_Internal_packets_Process_packet ( 00377 MP_packet_Prefix *the_packet_prefix 00378 ); 00379 00405 MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void ); 00406 00407 #ifdef __cplusplus 00408 } 00409 #endif 00410 00413 #endif 00414 /* end of include file */
1.5.6