Changeset 7fce2ca in rtems


Ignore:
Timestamp:
Mar 4, 2011, 2:07:08 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10
Children:
302784e
Parents:
631a092
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

    r631a092 r7fce2ca  
     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
    192011-02-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    210
  • c/src/lib/libbsp/sparc/leon3/clock/ckinit.c

    r631a092 r7fce2ca  
    9898{
    9999  uint32_t clicks;
     100  uint32_t usecs;
     101
    100102  if ( !LEON3_Timer_Regs )
    101103    return 0;
     
    103105  clicks = LEON3_Timer_Regs->timer[0].value;
    104106
    105   /* Down counter */
    106   return (uint32_t)
    107      (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
     107  if ( LEON_Is_interrupt_pending( clkirq ) ) {
     108    clicks = LEON3_Timer_Regs->timer[0].value;
     109    usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
     110  } else {
     111    usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
     112  }
     113  return usecs * 1000;
    108114}
    109115
    110 #define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
     116
     117#define Clock_driver_nanoseconds_since_last_tick \
     118        bsp_clock_nanoseconds_since_last_tick
    111119
    112120#include "../../../shared/clockdrv_shell.h"
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    r631a092 r7fce2ca  
    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.