Message-ID: <4H8YcS$_bd@smth.org>
Subject: Re: 系统���������源�5������么��
Date: Thu, 10 Mar 2005 03:04:37 +0000
From: arcturus@smth.org-SPAM.no (��拾��山��)
Path: news.cnusenet.org!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-cn.bbs.comp.unix.development.kernel.mbox.zip!g2news1.google.com!news3.google.com!news.glorb.com!nntp-server.pubsub.com!bbsnews.sdu.edu.cn!news.xjtu.edu.cn!news2.happynet.org!maily.cic.tsinghua.edu.cn!SMTH
Newsgroups: cn.bbs.comp.unix.development.kernel
Organization: BBS 水木�华站
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: KernelTech/z/M.1110423868.b0
Lines: 40
Xref: news.cnusenet.org cn.bbs.comp.unix.development.kernel:28634
On i386, the parameters of a system call are transported via registers. The system call number goes into %eax, the first parameter in %ebx, the second in %ecx, the third in %edx, the fourth in %esi, the fifth in %edi, the sixth in %ebp.
Ancient history
Earlier versions of Linux could handle only four or five system call parameters, and therefore the system calls select() (5 parameters) and mmap() (6 parameters) used to have a single parameter that was a pointer to a parameter block in memory. Since Linux 1.3.0 five parameters are supported (and the earlier select with memory block was renamed old_select), and since Linux 2.3.31 six parameters are supported (and the earlier mmap with memory block was succeeded by the new mmap2).
�� �� arcturus (��拾��山��) �拇������到: ��
: �� ��: Re: 系统���������源�5������么��
: ����站: BBS 水木�华站 (Thu Mar 10 10:29:08 2005), 转��
:
: ���诳��源�6���耍�x86��:
:
: #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
: type5,arg5,type6,arg6) \
: type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
: { \
: long __res; \
: __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; int $0x80 ; pop %%ebp" \
: : "=a" (__res) \
: : "i" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
: "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5)), \
: "0" ((long)(arg6))); \
: __syscall_return(type,__res); \
: }
:
: �� �� wangyxcti (���吖���) �拇������到: ��
: : 系统���������源�5������么?���牵�
: : void * mmap(void *start, size_t length, int prot , int flags, int fd,
: : off_t offset);��么���停�
: : ...................
:
: --
:
: [m[1;36m�� ��源:��BBS 水木�华站 smth.org��[FROM: 202.108.132.*][m
--
[m[1;36m�� ��源:��BBS 水木�华站 smth.org��[FROM: 202.108.132.*][m