Hi guys<br> In fact my problem is gettimeofday cannot return right value sometimes, and this will bring instability to our system software. You can find a law from the log that there is a 17592 seconds' shift every time error occurs.<br>
<br><br><br><div class="gmail_quote">2010/3/26 Csdncannon <span dir="ltr"><<a href="mailto:csdncannon@gmail.com">csdncannon@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes, the missing 64-bit conversion is the key problem, I will try removing isync later. <br><br>Thanks for your support.<br><br><br><div class="gmail_quote"><div class="im">2010/3/26 Segher Boessenkool <span dir="ltr"><<a href="mailto:segher@kernel.crashing.org" target="_blank">segher@kernel.crashing.org</a>></span><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>> Yes indeed. Could you post the relevant piece if disassembly from<div><div>
</div><div class="h5"><br>
> your original binary (the one that has the problem)? Or send me the<br>
> binary (not to the mailing list), I'll do it then.<br>
<br>
</div></div></div><div><div></div><div class="h5">Ah scratch that. I compiled your original code (after fixing the<br>
compile errors -- there is no such type as "bool" in C).<br>
<br>
The problem is that (upper << 32) | lower thing. "upper" is a 32-bit<br>
type, so shifting it by 32 or more bits is undefined. GCC compiles this<br>
to (shortened):<br>
<br>
0: mftbu 9 ; mftbl 11 ; mftbu 0 ; cmpw 0,9 ; bne 0b # so far so good<br>
slwi 0,0,0 ; or 4,0,11 ; li 3,0 ; blr<br>
<br>
so it shifts by 0, i.e. it does upper | lower .<br>
<br>
Case closed, no hardware problem :-)<br>
<font color="#888888"><br>
<br>
Segher<br>
<br>
</font></div></div></blockquote></div><br>
</blockquote></div><br>