From owner-freebsd-emulation@FreeBSD.ORG Fri Jul 29 18:32:50 2005 Return-Path: X-Original-To: emulation@freebsd.org Delivered-To: freebsd-emulation@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0ADC216A420; Fri, 29 Jul 2005 18:32:50 +0000 (GMT) (envelope-from jm.detrez@cegetel.net) Received: from smtp.cegetel.net (mf00.sitadelle.com [212.94.174.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3B9443D45; Fri, 29 Jul 2005 18:32:48 +0000 (GMT) (envelope-from jm.detrez@cegetel.net) Received: from Portable (84-4-225-28.adslgp.cegetel.net [84.4.225.28]) by smtp.cegetel.net (Postfix) with ESMTP id 2DC011A44F2; Fri, 29 Jul 2005 20:32:47 +0200 (CEST) From: "jean-marc DETREZ" To: , , Date: Fri, 29 Jul 2005 20:32:39 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0012_01C5947C.AB54E3D0" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcWUaeBhpXrj6jqATACbARZmzCRwVQAASJjQAAAsasA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Message-Id: <20050729183247.2DC011A44F2@smtp.cegetel.net> X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: TR: wine on FreeBSD with patch 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: Fri, 29 Jul 2005 18:32:50 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0012_01C5947C.AB54E3D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =20 =20 _____ =20 De : jean-marc DETREZ [mailto:jm.detrez@cegetel.net]=20 Envoy=E9 : vendredi 29 juillet 2005 20:28 =C0 : 'Alexandre Julliard' Cc : 'barner@FreeBSD.org'; 'wine-devel@winehq.com'; = 'emulation@freebsd.org'; 'Dmitry Timoshkov'; 'Gerald Pfeifer' Objet : TR: wine on FreeBSD with patch =20 =20 =20 _____ =20 De : jean-marc DETREZ [mailto:jm.detrez@cegetel.net]=20 Envoy=E9 : vendredi 29 juillet 2005 20:18 =C0 : 'Alexandre Julliard' Cc : 'barner@FreeBSD.org'; 'Gerald Pfeifer'; 'wine-devel@winehq.com'; 'emulation@freebsd.org'; 'Dmitry Timoshkov' Objet : wine on FreeBSD =20 Hi,=20 =20 With the differents mails i receive from users or wine=92s developers, = i think that: =20 - Dislike OpenBSD or SRV4, mincore did=92nt fail if the = page is not mapped no [ENOMEM] error condition. =20 - the FreeBSD man pages say that mmap would fail with [ENOMEM] error condition if address is in use but in the reality it seems always return the start address. =20 So for to use wine on FreeBSD before doing a more clean patch i propose = to add this to mmap . I know that it would map memory pages without verify before that the pages is=92nt already map but the man pages say it must = failed so I=92m just verify that the result is equal to start address the mmap = call asking for. =20 =20 I do that only when creating System heap because requesting = mmap for 0x800000 start address (without MAP_FIXED) always fail and prevent = wine running on FreeBSD. =20 I=92ll do more test to implement a try_mmap_fixed function = working on FreeBSD like this done for SRV4,NetBSD and DARWIN. =20 Jean-marc =20 =20 =20 =20 ------=_NextPart_000_0012_01C5947C.AB54E3D0 Content-Type: application/octet-stream; name="mmap.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="mmap.patch" --- mmap.orig Mon Jun 20 13:43:47 2005=0A= +++ mmap.c Fri Jul 29 18:57:55 2005=0A= @@ -207,7 +207,13 @@ void *wine_anon_mmap( void *start, size_=0A= #elif defined(__svr4__) || defined(__NetBSD__) || defined(__APPLE__)=0A= if ( try_mmap_fixed( start, size, prot, flags, fdzero, 0 ) )=0A= return start;=0A= -#endif=0A= +#elif defined(__FreeBSD__)=0A= + if (start =3D=3D (void *)0x80000000) =0A= + { /* assume that was not very clean to do that but mincore didnt = work to test if page is mapped in FreeBSD */=0A= + if (mmap (start, size, prot, flags | MAP_FIXED, fdzero, 0) = =3D=3D start)=0A= + return start;=0A= + }=0A= +#endif =0A= }=0A= return mmap( start, size, prot, flags, fdzero, 0 );=0A= #else=0A= ------=_NextPart_000_0012_01C5947C.AB54E3D0--