Changeset 9ec55e63 in rtems


Ignore:
Timestamp:
Mar 4, 2011, 2:07:17 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.9
Children:
d209d9b
Parents:
5357e24
Message:

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

PR 1748/bsps

  • clock/ckinit.c: 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
Files:
4 edited

Legend:

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

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

    r5357e24 r9ec55e63  
    5050{
    5151  uint32_t clicks;
     52  uint32_t usecs;
    5253
    5354  clicks = ERC32_MEC.Real_Time_Clock_Counter;
    5455
    55   return (uint32_t)
    56     (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
     56  if ( ERC32_Is_interrupt_pending( ERC32_INTERRUPT_REAL_TIME_CLOCK ) ) {
     57    clicks = ERC32_MEC.Real_Time_Clock_Counter;
     58    usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
     59  } else {
     60    usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
     61  }
     62  return usecs * 1000;
    5763}
    5864
  • c/src/lib/libbsp/sparc/leon2/ChangeLog

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

    r5357e24 r9ec55e63  
    6060  } while (0)
    6161
     62
    6263uint32_t bsp_clock_nanoseconds_since_last_tick(void)
    6364{
    6465  uint32_t clicks;
     66  uint32_t usecs;
    6567
    66   clicks = LEON_REG.Timer_Counter_1;
    67 
    68   /* Down counter */
    69   return (uint32_t)
    70      (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
     68  if ( LEON_Is_interrupt_pending( LEON_INTERRUPT_TIMER1 ) ) {
     69    clicks = LEON_REG.Timer_Counter_1;
     70    usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
     71  } else {
     72    usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
     73  }
     74  return usecs * 1000;
    7175}
    7276
    73 #define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
     77#define Clock_driver_nanoseconds_since_last_tick \
     78        bsp_clock_nanoseconds_since_last_tick
    7479
    7580#include "../../../shared/clockdrv_shell.c"
Note: See TracChangeset for help on using the changeset viewer.