Changeset 12f86efd in rtems for c/src/libchip/shmdr/init.c


Ignore:
Timestamp:
Aug 11, 1995, 2:23:49 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 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/libchip/shmdr/init.c

    r0b8b971 r12f86efd  
    2323
    2424#include <rtems.h>
    25 #include "shm.h"
     25#include <shm.h>
     26
     27#include <string.h>    /* memset() */
    2628
    2729/*
    28  * Need a user extension control to install MPCI_Fatal as
    29  *  a fatal error handler extension
     30 * User extension to install MPCI_Fatal as a fatal error
     31 * handler extension
    3032 */
    31 
     33 
    3234rtems_extensions_table MPCI_Shm_extensions;
    3335
     
    3941)
    4042{
    41   rtems_unsigned32         i, *u32_ptr, *endshm, all_initialized;
     43  rtems_unsigned32         i, all_initialized;
    4244  rtems_unsigned32         interrupt_cause, interrupt_value;
    4345  void                    *interrupt_address;
     
    5254  Shm_Maximum_nodes = Shm_RTEMS_MP_Configuration->maximum_nodes;
    5355
    54   Shm_Get_configuration( Shm_Local_node ,&Shm_Configuration );
     56  Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
    5557
    5658  Shm_Receive_message_count = 0;
     
    6264   */
    6365
    64 #define PEND Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' ))
    65 #define COMP Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' ))
    66 #define ACTV Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' ))
    67 
    68   Shm_Pending_initialization  = PEND;
    69   Shm_Initialization_complete = COMP;
    70   Shm_Active_node             = ACTV;
     66  Shm_Pending_initialization =
     67    Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' ));
     68  Shm_Initialization_complete =
     69    Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' ));
     70  Shm_Active_node =
     71    Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' ));
    7172
    7273  /*
     
    129130     */
    130131
    131     for ( u32_ptr = (rtems_unsigned32 *)Shm_Configuration->base,
    132           endshm = (rtems_unsigned32 *)END_SHARED_MEM ;
    133           u32_ptr < endshm ; )
    134       *u32_ptr++ = 0;
     132    (void) memset(
     133      (void *) Shm_Configuration->base,
     134      0,
     135      Shm_Configuration->length
     136    );
    135137
    136138    /*
     
    175177     */
    176178
    177     all_initialized = 0;
    178 
    179     for ( ; ; ) {
    180 
    181       if ( all_initialized == 1 ) break;
    182 
     179    do {
    183180      all_initialized = 1;
    184181
     
    186183        if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete )
    187184          all_initialized = 0;
    188     }
     185
     186    } while ( all_initialized == 0 );
    189187
    190188    /*
Note: See TracChangeset for help on using the changeset viewer.