• H. Peter Anvin's avatar
    [x86 setup] Volatilize asm() statements · b015124e
    H. Peter Anvin authored
    asm() statements need to be volatile when:
    
    a. They have side effects (other than value returned).
    b. When the value returned can vary over time.
    c. When they have ordering constraints that cannot be expressed to gcc.
    
    In particular, the keyboard and timer reads were violating constraint (b),
    which resulted in the keyboard/timeout poll getting
    loop-invariant-removed when compiling with gcc 4.2.0.
    
    Thanks to an anonymous bug reporter for pointing this out.
    Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
    b015124e
edd.c 3.81 KB