From: Martin Bisson <bissonm@discreet.com>
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: x86_64 system call entry points II
Date: Tue, 06 Jun 2006 09:25:49 -0400 [thread overview]
Message-ID: <4485825D.9000606@discreet.com> (raw)
In-Reply-To: <p73verezw9t.fsf@verdi.suse.de>
Andi Kleen wrote:
>Martin Bisson <bissonm@discreet.com> writes:
>
>
>>- int $0x80/64 bits: All system calls return -1 (EINTR). Is there
>>something wrong in the way I call it:
>>pid_t getpid64()
>>{
>> pid_t resultvar;
>>
>> asm volatile (
>> "int $0x80\n\t"
>> : "=a" (resultvar) : "0" (__NR_getpid)
>> : "memory");
>>
>> return resultvar;
>>}
>>
>>
>
>I tested it now. Since it ends up as a 32bit syscall you're not
>actually calling 64bit getpid() - but 32bit mkdir(). That is because 32bit and 64bit
>have different syscall numbers. For me it returns -14, which is EFAULT.
>Expected for a random argument to mkdir()
>
>
It makes a lot of sense...
I think the bottom line for me is simply that I cannot enter system
calls any way I want with any kernel, among other things because the
kernel expects that we got into the system call using vsyscall stuff and
that the correct way to return to user space is also found in the
vsyscall page.
Thanks for your input.
Mart
next prev parent reply other threads:[~2006-06-06 13:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-05 16:55 x86_64 system call entry points Martin Bisson
2006-06-06 5:25 ` Andi Kleen
2006-06-06 5:30 ` x86_64 system call entry points II Andi Kleen
2006-06-06 13:25 ` Martin Bisson [this message]
2006-06-06 13:34 ` 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=4485825D.9000606@discreet.com \
--to=bissonm@discreet.com \
--cc=ak@suse.de \
--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