]> granicus.if.org Git - gc/commitdiff
Fix support of FreeBSD/aarch64
authorCarlos J. Puga Medina <cpm@fbsd.es>
Sat, 11 Jul 2015 18:31:40 +0000 (21:31 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 11 Jul 2015 18:31:40 +0000 (21:31 +0300)
* include/private/gc_priv.h: Include machine/trap.h if qqqFREEBSD and
AARCH64 defined.
* os_dep.c (GC_FreeBSDGetDataStart, CODE_OK): Define if FREEBSD and
AARCH64.
* include/private/gc_priv.h: Replace checking powerpc/__powerpc__
macros with POWERPC.
* os_dep.c: Likewise.
* include/private/gcconfig.h (ALIGNMENT, HEURISTIC2,
SEARCH_FOR_DATA_START): Do not define for FREEBSD/AARCH64.
* include/private/gcconfig.h (MPROTECT_VDB, FREEBSD_STACKBOTTOM,
DATASTART, DATASTART_IS_FUNC): Define if FREEBSD and AARCH64 defined.

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

index 2ccf8d6ec9082be63778202ccbef68f83af1a54a..c9e021b34ac0ca78463ef178811b6230062b6da3 100644 (file)
@@ -2484,7 +2484,7 @@ GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str,
 #endif
 
 #if defined(FREEBSD) && (defined(I386) || defined(X86_64) \
-                        || defined(powerpc) || defined(__powerpc__))
+                        || defined(AARCH64) || defined(POWERPC))
 # include <machine/trap.h>
 # if !defined(PCR)
 #   define NEED_FIND_LIMIT
index c359d0a771b0a78ec6762ecedca6d04010f86b5a..e6d4dcd6456c9d26d245dd2f7879fc9fc113603f 100644 (file)
 #   define I386
 #   define mach_type_known
 # endif
-# if defined(FREEBSD) && defined(__aarch64__)
-#   define AARCH64
-#   define mach_type_known
-# endif
 # if defined(FREEBSD) && (defined(__amd64__) || defined(__x86_64__))
 #   define X86_64
 #   define mach_type_known
 #   define ARM32
 #   define mach_type_known
 # endif
+# if defined(FREEBSD) && defined(__aarch64__)
+#   define AARCH64
+#   define mach_type_known
+# endif
 # if defined(bsdi) && (defined(i386) || defined(__i386__))
 #    define I386
 #    define BSDI
 #     endif
 #   endif
 #   ifdef FREEBSD
-#     define ALIGNMENT 8
 #     define OS_TYPE "FREEBSD"
+#     ifndef GC_FREEBSD_THREADS
+#       define MPROTECT_VDB
+#     endif
+#     define FREEBSD_STACKBOTTOM
 #     ifdef __ELF__
 #       define DYNAMIC_LOADING
 #     endif
-#     define HEURISTIC2
       extern char etext[];
-#     define SEARCH_FOR_DATA_START
+      ptr_t GC_FreeBSDGetDataStart(size_t, ptr_t);
+#     define DATASTART GC_FreeBSDGetDataStart(0x1000, (ptr_t)etext)
+#     define DATASTART_IS_FUNC
 #   endif
 #   ifdef NOSYS
       /* __data_start is usually defined in the target linker script.   */
index 29ac4d595f05c47d0750bd33f70331a5545eaad6..76e56f4751af2b23807bcca54db711368002d330 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -1846,7 +1846,8 @@ void GC_register_data_segments(void)
 # endif
 
 # if defined(FREEBSD) && !defined(PCR) && (defined(I386) || defined(X86_64) \
-                                || defined(powerpc) || defined(__powerpc__))
+                                            || defined(AARCH64) \
+                                            || defined(POWERPC))
 
 /* Its unclear whether this should be identical to the above, or        */
 /* whether it should apply to non-X86 architectures.                    */
@@ -3063,7 +3064,9 @@ 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(POWERPC)
+#     if defined(AARCH64)
+#       define CODE_OK (si -> si_code == SEGV_ACCERR)
+#     elif defined(POWERPC)
 #       define AIM  /* Pretend that we're AIM. */
 #       include <machine/trap.h>
 #       define CODE_OK (si -> si_code == EXC_DSI \