Continual reading from the PowerPc time base register is not stable

Segher Boessenkool segher at kernel.crashing.org
Fri Mar 26 08:37:08 EST 2010


>          In my program, the value of the 64-bit time base register is read
> out, and you will find the later value is even smaller than the earlier
> value from the log “log_timebase”.

>          Do you have any idea about this problem, thanks for your any
> advice. Attached is the code and log.

Your code has a problem, you do (upper << 32) | lower, it should
be ((unsigned long long)upper << 32) | lower .

That is not the problem though: in your TBL, the bit with value
0x40 is stuck to 1.  Broken hardware?


Segher



More information about the Linuxppc-dev mailing list