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
This commit is contained in:
Loren J. Rittle 2002-03-22 02:40:32 +00:00 committed by Loren J. Rittle
parent fba39eafff
commit c0561434cd
3 changed files with 40 additions and 9 deletions

View File

@ -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.

View File

@ -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)

View File

@ -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 */