94 #define SHM_BIG 0x00000001 95 #define SHM_LITTLE 0x10000000 99 #define SHM_BIG 0x01000000 100 #define SHM_LITTLE 0x00000010 120 #if defined(__mc68000__) 121 #define SHM_LOCK_VALUE 0x80000000 122 #define SHM_UNLOCK_VALUE 0 123 #define SHM_LOCK_VALUE 0x80000000 124 #define SHM_UNLOCK_VALUE 0 125 #elif defined(__i386__) 126 #define SHM_LOCK_VALUE 0x80000000 127 #define SHM_UNLOCK_VALUE 0 128 #elif defined(__mips__) 129 #define SHM_LOCK_VALUE 0x80000000 130 #define SHM_UNLOCK_VALUE 0 131 #elif defined(__hppa__) 132 #define SHM_LOCK_VALUE 0 133 #define SHM_UNLOCK_VALUE 1 134 #elif defined(__PPC__) 135 #define SHM_LOCK_VALUE 1 136 #define SHM_UNLOCK_VALUE 0 137 #elif defined(__unix__) 138 #define SHM_LOCK_VALUE 0 139 #define SHM_UNLOCK_VALUE 1 140 #elif defined(_AM29K) 141 #define SHM_LOCK_VALUE 0 142 #define SHM_UNLOCK_VALUE 1 143 #elif defined(__nios2__) 144 #define SHM_LOCK_VALUE 1 145 #define SHM_UNLOCK_VALUE 0 146 #elif defined(__sparc__) 147 #define SHM_LOCK_VALUE 1 148 #define SHM_UNLOCK_VALUE 0 149 #elif defined(no_cpu) 150 #define SHM_LOCK_VALUE 1 151 #define SHM_UNLOCK_VALUE 0 153 #error "shm_driver.h - no SHM_LOCK_VALUE defined for this CPU architecture" 156 #define Shm_Convert( value ) \ 157 ((Shm_Configuration->convert) ? \ 158 (*Shm_Configuration->convert)(value) : (value)) 163 #define SHM_FIRST_NODE 1 167 #define KILOBYTE (1024) 168 #define MEGABYTE (1024*1024) 172 #define NO_INTERRUPT 0 178 #define POLLED_MODE 0 184 #define SHM_NO_FREE_PKTS 0xf0000 188 #define NULL_ENV_CB ((Shm_Envelope_control *) 0) 189 #define NULL_CONVERT 0 196 #define SHM_ENVELOPE_PREFIX_OVERHEAD (4 * sizeof(vol_u32)) 203 #ifndef MAX_ENVELOPE_SIZE 204 #define MAX_ENVELOPE_SIZE 0x180 207 #define MAX_PACKET_SIZE (MAX_ENVELOPE_SIZE - \ 208 SHM_ENVELOPE_PREFIX_OVERHEAD + \ 209 sizeof(Shm_Envelope_preamble) + \ 210 sizeof(Shm_Envelope_postamble)) 215 #define LQ_UNLOCKED SHM_UNLOCK_VALUE 216 #define LQ_LOCKED SHM_LOCK_VALUE 220 #define FREE_ENV_POOL 0 221 #define FREE_ENV_CB (&Shm_Locked_queues[ FREE_ENV_POOL ]) 230 #define START_NS_CBS ((void *)Shm_Configuration->base) 231 #define START_LQ_CBS ((START_NS_CBS) + \ 232 ( (sizeof (Shm_Node_status_control)) * (SHM_MAXIMUM_NODES + 1) ) ) 233 #define START_ENVELOPES ( ((void *) START_LQ_CBS) + \ 234 ( (sizeof (Shm_Locked_queue_Control)) * (SHM_MAXIMUM_NODES + 1) ) ) 235 #define END_SHMCI_AREA ( (void *) START_ENVELOPES + \ 236 ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) ) 237 #define END_SHARED_MEM (START_NS_CBS+Shm_Configuration->length) 241 #define Shm_Is_master_node() \ 242 ( SHM_MASTER == rtems_object_get_local_node() ) 244 #define Shm_Free_envelope( ecb ) \ 245 Shm_Locked_queue_Add( FREE_ENV_CB, (ecb) ) 246 #define Shm_Allocate_envelope() \ 247 Shm_Locked_queue_Get(FREE_ENV_CB) 249 #define Shm_Initialize_receive_queue(node) \ 250 Shm_Locked_queue_Initialize( &Shm_Locked_queues[node], node ) 252 #define Shm_Append_to_receive_queue(node, ecb) \ 253 Shm_Locked_queue_Add( &Shm_Locked_queues[node], (ecb) ) 255 #define Shm_Envelope_control_to_packet_prefix_pointer(ecb) \ 256 ((void *)(ecb)->packet) 258 #define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \ 259 ((Shm_Envelope_control *)((uint8_t*)(pkt) - \ 260 (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD))) 262 #define Shm_Build_preamble(ecb, node) \ 263 (ecb)->Preamble.endian = Shm_Configuration->format 265 #define Shm_Build_postamble( ecb ) 269 typedef volatile uint8_t vol_u8;
270 typedef volatile uint32_t vol_u32;
275 vol_u32 not_currently_used_0;
276 vol_u32 not_currently_used_1;
277 vol_u32 not_currently_used_2;
278 vol_u32 not_currently_used_3;
284 vol_u32 not_currently_used_0;
285 vol_u32 not_currently_used_1;
286 vol_u32 not_currently_used_2;
318 vol_u8
packet[MAX_PACKET_SIZE];
364 vol_u32 not_currently_used_0;
365 vol_u32 not_currently_used_1;
366 vol_u32 not_currently_used_2;
428 uint32_t (*convert)( uint32_t );
430 void (*cause_intr)( uint32_t);
436 #define SHM_MAXIMUM_NODES _MPCI_Configuration.maximum_nodes 443 #define SHM_EXTERN extern 451 SHM_EXTERN uint32_t Shm_Receive_message_count;
452 SHM_EXTERN uint32_t Shm_Null_message_count;
453 SHM_EXTERN uint32_t Shm_Interrupt_count;
456 SHM_EXTERN uint32_t Shm_isrstat;
459 SHM_EXTERN uint32_t Shm_Pending_initialization;
460 SHM_EXTERN uint32_t Shm_Initialization_complete;
461 SHM_EXTERN uint32_t Shm_Active_node;
463 SHM_EXTERN uint32_t Shm_Maximum_envelopes;
465 SHM_EXTERN uint32_t Shm_Locked_queue_End_of_list;
466 SHM_EXTERN uint32_t Shm_Locked_queue_Not_on_list;
471 void Shm_Locked_queue_Add(
474 void Shm_Locked_queue_Initialize(
481 void Init_env_pool(
void );
482 void Shm_Print_statistics(
void );
485 void Shm_install_timer(
void );
486 void Shm_Convert_packet( rtems_packet_prefix * );
491 void *Shm_Convert_address(
void * );
493 void Shm_isr(
void );
494 void Shm_setvec(
void );
501 rtems_mpci_entry Shm_Get_packet(
502 rtems_packet_prefix **
505 rtems_mpci_entry Shm_Initialization(
void );
507 rtems_mpci_entry Shm_Receive_packet(
508 rtems_packet_prefix **
511 rtems_mpci_entry Shm_Return_packet(
512 rtems_packet_prefix *
517 rtems_packet_prefix *
520 extern rtems_mpci_table MPCI_table;
526 rtems_mpci_table MPCI_table = {
Definition: shm_driver.h:274
Definition: shm_driver.h:312
Definition: shm_driver.h:358
void rtems_task
Definition: tasks.h:101
Definition: shm_driver.h:336
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
Definition: interr.h:47
Definition: shm_driver.h:289
Definition: shm_driver.h:424
Definition: shm_driver.h:281
rtems_mpci_entry Shm_Send_packet(uint32_t node, rtems_packet_prefix *packet)
Definition: shmdr-send.c:32