]> granicus.if.org Git - gc/commitdiff
Support FreeBSD/mips
authorCarlos J. Puga Medina <cpm@fbsd.es>
Sat, 29 Aug 2015 06:21:26 +0000 (09:21 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 29 Aug 2015 06:21:26 +0000 (09:21 +0300)
* include/private/gcconfig.h (MIPS, mach_type_known, OS_TYPE,
ALIGNMENT, MPROTECT_VDB, SIG_SUSPEND, SIG_THR_RESTART, DYNAMIC_LOADING,
DATASTART_USES_BSDGETDATASTART): Define for FreeBSD/mips.
* os_dep.c (CODE_OK): Define to si->si_code==SEGV_ACCERR for
FreeBSD/mips.

include/private/gcconfig.h
os_dep.c

index 5714acdc61333621549edcbbfa99eb9995e529fe..1b511acb0b581f0ffacac14b4de8c2129706a088 100644 (file)
 #   define AARCH64
 #   define mach_type_known
 # endif
+# if defined(FREEBSD) && (defined(mips) || defined(__mips) || defined(_mips))
+#   define MIPS
+#   define mach_type_known
+# endif
 # if defined(bsdi) && (defined(i386) || defined(__i386__))
 #    define I386
 #    define BSDI
 #    define DATAEND ((ptr_t)(&_end))
 #    define DYNAMIC_LOADING
 #  endif
+#  ifdef FREEBSD
+#    define OS_TYPE "FREEBSD"
+#    define ALIGNMENT 4
+#    ifndef GC_FREEBSD_THREADS
+#      define MPROTECT_VDB
+#    endif
+#    define SIG_SUSPEND SIGUSR1
+#    define SIG_THR_RESTART SIGUSR2
+#    define FREEBSD_STACKBOTTOM
+#    ifdef __ELF__
+#      define DYNAMIC_LOADING
+#    endif
+     extern char etext[];
+#    define DATASTART GC_FreeBSDGetDataStart(0x1000, (ptr_t)etext)
+#    define DATASTART_USES_BSDGETDATASTART
+#  endif /* FreeBSD */
 #  if defined(NONSTOP)
 #    define CPP_WORDSZ 32
 #    define OS_TYPE "NONSTOP"
index d5bbc70beff458778e9dd38b34c60e6c27e9a8cc..5548ca43b8509a2221e4d970f17a273d50a0136e 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -3060,7 +3060,7 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
 #     ifndef SEGV_ACCERR
 #       define SEGV_ACCERR 2
 #     endif
-#     if defined(AARCH64) || defined(ARM32)
+#     if defined(AARCH64) || defined(ARM32) || defined(MIPS)
 #       define CODE_OK (si -> si_code == SEGV_ACCERR)
 #     elif defined(POWERPC)
 #       define AIM  /* Pretend that we're AIM. */