Ticket #1748: pr1748.diff

File pr1748.diff, 941 bytes (added by Joel Sherrill, on Mar 3, 2011 at 1:40:18 PM)

erc32 clock fix

  • c/src/lib/libbsp/sparc/erc32/clock/ckinit.c

    RCS file: /usr1/CVS/rtems/c/src/lib/libbsp/sparc/erc32/clock/ckinit.c,v
    retrieving revision 1.17
    diff -u -r1.17 ckinit.c
     
    4949uint32_t bsp_clock_nanoseconds_since_last_tick(void)
    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  usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
     57  if ( ERC32_Is_interrupt_pending( ERC32_INTERRUPT_REAL_TIME_CLOCK ) )
     58    usecs += rtems_configuration_get_microseconds_per_tick();
     59  return usecs * 1000;
    5760}
    5861
    5962#define Clock_driver_nanoseconds_since_last_tick \