Changeset 12f86efd in rtems for c/src/lib/libbsp/shmdr/shm.h


Ignore:
Timestamp:
Aug 11, 1995, 2:23:49 PM (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
0e4c603
Parents:
0b8b971
Message:

minor clean up -- switched to memset for zero'ing SHM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shmdr/shm.h

    r0b8b971 r12f86efd  
    173173
    174174#define NULL_ENV_CB             ((Shm_Envelope_control *) 0)
    175 #define NULL_SHM_INFO           ((struct shm_info *) 0)
    176175#define NULL_CONVERT            0
    177 #if 0
    178 #define NULL_CONVERT            (((rtems_unsigned32 *)())0) /* we want this */
    179 #endif
    180 
    181 /* The following is adjusted so envelopes are 0x80 bytes long. */
    182 /* It should be >= MIN_PKT_SIZE in rtems.h                     */
    183 
    184 #define MAX_PACKET_SIZE          (80)
     176
     177/*
     178 * size of stuff before preamble in envelope.
     179 * It must be a constant since we will use it to generate MAX_PACKET_SIZE
     180 */
     181 
     182#define SHM_ENVELOPE_PREFIX_OVERHEAD    (4 * sizeof(vol_u32))
     183
     184/*
     185 *  The following is adjusted so envelopes are MAX_ENVELOPE_SIZE bytes long.
     186 *  It must be >= RTEMS_MINIMUM_PACKET_SIZE in mppkt.h.
     187 */
     188 
     189#ifndef MAX_ENVELOPE_SIZE
     190#define MAX_ENVELOPE_SIZE 0x180
     191#endif
     192
     193#define MAX_PACKET_SIZE  (MAX_ENVELOPE_SIZE -               \
     194                          SHM_ENVELOPE_PREFIX_OVERHEAD +    \
     195                          sizeof(Shm_Envelope_preamble) +   \
     196                          sizeof(Shm_Envelope_postamble))
     197
    185198
    186199/* constants pertinent to Locked Queue routines */
     
    200213 *        is defined in a system dependent file.
    201214 */
    202 
    203 #if 0
    204 #define START_NS_CBS     ( (rtems_unsigned8 *) START_SHARED_MEM )
    205 #define START_LQ_CBS     ( ((rtems_unsigned8 *) START_NS_CBS) + \
    206         ( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) )
    207 #define START_ENVELOPES  ( ((rtems_unsigned8 *) START_LQ_CBS) + \
    208         ( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) )
    209 #define END_SHMCI_AREA    ( (rtems_unsigned8 *) START_ENVELOPES + \
    210         ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) )
    211 #define END_SHARED_MEM   ((rtems_unsigned32)START_SHARED_MEM+SHARED_MEM_LEN)
    212 #endif
    213215
    214216#define START_NS_CBS     ((void *)Shm_Configuration->base)
     
    223225/* macros */
    224226
    225 #define Shm_Is_master_node() \
     227#define Shm_Is_master_node()  \
    226228  ( SHM_MASTER == Shm_Local_node )
    227229
     
    242244#define Shm_Packet_prefix_to_envelope_control_pointer( pkt )   \
    243245   ((Shm_Envelope_control *)((rtems_unsigned8 *)(pkt) - \
    244    (sizeof(Shm_Envelope_preamble) + 4*sizeof(vol_u32))))
     246   (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD)))
    245247
    246248#define Shm_Build_preamble(ecb, node) \
     
    249251#define Shm_Build_postamble( ecb )
    250252
    251 /* structures */
     253/* volatile types */
    252254
    253255typedef volatile rtems_unsigned8  vol_u8;
     
    272274
    273275typedef struct {
    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;
    278   /*byte end_of_text;*/
    279 } Shm_Envelope_postable;
     276} Shm_Envelope_postamble;
    280277
    281278/* WARNING! If you change this structure, don't forget to change
    282  *          Shm_Envelope_control_to_packet_prefix_pointer() and
     279 *          SHM_ENVELOPE_PREFIX_OVERHEAD and
    283280 *          Shm_Packet_prefix_to_envelope_control_pointer() above.
    284281 */
     
    306303  Shm_Envelope_preamble    Preamble; /* header information           */
    307304  vol_u8            packet[MAX_PACKET_SIZE]; /* RTEMS INFO    */
    308   Shm_Envelope_postable   Postamble;/* trailer information          */
     305  Shm_Envelope_postamble   Postamble;/* trailer information          */
    309306} Shm_Envelope_control;
    310307
     
    514511);
    515512
     513extern rtems_mpci_table MPCI_table;
     514
    516515#ifdef _SHM_INIT
    517516
     
    527526};
    528527
    529 #else
    530 
    531 extern rtems_mpci_table MPCI_table;
    532 
    533528#endif
    534529
Note: See TracChangeset for help on using the changeset viewer.