Skip to contentSkip to conversation

Using asm_volatile_goto for get_user()

DISCUSSION David Laight 1 participant 1 message Sep 7, 2020 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

I had an idea that might let 'asm_volatile_goto' be used for get_user() even though gcc doesn't allow outputs.

What if (eg) 'register eax asm ("eax") is used for the output and (probably) given in the 'clobber' list.

Such variables are usually used to get explicit registers used when there is no suitable constraint.
I don't see why it shouldn't work for 'asm goto' as well as just 'asm'.

While this forces the read value into a specific register that probably doesn't make much difference to the code.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)