forked from Imagelibrary/rtems
2008-12-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/shmdr/dump.c, libchip/shmdr/init.c, libchip/shmdr/send.c, libchip/shmdr/shm_driver.h: Cleanup and remove variables which duplicated data.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-12-18 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* libchip/shmdr/dump.c, libchip/shmdr/init.c, libchip/shmdr/send.c,
|
||||
libchip/shmdr/shm_driver.h: Cleanup and remove variables which
|
||||
duplicated data.
|
||||
|
||||
2008-12-17 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* optman/sapi/no-ext.c, optman/sapi/no-io.c: Convert SAPI manager and
|
||||
|
||||
@@ -31,8 +31,8 @@ Shm_Print_statistics(void)
|
||||
uint32_t seconds;
|
||||
int packets_per_second;
|
||||
|
||||
(void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
|
||||
(void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );
|
||||
ticks = rtems_clock_get_ticks_since_boot();
|
||||
ticks_per_second = rtems_clock_get_ticks_per_second();
|
||||
|
||||
seconds = ticks / ticks_per_second;
|
||||
if ( seconds == 0 )
|
||||
@@ -42,7 +42,8 @@ Shm_Print_statistics(void)
|
||||
if ( (Shm_Receive_message_count % seconds) >= (seconds / 2) )
|
||||
packets_per_second++;
|
||||
|
||||
printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n", Shm_Local_node );
|
||||
printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n",
|
||||
Multiprocessing_configuration.node );
|
||||
printk( "TICKS SINCE BOOT = %" PRId32 "\n", ticks );
|
||||
printk( "TICKS PER SECOND = %" PRId32 "\n", ticks_per_second );
|
||||
printk( "ISRs=%" PRId32 "\n", Shm_Interrupt_count );
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
|
||||
rtems_extensions_table MPCI_Shm_extensions;
|
||||
|
||||
/*
|
||||
* MP configuration table from confdefs.h
|
||||
*/
|
||||
|
||||
rtems_mpci_entry Shm_Initialization( void )
|
||||
|
||||
{
|
||||
@@ -42,25 +46,18 @@ rtems_mpci_entry Shm_Initialization( void )
|
||||
Shm_Node_status_control *nscb;
|
||||
uint32_t extension_id; /* for installation of MPCI_Fatal */
|
||||
uint32_t remaining_memory;
|
||||
/* XXX these should use "public" methods to set their values.... */
|
||||
rtems_configuration_table *configuration = _Configuration_Table;
|
||||
rtems_multiprocessing_table *mp_configuration = _Configuration_MP_table;
|
||||
uint32_t local_node;
|
||||
|
||||
Shm_RTEMS_Configuration = configuration;
|
||||
Shm_RTEMS_MP_Configuration = mp_configuration;
|
||||
local_node = _Configuration_MP_table->node;
|
||||
|
||||
Shm_Local_node = Shm_RTEMS_MP_Configuration->node;
|
||||
Shm_Maximum_nodes = Shm_RTEMS_MP_Configuration->maximum_nodes;
|
||||
|
||||
Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
|
||||
Shm_Get_configuration( local_node, &Shm_Configuration );
|
||||
|
||||
Shm_Interrupt_table = (Shm_Interrupt_information *) malloc(
|
||||
sizeof(Shm_Interrupt_information) * (Shm_Maximum_nodes + 1)
|
||||
sizeof(Shm_Interrupt_information) * (SHM_MAXIMUM_NODES + 1)
|
||||
);
|
||||
|
||||
assert( Shm_Interrupt_table );
|
||||
|
||||
|
||||
Shm_Receive_message_count = 0;
|
||||
Shm_Null_message_count = 0;
|
||||
Shm_Interrupt_count = 0;
|
||||
@@ -112,8 +109,8 @@ rtems_mpci_entry Shm_Initialization( void )
|
||||
* processing it.
|
||||
*/
|
||||
|
||||
Shm_Local_receive_queue = &Shm_Locked_queues[ Shm_Local_node ];
|
||||
Shm_Local_node_status = &Shm_Node_statuses[ Shm_Local_node ];
|
||||
Shm_Local_receive_queue = &Shm_Locked_queues[ local_node ];
|
||||
Shm_Local_node_status = &Shm_Node_statuses[ local_node ];
|
||||
|
||||
/*
|
||||
* Convert local interrupt cause information into the
|
||||
@@ -150,7 +147,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
||||
|
||||
Shm_Locked_queue_Initialize( FREE_ENV_CB, FREE_ENV_POOL );
|
||||
|
||||
for ( i=SHM_FIRST_NODE ; i<=Shm_Maximum_nodes ; i++ ) {
|
||||
for ( i=SHM_FIRST_NODE ; i<=SHM_MAXIMUM_NODES ; i++ ) {
|
||||
Shm_Initialize_receive_queue( i );
|
||||
|
||||
Shm_Node_statuses[ i ].status = Shm_Pending_initialization;
|
||||
@@ -185,7 +182,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
||||
do {
|
||||
all_initialized = 1;
|
||||
|
||||
for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
|
||||
for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ )
|
||||
if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete )
|
||||
all_initialized = 0;
|
||||
|
||||
@@ -195,7 +192,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
||||
* Tell the other nodes we think that the system is up.
|
||||
*/
|
||||
|
||||
for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
|
||||
for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ )
|
||||
Shm_Node_statuses[ i ].status = Shm_Active_node;
|
||||
|
||||
} else { /* is not MASTER node */
|
||||
@@ -233,7 +230,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
||||
* Initialize the Interrupt Information Table
|
||||
*/
|
||||
|
||||
for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) {
|
||||
for ( i = SHM_FIRST_NODE ; i <= SHM_MAXIMUM_NODES ; i++ ) {
|
||||
nscb = &Shm_Node_statuses[ i ];
|
||||
|
||||
Shm_Interrupt_table[i].address = Shm_Convert_address(
|
||||
|
||||
@@ -44,8 +44,8 @@ rtems_mpci_entry Shm_Send_packet(
|
||||
(*Shm_Configuration->cause_intr)( node );
|
||||
}
|
||||
else {
|
||||
for( nnum = SHM_FIRST_NODE ; nnum <= Shm_Maximum_nodes ; nnum++ )
|
||||
if ( Shm_Local_node != nnum ) {
|
||||
for( nnum = SHM_FIRST_NODE ; nnum <= SHM_MAXIMUM_NODES ; nnum++ )
|
||||
if ( _Configuration_MP_table->node != nnum ) {
|
||||
tmp_ecb = Shm_Allocate_envelope();
|
||||
if ( !tmp_ecb )
|
||||
rtems_fatal_error_occurred( SHM_NO_FREE_PKTS );
|
||||
|
||||
@@ -227,9 +227,9 @@ extern "C" {
|
||||
|
||||
#define START_NS_CBS ((void *)Shm_Configuration->base)
|
||||
#define START_LQ_CBS ((START_NS_CBS) + \
|
||||
( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) )
|
||||
( (sizeof (Shm_Node_status_control)) * (SHM_MAXIMUM_NODES + 1) ) )
|
||||
#define START_ENVELOPES ( ((void *) START_LQ_CBS) + \
|
||||
( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) )
|
||||
( (sizeof (Shm_Locked_queue_Control)) * (SHM_MAXIMUM_NODES + 1) ) )
|
||||
#define END_SHMCI_AREA ( (void *) START_ENVELOPES + \
|
||||
( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) )
|
||||
#define END_SHARED_MEM (START_NS_CBS+Shm_Configuration->length)
|
||||
@@ -237,7 +237,7 @@ extern "C" {
|
||||
/* macros */
|
||||
|
||||
#define Shm_Is_master_node() \
|
||||
( SHM_MASTER == Shm_Local_node )
|
||||
( SHM_MASTER ==_Configuration_MP_table-> node )
|
||||
|
||||
#define Shm_Free_envelope( ecb ) \
|
||||
Shm_Locked_queue_Add( FREE_ENV_CB, (ecb) )
|
||||
@@ -431,6 +431,8 @@ struct shm_config_info {
|
||||
|
||||
typedef struct shm_config_info shm_config_table;
|
||||
|
||||
#define SHM_MAXIMUM_NODES Multiprocessing_configuration.maximum_nodes
|
||||
|
||||
/* global variables */
|
||||
|
||||
#ifdef _SHM_INIT
|
||||
@@ -444,12 +446,9 @@ SHM_EXTERN Shm_Interrupt_information *Shm_Interrupt_table;
|
||||
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
||||
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
||||
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
||||
SHM_EXTERN rtems_configuration_table *Shm_RTEMS_Configuration;
|
||||
SHM_EXTERN rtems_multiprocessing_table *Shm_RTEMS_MP_Configuration;
|
||||
SHM_EXTERN uint32_t Shm_Receive_message_count;
|
||||
SHM_EXTERN uint32_t Shm_Null_message_count;
|
||||
SHM_EXTERN uint32_t Shm_Interrupt_count;
|
||||
SHM_EXTERN uint32_t Shm_Local_node;
|
||||
SHM_EXTERN Shm_Locked_queue_Control *Shm_Local_receive_queue;
|
||||
SHM_EXTERN Shm_Node_status_control *Shm_Local_node_status;
|
||||
SHM_EXTERN uint32_t Shm_isrstat;
|
||||
@@ -459,7 +458,6 @@ SHM_EXTERN uint32_t Shm_Pending_initialization;
|
||||
SHM_EXTERN uint32_t Shm_Initialization_complete;
|
||||
SHM_EXTERN uint32_t Shm_Active_node;
|
||||
|
||||
SHM_EXTERN uint32_t Shm_Maximum_nodes;
|
||||
SHM_EXTERN uint32_t Shm_Maximum_envelopes;
|
||||
|
||||
SHM_EXTERN uint32_t Shm_Locked_queue_End_of_list;
|
||||
|
||||
Reference in New Issue
Block a user