From owner-freebsd-emulation Mon Apr 22 13:12:23 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from beamer.mchh.siemens.de (beamer.mchh.siemens.de [194.138.158.163]) by hub.freebsd.org (Postfix) with ESMTP id 7B97A37B405 for ; Mon, 22 Apr 2002 13:12:16 -0700 (PDT) Received: from blues.mchh.siemens.de (mail2.mchh.siemens.de [194.138.158.227]) by beamer.mchh.siemens.de (8.9.3/8.9.3) with ESMTP id SAA05562; Mon, 22 Apr 2002 18:02:31 +0200 (MET DST) Received: from mchh274e.demchh201e.icn.siemens.de ([139.21.200.84]) by blues.mchh.siemens.de (8.9.1/8.9.1) with ESMTP id SAA10065; Mon, 22 Apr 2002 18:02:09 +0200 (MET DST) Received: by MCHH274E with Internet Mail Service (5.5.2653.19) id <268QGGDD>; Mon, 22 Apr 2002 18:02:40 +0200 Message-ID: <67E0BE167008D31185F60008C7289DA0E13189@MCHH218E> From: Reifenberger Michael EXT To: "'Andrew Gallatin'" , Kenneth Culver Cc: freebsd-emulation@FreeBSD.ORG Subject: AW: implementing linux mmap2 syscall Date: Mon, 22 Apr 2002 18:02:39 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, BTW: NETBSD seems so have the newer syscalls implemented. Take a look at: http://cvsweb.netbsd.org/bsdweb.cgi/syssrc/sys/compat/linux/common/linux= _misc.c?rev=3D1.107&content-type=3Dtext/x-cvsweb-markup versus old mmap at: http://cvsweb.netbsd.org/bsdweb.cgi/syssrc/sys/compat/linux/common/linux= _oldmmap.c?rev=3D1.58&content-type=3Dtext/x-cvsweb-markup Bye/2 ------ Michael Reifenberger - IT, UNIX, R/3-Basis Work: Michael.Reifenberger@plaut.de Proj: = Michael.Reifenberger.gp@icn.siemens.de Pers: Michael@Reifenberger.com Webspace: http://www.reifenberger.com -----Urspr=FCngliche Nachricht----- Von: Andrew Gallatin [mailto:gallatin@cs.duke.edu] Gesendet: Montag, 22. April 2002 16:07 An: Kenneth Culver Cc: freebsd-hackers@FreeBSD.ORG; freebsd-emulation@FreeBSD.ORG Betreff: Re: implementing linux mmap2 syscall Kenneth Culver writes: > static inline unsigned long do_mmap(struct file *file, unsigned long = addr, <..> > ret =3D do_mmap_pgoff(file, addr, len, prot, flag, offset >> = PAGE_SHIFT); > out: > return ret; > } >=20 > This is what mmap2 does: >=20 > andstatic inline long do_mmap2( > unsigned long addr, unsigned long len, > unsigned long prot, unsigned long flags, > unsigned long fd, unsigned long pgoff) <...> > error =3D do_mmap_pgoff(file, addr, len, prot, flags, pgoff); >=20 > So what it looks like to me is that mmap2 expects an offset that's = already=20 > page-aligned (I'm not sure if this is the right way to say it), = where mmap=20 > doesn't. the FreeBSD code in the linuxulator basically just takes = the offset=20 To me, it looks like mmap2 takes an offset that's a page index, rather than a byte position. Since linux passes the offset with a 32-bit long, rather than a 64-bit off_t like we do, they need to do this in order to be able to map offsets larger than 4GB into a file. For linux_mmap2, I'd think we want to do roughly the same things as linux_mmap, but with bsd_args.pos =3D ctob((off_t)linux_args.pos) Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message