Changeset d209d9b in rtems


Ignore:
Timestamp:
Mar 4, 2011, 2:07:19 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.9
Children:
97207cb
Parents:
9ec55e63
Message:

2011-03-04 Joel Sherrill <joel.sherrilL@…>

PR 1748/bsps

  • clock/ckinit.c, include/leon.h: When the clock tick generates an interrupt WHILE we have interrupts disabled doing a get TOD or uptime, the get nanoseconds handler was returning a bogusly large number.
Location:
c/src/lib/libbsp/sparc/leon3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/ChangeLog

    r9ec55e63 rd209d9b  
     12011-03-04      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        PR 1748/bsps
     4        * clock/ckinit.c, include/leon.h: When the clock tick generates an
     5        interrupt WHILE we have interrupts disabled doing a get TOD or
     6        uptime, the get nanoseconds handler was returning a bogusly large
     7        number.
     8
    192009-03-09      Antoine Lacroix <antoine.lacroix at sodern.fr>
    210
  • c/src/lib/libbsp/sparc/leon3/clock/ckinit.c

    r9ec55e63 rd209d9b  
    9898{
    9999  uint32_t clicks;
    100   if ( !LEON3_Timer_Regs )
    101     return 0;
     100  uint32_t usecs;
    102101
    103   clicks = LEON3_Timer_Regs->timer[0].value;
    104 
    105   /* Down counter */
    106   return (uint32_t)
    107      (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
     102  if ( LEON_Is_interrupt_pending( LEON_INTERRUPT_TIMER1 ) ) {
     103    clicks = LEON_REG.Timer_Counter_1;
     104    usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
     105  } else {
     106    usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
     107  }
     108  return usecs * 1000;
    108109}
    109110
    110 #define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
     111#define Clock_driver_nanoseconds_since_last_tick \
     112        bsp_clock_nanoseconds_since_last_tick
    111113
    112114#include "../../../shared/clockdrv_shell.c"
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r9ec55e63 rd209d9b  
    246246 
    247247#define LEON_Is_interrupt_pending( _source ) \
    248   (LEON3_IrqCtrl_Regs.ipend & (1 << (_source)))
     248  (LEON3_IrqCtrl_Regs->ipend & (1 << (_source)))
    249249 
    250250#define LEON_Is_interrupt_masked( _source ) \
    251251  do {\
    252      (LEON3_IrqCtrl_Regs.mask[LEON3_Cpu_Index] & (1 << (_source))); \
     252     (LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] & (1 << (_source))); \
    253253   } while (0)
    254254
Note: See TracChangeset for help on using the changeset viewer.