mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Martin Bisson <bissonm@discreet.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: x86_64 system call entry points
Date: Tue, 6 Jun 2006 00:13:58 -0400	[thread overview]
Message-ID: <200606060017_MC3-1-C1B2-81E5@compuserve.com> (raw)

In-Reply-To: <44846210.4080602@discreet.com>

On Mon, 05 Jun 2006 12:55:44 -0400, Martin Bisson wrote:

> - sysenter/32 bits, executed on a 32 bit machine: I get a segfault on 
> the sysenter instruction.  I use the following code to enter the system 
> call:
> pid_t getpid32()
> {
>     pid_t resultvar;
> 
>     asm volatile (
>     "push    %%ebp\n\t"
>     "push    %%ecx\n\t"
>     "push    %%edx\n\t"
>     "mov     %%esp,%%ebp\n\t"
>     "sysenter\n\t"
>     ".space 20,0x90\n\t"
>     "pop     %%edx\n\t"
>     "pop     %%ecx\n\t"
>     "pop     %%ebp\n\t"
>     : "=a" (resultvar)   
>     : "0" (__NR_getpid)
>     : "memory");
> 
>     return resultvar;
> }

sysenter always returns to a fixed address (in the vdso) no matter
where you invoke it from.

-- 
Chuck


             reply	other threads:[~2006-06-06  4:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06  4:13 Chuck Ebbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-05 16:55 Martin Bisson
2006-06-06  5:25 ` Andi Kleen

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=200606060017_MC3-1-C1B2-81E5@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=bissonm@discreet.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®