]> granicus.if.org Git - gc/commitdiff
FreeBSD/arm support improvement
authorCarlos J. Puga Medina <cpm@fbsd.es>
Tue, 21 Jul 2015 06:44:41 +0000 (09:44 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 21 Jul 2015 06:44:41 +0000 (09:44 +0300)
Update the arm32 code to match arm64, powerpc and x86.

* include/private/gc_priv.h: Include machine/trap.h if
DATASTART_USES_BSDGETDATASTART (instead of checking for FREEBSD and
particular CPUs).
* include/private/gcconfig.h (ALIGNMENT, HEURISTIC2,
SEARCH_FOR_DATA_START): Remove for FreeBSD/arm.
* include/private/gcconfig.h (MPROTECT_VDB, SIG_SUSPEND,
SIG_THR_RESTART, DATASTART, DATASTART_USES_BSDGETDATASTART): Define
macro if FREEBSD and ARM32.
* os_dep.c (CODE_OK): Define for FreeBSD/arm.

include/private/gc_priv.h
include/private/gcconfig.h
os_dep.c

index c9e021b34ac0ca78463ef178811b6230062b6da3..1411b27597b149dfe2dff1750324295e6afc91f4 100644 (file)
@@ -2483,13 +2483,12 @@ GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str,
 # define NEED_FIND_LIMIT
 #endif
 
-#if defined(FREEBSD) && (defined(I386) || defined(X86_64) \
-                        || defined(AARCH64) || defined(POWERPC))
+#if defined(DATASTART_USES_BSDGETDATASTART)
 # include <machine/trap.h>
 # if !defined(PCR)
 #   define NEED_FIND_LIMIT
 # endif
-#endif /* FREEBSD */
+#endif /* DATASTART_USES_BSDGETDATASTART */
 
 #if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__) \
     && !defined(NEED_FIND_LIMIT)
index a1f497feb14668ede1f9e32c5d692428134f034b..73303a0f4fbb6e237dece433892efb3dc6ccf61f 100644 (file)
 #   endif
 #   ifdef FREEBSD
       /* FreeBSD/arm */
-#     define ALIGNMENT 4
 #     define OS_TYPE "FREEBSD"
+#     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
-#     define HEURISTIC2
       extern char etext[];
-#     define SEARCH_FOR_DATA_START
+#     define DATASTART GC_FreeBSDGetDataStart(0x1000, (ptr_t)etext)
+#     define DATASTART_USES_BSDGETDATASTART
 #   endif
 #   ifdef DARWIN
       /* iOS */
index 2ea0281333fd8eb08db59e07173aa6107b8c6fe7..c79058db88f4b3be1ef12734361d1667ca6407c6 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)
+#     if defined(AARCH64) || defined(ARM32)
 #       define CODE_OK (si -> si_code == SEGV_ACCERR)
 #     elif defined(POWERPC)
 #       define AIM  /* Pretend that we're AIM. */