linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org
Subject: [x86] Strange 64-bit put_user ?
Date: Tue, 28 Apr 2009 13:32:06 -0400	[thread overview]
Message-ID: <49F73D96.2090801@garzik.org> (raw)

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




             reply	other threads:[~2009-04-28 17:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 17:32 Jeff Garzik [this message]
2009-04-29  0:31 ` [x86] Strange 64-bit put_user ? H. Peter Anvin
2009-04-29 20:00   ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F73D96.2090801@garzik.org \
    --to=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).