• H
    [x86 setup] Volatilize asm() statements · b015124e
    H. Peter Anvin 提交于
    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: NH. Peter Anvin <hpa@zytor.com>
    b015124e
boot.h 6.3 KB