linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [x86] Strange 64-bit put_user ?
@ 2009-04-28 17:32 Jeff Garzik
  2009-04-29  0:31 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2009-04-28 17:32 UTC (permalink / raw)
  To: LKML; +Cc: x86

In arch/x86/include/asm/uaccess.h, if !CONFIG_X86_32, we see

> #define __put_user_x8(x, ptr, __ret_pu) \
>         ({ u64 __ret_pu; __put_user_x(8, x, ptr, __ret_pu); (int)__ret_pu; })

which was preceded by

> #define __put_user_x(size, x, ptr, __ret_pu)                    \
>         asm volatile("call __put_user_" #size : "=a" (__ret_pu) \
>                      :"0" ((typeof(*(ptr)))(x)), "c" (ptr) : "ebx")


My question, from an admitted inline asm newbie:

Why is 32-bit register 'ebx' being used for a 64-bit put_user?

And a dumb-question follow-up, probably easy, for any x86 expert:  why 
are registers 'bl' and 'bx' not used for 8-bit and 16-bit put_user, 
respectively?

Thanks,

	Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-29 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28 17:32 [x86] Strange 64-bit put_user ? Jeff Garzik
2009-04-29  0:31 ` H. Peter Anvin
2009-04-29 20:00   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).