mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 01:26:32 +08:00
2003-12-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* shmdr/addlq.c, shmdr/cnvpkt.c, shmdr/dump.c, shmdr/fatal.c, shmdr/getlq.c, shmdr/getpkt.c, shmdr/init.c, shmdr/initlq.c, shmdr/intr.c, shmdr/mpci.h, shmdr/mpisr.c, shmdr/poll.c, shmdr/README, shmdr/receive.c, shmdr/retpkt.c, shmdr/send.c, shmdr/setckvec.c, shmdr/shm_driver.h: Remove (Moved to c/src/libchip/shmdr). 2003-12-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bspstart.am: Use .$(OBJEXT) instead of .o. * Makefile.am: Remove shmdr. 2003-12-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: Use $(mkdir_p) instead of $(mkinstalldirs). 2003-12-13 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: s,${PROJECT_RELEASE}/lib,$(PROJECT_LIB),g. 2003-12-13 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: s,${PROJECT_RELEASE}/lib,$(PROJECT_LIB),g. 2003-12-12 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Use mkdir_p. Remove dirs from PRE/TMPINSTALL_FILES. * bsp.am: Replace bsplibdir by project_libdir. Use mkdir_p instead of mkinstalldirs. Remove dirs from PRE/TMPINSTALL_FILES. 2003-12-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: Remove project_libdir. 2003-12-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Misc. fixes. * bsp.am: Add project_libdir. 2003-12-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bspstart.am: New. 2003-12-03 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Merge-in shared/Makefile.am, shmdr/Makefile.am. * shared/Makefile.am: Remove. * shmdir/Makefile.am: Remove. * bsp.am: Add preinstallation dirstamp support. 2003-12-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * shmdr/Makefile.am: Remove all-local: $(ARCH). 2003-09-29 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: Reworked. 2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Reflect having moved automake/. * shmdr/Makefile.am: Reflect having moved automake/. 2003-08-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * shmdr/Makefile.am: Reflect having merged configure.ac into ../../configure.ac. 2003-08-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: Remove (Merged into ../../configure.ac). * Makefile.am: Reflect having merged configure.ac into ../../configure.ac. 2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: Remove AC_CONFIG_AUX_DIR. 2003-02-14 Joel Sherrill <joel@OARcorp.com> AMD a29k port declared obsolete. * a29k/.cvsignore, a29k/ChangeLog, a29k/Makefile.am, a29k/acinclude.m4, a29k/configure.ac, a29k/portsw/.cvsignore, a29k/portsw/ChangeLog, a29k/portsw/Makefile.am, a29k/portsw/README, a29k/portsw/bsp_specs, a29k/portsw/configure.ac, a29k/portsw/times, a29k/portsw/console/.cvsignore, a29k/portsw/console/Makefile.am, a29k/portsw/console/concntl.h, a29k/portsw/console/console.c, a29k/portsw/console/serial.c, a29k/portsw/console/serial.h, a29k/portsw/include/.cvsignore, a29k/portsw/include/Makefile.am, a29k/portsw/include/bsp.h, a29k/portsw/start/.cvsignore, a29k/portsw/start/Makefile.am, a29k/portsw/start/amd.ah, a29k/portsw/start/pswmacro.ah, a29k/portsw/start/register.S, a29k/portsw/start/register.ah, a29k/portsw/start/start.S, a29k/portsw/startup/.cvsignore, a29k/portsw/startup/Makefile.am, a29k/portsw/startup/bspclean.c, a29k/portsw/startup/bspstart.c, a29k/portsw/startup/linkcmds, a29k/portsw/startup/main.c, a29k/portsw/startup/ramlink, a29k/portsw/startup/romlink, a29k/portsw/startup/setvec.c, a29k/portsw/wrapup/.cvsignore, a29k/portsw/wrapup/Makefile.am: Removed. 2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). 2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: AC_PREREQ(2.57). 2003-02-03 Joel Sherrill <joel@OARcorp.com> * shmdr/Makefile.am: Add .h files to PREINSTALL_FILES not TMPINSTALL_FILES. 2003-01-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * shmdr/Makefile.am: install mpci.h and shm_driver.h. Eliminate OBJS. 2003-01-15 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * shmdr/Makefile.am: Don't include @RTEMS_BSP@.cfg. 2002-12-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: Remove RTEMS_CHECK_BSP_CACHE. 2002-10-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * .cvsignore: Reformat. Add autom4te*cache. Remove autom4te.cache. 2002-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * shmdr/Makefile.am: Use .$(OBJEXT) instead of .o. 2002-08-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * include/Makefile.am: Remove. * include/.cvsignore: Remove. * include/rtems/Makefile.am: Remove. * include/rtems/.cvsignore: Remove. * include/rtems/score/Makefile.am: Remove. * include/rtems/score/.cvsignore: Remove. 2002-08-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: Remove RTEMS_BSP_ALIAS. Add RTEMS_CHECK_BSP_CACHE. Replace $bspdir with $RTEMS_BSP_FAMILY. 2002-08-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: Remove include/Makefile, include/rtems/Makefile, include/rtems/score/Makefile (Eliminate targopts.h). * Makefile.am: Remove include from SUBDIRS (Eliminate targopts.h) 2002-07-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: Add bsplib_DATA = bsp_specs. 2002-06-25 Joel Sherrill <joel@OARcorp.com> * Thomas Doerfler <Thomas.Doerfler@imd-systems.de> added m68k support to the shared gdb stub glue thus adding a directory at the top shared level. * shared/gdbstub: New directory. * configure.ac: Modified to reflect above. 2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * configure.ac: AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). AM_INIT_AUTOMAKE([no-define foreign 1.6]). * Makefile.am: Remove AUTOMAKE_OPTIONS. * include/rtems/score/Makefile.am: Remove AUTOMAKE_OPTIONS. * include/rtems/Makefile.am: Remove AUTOMAKE_OPTIONS. * include/Makefile.am: Remove AUTOMAKE_OPTIONS. * shmdr/Makefile.am: Remove AUTOMAKE_OPTIONS. 2002-02-05 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: Add line break, remove comment. 2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * .cvsignore: Add autom4te.cache for autoconf > 2.52. * configure.in: Remove. * configure.ac: New file, generated from configure.in by autoupdate. 2001-10-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Use @subdirs@ instead of RTEMS_LIBBSP_CPU_SUBDIR. * configure.in: AC_PREREQ(2.52), apply RTEMS_CPU_SUBDIRS, remove RTEMS_LIBBSP_CPU_SUBDIR. 2001-09-28 Joel Sherrill <joel@OARcorp.com> * shared/bootcard.c, shared/main.c: Now call int c_rtems_main() not main(). 2001-09-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * include/rtems/score/Makefile.am: Use 'PREINSTALL_FILES ='. * shmdr/Makefile.am: Use 'PREINSTALL_FILES ='. 2001-09-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Use SUBDIRS = instead of SUBDIRS += to make automake-1.5 happy. * include/rtems/score/Makefile.am: Use CLEANFILES = to make automake-1.5 happy. * bsp.am: Use PREINSTALL_FILES = to make automake-1.5 happy. 2001-02-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * bsp.am: Fix automake version number in comment. 2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. 2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. 2000-10-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. Switch to GNU canonicalization. 2000-09-25 Joel Sherrill <joel@OARcorp.com> * shmdr/shm_driver.h: Added _AM29K entry. May not be correct. 2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * shmdr/Makefile.am: Include compile.am 2000-08-10 Joel Sherrill <joel@OARcorp.com> * ChangeLog: New file.
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
The mpci.h file provided in here is too simple for an MPCI with
|
||||
multiple ways to get to a node.
|
||||
|
||||
This version of the shm driver needs to be reorganized to follow
|
||||
the better model of the Ada version.
|
||||
@@ -1,42 +0,0 @@
|
||||
/* void Shm_Locked_queue_Add( lq_cb, ecb )
|
||||
*
|
||||
* This routine adds an envelope control block to a shared memory queue.
|
||||
*
|
||||
* Input parameters:
|
||||
* lq_cb - pointer to a locked queue control block
|
||||
* ecb - pointer to an envelope control block
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
void Shm_Locked_queue_Add(
|
||||
Shm_Locked_queue_Control *lq_cb,
|
||||
Shm_Envelope_control *ecb
|
||||
)
|
||||
{
|
||||
rtems_unsigned32 index;
|
||||
|
||||
ecb->next = Shm_Locked_queue_End_of_list;
|
||||
ecb->queue = lq_cb->owner;
|
||||
index = ecb->index;
|
||||
|
||||
Shm_Lock( lq_cb );
|
||||
if ( Shm_Convert(lq_cb->front) != Shm_Locked_queue_End_of_list )
|
||||
Shm_Envelopes[ Shm_Convert(lq_cb->rear) ].next = index;
|
||||
else
|
||||
lq_cb->front = index;
|
||||
lq_cb->rear = index;
|
||||
Shm_Unlock( lq_cb );
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/* void Shm_Convert_packet( &packet )
|
||||
*
|
||||
* This routine is the shared memory locked queue MPCI driver routine
|
||||
* used to convert the RTEMS's information in a packet from non-native
|
||||
* format to processor native format.
|
||||
*
|
||||
* Input parameters:
|
||||
* packet - pointer to a packet
|
||||
*
|
||||
* Output parameters:
|
||||
* *packet - packet in native format
|
||||
*
|
||||
* NOTE: Message buffers are not manipulated.
|
||||
* Endian conversion is currently the only conversion.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
void Shm_Convert_packet(
|
||||
rtems_packet_prefix *packet
|
||||
)
|
||||
{
|
||||
rtems_unsigned32 *pkt, i;
|
||||
|
||||
pkt = (rtems_unsigned32 *) packet;
|
||||
for ( i=RTEMS_MINIMUN_HETERO_CONVERSION ; i ; i--, pkt++ )
|
||||
*pkt = CPU_swap_u32( *pkt );
|
||||
|
||||
for ( i=packet->to_convert ; i ; i--, pkt++ )
|
||||
*pkt = CPU_swap_u32( *pkt );
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* This routine is invoked following a reset to report the statistics
|
||||
* gathered during the previous execution.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "shm_driver.h"
|
||||
|
||||
void
|
||||
Shm_Print_statistics(void)
|
||||
{
|
||||
rtems_unsigned32 ticks;
|
||||
rtems_unsigned32 ticks_per_second;
|
||||
rtems_unsigned32 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 );
|
||||
|
||||
seconds = ticks / ticks_per_second;
|
||||
if ( seconds == 0 )
|
||||
seconds = 1;
|
||||
|
||||
packets_per_second = Shm_Receive_message_count / seconds;
|
||||
if ( (Shm_Receive_message_count % seconds) >= (seconds / 2) )
|
||||
packets_per_second++;
|
||||
|
||||
printf( "\n\nSHMDR STATISTICS (NODE %d)\n", Shm_Local_node );
|
||||
printf( "TICKS SINCE BOOT = %d\n", ticks );
|
||||
printf( "TICKS PER SECOND = %d\n", ticks_per_second );
|
||||
printf( "ISRs=%d\n", Shm_Interrupt_count );
|
||||
printf( "RECV=%d\n", Shm_Receive_message_count );
|
||||
printf( "NULL=%d\n", Shm_Null_message_count );
|
||||
printf( "PKTS/SEC=%d\n", packets_per_second );
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/* void MPCI_Fatal( error )
|
||||
*
|
||||
* This routine is the shared memory driver fatal error handler.
|
||||
*
|
||||
* Input parameters:
|
||||
* error - fatal error code
|
||||
*
|
||||
* Output parameters: NEVER RETURNS
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
void MPCI_Fatal(
|
||||
Internal_errors_Source source,
|
||||
boolean is_internal,
|
||||
rtems_unsigned32 error
|
||||
)
|
||||
{
|
||||
/* Eventually need to attempt to broadcast a K_FATAL message
|
||||
* without checking for all possible errors (do not want to
|
||||
* recurse).
|
||||
*
|
||||
* Also need to avoid using Shm_Node_statuses if the driver has not been
|
||||
* initialized.
|
||||
*/
|
||||
|
||||
Shm_Local_node_status->error = Shm_Convert(error);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/* Shm_Envelope_control *Shm_Locked_queue_Get( lq_cb )
|
||||
*
|
||||
* This routine returns an envelope control block from a shared
|
||||
* memory queue.
|
||||
*
|
||||
* Input parameters:
|
||||
* lq_cb - pointer to a locked queue control block
|
||||
*
|
||||
* Output parameters:
|
||||
* returns - pointer to an envelope control block
|
||||
* - NULL if no envelopes on specified queue
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <shm_driver.h>
|
||||
|
||||
Shm_Envelope_control *Shm_Locked_queue_Get(
|
||||
Shm_Locked_queue_Control *lq_cb
|
||||
)
|
||||
{
|
||||
Shm_Envelope_control *tmp_ecb;
|
||||
rtems_unsigned32 tmpfront;
|
||||
|
||||
tmp_ecb = NULL;
|
||||
Shm_Lock( lq_cb );
|
||||
|
||||
tmpfront = Shm_Convert(lq_cb->front);
|
||||
if ( tmpfront != Shm_Locked_queue_End_of_list ) {
|
||||
tmp_ecb = &Shm_Envelopes[ tmpfront ];
|
||||
lq_cb->front = tmp_ecb->next;
|
||||
if ( tmp_ecb->next == Shm_Locked_queue_End_of_list )
|
||||
lq_cb->rear = Shm_Locked_queue_End_of_list;
|
||||
tmp_ecb->next = Shm_Locked_queue_Not_on_list;
|
||||
}
|
||||
|
||||
Shm_Unlock( lq_cb );
|
||||
return( tmp_ecb );
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/* Shm_Get_packet
|
||||
*
|
||||
* This routine is the shared memory locked queue MPCI driver
|
||||
* routine used to obtain an empty message packet.
|
||||
*
|
||||
* Input parameters:
|
||||
* packet - address of pointer to packet
|
||||
*
|
||||
* Output parameters:
|
||||
* *(cpb->get_packet) - address of allocated packet
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
rtems_mpci_entry Shm_Get_packet(
|
||||
rtems_packet_prefix **packet
|
||||
)
|
||||
{
|
||||
Shm_Envelope_control *ecb;
|
||||
|
||||
ecb = Shm_Allocate_envelope();
|
||||
if ( !ecb )
|
||||
rtems_fatal_error_occurred ( SHM_NO_FREE_PKTS );
|
||||
*packet = Shm_Envelope_control_to_packet_prefix_pointer( ecb );
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
/* Shm_Initialization
|
||||
*
|
||||
* This routine is the shared memory communications initerface
|
||||
* driver initialization routine.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define _SHM_INIT
|
||||
|
||||
#include <rtems.h>
|
||||
#include <shm_driver.h>
|
||||
|
||||
#include <string.h> /* memset() */
|
||||
#include <stdlib.h> /* malloc() */
|
||||
#include <assert.h>
|
||||
|
||||
/*
|
||||
* User extension to install MPCI_Fatal as a fatal error
|
||||
* handler extension
|
||||
*/
|
||||
|
||||
rtems_extensions_table MPCI_Shm_extensions;
|
||||
|
||||
rtems_mpci_entry Shm_Initialization( void )
|
||||
|
||||
{
|
||||
rtems_unsigned32 i, all_initialized;
|
||||
rtems_unsigned32 interrupt_cause, interrupt_value;
|
||||
void *interrupt_address;
|
||||
Shm_Node_status_control *nscb;
|
||||
rtems_unsigned32 extension_id; /* for installation of MPCI_Fatal */
|
||||
rtems_unsigned32 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;
|
||||
|
||||
Shm_RTEMS_Configuration = configuration;
|
||||
Shm_RTEMS_MP_Configuration = mp_configuration;
|
||||
|
||||
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_Interrupt_table = (Shm_Interrupt_information *) malloc(
|
||||
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;
|
||||
|
||||
/*
|
||||
* Set the Node Status indicators
|
||||
*/
|
||||
|
||||
Shm_Pending_initialization =
|
||||
Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' ));
|
||||
Shm_Initialization_complete =
|
||||
Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' ));
|
||||
Shm_Active_node =
|
||||
Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' ));
|
||||
|
||||
/*
|
||||
* Initialize the constants used by the Locked Queue code.
|
||||
*/
|
||||
|
||||
Shm_Locked_queue_End_of_list = Shm_Convert( 0xffffffff );
|
||||
Shm_Locked_queue_Not_on_list = Shm_Convert( 0xfffffffe );
|
||||
|
||||
/*
|
||||
* Set the base addresses for the:
|
||||
* + Node Status Table
|
||||
* + Free Pool and Receive Queues
|
||||
* + Envelopes
|
||||
*/
|
||||
|
||||
Shm_Node_statuses = (Shm_Node_status_control *) START_NS_CBS;
|
||||
Shm_Locked_queues = (Shm_Locked_queue_Control *) START_LQ_CBS;
|
||||
Shm_Envelopes = (Shm_Envelope_control *) START_ENVELOPES;
|
||||
|
||||
/*
|
||||
* Calculate the maximum number of envelopes which can be
|
||||
* placed the remaining shared memory.
|
||||
*/
|
||||
|
||||
remaining_memory =
|
||||
((void *)Shm_Configuration->base + Shm_Configuration->length) -
|
||||
((void *)Shm_Envelopes);
|
||||
|
||||
Shm_Maximum_envelopes = remaining_memory / sizeof( Shm_Envelope_control );
|
||||
Shm_Maximum_envelopes -= 1;
|
||||
|
||||
/*
|
||||
* Set the pointer to the receive queue for the local node.
|
||||
* When we receive a node, we will get it from here before
|
||||
* processing it.
|
||||
*/
|
||||
|
||||
Shm_Local_receive_queue = &Shm_Locked_queues[ Shm_Local_node ];
|
||||
Shm_Local_node_status = &Shm_Node_statuses[ Shm_Local_node ];
|
||||
|
||||
/*
|
||||
* Convert local interrupt cause information into the
|
||||
* neutral format so other nodes will be able to
|
||||
* understand it.
|
||||
*/
|
||||
|
||||
interrupt_address =
|
||||
(void *) Shm_Convert( (rtems_unsigned32)Shm_Configuration->Intr.address );
|
||||
interrupt_value = Shm_Convert( Shm_Configuration->Intr.value );
|
||||
interrupt_cause = Shm_Convert( Shm_Configuration->Intr.length );
|
||||
|
||||
if ( Shm_Configuration->poll_intr == POLLED_MODE ) Shm_setclockvec();
|
||||
else Shm_setvec();
|
||||
|
||||
if ( Shm_Is_master_node() ) {
|
||||
|
||||
/*
|
||||
* Zero out the shared memory area.
|
||||
*/
|
||||
|
||||
(void) memset(
|
||||
(void *) Shm_Configuration->base,
|
||||
0,
|
||||
Shm_Configuration->length
|
||||
);
|
||||
|
||||
/*
|
||||
* Initialize all of the locked queues (the free envelope
|
||||
* pool and a receive queue per node) and set all of the
|
||||
* node's status so they will be waiting to initialization
|
||||
* to complete.
|
||||
*/
|
||||
|
||||
Shm_Locked_queue_Initialize( FREE_ENV_CB, FREE_ENV_POOL );
|
||||
|
||||
for ( i=SHM_FIRST_NODE ; i<=Shm_Maximum_nodes ; i++ ) {
|
||||
Shm_Initialize_receive_queue( i );
|
||||
|
||||
Shm_Node_statuses[ i ].status = Shm_Pending_initialization;
|
||||
Shm_Node_statuses[ i ].error = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize all of the envelopes and place them in the
|
||||
* free pool.
|
||||
*/
|
||||
|
||||
for ( i=0 ; i<Shm_Maximum_envelopes ; i++ ) {
|
||||
Shm_Envelopes[ i ].index = Shm_Convert(i);
|
||||
Shm_Free_envelope( &Shm_Envelopes[ i ] );
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize this node's interrupt information in the
|
||||
* shared area so other nodes can interrupt us.
|
||||
*/
|
||||
|
||||
Shm_Local_node_status->int_address = (rtems_unsigned32) interrupt_address;
|
||||
Shm_Local_node_status->int_value = interrupt_value;
|
||||
Shm_Local_node_status->int_length = interrupt_cause;
|
||||
|
||||
Shm_Local_node_status->status = Shm_Initialization_complete;
|
||||
|
||||
/*
|
||||
* Loop until all nodes have completed initialization.
|
||||
*/
|
||||
|
||||
do {
|
||||
all_initialized = 1;
|
||||
|
||||
for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
|
||||
if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete )
|
||||
all_initialized = 0;
|
||||
|
||||
} while ( all_initialized == 0 );
|
||||
|
||||
/*
|
||||
* Tell the other nodes we think that the system is up.
|
||||
*/
|
||||
|
||||
for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ )
|
||||
Shm_Node_statuses[ i ].status = Shm_Active_node;
|
||||
|
||||
} else { /* is not MASTER node */
|
||||
|
||||
/*
|
||||
* Initialize the node status for the non-master nodes.
|
||||
* Because the master node zeroes out memory, it is
|
||||
* necessary for them to keep putting their values in
|
||||
* the node status area until the master says they
|
||||
* should become active.
|
||||
*/
|
||||
|
||||
Shm_Local_node_status->status = Shm_Pending_initialization;
|
||||
|
||||
do {
|
||||
|
||||
if ( Shm_Local_node_status->status == Shm_Pending_initialization ) {
|
||||
|
||||
/*
|
||||
* Initialize this node's interrupt information in the
|
||||
* shared area so other nodes can interrupt us.
|
||||
*/
|
||||
|
||||
Shm_Local_node_status->int_address =
|
||||
(rtems_unsigned32) interrupt_address;
|
||||
Shm_Local_node_status->int_value = interrupt_value;
|
||||
Shm_Local_node_status->int_length = interrupt_cause;
|
||||
|
||||
Shm_Local_node_status->status = Shm_Initialization_complete;
|
||||
}
|
||||
} while ( Shm_Local_node_status->status != Shm_Active_node ) ;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the Interrupt Information Table
|
||||
*/
|
||||
|
||||
for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) {
|
||||
nscb = &Shm_Node_statuses[ i ];
|
||||
|
||||
Shm_Interrupt_table[i].address = Shm_Convert_address(
|
||||
(void *)Shm_Convert(((vol_u32) nscb->int_address))
|
||||
);
|
||||
Shm_Interrupt_table[i].value = Shm_Convert( nscb->int_value );
|
||||
Shm_Interrupt_table[i].length = Shm_Convert( nscb->int_length );
|
||||
}
|
||||
|
||||
MPCI_Shm_extensions.fatal = MPCI_Fatal;
|
||||
|
||||
(void) rtems_extension_create(
|
||||
rtems_build_name( 'M', 'P', 'E', 'X' ),
|
||||
&MPCI_Shm_extensions,
|
||||
&extension_id
|
||||
);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/* void Shm_Locked_queue_Initialize( lq_cb, owner )
|
||||
*
|
||||
* This routine initializes a shared memory locked queue.
|
||||
*
|
||||
* Input parameters:
|
||||
* lq_cb - pointer to the control block of the queue
|
||||
* to be initialized
|
||||
* owner - unique idenitifier of who owns this queue.
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
void Shm_Locked_queue_Initialize(
|
||||
Shm_Locked_queue_Control *lq_cb,
|
||||
rtems_unsigned32 owner
|
||||
)
|
||||
{
|
||||
Shm_Initialize_lock( lq_cb );
|
||||
lq_cb->front = Shm_Locked_queue_End_of_list;
|
||||
lq_cb->rear = Shm_Locked_queue_End_of_list;
|
||||
lq_cb->owner = Shm_Convert(owner);
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/* void Shm_Cause_interrupt( node )
|
||||
*
|
||||
* This routine is the shared memory driver routine which
|
||||
* generates interrupts to other CPUs.
|
||||
*
|
||||
* It uses the information placed in the node status control
|
||||
* block by each node. For example, when used with the Motorola
|
||||
* MVME136 board, the MPCSR is used.
|
||||
*
|
||||
* Input parameters:
|
||||
* node - destination of this packet (0 = broadcast)
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
void Shm_Cause_interrupt(
|
||||
rtems_unsigned32 node
|
||||
)
|
||||
{
|
||||
Shm_Interrupt_information *intr;
|
||||
rtems_unsigned8 *u8;
|
||||
rtems_unsigned16 *u16;
|
||||
rtems_unsigned32 *u32;
|
||||
rtems_unsigned32 value;
|
||||
|
||||
intr = &Shm_Interrupt_table[node];
|
||||
value = intr->value;
|
||||
|
||||
switch ( intr->length ) {
|
||||
case NO_INTERRUPT:
|
||||
break;
|
||||
case BYTE:
|
||||
u8 = (rtems_unsigned8 *)intr->address;
|
||||
*u8 = (rtems_unsigned8) value;
|
||||
break;
|
||||
case WORD:
|
||||
u16 = (rtems_unsigned16 *)intr->address;
|
||||
*u16 = (rtems_unsigned16) value;
|
||||
break;
|
||||
case LONG:
|
||||
u32 = (rtems_unsigned32 *)intr->address;
|
||||
*u32 = (rtems_unsigned32) value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/* mpci.h
|
||||
*
|
||||
* This include file contains all the renaming necessary to
|
||||
* have an application use the Shared Memory Driver as its
|
||||
* sole mechanism for MPCI.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __SHM_MPCI_h
|
||||
#define __SHM_MPCI_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <shm_driver.h>
|
||||
|
||||
#define MPCI_Initialization( _configuration ) \
|
||||
Shm_Initialization( _configuration )
|
||||
|
||||
#define MPCI_Get_packet( _the_packet ) \
|
||||
Shm_Get_packet( _the_packet )
|
||||
|
||||
#define MPCI_Return_packet( _the_packet ) \
|
||||
Shm_Return_packet( _the_packet )
|
||||
|
||||
#define MPCI_Receive_packet( _the_packet ) \
|
||||
Shm_Receive_packet( _the_packet )
|
||||
|
||||
#define MPCI_Send_packet( _destination, _the_packet ) \
|
||||
Shm_Send_packet( _destination, _the_packet )
|
||||
|
||||
/* Unnecessary... mapped in shm_driver.h
|
||||
#define MPCI_Fatal( _the_error ) \
|
||||
Shm_Fatal( _the_error )
|
||||
*/
|
||||
|
||||
#define MPCI_Enable_statistics()
|
||||
|
||||
#define MPCI_Print_statistics() \
|
||||
Shm_Print_statistics()
|
||||
|
||||
/* no need to rename the MPCI_Table either */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
@@ -1,22 +0,0 @@
|
||||
/* _Shm_isr()
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
rtems_isr Shm_isr(
|
||||
rtems_vector_number vector
|
||||
)
|
||||
{
|
||||
Shm_Interrupt_count += 1;
|
||||
rtems_multiprocessing_announce();
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/* void Shm_Poll()
|
||||
*
|
||||
* This routine polls to see if a packet has arrived. If one
|
||||
* has it informs the executive. It is typically called from
|
||||
* the clock tick interrupt service routine.
|
||||
*
|
||||
* Input parameters: NONE
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/score/sysstate.h>
|
||||
#include <rtems/libio.h>
|
||||
|
||||
#include "shm_driver.h"
|
||||
|
||||
void Shm_Poll()
|
||||
{
|
||||
rtems_unsigned32 tmpfront;
|
||||
rtems_libio_ioctl_args_t args;
|
||||
|
||||
/* invoke clock isr */
|
||||
args.iop = 0;
|
||||
args.command = rtems_build_name('I', 'S', 'R', ' ');
|
||||
(void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args);
|
||||
|
||||
/*
|
||||
* Check for msgs only if we are "up"
|
||||
* This avoids a race condition where we may get a clock
|
||||
* interrupt before MPCI has completed its init
|
||||
*/
|
||||
|
||||
if (_System_state_Is_up(_System_state_Get()))
|
||||
{
|
||||
tmpfront = Shm_Local_receive_queue->front;
|
||||
if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list )
|
||||
{
|
||||
rtems_multiprocessing_announce();
|
||||
Shm_Interrupt_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/* Shm_Receive_packet
|
||||
*
|
||||
* This routine is the shared memory locked queue MPCI driver routine
|
||||
* used to obtain a packet containing a message from this node's
|
||||
* receive queue.
|
||||
*
|
||||
* Input parameters:
|
||||
* packet - address of a pointer to a packet
|
||||
*
|
||||
* Output parameters:
|
||||
* *(rpb->packet) - pointer to packet
|
||||
* NULL if no packet currently available
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
rtems_mpci_entry Shm_Receive_packet(
|
||||
rtems_packet_prefix **packet
|
||||
)
|
||||
{
|
||||
Shm_Envelope_control *ecb;
|
||||
|
||||
ecb = Shm_Locked_queue_Get( Shm_Local_receive_queue );
|
||||
if ( ecb ) {
|
||||
*(packet) = Shm_Envelope_control_to_packet_prefix_pointer( ecb );
|
||||
if ( ecb->Preamble.endian != Shm_Configuration->format )
|
||||
Shm_Convert_packet( *packet );
|
||||
Shm_Receive_message_count++;
|
||||
} else {
|
||||
*(packet) = NULL;
|
||||
Shm_Null_message_count++;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/* Shm_Return_packet
|
||||
*
|
||||
* This routine is the shared memory locked queue MPCI driver
|
||||
* routine used to return a message packet to a free envelope
|
||||
* pool accessible by this node.
|
||||
*
|
||||
* Input parameters:
|
||||
* packet - address of pointer to packet
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
rtems_mpci_entry Shm_Return_packet(
|
||||
rtems_packet_prefix *packet
|
||||
)
|
||||
{
|
||||
Shm_Free_envelope( Shm_Packet_prefix_to_envelope_control_pointer(packet) );
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/* Shm_Send_packet
|
||||
*
|
||||
* This routine is the shared memory driver locked queue write
|
||||
* MPCI driver routine. This routine sends the specified packet
|
||||
* to the destination specified by "node". A "node" value of
|
||||
* zero designates that this packet is to be broadcasted.
|
||||
*
|
||||
* Input parameters:
|
||||
* node - destination of this packet (0 = broadcast)
|
||||
* packet - address of packet
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include "shm_driver.h"
|
||||
|
||||
struct pkt_cpy {
|
||||
rtems_unsigned32 packet[MAX_PACKET_SIZE/4];
|
||||
};
|
||||
|
||||
rtems_mpci_entry Shm_Send_packet(
|
||||
rtems_unsigned32 node,
|
||||
rtems_packet_prefix *packet
|
||||
)
|
||||
{
|
||||
Shm_Envelope_control *ecb, *tmp_ecb;
|
||||
rtems_unsigned32 nnum;
|
||||
|
||||
ecb = Shm_Packet_prefix_to_envelope_control_pointer( packet );
|
||||
if ( node ) {
|
||||
Shm_Build_preamble( ecb, node );
|
||||
Shm_Build_postamble( ecb );
|
||||
Shm_Append_to_receive_queue( node, ecb );
|
||||
(*Shm_Configuration->cause_intr)( node );
|
||||
}
|
||||
else {
|
||||
for( nnum = SHM_FIRST_NODE ; nnum <= Shm_Maximum_nodes ; nnum++ )
|
||||
if ( Shm_Local_node != nnum ) {
|
||||
tmp_ecb = Shm_Allocate_envelope();
|
||||
if ( !tmp_ecb )
|
||||
rtems_fatal_error_occurred( SHM_NO_FREE_PKTS );
|
||||
Shm_Build_preamble( tmp_ecb, nnum );
|
||||
*((struct pkt_cpy *)tmp_ecb->packet) = *((struct pkt_cpy *)packet);
|
||||
Shm_Build_postamble( tmp_ecb );
|
||||
Shm_Append_to_receive_queue( nnum, tmp_ecb );
|
||||
(*Shm_Configuration->cause_intr)( nnum );
|
||||
}
|
||||
Shm_Free_envelope( ecb );
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/* Shm_setclockvec
|
||||
*
|
||||
* This routines installs the shared memory clock interrupt handler
|
||||
* used when the driver is used in polling mode.
|
||||
*
|
||||
* INPUT PARAMETERS: NONE
|
||||
*
|
||||
* OUTPUT PARAMETERS: NONE
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <rtems.h>
|
||||
#include <rtems/libio.h>
|
||||
|
||||
#include "shm_driver.h"
|
||||
|
||||
rtems_isr Shm_setclockvec()
|
||||
{
|
||||
rtems_libio_ioctl_args_t args;
|
||||
args.iop = 0;
|
||||
args.command = rtems_build_name('N', 'E', 'W', ' ');
|
||||
args.buffer = (void *) Shm_Poll;
|
||||
|
||||
(void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user