From: Ralf Baechle <ralf@linux-mips.org>
To: adnan iqbal <adnan.iqbal@seecs.edu.pk>
Cc: linux-mips@linux-mips.org
Subject: Re: Details of MIPS(Octeon) system call semantics
Date: Wed, 2 Jun 2010 14:38:09 +0100 [thread overview]
Message-ID: <20100602133809.GA13625@linux-mips.org> (raw)
In-Reply-To: <AANLkTino_WFpj8aueN4zGwkRV-SCVqA5NGsKQOGU9qho@mail.gmail.com>
On Wed, Jun 02, 2010 at 03:17:38PM +0500, adnan iqbal wrote:
> I am able to find system call list (o32 and n64) in
> /usr/include/asm/unistd.h over octeon/debian board. I am looking for details
> about these system calls so that for each system call i know exactly
>
> 1. What parmeters should be set in which registers before syscall
> 2. Which registers contain output of those system calls.
The basic concept for all ABIs is that syscalls are working almost like
subroutine calls, so:
o arguments are passed in $a0 - $a3 for o32
o arguments are passed in $a0 - $a7 for N32 and N64
o argument that don't fit into the argument registers are passed on the
stack.
o for details such as alignment of 64-bit arguments the usual ABI
conventions apply
o the result is return in $v0
In addition to normal subroutine calls:
o $a3 on syscall return will indicate success or error. 0 means success,
non-zero means an error happened in which case $v0 will contain an
errno.h error code.
o Many syscalls deviate from this convention. For example the sigreturn
family of syscalls doesn't return a result or error status.
o pipe() will return the 2nd filedescriptor of the result in $v1.
o vfork is even more weird.
o The ABI differences mean there are many subtle difference between the
syscall handlers.
Ralf
next prev parent reply other threads:[~2010-06-02 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-02 10:17 Details of MIPS(Octeon) system call semantics adnan iqbal
2010-06-02 13:38 ` Ralf Baechle [this message]
2010-06-06 21:19 ` Maciej W. Rozycki
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=20100602133809.GA13625@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=adnan.iqbal@seecs.edu.pk \
--cc=linux-mips@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.