Changeset 84aee2e9 in rtems


Ignore:
Timestamp:
Dec 10, 2019, 7:09:13 AM (6 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
86c70e71
Parents:
46865542
git-author:
Sebastian Huber <sebastian.huber@…> (12/10/19 07:09:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/11/19 08:05:07)
Message:

mpci: Simplify MPCI configuration

Use watchdog for shared memory driver instead of a Classic API Timer.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bsps/include/shm_driver.h

    r46865542 r84aee2e9  
    1818#define __SHM_h
    1919
     20#include <rtems.h>
    2021#include <rtems/clockdrv.h>
    2122
  • bsps/shared/shmdr/shmdr-poll.c

    r46865542 r84aee2e9  
    1414 */
    1515
    16 #include <rtems.h>
    1716#include <rtems/score/sysstate.h>
    18 #include <rtems/libio.h>
    19 
    20 #include <assert.h>
     17#include <rtems/score/watchdogimpl.h>
    2118
    2219#include "shm_driver.h"
    2320
    24 static rtems_timer_service_routine Shm_Poll_TSR(
    25   rtems_id  id,
    26   void     *ignored_address
    27 )
     21static void Shm_Poll_Set_timer( Watchdog_Control *the_watchdog )
     22{
     23  Per_CPU_Control  *cpu;
     24  ISR_lock_Context  lock_context;
     25
     26  cpu = _Watchdog_Get_CPU( the_watchdog );
     27  _ISR_lock_ISR_disable( &lock_context );
     28  _Watchdog_Per_CPU_acquire_critical( cpu, &lock_context );
     29  _Watchdog_Insert(
     30    &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_TICKS ],
     31    the_watchdog,
     32    cpu->Watchdog.ticks + 1
     33  );
     34  _Watchdog_Per_CPU_release_critical( cpu, &lock_context );
     35  _ISR_lock_ISR_enable( &lock_context );
     36}
     37
     38static void Shm_Poll_TSR( Watchdog_Control *the_watchdog )
    2839{
    2940  uint32_t tmpfront;
     
    4152  }
    4253
    43   (void) rtems_timer_reset( id );
     54  Shm_Poll_Set_timer( the_watchdog );
    4455}
     56
     57static Watchdog_Control Shm_Poll_Watchdog = WATCHDOG_INITIALIZER(
     58  Shm_Poll_TSR
     59);
    4560
    4661void Shm_install_timer(void)
    4762{
    48   rtems_id          id;
    49   rtems_status_code status;
    50 
    51   status = rtems_timer_create( rtems_build_name( 'S', 'H', 'P', 'L' ), &id );
    52   assert( !status );
    53 
    54   status = rtems_timer_fire_after( id, 1, Shm_Poll_TSR, NULL );
    55   assert( !status );
     63  Shm_Poll_Set_timer( &Shm_Poll_Watchdog );
    5664}
    57 
  • cpukit/include/rtems/confdefs.h

    r46865542 r84aee2e9  
    18181818
    18191819  #ifdef CONFIGURE_MP_APPLICATION
    1820     #define _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1
    1821 
    18221820    #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
    18231821
     
    18691867  #else
    18701868    #define CONFIGURE_MULTIPROCESSING_TABLE NULL
    1871     #define _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0
    18721869    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
    18731870  #endif /* CONFIGURE_MP_APPLICATION */
    18741871#else
    1875   #define _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0
    18761872  #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
    18771873#endif /* RTEMS_MULTIPROCESSING */
     
    19921988  #define CONFIGURE_MAXIMUM_TIMERS             0
    19931989#endif
    1994 
    1995 #define _CONFIGURE_TIMERS \
    1996   (CONFIGURE_MAXIMUM_TIMERS + _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER)
    19971990
    19981991#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
     
    27762769  #endif
    27772770
    2778   #if _CONFIGURE_TIMERS > 0
    2779     TIMER_INFORMATION_DEFINE( _CONFIGURE_TIMERS );
     2771  #if CONFIGURE_MAXIMUM_TIMERS > 0
     2772    TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_TIMERS );
    27802773  #endif
    27812774
Note: See TracChangeset for help on using the changeset viewer.