Date: Wed, 24 Apr 2002 16:19:44 -0400 (EDT) From: Kenneth Culver <culverk@alpha.yumyumyum.org> To: Andrew Gallatin <gallatin@cs.duke.edu> Cc: Brandon S Allbery KF8NH <allbery@ece.cmu.edu>, <freebsd-hackers@FreeBSD.ORG>, FreeBSD-CURRENT List <freebsd-current@FreeBSD.ORG> Subject: Re: implementing linux mmap2 syscall Message-ID: <20020424161828.R38664-100000@alpha.yumyumyum.org> In-Reply-To: <15558.54159.737973.56540@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
> > 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. Ken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020424161828.R38664-100000>