diff options
author | Jiri Hladky <hladky.jiri@googlemail.com> | 2008-06-02 12:00:19 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-17 10:55:47 +0200 |
commit | e01b70ef3eb3080fecc35e15f68cd274c0a48163 (patch) | |
tree | 968f1da3d1f60236df49c24943e99bbf84ce81ca /init/calibrate.c | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 (diff) | |
download | linux-e01b70ef3eb3080fecc35e15f68cd274c0a48163.tar.xz linux-e01b70ef3eb3080fecc35e15f68cd274c0a48163.zip |
x86: fix bug in arch/i386/lib/delay.c file, delay_loop function
when trying to understand how Bogomips are implemented I have found a
bug in arch/i386/lib/delay.c file, delay_loop function.
The function fails for loops > 2^31+1. It because SF is set when dec
returns numbers > 2^31.
The fix is to use jnz instruction instead of jns (and add one decl
instruction to the end to have exactly the same number of loops as in
original version).
Martin Mares observed:
> It is a long time since I have hacked that file, but you should definitely
> make sure that the function is never called with a zero argument. In such
> case, the original version made just a single pass, but your version
> makes 2^32 of them.
fixed that.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init/calibrate.c')
0 files changed, 0 insertions, 0 deletions