From owner-freebsd-emulation@FreeBSD.ORG Tue Jan 1 12:42:46 2008 Return-Path: Delivered-To: emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C44216A418; Tue, 1 Jan 2008 12:42:46 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id D9CB113C458; Tue, 1 Jan 2008 12:42:45 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4C8C866B4D4; Tue, 1 Jan 2008 13:26:49 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8XEI5wvUdKtu; Tue, 1 Jan 2008 13:26:39 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1698866B4B3; Tue, 1 Jan 2008 13:26:39 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id m01CQdDH093283; Tue, 1 Jan 2008 13:26:39 +0100 (CET) (envelope-from rdivacky) Date: Tue, 1 Jan 2008 13:26:38 +0100 From: Roman Divacky To: emulation@freebsd.org Message-ID: <20080101122638.GA93070@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: mva@sysfault.org Subject: mmap/mmap2 parameters type X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2008 12:42:46 -0000 hi... in our linuxulator linux_mmap is defined as: int linux_mmap(struct l_mmap_argv *ptr); while linux_mmap2 is defined: int linux_mmap2(l_ulong addr, l_ulong len, l_ulong prot, l_ulong flags, l_ulong fd, l_ulong pgoff); both mmap and mmap2 uses l_mmap_argv to pass their args to linux_mmap_common where "stuff" happens strcut l_mmap_argv is defined as: struct l_mmap_argv { l_uintptr_t addr; l_size_t len; l_int prot; l_int flags; l_int fd; l_off_t pgoff; } __packed; on real linux (linux 2.6.16 I have on my disk) mmap and mmap2 is defined like this: asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long off) ie. every parameter is unsigned long, while our structure uses signed int in some places. overall the l_mmap_argv seems to be modeled after our [bsd_]mmap_args. can someone tell me why? I dont think its correct. if you accept my analysis, is this patch correct? Index: linux.h =================================================================== RCS file: /home/ncvs/src/sys/i386/linux/linux.h,v retrieving revision 1.78 diff -u -r1.78 linux.h --- linux.h 18 Sep 2007 19:50:33 -0000 1.78 +++ linux.h 1 Jan 2008 12:20:54 -0000 @@ -143,12 +143,12 @@ #define LINUX_MAP_GROWSDOWN 0x0100 struct l_mmap_argv { - l_uintptr_t addr; - l_size_t len; - l_int prot; - l_int flags; - l_int fd; - l_off_t pgoff; + l_ulong addr; + l_ulong len; + l_ulong prot; + l_ulong flags; + l_ulong fd; + l_ulong pgoff; } __packed; /* marcus, can you please test if that makes any difference with your problems? (I dont think it will but you never know ;) ) thnx, roman