From: Carlos J. Puga Medina Date: Sat, 29 Aug 2015 06:21:26 +0000 (+0300) Subject: Support FreeBSD/mips X-Git-Tag: gc7_6_0~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfe78991e3868983f1840270b8dbbfb2d9606a38;p=gc Support FreeBSD/mips * 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. --- diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 5714acdc..1b511acb 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -429,6 +429,10 @@ # 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 @@ -1668,6 +1672,22 @@ # 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" diff --git a/os_dep.c b/os_dep.c index d5bbc70b..5548ca43 100644 --- 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. */