From owner-freebsd-current Wed Apr 24 15: 3:22 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 7884F37B404 for ; Wed, 24 Apr 2002 15:03:15 -0700 (PDT) Received: (qmail 13193 invoked from network); 24 Apr 2002 21:01:53 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 24 Apr 2002 21:01:53 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g3OL1pv08001; Wed, 24 Apr 2002 17:01:51 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020424161828.R38664-100000@alpha.yumyumyum.org> Date: Wed, 24 Apr 2002 17:01:00 -0400 (EDT) From: John Baldwin To: Kenneth Culver Subject: Re: implementing linux mmap2 syscall Cc: FreeBSD-CURRENT List Cc: FreeBSD-CURRENT List , freebsd-hackers@FreeBSD.ORG, Brandon S Allbery KF8NH , Andrew Gallatin Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 24-Apr-2002 Kenneth Culver wrote: >> >> Brandon S Allbery KF8NH writes: >> > On Wed, 2002-04-24 at 10:41, Andrew Gallatin wrote: >> > > Maybe the argument isn't where you expect it to be, but is there. >> > > Can you make a test program which calls mmap2 with its 6th arg as >> > > something unique like 0xdeadbeef? Then print out (in hex :) the >> > > trapframe >> > > from the linux prepsyscall routine & see if you can find the deadbeef. >> > >> > My recollection is that beyond 5 arguments, a pointer to the remaining >> > ones is passed. (But my recollection may be wrong and I don't wish to >> > subject myself to the source cesspool at the moment....) >> > >> >> I think that's how it used to work. Apparently, they've changed it >> recently and they now pass 6 args in registers. Eg, in the linux >> kernel sources, old_mmap() fetches its args via copy_from_user(), >> whereas the newer sys_mmap2() doesn't. >> >> Drew >> > Yep, according to the docs and source code I looked at in the linux > kernel, the sixth arg is in the ebp register. I've looked all over the > FreeBSD kernel and the linux emulator for the place that actually sets > these, and unfortunately, due to my lack of asm coding knowledge, I can't > find anything. libc sets it before it enters the kernel. Then on kernel entry we save ebp in the trapframe. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message