113#define SHM_BIG 0x00000001
114#define SHM_LITTLE 0x10000000
118#define SHM_BIG 0x01000000
119#define SHM_LITTLE 0x00000010
139#if defined(__mc68000__)
140#define SHM_LOCK_VALUE 0x80000000
141#define SHM_UNLOCK_VALUE 0
142#define SHM_LOCK_VALUE 0x80000000
143#define SHM_UNLOCK_VALUE 0
144#elif defined(__i386__)
145#define SHM_LOCK_VALUE 0x80000000
146#define SHM_UNLOCK_VALUE 0
147#elif defined(__mips__)
148#define SHM_LOCK_VALUE 0x80000000
149#define SHM_UNLOCK_VALUE 0
150#elif defined(__hppa__)
151#define SHM_LOCK_VALUE 0
152#define SHM_UNLOCK_VALUE 1
153#elif defined(__PPC__)
154#define SHM_LOCK_VALUE 1
155#define SHM_UNLOCK_VALUE 0
156#elif defined(__unix__)
157#define SHM_LOCK_VALUE 0
158#define SHM_UNLOCK_VALUE 1
160#define SHM_LOCK_VALUE 0
161#define SHM_UNLOCK_VALUE 1
162#elif defined(__nios2__)
163#define SHM_LOCK_VALUE 1
164#define SHM_UNLOCK_VALUE 0
165#elif defined(__sparc__)
166#define SHM_LOCK_VALUE 1
167#define SHM_UNLOCK_VALUE 0
169#define SHM_LOCK_VALUE 1
170#define SHM_UNLOCK_VALUE 0
172#error "shm_driver.h - no SHM_LOCK_VALUE defined for this CPU architecture"
175#define Shm_Convert( value ) \
176 ((Shm_Configuration->convert) ? \
177 (*Shm_Configuration->convert)(value) : (value))
182#define SHM_FIRST_NODE 1
186#define KILOBYTE (1024)
187#define MEGABYTE (1024*1024)
191#define NO_INTERRUPT 0
203#define SHM_NO_FREE_PKTS 0xf0000
207#define NULL_ENV_CB ((Shm_Envelope_control *) 0)
208#define NULL_CONVERT 0
215#define SHM_ENVELOPE_PREFIX_OVERHEAD (4 * sizeof(vol_u32))
222#ifndef MAX_ENVELOPE_SIZE
223#define MAX_ENVELOPE_SIZE 0x180
226#define MAX_PACKET_SIZE (MAX_ENVELOPE_SIZE - \
227 SHM_ENVELOPE_PREFIX_OVERHEAD + \
228 sizeof(Shm_Envelope_preamble) + \
229 sizeof(Shm_Envelope_postamble))
234#define LQ_UNLOCKED SHM_UNLOCK_VALUE
235#define LQ_LOCKED SHM_LOCK_VALUE
239#define FREE_ENV_POOL 0
240#define FREE_ENV_CB (&Shm_Locked_queues[ FREE_ENV_POOL ])
249#define START_NS_CBS ((void *)Shm_Configuration->base)
250#define START_LQ_CBS ((START_NS_CBS) + \
251 ( (sizeof (Shm_Node_status_control)) * (SHM_MAXIMUM_NODES + 1) ) )
252#define START_ENVELOPES ( ((void *) START_LQ_CBS) + \
253 ( (sizeof (Shm_Locked_queue_Control)) * (SHM_MAXIMUM_NODES + 1) ) )
254#define END_SHMCI_AREA ( (void *) START_ENVELOPES + \
255 ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) )
256#define END_SHARED_MEM (START_NS_CBS+Shm_Configuration->length)
260#define Shm_Is_master_node() \
261 ( SHM_MASTER == rtems_object_get_local_node() )
263#define Shm_Free_envelope( ecb ) \
264 Shm_Locked_queue_Add( FREE_ENV_CB, (ecb) )
265#define Shm_Allocate_envelope() \
266 Shm_Locked_queue_Get(FREE_ENV_CB)
268#define Shm_Initialize_receive_queue(node) \
269 Shm_Locked_queue_Initialize( &Shm_Locked_queues[node], node )
271#define Shm_Append_to_receive_queue(node, ecb) \
272 Shm_Locked_queue_Add( &Shm_Locked_queues[node], (ecb) )
274#define Shm_Envelope_control_to_packet_prefix_pointer(ecb) \
275 ((void *)(ecb)->packet)
277#define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \
278 ((Shm_Envelope_control *)((uint8_t*)(pkt) - \
279 (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD)))
281#define Shm_Build_preamble(ecb, node) \
282 (ecb)->Preamble.endian = Shm_Configuration->format
284#define Shm_Build_postamble( ecb )
288typedef volatile uint8_t vol_u8;
289typedef volatile uint32_t vol_u32;
294 vol_u32 not_currently_used_0;
295 vol_u32 not_currently_used_1;
296 vol_u32 not_currently_used_2;
297 vol_u32 not_currently_used_3;
303 vol_u32 not_currently_used_0;
304 vol_u32 not_currently_used_1;
305 vol_u32 not_currently_used_2;
337 vol_u8 packet[MAX_PACKET_SIZE];
383 vol_u32 not_currently_used_0;
384 vol_u32 not_currently_used_1;
385 vol_u32 not_currently_used_2;
447 uint32_t (*convert)( uint32_t );
449 void (*cause_intr)( uint32_t);
455#define SHM_MAXIMUM_NODES _MPCI_Configuration.maximum_nodes
462#define SHM_EXTERN extern
470SHM_EXTERN uint32_t Shm_Receive_message_count;
471SHM_EXTERN uint32_t Shm_Null_message_count;
472SHM_EXTERN uint32_t Shm_Interrupt_count;
475SHM_EXTERN uint32_t Shm_isrstat;
478SHM_EXTERN uint32_t Shm_Pending_initialization;
479SHM_EXTERN uint32_t Shm_Initialization_complete;
480SHM_EXTERN uint32_t Shm_Active_node;
482SHM_EXTERN uint32_t Shm_Maximum_envelopes;
484SHM_EXTERN uint32_t Shm_Locked_queue_End_of_list;
485SHM_EXTERN uint32_t Shm_Locked_queue_Not_on_list;
490void Shm_Locked_queue_Add(
493void Shm_Locked_queue_Initialize(
500void Init_env_pool(
void );
501void Shm_Print_statistics(
void );
504void Shm_install_timer(
void );
505void Shm_Convert_packet( rtems_packet_prefix * );
510void *Shm_Convert_address(
void * );
513void Shm_setvec(
void );
520rtems_mpci_entry Shm_Get_packet(
521 rtems_packet_prefix **
524rtems_mpci_entry Shm_Initialization(
void );
526rtems_mpci_entry Shm_Receive_packet(
527 rtems_packet_prefix **
530rtems_mpci_entry Shm_Return_packet(
531 rtems_packet_prefix *
534rtems_mpci_entry Shm_Send_packet(
536 rtems_packet_prefix *
539extern rtems_mpci_table MPCI_table;
545rtems_mpci_table MPCI_table = {
This header file defines the Clock Driver API.
void rtems_task
This type defines the return type of task entry points.
Definition: tasks.h:230
Internal_errors_t rtems_fatal_code
This integer type represents system termination codes.
Definition: extension.h:162
Internal_errors_Source
This type lists the possible sources from which an error can be reported.
Definition: interr.h:63
This header file defines the RTEMS Classic API.
Definition: shm_driver.h:331
Definition: shm_driver.h:308
Definition: shm_driver.h:300
Definition: shm_driver.h:355
Definition: shm_driver.h:377
Definition: shm_driver.h:443
Definition: shm_driver.h:293