Changeset 5c980d0 in rtems for c/src/libchip


Ignore:
Timestamp:
Sep 5, 2008, 2:48:37 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
26f5aa0
Parents:
3c4d041c
Message:

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

  • 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.
Location:
c/src/libchip
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/Makefile.am

    r3c4d041c r5c980d0  
    132132shmdr_rel_SOURCES = shmdr/addlq.c shmdr/cnvpkt.c shmdr/getlq.c shmdr/dump.c \
    133133    shmdr/fatal.c shmdr/getpkt.c shmdr/init.c shmdr/initlq.c shmdr/intr.c \
    134     shmdr/mpisr.c shmdr/poll.c shmdr/receive.c shmdr/retpkt.c shmdr/send.c \
    135     shmdr/setckvec.c
     134    shmdr/mpisr.c shmdr/poll.c shmdr/receive.c shmdr/retpkt.c shmdr/send.c
    136135shmdr_rel_CPPFLAGS = $(AM_CPPFLAGS)
    137136shmdr_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
  • c/src/libchip/shmdr/init.c

    r3c4d041c r5c980d0  
    127127  interrupt_cause   = Shm_Convert( Shm_Configuration->Intr.length );
    128128
    129   if ( Shm_Configuration->poll_intr == POLLED_MODE ) Shm_setclockvec();
     129  if ( Shm_Configuration->poll_intr == POLLED_MODE ) Shm_install_timer();
    130130  else                                               Shm_setvec();
    131131
  • c/src/libchip/shmdr/mpisr.c

    r3c4d041c r5c980d0  
    1414#include "shm_driver.h"
    1515
    16 rtems_isr Shm_isr(
    17   rtems_vector_number vector
    18 )
     16void Shm_isr(void)
    1917{
    2018  Shm_Interrupt_count += 1;
  • c/src/libchip/shmdr/poll.c

    r3c4d041c r5c980d0  
    1 /*  void Shm_Poll()
     1/*
     2 *  This routine polls to see if a packet has arrived.  If one
     3 *  has it informs the executive. It uses a Classic API Timer
    24 *
    3  *  This routine polls to see if a packet has arrived.  If one
    4  *  has it informs the executive.  It is typically called from
    5  *  the clock tick interrupt service routine.
    6  *
    7  *  Input parameters:  NONE
    8  *
    9  *  Output parameters: NONE
    10  *
    11  *  COPYRIGHT (c) 1989-1999.
     5 *  COPYRIGHT (c) 1989-2008.
    126 *  On-Line Applications Research Corporation (OAR).
    137 *
     
    2317#include <rtems/libio.h>
    2418
     19#include <assert.h>
     20
    2521#include "shm_driver.h"
    2622
    27 void Shm_Poll()
     23rtems_timer_service_routine Shm_Poll_TSR(
     24  rtems_id  id,
     25  void     *ignored_address
     26)
    2827{
    29   uint32_t   tmpfront;
    30   rtems_libio_ioctl_args_t args;
    31 
    32   /* invoke clock isr */
    33   args.iop = 0;
    34   args.command = rtems_build_name('I', 'S', 'R', ' ');
    35   (void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args);
     28  uint32_t tmpfront;
    3629
    3730  /*
    38    * Check for msgs only if we are "up"
    39    * This avoids a race condition where we may get a clock
    40    * interrupt before MPCI has completed its init
     31   *  This should NEVER happen but just in case.
    4132   */
     33  if (!_System_state_Is_up(_System_state_Get()))
     34    return;
    4235
    43   if (_System_state_Is_up(_System_state_Get()))
    44   {
    45       tmpfront = Shm_Local_receive_queue->front;
    46       if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list )
    47       {
    48           rtems_multiprocessing_announce();
    49           Shm_Interrupt_count++;
    50       }
     36  tmpfront = Shm_Local_receive_queue->front;
     37  if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) {
     38    rtems_multiprocessing_announce();
     39    Shm_Interrupt_count++;
    5140  }
     41
     42  (void) rtems_timer_reset( id );
    5243}
     44
     45void Shm_install_timer(void)
     46{
     47  rtems_id          id;
     48  rtems_status_code status;
     49
     50  status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id );
     51  assert( !status );
     52 
     53  status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL );
     54  assert( !status );
     55}
     56
  • c/src/libchip/shmdr/shm_driver.h

    r3c4d041c r5c980d0  
    405405 *               target boards may not provide hardware for
    406406 *               an interprocessor interrupt.  If POLLED_MODE
    407  *               is selected, the SHM driver will install a
    408  *               wrapper around the Clock_isr() to poll for
     407 *               is selected, the SHM driver will use a
     408 *               Classiv API Timer instance to poll for
    409409 *               incoming packets.  Throughput is dependent
    410410 *               on the time between clock interrupts.
     
    483483void           MPCI_Fatal( Internal_errors_Source, boolean, uint32_t);
    484484rtems_task     Shm_Cause_interrupt( uint32_t );
    485 void           Shm_Poll( void );
    486 void           Shm_setclockvec( void );
     485void           Shm_install_timer( void );
    487486void           Shm_Convert_packet( rtems_packet_prefix * );
    488487
Note: See TracChangeset for help on using the changeset viewer.