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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.