qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUG


From: Helge Deller
Subject: [Qemu-devel] [PATCH] linux-user: Add TARGET_MAP_STACK and TARGET_MAP_HUGETLB for all remaining architectures
Date: Sat, 11 Mar 2017 19:30:16 +0100
User-agent: Mutt/1.7.1 (2016-10-04)

Add the missing defines and for TARGET_MAP_STACK and TARGET_MAP_HUGETLB
for alpha, mips, ppc and x86, and fix the mmap_flags translation table
to translate those flags between host and target architecture.

Signed-off-by: Helge Deller <address@hidden>

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cec8428..03ed370 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5875,6 +5875,8 @@ static bitmask_transtbl mmap_flags_tbl[] = {
        { TARGET_MAP_LOCKED, TARGET_MAP_LOCKED, MAP_LOCKED, MAP_LOCKED },
         { TARGET_MAP_NORESERVE, TARGET_MAP_NORESERVE, MAP_NORESERVE,
           MAP_NORESERVE },
+       { TARGET_MAP_STACK, TARGET_MAP_STACK, MAP_STACK, MAP_STACK },
+       { TARGET_MAP_HUGETLB, TARGET_MAP_HUGETLB, MAP_HUGETLB, MAP_HUGETLB },
        { 0, 0, 0, 0 }
 };
 
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index f356189..a516d77 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1346,6 +1346,8 @@ struct target_winsize {
 #define TARGET_MAP_NORESERVE   0x0400          /* don't check for reservations 
*/
 #define TARGET_MAP_POPULATE    0x10000         /* populate (prefault) 
pagetables */
 #define TARGET_MAP_NONBLOCK    0x20000         /* do not block on IO */
+#define TARGET_MAP_STACK       0x40000         /* give out an address that is 
best suited for process/thread stacks */
+#define TARGET_MAP_HUGETLB     0x80000         /* create a huge page mapping */
 #elif defined(TARGET_PPC)
 #define TARGET_MAP_FIXED       0x10            /* Interpret addr exactly */
 #define TARGET_MAP_ANONYMOUS   0x20            /* don't use a file */
@@ -1356,6 +1358,8 @@ struct target_winsize {
 #define TARGET_MAP_NORESERVE   0x0040          /* don't check for reservations 
*/
 #define TARGET_MAP_POPULATE    0x8000          /* populate (prefault) 
pagetables */
 #define TARGET_MAP_NONBLOCK    0x10000         /* do not block on IO */
+#define TARGET_MAP_STACK       0x20000         /* give out an address that is 
best suited for process/thread stacks */
+#define TARGET_MAP_HUGETLB     0x40000         /* create a huge page mapping */
 #elif defined(TARGET_ALPHA)
 #define TARGET_MAP_ANONYMOUS   0x10            /* don't use a file */
 #define TARGET_MAP_FIXED       0x100           /* Interpret addr exactly */
@@ -1366,6 +1370,8 @@ struct target_winsize {
 #define TARGET_MAP_NORESERVE   0x10000         /* no check for reservations */
 #define TARGET_MAP_POPULATE    0x20000         /* pop (prefault) pagetables */
 #define TARGET_MAP_NONBLOCK    0x40000         /* do not block on IO */
+#define TARGET_MAP_STACK       0x80000         /* give out an address that is 
best suited for process/thread stacks */
+#define TARGET_MAP_HUGETLB     0x100000        /* create a huge page mapping */
 #elif defined(TARGET_HPPA)
 #define TARGET_MAP_ANONYMOUS   0x10            /* don't use a file */
 #define TARGET_MAP_FIXED       0x04            /* Interpret addr exactly */
@@ -1388,6 +1394,8 @@ struct target_winsize {
 #define TARGET_MAP_NORESERVE   0x4000          /* don't check for reservations 
*/
 #define TARGET_MAP_POPULATE    0x8000          /* populate (prefault) 
pagetables */
 #define TARGET_MAP_NONBLOCK    0x10000         /* do not block on IO */
+#define TARGET_MAP_STACK       0x20000         /* give out an address that is 
best suited for process/thread stacks */
+#define TARGET_MAP_HUGETLB     0x40000         /* create a huge page mapping */
 #define TARGET_MAP_UNINITIALIZED 0x4000000     /* for anonymous mmap, memory 
could be uninitialized */
 #endif
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]