[RTEMS Project] #2369: [PowerPC Book E] Invalid mftb instruction in _CPU_Counter_read()

RTEMS trac trac at rtems.org
Wed Jul 15 08:45:37 UTC 2015


#2369: [PowerPC Book E] Invalid mftb instruction in _CPU_Counter_read()
--------------------------+--------------------------------------------
 Reporter:  nick.withers  |       Owner:  Nick Withers <nick.withers@…>
     Type:  defect        |      Status:  closed
 Priority:  normal        |   Milestone:  4.11.1
Component:  General       |     Version:  4.11
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |
--------------------------+--------------------------------------------

Comment (by sebastian.huber):

 Replying to [comment:18 nick.withers]:
 > Replying to [comment:16 nick.withers]:
 > > Replying to [comment:15 sebastian.huber]:
 > > > Replying to [comment:14 nick.withers]:
 > > > > I've cunningly avoided thinking properly about whether ignoring
 the upper portion of the time base is a good idea... But, for example,
 isn't {{{rtems_bsp_delay()}}} going to stuff up if the lower 32 bits wrap?
 > > >
 > > > The use case for the _CPU_Counter_read() is to measure short time
 intervals for the SMP lock profiling and short delay loops for device
 drivers.  Do you really want to busy wait for 123 seconds?
 > >
 > > Do you really want to busy wait 123 seconds instead of the intended
 short time interval because you lost the race and the lower 32 bits of the
 counter wrapped?
 >
 > Actually, I'm full of it there I think, sorry. The 32 bit unsigned
 multiplication's gonna wrap too in that case, right?

 Yes.

--
Ticket URL: <http://devel.rtems.org/ticket/2369#comment:19>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list