diff options
author | Loren J. Rittle <ljrittle@acm.org> | 2002-03-22 02:40:32 +0000 |
---|---|---|
committer | Loren J. Rittle <ljrittle@gcc.gnu.org> | 2002-03-22 02:40:32 +0000 |
commit | c0561434cdccc513e6b1238302a5b8f798456b66 (patch) | |
tree | 4c334d22c263ac85927733f701963abf3bec4c78 /boehm-gc | |
parent | fba39eafffa316f82e6f588233db8cdb7cd8ee22 (diff) | |
download | gcc-c0561434cdccc513e6b1238302a5b8f798456b66.zip gcc-c0561434cdccc513e6b1238302a5b8f798456b66.tar.gz gcc-c0561434cdccc513e6b1238302a5b8f798456b66.tar.bz2 |
gcconfig.h: Add unified test for FreeBSD.
* include/private/gcconfig.h: Add unified test for FreeBSD.
Support FreeBSD/alpha.
* os_dep.c: Do not include <machine/trap.h> unless available.
(GC_freebsd_stack_base): Fix types.
From-SVN: r51159
Diffstat (limited to 'boehm-gc')
-rw-r--r-- | boehm-gc/ChangeLog | 7 | ||||
-rw-r--r-- | boehm-gc/include/private/gcconfig.h | 30 | ||||
-rw-r--r-- | boehm-gc/os_dep.c | 12 |
3 files changed, 40 insertions, 9 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index c0b897c..5f1c1e1 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,10 @@ +2002-03-21 Loren J. Rittle <ljrittle@acm.org> + + * include/private/gcconfig.h: Add unified test for FreeBSD. + Support FreeBSD/alpha. + * os_dep.c: Do not include <machine/trap.h> unless available. + (GC_freebsd_stack_base): Fix types. + 2002-03-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz> * Makefile.am: Make a convenience library. diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index e06cc4a..14aa8cb 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -38,6 +38,11 @@ # define OPENBSD # endif +/* And one for FreeBSD: */ +# if defined(__FreeBSD__) +# define FREEBSD +# endif + /* Determine the machine type: */ # if defined(__XSCALE__) # define ARM32 @@ -214,7 +219,7 @@ # endif # if defined(__alpha) || defined(__alpha__) # define ALPHA -# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) +# if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) && !defined(FREEBSD) # define OSF1 /* a.k.a Digital Unix */ # endif # define mach_type_known @@ -262,9 +267,8 @@ # define OPENBSD # define mach_type_known # endif -# if defined(__FreeBSD__) && (defined(i386) || defined(__i386__)) +# if defined(FREEBSD) && (defined(i386) || defined(__i386__)) # define I386 -# define FREEBSD # define mach_type_known # endif # if defined(__NetBSD__) && (defined(i386) || defined(__i386__)) @@ -1330,6 +1334,26 @@ # define DATASTART ((ptr_t) 0x140000000) # endif # endif +# ifdef FREEBSD +# define OS_TYPE "FREEBSD" +/* MPROTECT_VDB is not yet supported at all on FreeBSD/alpha. */ +# define SIG_SUSPEND SIGUSR1 +# define SIG_THR_RESTART SIGUSR2 +# define FREEBSD_STACKBOTTOM +# ifdef __ELF__ +# define DYNAMIC_LOADING +# endif +/* Handle unmapped hole alpha*-*-freebsd[45]* puts between etext and edata. */ + extern char etext; + extern char edata; + extern char end; +# define NEED_FIND_LIMIT +# define DATASTART ((ptr_t)(&etext)) +# define DATAEND (GC_find_limit (DATASTART, TRUE)) +# define DATASTART2 ((ptr_t)(&edata)) +# define DATAEND2 ((ptr_t)(&end)) +# define CPP_WORDSZ 64 +# endif # ifdef OSF1 # define OS_TYPE "OSF1" # define DATASTART ((ptr_t) 0x140000000) diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index b8f4cf8..88194fe 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -84,7 +84,7 @@ # include <setjmp.h> #endif -#ifdef FREEBSD +#if defined(FREEBSD) && defined(I386) # include <machine/trap.h> #endif @@ -747,14 +747,14 @@ ptr_t GC_get_stack_base() ptr_t GC_freebsd_stack_base(void) { - int nm[2] = { CTL_KERN, KERN_USRSTACK}, base, len, r; - - len = sizeof(int); - r = sysctl(nm, 2, &base, &len, NULL, 0); + int nm[2] = {CTL_KERN, KERN_USRSTACK}; + ptr_t base; + size_t len = sizeof(ptr_t); + int r = sysctl(nm, 2, &base, &len, NULL, 0); if (r) ABORT("Error getting stack base"); - return (ptr_t)base; + return base; } #endif /* FREEBSD_STACKBOTTOM */ |