Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Nov 2004 05:00:53 GMT
From:      "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/73092: [patch] Unbreak WINE for 5.x and 6 [patches for both kern and port]
Message-ID:  <200411180500.iAI50r8R027685@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/73092; it has been noted by GNATS.

From: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>
To: freebsd-gnats-submit@FreeBSD.org, amistry@am-productions.biz
Cc:  
Subject: Re: kern/73092: [patch] Unbreak WINE for 5.x and 6 [patches for both kern and port]
Date: Thu, 18 Nov 2004 05:51:49 +0100

 --Apple-Mail-8-39742086
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain; charset=US-ASCII; format=flowed
 
 I was looking at getting a current wine running on DragonFly and found 
 your patch. In my opinion, this patch fixes the "problem" at the wrong 
 place:
 
 wine doesn't want arbitary addresses (mmap(NULL...)), but wants 
 addresses below user_space_limit. Although mmap(2) doesn't provide such 
 a rich set of features to be able to specify an "desired/allowed 
 range", this can be easily done in wine itself:
 
 diff -ru work/wine-20041019/dlls/ntdll/virtual.c 
 work.old/wine-20041019/dlls/ntdll/virtual.c
 --- work/wine-20041019/dlls/ntdll/virtual.c	2004-10-11 
 22:59:06.000000000 +0200
 +++ work.old/wine-20041019/dlls/ntdll/virtual.c	2004-11-18 
 04:33:04.000000000 +0100
 @@ -119,6 +119,7 @@
   /* 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 */
 +# define LOW_SPACE_LIMIT      ((void *)0x110000)    /* lower address 
 space limit */
   #else
   static UINT page_shift;
   static UINT page_mask;
 @@ -600,7 +601,7 @@
 
           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;
 
 Just ask mmap to start allocating at a low address. It's not tested a 
 lot, but applications run again.
 
 cheers
    simon
 
 -- 
 /"\
 \ /
   \     ASCII Ribbon Campaign
 / \  Against HTML Mail and News
 
 --Apple-Mail-8-39742086
 content-type: application/pgp-signature; x-mac-type=70674453;
 	name=PGP.sig
 content-description: This is a digitally signed message part
 content-disposition: inline; filename=PGP.sig
 content-transfer-encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (Darwin)
 
 iD8DBQFBnCpmr5S+dk6z85oRAqysAKDCTQaaZY8EYBdxaEsbrI+Pyt7mMwCgxs1v
 wvmNGslGYV98zf8nnU2HlBk=
 =2JTS
 -----END PGP SIGNATURE-----
 
 --Apple-Mail-8-39742086--
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411180500.iAI50r8R027685>