Changeset a205b96b in rtems


Ignore:
Timestamp:
May 21, 2007, 7:29:34 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
e49e84c9
Parents:
ec2078d
Message:

2007-05-21 Joel Sherrill <joel.sherrill@…>

  • mpc6xx/clock/c_clock.c: Tinker with math so it does not overflow on psim and give a negative nanoseconds since last tick.
Location:
c/src/lib/libcpu/powerpc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/ChangeLog

    rec2078d ra205b96b  
     12007-05-21      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * mpc6xx/clock/c_clock.c: Tinker with math so it does not overflow on
     4        psim and give a negative nanoseconds since last tick.
     5
    162007-05-07      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • c/src/lib/libcpu/powerpc/mpc6xx/clock/c_clock.c

    rec2078d ra205b96b  
    137137  PPC_Get_decrementer( clicks );
    138138
    139   tmp = (Clock_Decrementer_value - clicks) * 1000000;
     139  /*
     140   * Multiply by 1000 here separately from below so we do not overflow
     141   * and get a negative value.
     142   */
     143  tmp = (Clock_Decrementer_value - clicks) * 1000;
    140144  tmp /= (BSP_bus_frequency/BSP_time_base_divisor);
    141145
    142   return tmp;
     146  return tmp * 1000;
    143147}
    144148
Note: See TracChangeset for help on using the changeset viewer.