a20: advance A20Test by a large, prime number
authorH. Peter Anvin <hpa@zytor.com>
Wed, 22 Apr 2009 02:15:55 +0000 (19:15 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 22 Apr 2009 02:15:55 +0000 (19:15 -0700)
Rather than simply incrementing A20Test, advance it by a large prime
number every time.  The reason is to minimize false aliasing as
quickly as possible.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/bcopy32.inc

index 97b9263..c715557 100644 (file)
@@ -333,7 +333,7 @@ a20_test:
                mov eax,[cs:A20Test]
                mov cx,32                       ; Loop count
                jmp .test                       ; First iteration = early out
-.wait:         inc eax
+.wait:         add eax,0x430aea41              ; A large prime number
                mov [cs:A20Test],eax
                io_delay                        ; Serialize, and fix delay
 .test:         cmp eax,[es:A20Test+10h]