• Heiko Carstens's avatar
    s390/uaccess: fix __put_get_user_asm define · dc4aace1
    Heiko Carstens authored
    The __put_get_user_asm defines an inline assmembly which makes use of
    the asm register construct. The parameters passed to that define may
    also contain function calls.
    
    It is a gcc restriction that between register asm statements and the
    use of any such annotated variables function calls may clobber the
    register / variable contents. Or in other words: gcc would generate
    broken code.
    
    This can be achieved e.g. with the following code:
    
        get_user(x, func() ? a : b);
    
    where the call of func would clobber register zero which is used by
    the __put_get_user_asm define.
    To avoid this add two static inline functions which don't have these
    side effects.
    Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    dc4aace1
uaccess.h 11 KB