summaryrefslogtreecommitdiff
path: root/src/arch/x86/linux/linux.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/linux/linux.hh')
-rw-r--r--src/arch/x86/linux/linux.hh47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh
index 854ab00a0..ce395f17d 100644
--- a/src/arch/x86/linux/linux.hh
+++ b/src/arch/x86/linux/linux.hh
@@ -126,8 +126,27 @@ class X86Linux64 : public Linux
static const int NUM_OPEN_FLAGS;
- static const unsigned TGT_MAP_ANONYMOUS = 0x20;
- static const unsigned TGT_MAP_FIXED = 0x10;
+ /// For mmap().
+ static SyscallFlagTransTable mmapFlagTable[];
+
+ static const unsigned TGT_MAP_SHARED = 0x00001;
+ static const unsigned TGT_MAP_PRIVATE = 0x00002;
+ static const unsigned TGT_MAP_32BIT = 0x00040;
+ static const unsigned TGT_MAP_ANON = 0x00020;
+ static const unsigned TGT_MAP_DENYWRITE = 0x00800;
+ static const unsigned TGT_MAP_EXECUTABLE = 0x01000;
+ static const unsigned TGT_MAP_FILE = 0x00000;
+ static const unsigned TGT_MAP_GROWSDOWN = 0x00100;
+ static const unsigned TGT_MAP_HUGETLB = 0x40000;
+ static const unsigned TGT_MAP_LOCKED = 0x02000;
+ static const unsigned TGT_MAP_NONBLOCK = 0x10000;
+ static const unsigned TGT_MAP_NORESERVE = 0x04000;
+ static const unsigned TGT_MAP_POPULATE = 0x08000;
+ static const unsigned TGT_MAP_STACK = 0x20000;
+ static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
+ static const unsigned TGT_MAP_FIXED = 0x00010;
+
+ static const unsigned NUM_MMAP_FLAGS;
typedef struct {
uint64_t iov_base; // void *
@@ -147,7 +166,7 @@ class X86Linux64 : public Linux
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint64_t mem_unit; /* Memory unit size in bytes */
- } tgt_sysinfo;
+ } tgt_sysinfo;
};
@@ -236,8 +255,26 @@ class X86Linux32 : public Linux
static const int NUM_OPEN_FLAGS;
- static const unsigned TGT_MAP_ANONYMOUS = 0x20;
- static const unsigned TGT_MAP_FIXED = 0x10;
+ static SyscallFlagTransTable mmapFlagTable[];
+
+ static const unsigned TGT_MAP_SHARED = 0x00001;
+ static const unsigned TGT_MAP_PRIVATE = 0x00002;
+ static const unsigned TGT_MAP_32BIT = 0x00040;
+ static const unsigned TGT_MAP_ANON = 0x00020;
+ static const unsigned TGT_MAP_DENYWRITE = 0x00800;
+ static const unsigned TGT_MAP_EXECUTABLE = 0x01000;
+ static const unsigned TGT_MAP_FILE = 0x00000;
+ static const unsigned TGT_MAP_GROWSDOWN = 0x00100;
+ static const unsigned TGT_MAP_HUGETLB = 0x40000;
+ static const unsigned TGT_MAP_LOCKED = 0x02000;
+ static const unsigned TGT_MAP_NONBLOCK = 0x10000;
+ static const unsigned TGT_MAP_NORESERVE = 0x04000;
+ static const unsigned TGT_MAP_POPULATE = 0x08000;
+ static const unsigned TGT_MAP_STACK = 0x20000;
+ static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
+ static const unsigned TGT_MAP_FIXED = 0x00010;
+
+ static const unsigned NUM_MMAP_FLAGS;
typedef struct {
int32_t uptime; /* Seconds since boot */