2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>

* libchip/Makefile.am, libchip/shmdr/init.c, libchip/shmdr/mpisr.c,
	libchip/shmdr/poll.c, libchip/shmdr/shm_driver.h: Update shared
	memory driver to not use the clock ioctl to install a method to poll
	for input. It now uses a Class API Timer which means we can eliminate
	this special IOCTL from all clock drivers.
	* libchip/shmdr/setckvec.c: Removed.
This commit is contained in:
Joel Sherrill
2008-09-05 14:48:37 +00:00
parent 3c4d041ce4
commit 5c980d0f99
7 changed files with 47 additions and 71 deletions

View File

@@ -1,3 +1,12 @@
2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/Makefile.am, libchip/shmdr/init.c, libchip/shmdr/mpisr.c,
libchip/shmdr/poll.c, libchip/shmdr/shm_driver.h: Update shared
memory driver to not use the clock ioctl to install a method to poll
for input. It now uses a Class API Timer which means we can eliminate
this special IOCTL from all clock drivers.
* libchip/shmdr/setckvec.c: Removed.
2008-08-30 Joel Sherrill <joel.sherrill@OARcorp.com>
* libchip/network/sonic.c: Do not declare a variable just to hold an

View File

@@ -131,8 +131,7 @@ include_HEADERS = shmdr/shm_driver.h shmdr/mpci.h
project_lib_PROGRAMS = shmdr.rel
shmdr_rel_SOURCES = shmdr/addlq.c shmdr/cnvpkt.c shmdr/getlq.c shmdr/dump.c \
shmdr/fatal.c shmdr/getpkt.c shmdr/init.c shmdr/initlq.c shmdr/intr.c \
shmdr/mpisr.c shmdr/poll.c shmdr/receive.c shmdr/retpkt.c shmdr/send.c \
shmdr/setckvec.c
shmdr/mpisr.c shmdr/poll.c shmdr/receive.c shmdr/retpkt.c shmdr/send.c
shmdr_rel_CPPFLAGS = $(AM_CPPFLAGS)
shmdr_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
endif

View File

@@ -126,7 +126,7 @@ rtems_mpci_entry Shm_Initialization( void )
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();
if ( Shm_Configuration->poll_intr == POLLED_MODE ) Shm_install_timer();
else Shm_setvec();
if ( Shm_Is_master_node() ) {

View File

@@ -13,9 +13,7 @@
#include <rtems.h>
#include "shm_driver.h"
rtems_isr Shm_isr(
rtems_vector_number vector
)
void Shm_isr(void)
{
Shm_Interrupt_count += 1;
rtems_multiprocessing_announce();

View File

@@ -1,14 +1,8 @@
/* 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.
* has it informs the executive. It uses a Classic API Timer
*
* Input parameters: NONE
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -22,31 +16,41 @@
#include <rtems/score/sysstate.h>
#include <rtems/libio.h>
#include <assert.h>
#include "shm_driver.h"
void Shm_Poll()
rtems_timer_service_routine Shm_Poll_TSR(
rtems_id id,
void *ignored_address
)
{
uint32_t 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);
uint32_t tmpfront;
/*
* 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
* This should NEVER happen but just in case.
*/
if (!_System_state_Is_up(_System_state_Get()))
return;
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++;
}
tmpfront = Shm_Local_receive_queue->front;
if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) {
rtems_multiprocessing_announce();
Shm_Interrupt_count++;
}
(void) rtems_timer_reset( id );
}
void Shm_install_timer(void)
{
rtems_id id;
rtems_status_code status;
status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id );
assert( !status );
status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL );
assert( !status );
}

View File

@@ -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);
}

View File

@@ -404,8 +404,8 @@ typedef struct {
* poll_intr - The operational mode of the driver. Some
* target boards may not provide hardware for
* an interprocessor interrupt. If POLLED_MODE
* is selected, the SHM driver will install a
* wrapper around the Clock_isr() to poll for
* is selected, the SHM driver will use a
* Classiv API Timer instance to poll for
* incoming packets. Throughput is dependent
* on the time between clock interrupts.
* Valid values are POLLED_MODE and INTR_MODE.
@@ -482,8 +482,7 @@ void Init_env_pool( void );
void Shm_Print_statistics( void );
void MPCI_Fatal( Internal_errors_Source, boolean, uint32_t);
rtems_task Shm_Cause_interrupt( uint32_t );
void Shm_Poll( void );
void Shm_setclockvec( void );
void Shm_install_timer( void );
void Shm_Convert_packet( rtems_packet_prefix * );
/* CPU specific routines are inlined in shmcpu.h */