From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L5O4p-0004Qv-7a for qemu-devel@nongnu.org; Wed, 26 Nov 2008 12:21:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L5O4o-0004Q4-2P for qemu-devel@nongnu.org; Wed, 26 Nov 2008 12:21:22 -0500 Received: from [199.232.76.173] (port=37235 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L5O4n-0004Pp-QR for qemu-devel@nongnu.org; Wed, 26 Nov 2008 12:21:21 -0500 Received: from ey-out-1920.google.com ([74.125.78.146]:21398) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L5O4n-0005t5-Gi for qemu-devel@nongnu.org; Wed, 26 Nov 2008 12:21:21 -0500 Received: by ey-out-1920.google.com with SMTP id 4so248854eyk.4 for ; Wed, 26 Nov 2008 09:21:11 -0800 (PST) Message-ID: Date: Wed, 26 Nov 2008 19:21:11 +0200 From: "Blue Swirl" In-Reply-To: <200811261127.23684.Christoph.Egger@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200811261127.23684.Christoph.Egger@amd.com> Subject: [Qemu-devel] Re: [PATCH] handle MAP_FLAGMASK Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Egger Cc: qemu-devel@nongnu.org On 11/26/08, Christoph Egger wrote: > > Hi, > > NetBSD doesn't have MAP_FLAGMASK. Attached patch fixes this. The code blindly uses native definitions, but the BSDs differ in some cases. FreeBSD: #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ #define MAP_STACK 0x0400 /* region grows down, like a stack */ #define MAP_NOSYNC 0x0800 /* page to but do not sync underlying file */ NetBSD: #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ #define MAP_TRYFIXED 0x0400 /* attempt hint address, even within break */ #define MAP_WIRED 0x0800 /* mlock() mapping when it is established */ OpenBSD: #define MAP_HASSEMAPHORE 0x0200 /* region may contain semaphores */ #define MAP_TRYFIXED 0x0400 /* attempt hint address, even within heap */ Same for madvise flags. So we need TARGET_FREEBSD_MAP_HASSEMAPHORE etc. and specific handling for each OS, like the syscalls are handled.