* [Qemu-devel] [PATCH] handle MAP_FLAGMASK
@ 2008-11-26 10:27 Christoph Egger
2008-11-26 17:21 ` [Qemu-devel] " Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Egger @ 2008-11-26 10:27 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel
[-- Attachment #1: Type: text/plain, Size: 558 bytes --]
Hi,
NetBSD doesn't have MAP_FLAGMASK. Attached patch fixes this.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: qemu_mmap.diff --]
[-- Type: text/x-diff, Size: 371 bytes --]
Index: bsd-user/mmap.c
===================================================================
--- bsd-user/mmap.c (revision 5799)
+++ bsd-user/mmap.c (working copy)
@@ -30,6 +30,10 @@
//#define DEBUG_MMAP
+#ifndef MAP_FLAGMASK
+#define MAP_FLAGMASK ~MAP_ALIGNMENT_MASK
+#endif
+
#if defined(USE_NPTL)
pthread_mutex_t mmap_mutex;
static int __thread mmap_lock_count;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] handle MAP_FLAGMASK
2008-11-26 10:27 [Qemu-devel] [PATCH] handle MAP_FLAGMASK Christoph Egger
@ 2008-11-26 17:21 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2008-11-26 17:21 UTC (permalink / raw)
To: Christoph Egger; +Cc: qemu-devel
On 11/26/08, Christoph Egger <Christoph.Egger@amd.com> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-26 17:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-26 10:27 [Qemu-devel] [PATCH] handle MAP_FLAGMASK Christoph Egger
2008-11-26 17:21 ` [Qemu-devel] " Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).