Changeset 534c893 in rtems


Ignore:
Timestamp:
Dec 18, 2008, 5:15:51 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
ec11156e
Parents:
584ab9e
Message:

2008-12-18 Joel Sherrill <joel.sherrill@…>

  • libchip/shmdr/dump.c, libchip/shmdr/init.c, libchip/shmdr/send.c, libchip/shmdr/shm_driver.h: Cleanup and remove variables which duplicated data.
Location:
c/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    r584ab9e r534c893  
     12008-12-18      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libchip/shmdr/dump.c, libchip/shmdr/init.c, libchip/shmdr/send.c,
     4        libchip/shmdr/shm_driver.h: Cleanup and remove variables which
     5        duplicated data.
     6
    172008-12-17      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • c/src/libchip/shmdr/dump.c

    r584ab9e r534c893  
    3232  int         packets_per_second;
    3333
    34   (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
    35   (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );
     34  ticks            = rtems_clock_get_ticks_since_boot();
     35  ticks_per_second = rtems_clock_get_ticks_per_second();
    3636
    3737  seconds = ticks / ticks_per_second;
     
    4343    packets_per_second++;
    4444
    45   printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n", Shm_Local_node );
     45  printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n",
     46    Multiprocessing_configuration.node );
    4647  printk( "TICKS SINCE BOOT = %" PRId32 "\n", ticks );
    4748  printk( "TICKS PER SECOND = %" PRId32 "\n", ticks_per_second );
  • c/src/libchip/shmdr/init.c

    r584ab9e r534c893  
    3434rtems_extensions_table MPCI_Shm_extensions;
    3535
     36/*
     37 *  MP configuration table from confdefs.h
     38 */
     39
    3640rtems_mpci_entry Shm_Initialization( void )
    3741
    3842{
    39   uint32_t           i, all_initialized;
    40   uint32_t           interrupt_cause, interrupt_value;
     43  uint32_t                 i, all_initialized;
     44  uint32_t                 interrupt_cause, interrupt_value;
    4145  void                    *interrupt_address;
    4246  Shm_Node_status_control *nscb;
    43   uint32_t           extension_id;    /* for installation of MPCI_Fatal */
    44   uint32_t           remaining_memory;
    45 /* XXX these should use "public" methods to set their values.... */
    46   rtems_configuration_table   *configuration = _Configuration_Table;
    47   rtems_multiprocessing_table *mp_configuration = _Configuration_MP_table;
    48 
    49   Shm_RTEMS_Configuration    = configuration;
    50   Shm_RTEMS_MP_Configuration = mp_configuration;
    51 
    52   Shm_Local_node    = Shm_RTEMS_MP_Configuration->node;
    53   Shm_Maximum_nodes = Shm_RTEMS_MP_Configuration->maximum_nodes;
    54 
    55   Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
     47  uint32_t                 extension_id;    /* for installation of MPCI_Fatal */
     48  uint32_t                 remaining_memory;
     49  uint32_t                 local_node;
     50
     51  local_node = _Configuration_MP_table->node;
     52
     53  Shm_Get_configuration( local_node, &Shm_Configuration );
    5654
    5755  Shm_Interrupt_table = (Shm_Interrupt_information *) malloc(
    58     sizeof(Shm_Interrupt_information) * (Shm_Maximum_nodes + 1)
     56    sizeof(Shm_Interrupt_information) * (SHM_MAXIMUM_NODES + 1)
    5957  );
    6058
    6159  assert( Shm_Interrupt_table );
    62 
    6360
    6461  Shm_Receive_message_count = 0;
     
    113110   */
    114111
    115   Shm_Local_receive_queue  = &Shm_Locked_queues[ Shm_Local_node ];
    116   Shm_Local_node_status    = &Shm_Node_statuses[ Shm_Local_node ];
     112  Shm_Local_receive_queue  = &Shm_Locked_queues[ local_node ];
     113  Shm_Local_node_status    = &Shm_Node_statuses[ local_node ];
    117114
    118115  /*
     
    151148    Shm_Locked_queue_Initialize( FREE_ENV_CB, FREE_ENV_POOL );
    152149
    153     for ( i=SHM_FIRST_NODE ; i<=Shm_Maximum_nodes ; i++ ) {
     150    for ( i=SHM_FIRST_NODE ; i<=SHM_MAXIMUM_NODES ; i++ ) {
    154151      Shm_Initialize_receive_queue( i );
    155152
     
    186183      all_initialized = 1;
    187184
    188       for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
     185      for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ )
    189186        if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete )
    190187          all_initialized = 0;
     
    196193     */
    197194
    198     for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
     195    for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ )
    199196      Shm_Node_statuses[ i ].status = Shm_Active_node;
    200197
     
    234231   */
    235232
    236   for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) {
     233  for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ ) {
    237234    nscb = &Shm_Node_statuses[ i ];
    238235
  • c/src/libchip/shmdr/send.c

    r584ab9e r534c893  
    4545  }
    4646  else {
    47     for( nnum = SHM_FIRST_NODE ; nnum <= Shm_Maximum_nodes ; nnum++ )
    48       if ( Shm_Local_node != nnum ) {
     47    for( nnum = SHM_FIRST_NODE ; nnum <= SHM_MAXIMUM_NODES ; nnum++ )
     48      if ( _Configuration_MP_table->node != nnum ) {
    4949        tmp_ecb = Shm_Allocate_envelope();
    5050        if ( !tmp_ecb )
  • c/src/libchip/shmdr/shm_driver.h

    r584ab9e r534c893  
    228228#define START_NS_CBS     ((void *)Shm_Configuration->base)
    229229#define START_LQ_CBS     ((START_NS_CBS) + \
    230         ( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) )
     230        ( (sizeof (Shm_Node_status_control)) * (SHM_MAXIMUM_NODES + 1) ) )
    231231#define START_ENVELOPES  ( ((void *) START_LQ_CBS) + \
    232         ( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) )
     232        ( (sizeof (Shm_Locked_queue_Control)) * (SHM_MAXIMUM_NODES + 1) ) )
    233233#define END_SHMCI_AREA    ( (void *) START_ENVELOPES + \
    234234        ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) )
     
    238238
    239239#define Shm_Is_master_node()  \
    240   ( SHM_MASTER == Shm_Local_node )
     240  ( SHM_MASTER ==_Configuration_MP_table-> node )
    241241
    242242#define Shm_Free_envelope( ecb ) \
     
    432432typedef struct shm_config_info shm_config_table;
    433433
     434#define SHM_MAXIMUM_NODES Multiprocessing_configuration.maximum_nodes
     435
    434436/* global variables */
    435437
     
    445447SHM_EXTERN Shm_Locked_queue_Control     *Shm_Locked_queues;
    446448SHM_EXTERN Shm_Envelope_control         *Shm_Envelopes;
    447 SHM_EXTERN rtems_configuration_table    *Shm_RTEMS_Configuration;
    448 SHM_EXTERN rtems_multiprocessing_table  *Shm_RTEMS_MP_Configuration;
    449 SHM_EXTERN uint32_t                Shm_Receive_message_count;
    450 SHM_EXTERN uint32_t                Shm_Null_message_count;
    451 SHM_EXTERN uint32_t                Shm_Interrupt_count;
    452 SHM_EXTERN uint32_t                Shm_Local_node;
    453 SHM_EXTERN Shm_Locked_queue_Control      *Shm_Local_receive_queue;
    454 SHM_EXTERN Shm_Node_status_control       *Shm_Local_node_status;
    455 SHM_EXTERN uint32_t                Shm_isrstat;
     449SHM_EXTERN uint32_t                      Shm_Receive_message_count;
     450SHM_EXTERN uint32_t                      Shm_Null_message_count;
     451SHM_EXTERN uint32_t                      Shm_Interrupt_count;
     452SHM_EXTERN Shm_Locked_queue_Control     *Shm_Local_receive_queue;
     453SHM_EXTERN Shm_Node_status_control      *Shm_Local_node_status;
     454SHM_EXTERN uint32_t                      Shm_isrstat;
    456455                                                     /* reported by shmdr */
    457456
     
    460459SHM_EXTERN uint32_t   Shm_Active_node;
    461460
    462 SHM_EXTERN uint32_t   Shm_Maximum_nodes;
    463461SHM_EXTERN uint32_t   Shm_Maximum_envelopes;
    464462
Note: See TracChangeset for help on using the changeset viewer.