Gerald Pfeifer gerald@pfeifer.com writes:
--- dlls/ntdll/virtual.c 11 Oct 2004 20:59:06 -0000 1.41 +++ dlls/ntdll/virtual.c 3 Dec 2004 04:06:42 -0000 @@ -119,6 +119,12 @@ static CRITICAL_SECTION csVirtual = { &c /* Note: these are Windows limits, you cannot change them. */ # define ADDRESS_SPACE_LIMIT ((void *)0xc0000000) /* top of the total available address space */ # define USER_SPACE_LIMIT ((void *)0x80000000) /* top of the user address space */ +# ifdef __FreeBSD__ +# define LOW_SPACE_LIMIT ((void *)0x110000) /* lower address space limit */ +# else +# define LOW_SPACE_LIMIT NULL +# endif
#else static UINT page_shift; static UINT page_mask; @@ -600,7 +606,7 @@ static NTSTATUS map_view( struct file_vi
for (;;) {
if ((ptr = wine_anon_mmap( NULL, view_size, VIRTUAL_GetUnixProt(vprot), 0 )) == (void *)-1)
if ((ptr = wine_anon_mmap( LOW_SPACE_LIMIT, view_size, VIRTUAL_GetUnixProt(vprot), 0 )) == (void *)-1)
Looks OK, but this is a job for wine_anon_mmap, it's supposed to abstract these sorts of platform dependencies so that the callers don't have to worry about it.
On Tue, 14 Dec 2004, Alexandre Julliard wrote:
Looks OK, but this is a job for wine_anon_mmap, it's supposed to abstract these sorts of platform dependencies so that the callers don't have to worry about it.
How about the following?
Gerald
ChangeLog: Make us work on FreeBSD again by working around their different mmap() implementation. Index: README =================================================================== RCS file: /home/wine/wine/README,v retrieving revision 1.47 diff -u -3 -p -r1.47 README --- README 21 Nov 2004 15:33:00 -0000 1.47 +++ README 14 Dec 2004 22:30:53 -0000 @@ -44,10 +44,8 @@ Linux info: it's best to have a current kernel such as 2.4.x.
FreeBSD info: - Wine should build on FreeBSD 4.x and FreeBSD 5.x before 5.3, but will - generally not work on these systems due to issues with threading and - mmap(). In fact, even on FreeBSD 5.3 you will need the kernel patch - posted at http://www.freebsd.org/cgi/query-pr.cgi?pr=73092. + Wine should build on FreeBSD 4.x and FreeBSD 5.x, but versions before + FreeBSD 5.3 will generally not work properly.
More information can be found in the FreeBSD ports tree at ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/emulators/wine/. Index: libs/wine/mmap.c =================================================================== RCS file: /home/wine/wine/libs/wine/mmap.c,v retrieving revision 1.8 diff -u -3 -p -r1.8 mmap.c --- libs/wine/mmap.c 4 Nov 2004 04:52:48 -0000 1.8 +++ libs/wine/mmap.c 14 Dec 2004 22:31:08 -0000 @@ -150,6 +150,12 @@ void *wine_anon_mmap( void *start, size_ #ifdef HAVE_MMAP static int fdzero = -1;
+#ifdef __FreeBSD__ + /* Even FreeBSD 5.3 does not properly support NULL here. */ + if( start == NULL ) + start=(void *)0x110000; +#endif + #ifdef MAP_ANON flags |= MAP_ANON; #else