diff options
author | Martin Koeppe <mkoeppe@gmx.de> | 2018-08-07 11:55:23 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-08-07 11:58:12 +0300 |
commit | 56fd4797c4681648539ba28669f16267920bfec1 (patch) | |
tree | df366a7030c112e700b0ec07552a3046496466e2 | |
parent | 423d3f60d7e07d3ec3f620078d437870e40031a0 (diff) | |
download | bdwgc-56fd4797c4681648539ba28669f16267920bfec1.tar.gz |
Initial single-threaded support of Interix subsystem
* include/private/gc_priv.h [__INTERIX] (_ALL_SOURCE): Define macro.
* include/private/gcconfig.h [__INTERIX] (I386, INTERIX,
mach_type_known): Likewise.
* include/private/gcconfig.h [I386 && INTERIX] (OS_TYPE, DATASTART,
DATAEND, STACKBOTTOM, USE_MMAP, USE_MMAP_ANON): Likewise.
* include/private/gcconfig.h [I386 && INTERIX] (_data_start__,
_bss_end__): Declare extern variable.
-rw-r--r-- | include/private/gc_priv.h | 4 | ||||
-rw-r--r-- | include/private/gcconfig.h | 22 |
2 files changed, 25 insertions, 1 deletions
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 43f46984..3fb435ce 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -32,6 +32,10 @@ # define _GNU_SOURCE 1 #endif +#if defined(__INTERIX) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif + #if (defined(DGUX) && defined(GC_THREADS) || defined(DGUX386_THREADS) \ || defined(GC_DGUX386_THREADS)) && !defined(_USING_POSIX4A_DRAFT10) # define _USING_POSIX4A_DRAFT10 1 diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 1b50efa0..a167751a 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -539,7 +539,7 @@ EXTERN_C_BEGIN # else # if ((defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300)) \ || (defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__) \ - && !defined(SYMBIAN)) + && !defined(__INTERIX) && !defined(SYMBIAN)) # if defined(__LP64__) || defined(_WIN64) # define X86_64 # elif defined(_M_ARM) @@ -581,6 +581,11 @@ EXTERN_C_BEGIN # define CYGWIN32 # define mach_type_known # endif +# if defined(__INTERIX) +# define I386 +# define INTERIX +# define mach_type_known +# endif # if defined(__MINGW32__) && !defined(mach_type_known) # define I386 # define MSWIN32 @@ -1536,6 +1541,21 @@ EXTERN_C_BEGIN # define USE_MMAP_ANON # endif # endif +# ifdef INTERIX +# define OS_TYPE "INTERIX" + extern int _data_start__[]; + extern int _bss_end__[]; +# define DATASTART ((ptr_t)_data_start__) +# define DATAEND ((ptr_t)_bss_end__) +# define STACKBOTTOM ({ ptr_t rv; \ + __asm__ __volatile__ ("movl %%fs:4, %%eax" \ + : "=a" (rv)); \ + rv; }) +# ifndef USE_MMAP +# define USE_MMAP +# endif +# define USE_MMAP_ANON +# endif # ifdef OS2 # define OS_TYPE "OS2" /* STACKBOTTOM and DATASTART are handled specially in */ |