mirror of git://gcc.gnu.org/git/gcc.git
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:
parent
fba39eafff
commit
c0561434cd
|
|
@ -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>
|
2002-03-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
|
||||||
|
|
||||||
* Makefile.am: Make a convenience library.
|
* Makefile.am: Make a convenience library.
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@
|
||||||
# define OPENBSD
|
# define OPENBSD
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
/* And one for FreeBSD: */
|
||||||
|
# if defined(__FreeBSD__)
|
||||||
|
# define FREEBSD
|
||||||
|
# endif
|
||||||
|
|
||||||
/* Determine the machine type: */
|
/* Determine the machine type: */
|
||||||
# if defined(__XSCALE__)
|
# if defined(__XSCALE__)
|
||||||
# define ARM32
|
# define ARM32
|
||||||
|
|
@ -214,7 +219,7 @@
|
||||||
# endif
|
# endif
|
||||||
# if defined(__alpha) || defined(__alpha__)
|
# if defined(__alpha) || defined(__alpha__)
|
||||||
# define 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 */
|
# define OSF1 /* a.k.a Digital Unix */
|
||||||
# endif
|
# endif
|
||||||
# define mach_type_known
|
# define mach_type_known
|
||||||
|
|
@ -262,9 +267,8 @@
|
||||||
# define OPENBSD
|
# define OPENBSD
|
||||||
# define mach_type_known
|
# define mach_type_known
|
||||||
# endif
|
# endif
|
||||||
# if defined(__FreeBSD__) && (defined(i386) || defined(__i386__))
|
# if defined(FREEBSD) && (defined(i386) || defined(__i386__))
|
||||||
# define I386
|
# define I386
|
||||||
# define FREEBSD
|
|
||||||
# define mach_type_known
|
# define mach_type_known
|
||||||
# endif
|
# endif
|
||||||
# if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
|
# if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
|
||||||
|
|
@ -1330,6 +1334,26 @@
|
||||||
# define DATASTART ((ptr_t) 0x140000000)
|
# define DATASTART ((ptr_t) 0x140000000)
|
||||||
# endif
|
# endif
|
||||||
# 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
|
# ifdef OSF1
|
||||||
# define OS_TYPE "OSF1"
|
# define OS_TYPE "OSF1"
|
||||||
# define DATASTART ((ptr_t) 0x140000000)
|
# define DATASTART ((ptr_t) 0x140000000)
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
# include <setjmp.h>
|
# include <setjmp.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FREEBSD
|
#if defined(FREEBSD) && defined(I386)
|
||||||
# include <machine/trap.h>
|
# include <machine/trap.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -747,14 +747,14 @@ ptr_t GC_get_stack_base()
|
||||||
|
|
||||||
ptr_t GC_freebsd_stack_base(void)
|
ptr_t GC_freebsd_stack_base(void)
|
||||||
{
|
{
|
||||||
int nm[2] = { CTL_KERN, KERN_USRSTACK}, base, len, r;
|
int nm[2] = {CTL_KERN, KERN_USRSTACK};
|
||||||
|
ptr_t base;
|
||||||
len = sizeof(int);
|
size_t len = sizeof(ptr_t);
|
||||||
r = sysctl(nm, 2, &base, &len, NULL, 0);
|
int r = sysctl(nm, 2, &base, &len, NULL, 0);
|
||||||
|
|
||||||
if (r) ABORT("Error getting stack base");
|
if (r) ABORT("Error getting stack base");
|
||||||
|
|
||||||
return (ptr_t)base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FREEBSD_STACKBOTTOM */
|
#endif /* FREEBSD_STACKBOTTOM */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue