public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: "Roar Thronæs" <roart@nvg.ntnu.no>
Cc: linux-kernel@vger.kernel.org
Subject: Re: increase the number of system call parameters
Date: 22 Oct 2001 14:03:35 +0200	[thread overview]
Message-ID: <k2r8rvvq3s.fsf@zero.aec.at> (raw)
In-Reply-To: <Pine.LNX.4.33.0110221334200.1121-100000@hagbart.nvg.ntnu.no>
In-Reply-To: Roar Thronæs's message of "Mon, 22 Oct 2001 13:48:26 +0200 (CEST)"

In article <Pine.LNX.4.33.0110221334200.1121-100000@hagbart.nvg.ntnu.no>,
=?iso-8859-1?Q?Roar_Thron=E6s?= <roart@nvg.ntnu.no> writes:
> Hi
> (I am sorry if this question has been asked and answered before)

> How do you increase the number of system call parameters, and how many
> can you at most have?

You can have upto 6 argument on i386. Each argument needs an register 
to pass and the i386 has only 8 and two are used for the stack pointer
and the syscall number. This leaves you 6.
Other architectures may not have that limitation.

> Would up to 12 parameters be possible, and how?

Yes. Just pass a pointer to an auxillary structure as the first argument
and do a copy_from_user on that structure at the entry point. Put the
arguments in that structure. In user space you can hide the structure in a 
stub.

Some system calls (mmap, old_select, socketcall) are in fact implemented 
like this because they were designed before the entry point supported
6 arguments.

A note on design: if you have a function call that needs 12 arguments you
probably forgot some[1] (in short it is a strong cue for a broken design,
you should probably split it in smaller calls) 

-Andi

[1] unknown author

  parent reply	other threads:[~2001-10-22 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-22 11:48 increase the number of system call parameters Roar Thronæs
2001-10-22 11:57 ` Matti Aarnio
2001-10-22 12:03 ` Andi Kleen [this message]
2001-10-22 21:37   ` Daniel Barlow

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=k2r8rvvq3s.fsf@zero.aec.at \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roart@nvg.ntnu.no \
    /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