arch-sparc: MAP_32BIT does not exist on solaris
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 30 Mar 2020 16:24:25 +0000 (17:24 +0100)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Sun, 19 Apr 2020 22:14:30 +0000 (22:14 +0000)
Judging by the mmap documentation for solaris:

https://docs.oracle.com/cd/E88353_01/html/E37841/mmap-2.html

MAP_32BIT is not defined. Instead it is using a MAP_LOW32 field
which is explicitly described as different from the MAP_32BIT
field in Linux distributions.

The patch is removing the mapping since:

* As mentioned solaris doesn't implement MAP_32BIT (Target)
* Not every host supports MAP_32BIT.
    ** http://man7.org/linux/man-pages/man2/mmap.2.html

In fact, assuming a Linux host, MAP_32BIT is defined for
x86-64 only, which means it is not possible to compile
gem5-SPARC on a (e.g.) Arm host.

Change-Id: Ibf234754941ae915e728db5fbc4ba1db3aaa1c81
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27647
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/arch/sparc/solaris/solaris.cc
src/arch/sparc/solaris/solaris.hh

index c5b5902cc95f2c6fa8fa385d4fdc66cca34569a9..33b20786ba469d6469ded9478e385c943464de3c 100644 (file)
@@ -79,7 +79,6 @@ const int SparcSolaris::NUM_OPEN_FLAGS =
 SyscallFlagTransTable SparcSolaris::mmapFlagTable[] = {
   { TGT_MAP_SHARED, MAP_SHARED },
   { TGT_MAP_PRIVATE, MAP_PRIVATE },
-  { TGT_MAP_32BIT, MAP_32BIT},
   { TGT_MAP_ANON, MAP_ANON },
   { TGT_MAP_DENYWRITE, MAP_DENYWRITE },
   { TGT_MAP_EXECUTABLE, MAP_EXECUTABLE },
index b2f126a7e96277d2b5bf1e040bc53609a1ed47ab..5ca811d25f6554b745725dce12010b1bd7e25de6 100644 (file)
@@ -63,7 +63,6 @@ class SparcSolaris : public Solaris
 
     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;