On 09/14/14 16:49, Paolo Bonzini wrote:
> Il 14/09/2014 16:45, Paolo Bonzini ha scritto:
>> Il 14/09/2014 15:06, Laszlo Ersek ha scritto:
>>> + } else {
>>> + Accumulator -= gMetronome->TickPeriod;
>>> + if (Counter == MAX_UINT64) {
>>> + CoreInternalWaitForTick (Counter);
>>> + CoreInternalWaitForTick (1);
>>> + } else {
>>> + CoreInternalWaitForTick (Counter + 1);
>>> + }
>>
>> Counter is the result of a division, so it is at most
>> 0x1999999999999999ULL. You do not need the "if", I think.
>
> Oops---sorry, the division is not by 10.
>
> Still, if you count the extra number of ticks, and do a final
> CoreInternalWaitForTick (together with the extra wait for Accumulator >
> 0), I think the code is cleaner.
That did cross my mind, but I didn't realize that it would make the code
cleaner (ie. eliminate the innermost if). If the idea of accumulating
the fractions proves acceptable for the maintainers in general, then
I'll spin a v2 the way you suggest.
Thanks!
Laszlo
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel