• David S. Miller's avatar
    [SPARC64]: __atomic_{add,sub}() must sign-extend return value. · 86ca2ffe
    David S. Miller authored
    Even though we declare these functions as returning
    a 32-bit signed integer, the sparc64 ABI states that
    such functions must properly sign-extend the return
    value to the full 64-bits.
    
    Due to this bug, parts of mm/rmap.c were misbehaving
    when compiled with gcc-3.4 on sparc64.  gcc-3.4 was
    legally using a 64-bit comparison against zero with
    the return value of __atomic_add().
    
    I would like to thank Hugh Daniels and others for helping
    to track down this peculiar bug.
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    86ca2ffe
atomic.S 1.75 KB