93 #define SHM_BIG 0x00000001 94 #define SHM_LITTLE 0x10000000 98 #define SHM_BIG 0x01000000 99 #define SHM_LITTLE 0x00000010 119 #if defined(__mc68000__) 120 #define SHM_LOCK_VALUE 0x80000000 121 #define SHM_UNLOCK_VALUE 0 122 #define SHM_LOCK_VALUE 0x80000000 123 #define SHM_UNLOCK_VALUE 0 124 #elif defined(__i386__) 125 #define SHM_LOCK_VALUE 0x80000000 126 #define SHM_UNLOCK_VALUE 0 127 #elif defined(__mips__) 128 #define SHM_LOCK_VALUE 0x80000000 129 #define SHM_UNLOCK_VALUE 0 130 #elif defined(__hppa__) 131 #define SHM_LOCK_VALUE 0 132 #define SHM_UNLOCK_VALUE 1 133 #elif defined(__PPC__) 134 #define SHM_LOCK_VALUE 1 135 #define SHM_UNLOCK_VALUE 0 136 #elif defined(__unix__) 137 #define SHM_LOCK_VALUE 0 138 #define SHM_UNLOCK_VALUE 1 139 #elif defined(_AM29K) 140 #define SHM_LOCK_VALUE 0 141 #define SHM_UNLOCK_VALUE 1 142 #elif defined(__nios2__) 143 #define SHM_LOCK_VALUE 1 144 #define SHM_UNLOCK_VALUE 0 145 #elif defined(__sparc__) 146 #define SHM_LOCK_VALUE 1 147 #define SHM_UNLOCK_VALUE 0 148 #elif defined(no_cpu) 149 #define SHM_LOCK_VALUE 1 150 #define SHM_UNLOCK_VALUE 0 152 #error "shm_driver.h - no SHM_LOCK_VALUE defined for this CPU architecture" 155 #define Shm_Convert( value ) \ 156 ((Shm_Configuration->convert) ? \ 157 (*Shm_Configuration->convert)(value) : (value)) 162 #define SHM_FIRST_NODE 1 166 #define KILOBYTE (1024) 167 #define MEGABYTE (1024*1024) 171 #define NO_INTERRUPT 0 177 #define POLLED_MODE 0 183 #define SHM_NO_FREE_PKTS 0xf0000 187 #define NULL_ENV_CB ((Shm_Envelope_control *) 0) 188 #define NULL_CONVERT 0 195 #define SHM_ENVELOPE_PREFIX_OVERHEAD (4 * sizeof(vol_u32)) 202 #ifndef MAX_ENVELOPE_SIZE 203 #define MAX_ENVELOPE_SIZE 0x180 206 #define MAX_PACKET_SIZE (MAX_ENVELOPE_SIZE - \ 207 SHM_ENVELOPE_PREFIX_OVERHEAD + \ 208 sizeof(Shm_Envelope_preamble) + \ 209 sizeof(Shm_Envelope_postamble)) 214 #define LQ_UNLOCKED SHM_UNLOCK_VALUE 215 #define LQ_LOCKED SHM_LOCK_VALUE 219 #define FREE_ENV_POOL 0 220 #define FREE_ENV_CB (&Shm_Locked_queues[ FREE_ENV_POOL ]) 229 #define START_NS_CBS ((void *)Shm_Configuration->base) 230 #define START_LQ_CBS ((START_NS_CBS) + \ 231 ( (sizeof (Shm_Node_status_control)) * (SHM_MAXIMUM_NODES + 1) ) ) 232 #define START_ENVELOPES ( ((void *) START_LQ_CBS) + \ 233 ( (sizeof (Shm_Locked_queue_Control)) * (SHM_MAXIMUM_NODES + 1) ) ) 234 #define END_SHMCI_AREA ( (void *) START_ENVELOPES + \ 235 ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) ) 236 #define END_SHARED_MEM (START_NS_CBS+Shm_Configuration->length) 240 #define Shm_Is_master_node() \ 241 ( SHM_MASTER ==_Configuration_MP_table-> node ) 243 #define Shm_Free_envelope( ecb ) \ 244 Shm_Locked_queue_Add( FREE_ENV_CB, (ecb) ) 245 #define Shm_Allocate_envelope() \ 246 Shm_Locked_queue_Get(FREE_ENV_CB) 248 #define Shm_Initialize_receive_queue(node) \ 249 Shm_Locked_queue_Initialize( &Shm_Locked_queues[node], node ) 251 #define Shm_Append_to_receive_queue(node, ecb) \ 252 Shm_Locked_queue_Add( &Shm_Locked_queues[node], (ecb) ) 254 #define Shm_Envelope_control_to_packet_prefix_pointer(ecb) \ 255 ((void *)(ecb)->packet) 257 #define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \ 258 ((Shm_Envelope_control *)((uint8_t*)(pkt) - \ 259 (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD))) 261 #define Shm_Build_preamble(ecb, node) \ 262 (ecb)->Preamble.endian = Shm_Configuration->format 264 #define Shm_Build_postamble( ecb ) 268 typedef volatile uint8_t vol_u8;
269 typedef volatile uint32_t vol_u32;
274 vol_u32 not_currently_used_0;
275 vol_u32 not_currently_used_1;
276 vol_u32 not_currently_used_2;
277 vol_u32 not_currently_used_3;
283 vol_u32 not_currently_used_0;
284 vol_u32 not_currently_used_1;
285 vol_u32 not_currently_used_2;
317 vol_u8
packet[MAX_PACKET_SIZE];
318 Shm_Envelope_postamble Postamble;
363 vol_u32 not_currently_used_0;
364 vol_u32 not_currently_used_1;
365 vol_u32 not_currently_used_2;
427 uint32_t (*convert)( uint32_t );
429 void (*cause_intr)( uint32_t);
435 #define SHM_MAXIMUM_NODES Multiprocessing_configuration.maximum_nodes 442 #define SHM_EXTERN extern 445 SHM_EXTERN shm_config_table *Shm_Configuration;
450 SHM_EXTERN uint32_t Shm_Receive_message_count;
451 SHM_EXTERN uint32_t Shm_Null_message_count;
452 SHM_EXTERN uint32_t Shm_Interrupt_count;
455 SHM_EXTERN uint32_t Shm_isrstat;
458 SHM_EXTERN uint32_t Shm_Pending_initialization;
459 SHM_EXTERN uint32_t Shm_Initialization_complete;
460 SHM_EXTERN uint32_t Shm_Active_node;
462 SHM_EXTERN uint32_t Shm_Maximum_envelopes;
464 SHM_EXTERN uint32_t Shm_Locked_queue_End_of_list;
465 SHM_EXTERN uint32_t Shm_Locked_queue_Not_on_list;
470 void Shm_Locked_queue_Add(
473 void Shm_Locked_queue_Initialize(
480 void Init_env_pool(
void );
481 void Shm_Print_statistics(
void );
484 void Shm_install_timer(
void );
485 void Shm_Convert_packet( rtems_packet_prefix * );
490 void *Shm_Convert_address(
void * );
491 void Shm_Get_configuration( uint32_t, shm_config_table ** );
492 void Shm_isr(
void );
493 void Shm_setvec(
void );
500 rtems_mpci_entry Shm_Get_packet(
501 rtems_packet_prefix **
504 rtems_mpci_entry Shm_Initialization(
void );
506 rtems_mpci_entry Shm_Receive_packet(
507 rtems_packet_prefix **
510 rtems_mpci_entry Shm_Return_packet(
511 rtems_packet_prefix *
516 rtems_packet_prefix *
519 extern rtems_mpci_table MPCI_table;
525 rtems_mpci_table MPCI_table = {
Definition: shm_driver.h:273
Definition: shm_driver.h:311
Definition: shm_driver.h:357
void rtems_task
Definition: tasks.h:100
Definition: shm_driver.h:335
Definition: shm_driver.h:288
Definition: shm_driver.h:423
Definition: shm_driver.h:280
Clock Driver for all Boards.
rtems_mpci_entry Shm_Send_packet(uint32_t node, rtems_packet_prefix *packet)
Definition: shmdr-send.c:32
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
Definition: interr.h:42