Changeset b61d5cac in rtems


Ignore:
Timestamp:
06/14/16 08:56:09 (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, 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.

Location:
c/src/lib/libbsp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/realview-pbx-a9/configure.ac

    r042072b rb61d5cac  
    4242simulation times.])
    4343
     44RTEMS_BSPOPTS_SET([CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR],[*qemu*],[1])
     45RTEMS_BSPOPTS_HELP([CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR],
     46[If defined, then do the clock tick processing on the boot processor on behalf
     47of all other processors.])
     48
    4449RTEMS_CHECK_SMP
    4550AM_CONDITIONAL(HAS_SMP,[test "$rtems_cv_HAS_SMP" = "yes"])
  • c/src/lib/libbsp/arm/shared/arm-a9mpcore-clock-config.c

    r042072b rb61d5cac  
    9595}
    9696
    97 #ifdef RTEMS_SMP
     97#if defined(RTEMS_SMP) && !defined(CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR)
    9898typedef struct {
    9999  uint64_t cmpval;
     
    117117)
    118118{
    119 #ifdef RTEMS_SMP
     119#if defined(RTEMS_SMP) && !defined(CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR)
    120120  a9mpcore_clock_init_data init_data = {
    121121    .cmpval = cmpval,
  • 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.