* include/gc.h (GC_DATASTART, GC_DATAEND): Define for Cygwin-64.
* include/private/gcconfig.h (X86_64): Likewise.
* include/private/gcconfig.h (OS_TYPE, DATASTART, DATAEND, STACK_GRAN,
NEED_FIND_LIMIT, USE_MMAP_ANON): Define for Cygwin-64 (code copied
from Cygwin-32 block).
* os_dep.c (GC_get_stack_base): Get the stack base for Cygwin-64
(implementation based on NtCurrentTeb call).
/* THREAD_LOCAL_ALLOC defined and the initial allocation call is not */
/* to GC_malloc() or GC_malloc_atomic(). */
-#ifdef __CYGWIN32__
+#if defined(__CYGWIN32__) || defined(__CYGWIN__)
/* Similarly gnu-win32 DLLs need explicit initialization from the */
/* main program, as does AIX. */
extern int _data_start__[], _data_end__[], _bss_start__[], _bss_end__[];
# define mach_type_known
# endif
# if defined(__CYGWIN32__) || defined(__CYGWIN__)
-# define I386
+# if defined(__LP64__)
+# define X86_64
+# else
+# define I386
+# endif
# define CYGWIN32
# define mach_type_known
# endif
# endif /* __INTEL_COMPILER */
# endif
# endif
+# ifdef CYGWIN32
+# define OS_TYPE "CYGWIN32"
+# define DATASTART ((ptr_t)GC_DATASTART) /* From gc.h */
+# define DATAEND ((ptr_t)GC_DATAEND)
+# undef STACK_GRAN
+# define STACK_GRAN 0x10000
+# ifdef USE_MMAP
+# define NEED_FIND_LIMIT
+# define USE_MMAP_ANON
+# endif
+# endif
# ifdef MSWIN32
/* FIXME: This is a very partial guess. There is no port, yet. */
# define OS_TYPE "MSWIN32"
/* gcc version of boehm-gc). */
GC_API int GC_CALL GC_get_stack_base(struct GC_stack_base *sb)
{
- void * _tlsbase;
+# ifdef X86_64
+ sb -> mem_base = ((NT_TIB*)NtCurrentTeb())->StackBase;
+# else
+ void * _tlsbase;
- __asm__ ("movl %%fs:4, %0"
- : "=r" (_tlsbase));
- sb -> mem_base = _tlsbase;
+ __asm__ ("movl %%fs:4, %0"
+ : "=r" (_tlsbase));
+ sb -> mem_base = _tlsbase;
+# endif
return GC_SUCCESS;
}
# endif /* CYGWIN32 */