forked from Imagelibrary/rtems
Fixed so now supports more than 16 nodes. Tested for up to 24 nodes
by Tony Bennett. Information table is now malloc'ed.
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include <shm.h>
|
#include <shm.h>
|
||||||
|
|
||||||
#include <string.h> /* memset() */
|
#include <string.h> /* memset() */
|
||||||
|
#include <stdlib.h> /* malloc() */
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User extension to install MPCI_Fatal as a fatal error
|
* User extension to install MPCI_Fatal as a fatal error
|
||||||
@@ -53,6 +55,13 @@ rtems_mpci_entry Shm_Initialization( void )
|
|||||||
|
|
||||||
Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
|
Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
|
||||||
|
|
||||||
|
Shm_Interrupt_table = (Shm_Interrupt_information *) malloc(
|
||||||
|
sizeof(Shm_Interrupt_information) * (Shm_Maximum_nodes + 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
assert( Shm_Interrupt_table );
|
||||||
|
|
||||||
|
|
||||||
Shm_Receive_message_count = 0;
|
Shm_Receive_message_count = 0;
|
||||||
Shm_Null_message_count = 0;
|
Shm_Null_message_count = 0;
|
||||||
Shm_Interrupt_count = 0;
|
Shm_Interrupt_count = 0;
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ typedef struct shm_config_info shm_config_table;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
SHM_EXTERN shm_config_table *Shm_Configuration;
|
SHM_EXTERN shm_config_table *Shm_Configuration;
|
||||||
SHM_EXTERN Shm_Interrupt_information Shm_Interrupt_table[16];
|
SHM_EXTERN Shm_Interrupt_information *Shm_Interrupt_table;
|
||||||
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
||||||
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
||||||
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ typedef struct shm_config_info shm_config_table;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
SHM_EXTERN shm_config_table *Shm_Configuration;
|
SHM_EXTERN shm_config_table *Shm_Configuration;
|
||||||
SHM_EXTERN Shm_Interrupt_information Shm_Interrupt_table[16];
|
SHM_EXTERN Shm_Interrupt_information *Shm_Interrupt_table;
|
||||||
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
||||||
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
||||||
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
#include <shm.h>
|
#include <shm.h>
|
||||||
|
|
||||||
#include <string.h> /* memset() */
|
#include <string.h> /* memset() */
|
||||||
|
#include <stdlib.h> /* malloc() */
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User extension to install MPCI_Fatal as a fatal error
|
* User extension to install MPCI_Fatal as a fatal error
|
||||||
@@ -53,6 +55,13 @@ rtems_mpci_entry Shm_Initialization( void )
|
|||||||
|
|
||||||
Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
|
Shm_Get_configuration( Shm_Local_node, &Shm_Configuration );
|
||||||
|
|
||||||
|
Shm_Interrupt_table = (Shm_Interrupt_information *) malloc(
|
||||||
|
sizeof(Shm_Interrupt_information) * (Shm_Maximum_nodes + 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
assert( Shm_Interrupt_table );
|
||||||
|
|
||||||
|
|
||||||
Shm_Receive_message_count = 0;
|
Shm_Receive_message_count = 0;
|
||||||
Shm_Null_message_count = 0;
|
Shm_Null_message_count = 0;
|
||||||
Shm_Interrupt_count = 0;
|
Shm_Interrupt_count = 0;
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ typedef struct shm_config_info shm_config_table;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
SHM_EXTERN shm_config_table *Shm_Configuration;
|
SHM_EXTERN shm_config_table *Shm_Configuration;
|
||||||
SHM_EXTERN Shm_Interrupt_information Shm_Interrupt_table[16];
|
SHM_EXTERN Shm_Interrupt_information *Shm_Interrupt_table;
|
||||||
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses;
|
||||||
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues;
|
||||||
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
SHM_EXTERN Shm_Envelope_control *Shm_Envelopes;
|
||||||
|
|||||||
Reference in New Issue
Block a user