Merged in rest of Native Client changes, untested
[mono.git] / libgc / include / private / gcconfig.h
index d1c46944bfecd13034bed7f817d6d5869abccf6f..8276079d91edb183ca642fe67c08459ec58d4996 100644 (file)
 # endif
 
 /* Determine the machine type: */
+# if defined(__native_client__)
+#    define NACL
+#    define I386
+#    define mach_type_known
+# endif
 # if defined(__arm__) || defined(__thumb__)
 #    define ARM32
 #    if !defined(LINUX) && !defined(NETBSD) && !defined(DARWIN)
 # endif
 
 # ifdef I386
-#   define MACH_TYPE "I386"
-#   if defined(__LP64__) || defined(_WIN64)
-#     define CPP_WORDSZ 64
-#     define ALIGNMENT 8
-#   else
+#   if defined( NACL )
+#     define MACH_TYPE "NACL"
 #     define CPP_WORDSZ 32
 #     define ALIGNMENT 4
+#   else
+#     define MACH_TYPE "I386"
+#     if defined(__LP64__) || defined(_WIN64)
+#       define CPP_WORDSZ 64
+#       define ALIGNMENT 8
+#     else
+#       define CPP_WORDSZ 32
+#       define ALIGNMENT 4
+#     endif
                        /* Appears to hold for all "32 bit" compilers   */
                        /* except Borland.  The -a4 option fixes        */
                        /* Borland.                                     */
 #        define HEAP_START DATAEND
 #      endif /* USE_MMAP */
 #   endif /* DGUX */
-
+#   ifdef NACL
+#      define OS_TYPE "NACL"
+       extern int etext[];
+#      define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
+       extern int _end[];
+#      define DATAEND (_end)
+#      ifdef STACK_GRAN
+#        undef STACK_GRAN
+#      endif /* STACK_GRAN */
+#      define STACK_GRAN 0x10000
+#      define HEURISTIC1
+#      ifdef USE_MMAP
+#        undef USE_MMAP
+#      endif
+#      ifdef USE_MUNMAP
+#        undef USE_MUNMAP
+#      endif
+#      ifdef USE_MMAP_ANON
+#        undef USE_MMAP_ANON
+#      endif
+#      ifdef USE_MMAP_FIXED
+#        undef USE_MMAP_FIXED
+#      endif
+#      define GETPAGESIZE() 65536
+#      define MAX_NACL_GC_THREADS 1024
+#   endif
 #   ifdef LINUX
 #      ifndef __GNUC__
          /* The Intel compiler doesn't like inline assembly */
 # if defined(GC_IRIX_THREADS) && !defined(IRIX5)
        --> inconsistent configuration
 # endif
-# if defined(GC_LINUX_THREADS) && !defined(LINUX)
+# if defined(GC_LINUX_THREADS) && !(defined(LINUX) || defined(NACL))
        --> inconsistent configuration
 # endif
 # if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)