Re: System Call parameters

From: H. Peter Anvin (hpa@zytor.com)
Date: Wed Apr 16 2003 - 15:35:37 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:19 EST