Ignore:
Timestamp:
Jun 14, 2016, 8:56:09 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ea02782a
Parents:
042072b
git-author:
Sebastian Huber <sebastian.huber@…> (06/14/16 08:56:09)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/16 09:57:48)
Message:

bsps: Add CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR

Add CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR clock driver option. If
defined, then do the clock tick processing on the boot processor on
behalf of all other processors. Currently, this is intended as a
workaround for a Qemu shortcoming on ARM.

Update #2737.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/clockdrv_shell.h

    r042072b rb61d5cac  
    2222#include <rtems/score/percpu.h>
    2323#include <rtems/score/smpimpl.h>
     24#include <rtems/score/watchdogimpl.h>
    2425
    2526#ifdef Clock_driver_nanoseconds_since_last_tick
     
    6566 */
    6667#ifndef Clock_driver_timecounter_tick
    67   #ifdef CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
    68     #define Clock_driver_timecounter_tick() rtems_clock_tick()
    69   #else
    70     #define Clock_driver_timecounter_tick() rtems_timecounter_tick()
    71   #endif
     68static void Clock_driver_timecounter_tick( void )
     69{
     70#if defined(CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER)
     71  rtems_clock_tick();
     72#elif defined(RTEMS_SMP) && defined(CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR)
     73  uint32_t cpu_count = _SMP_Get_processor_count();
     74  uint32_t cpu_index;
     75
     76  for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
     77    Per_CPU_Control *cpu;
     78
     79    cpu = _Per_CPU_Get_by_index( cpu_index );
     80
     81    if ( _Per_CPU_Is_boot_processor( cpu ) ) {
     82      rtems_timecounter_tick();
     83    } else if ( _Processor_mask_Is_set( _SMP_Online_processors, cpu_index ) ) {
     84      _Watchdog_Tick( cpu );
     85    }
     86  }
     87#else
     88  rtems_timecounter_tick();
     89#endif
     90}
    7291#endif
    7392
Note: See TracChangeset for help on using the changeset viewer.