linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: System Call parameters
Date: 16 Apr 2003 13:35:37 -0700	[thread overview]
Message-ID: <b7keqp$7p2$1@cesium.transmeta.com> (raw)
In-Reply-To: Pine.LNX.4.53.0304161256130.11667@chaos

Followup to:  <Pine.LNX.4.53.0304161256130.11667@chaos>
By author:    "Richard B. Johnson" <root@chaos.analogic.com>
In newsgroup: linux.dev.kernel
>
> How does the kernel get more than five parameters?
> 
> Currently...
> 	eax	= function code
> 	ebx	= first parameter
> 	ecx	= second parameter
> 	edx	= third parameter
> 	esi	= fourth parameter
> 	edi	= fifth parameter
> 
> Some functions like mmap() take 6 parameters!
> Does anybody know how these parameters get passed?
> I have an "ultra-light" 'C' runtime library I have
> been working on and, so-far, I've got everything up
> to mmap()  (in syscall.h) (89 functions) working.
> I thought, maybe ebp was being used, but it doesn't
> seem to be the case.
> 

%ebp is used.

However, on i386, SYS_mmap is a four-parameter system call where the
last parameter is a pointer to a parameter block.  SYS_mmap2 is the
full six-parameter sane version.

You may want to check out klibc.

	-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

  parent reply	other threads:[~2003-04-16 20:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16 16:58 System Call parameters Richard B. Johnson
2003-04-16 17:41 ` Bruce Harada
2003-04-16 17:58   ` Richard B. Johnson
2003-04-16 17:47 ` Bruce Harada
2003-04-16 20:35 ` H. Peter Anvin [this message]
2003-04-17  0:39 Perez-Gonzalez, Inaky

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='b7keqp$7p2$1@cesium.transmeta.com' \
    --to=hpa@zytor.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;
as well as URLs for NNTP newsgroup(s).