PATCH: revive FreeBSD support
Gerald Pfeifer
gerald at pfeifer.com
Sat Dec 11 14:29:46 CST 2004
This is a generalized version of a patch that Simon submitted to the
FreeBSD project to make FreeBSD work again. I adjusted it to retain
the original behavior on other platforms, and it has undergone successful
testing by various FreeBSD users.
Gerald
ChangeLog:
Make us work on FreeBSD again.
Index: dlls/ntdll/virtual.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/virtual.c,v
retrieving revision 1.41
diff -u -3 -p -r1.41 virtual.c
--- 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)
{
if (errno == ENOMEM) return STATUS_NO_MEMORY;
return STATUS_INVALID_PARAMETER;
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 11 Dec 2004 21:20:02 -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/>.
More information about the wine-patches
mailing list