Date: Tue, 1 Jan 2008 13:26:38 +0100 From: Roman Divacky <rdivacky@freebsd.org> To: emulation@freebsd.org Cc: mva@sysfault.org Subject: mmap/mmap2 parameters type Message-ID: <20080101122638.GA93070@freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080101122638.GA93070>