📄 gcconfig.h
字号:
# define OS_TYPE "DOS4GW" extern long __nullarea; extern char _end; extern char *_STACKTOP; /* Depending on calling conventions Watcom C either precedes or does not precedes with undescore names of C-variables. Make sure startup code variables always have the same names. */ #pragma aux __nullarea "*"; #pragma aux _end "*";# define STACKBOTTOM ((ptr_t) _STACKTOP) /* confused? me too. */# define DATASTART ((ptr_t) &__nullarea)# define DATAEND ((ptr_t) &_end)# endif# ifdef HURD# define OS_TYPE "HURD"# define STACK_GROWS_DOWN# define HEURISTIC2 extern int __data_start[];# define DATASTART ( (ptr_t) (__data_start)) extern int _end[];# define DATAEND ( (ptr_t) (_end))/* # define MPROTECT_VDB Not quite working yet? */# define DYNAMIC_LOADING# endif# endif# ifdef NS32K# define MACH_TYPE "NS32K"# define ALIGNMENT 4 extern char **environ;# define DATASTART ((ptr_t)(&environ)) /* hideous kludge: environ is the first */ /* word in crt0.o, and delimits the start */ /* of the data segment, no matter which */ /* ld options were passed through. */# define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */# endif# ifdef MIPS# define MACH_TYPE "MIPS"# ifdef LINUX /* This was developed for a linuxce style platform. Probably */ /* needs to be tweaked for workstation class machines. */# define OS_TYPE "LINUX"# define DYNAMIC_LOADING extern int _end[];# define DATAEND (_end) extern int __data_start[];# define DATASTART ((ptr_t)(__data_start))# define ALIGNMENT 4# define USE_GENERIC_PUSH_REGS# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2# define LINUX_STACKBOTTOM# else# define STACKBOTTOM 0x80000000# endif# endif /* Linux */# ifdef EWS4800# define HEURISTIC2# if defined(_MIPS_SZPTR) && (_MIPS_SZPTR == 64) extern int _fdata[], _end[];# define DATASTART ((ptr_t)_fdata)# define DATAEND ((ptr_t)_end)# define CPP_WORDSZ _MIPS_SZPTR# define ALIGNMENT (_MIPS_SZPTR/8)# else extern int etext[], edata[], end[]; extern int _DYNAMIC_LINKING[], _gp[];# define DATASTART ((ptr_t)((((word)etext + 0x3ffff) & ~0x3ffff) \ + ((word)etext & 0xffff)))# define DATAEND (edata)# define DATASTART2 (_DYNAMIC_LINKING \ ? (ptr_t)(((word)_gp + 0x8000 + 0x3ffff) & ~0x3ffff) \ : (ptr_t)edata)# define DATAEND2 (end)# define ALIGNMENT 4# endif# define OS_TYPE "EWS4800"# define USE_GENERIC_PUSH_REGS 1# endif# ifdef ULTRIX# define HEURISTIC2# define DATASTART (ptr_t)0x10000000 /* Could probably be slightly higher since */ /* startup code allocates lots of stuff. */# define OS_TYPE "ULTRIX"# define ALIGNMENT 4# endif# ifdef RISCOS# define HEURISTIC2# define DATASTART (ptr_t)0x10000000# define OS_TYPE "RISCOS"# define ALIGNMENT 4 /* Required by hardware */# endif# ifdef IRIX5# define HEURISTIC2 extern int _fdata[];# define DATASTART ((ptr_t)(_fdata))# ifdef USE_MMAP# define HEAP_START (ptr_t)0x30000000# else# define HEAP_START DATASTART# endif /* Lowest plausible heap address. */ /* In the MMAP case, we map there. */ /* In either case it is used to identify */ /* heap sections so they're not */ /* considered as roots. */# define OS_TYPE "IRIX5"/*# define MPROTECT_VDB DOB: this should work, but there is evidence *//* of recent breakage. */# ifdef _MIPS_SZPTR# define CPP_WORDSZ _MIPS_SZPTR# define ALIGNMENT (_MIPS_SZPTR/8)# if CPP_WORDSZ != 64# define ALIGN_DOUBLE# endif# else# define ALIGNMENT 4# define ALIGN_DOUBLE# endif# define DYNAMIC_LOADING# endif# ifdef MSWINCE# define OS_TYPE "MSWINCE"# define ALIGNMENT 4# define DATAEND /* not needed */# endif# if defined(NETBSD)# define OS_TYPE "NETBSD"# define ALIGNMENT 4# define HEURISTIC2# define USE_GENERIC_PUSH_REGS# ifdef __ELF__ extern int etext[];# define DATASTART GC_data_start# define NEED_FIND_LIMIT# define DYNAMIC_LOADING# else# define DATASTART ((ptr_t) 0x10000000)# define STACKBOTTOM ((ptr_t) 0x7ffff000)# endif /* _ELF_ */# endif# endif# ifdef RS6000# define MACH_TYPE "RS6000"# ifdef ALIGNMENT# undef ALIGNMENT# endif# ifdef IA64# undef IA64 /* DOB: some AIX installs stupidly define IA64 in /usr/include/sys/systemcfg.h */# endif# ifdef __64BIT__# define ALIGNMENT 8# define CPP_WORDSZ 64# define STACKBOTTOM ((ptr_t)0x1000000000000000)# else# define ALIGNMENT 4# define CPP_WORDSZ 32# define STACKBOTTOM ((ptr_t)((ulong)&errno))# endif /* From AIX linker man page: _text Specifies the first location of the program. _etext Specifies the first location after the program. _data Specifies the first location of the data. _edata Specifies the first location after the initialized data _end or end Specifies the first location after all data. */ extern int _data[], _end[];# define DATASTART ((ptr_t)((ulong)_data))# define DATAEND ((ptr_t)((ulong)_end)) extern int errno;# define USE_GENERIC_PUSH_REGS# define DYNAMIC_LOADING /* For really old versions of AIX, this may have to be removed. */# endif# ifdef HP_PA# define MACH_TYPE "HP_PA"# ifdef __LP64__# define CPP_WORDSZ 64# define ALIGNMENT 8# else# define CPP_WORDSZ 32# define ALIGNMENT 4# define ALIGN_DOUBLE# endif# if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)# ifndef LINUX /* For now. */# define MPROTECT_VDB# endif# else# define GENERIC_COMPARE_AND_SWAP /* No compare-and-swap instruction. Use pthread mutexes */ /* when we absolutely have to. */# ifdef PARALLEL_MARK# define USE_MARK_BYTES /* Minimize compare-and-swap usage. */# endif# endif# define STACK_GROWS_UP# ifdef HPUX# define OS_TYPE "HPUX" extern int __data_start[];# define DATASTART ((ptr_t)(__data_start))# if 0 /* The following appears to work for 7xx systems running HP/UX */ /* 9.xx Furthermore, it might result in much faster */ /* collections than HEURISTIC2, which may involve scanning */ /* segments that directly precede the stack. It is not the */ /* default, since it may not work on older machine/OS */ /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */ /* this.) */# define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */# else /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */ /* to this. Note that the GC must be initialized before the */ /* first putenv call. */ extern char ** environ;# define STACKBOTTOM ((ptr_t)environ)# endif# define DYNAMIC_LOADING# include <unistd.h># define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)# ifndef __GNUC__# define PREFETCH(x) { \ register long addr = (long)(x); \ (void) _asm ("LDW", 0, 0, addr, 0); \ }# endif# endif /* HPUX */# ifdef LINUX# define OS_TYPE "LINUX"# define LINUX_STACKBOTTOM# define DYNAMIC_LOADING# define SEARCH_FOR_DATA_START extern int _end[];# define DATAEND (&_end)# endif /* LINUX */# endif /* HP_PA */# ifdef ALPHA# define MACH_TYPE "ALPHA"# define ALIGNMENT 8# define CPP_WORDSZ 64# ifndef LINUX# define USE_GENERIC_PUSH_REGS /* Gcc and probably the DEC/Compaq compiler spill pointers to preserved */ /* fp registers in some cases when the target is a 21264. The assembly */ /* code doesn't handle that yet, and version dependencies make that a */ /* bit tricky. Do the easy thing for now. */# endif# ifdef NETBSD# define OS_TYPE "NETBSD"# define HEURISTIC2# define DATASTART GC_data_start# define ELFCLASS32 32# define ELFCLASS64 64# define ELF_CLASS ELFCLASS64# define DYNAMIC_LOADING# endif# ifdef OPENBSD# define OS_TYPE "OPENBSD"# define HEURISTIC2# ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */# define DATASTART GC_data_start# define ELFCLASS32 32# define ELFCLASS64 64# define ELF_CLASS ELFCLASS64# else /* ECOFF, until OpenBSD/Alpha 2.7 */# 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))# endif# ifdef OSF1# define OS_TYPE "OSF1"# define DATASTART ((ptr_t) 0x140000000) extern int _end[];# define DATAEND ((ptr_t) &_end) extern char ** environ; /* round up from the value of environ to the nearest page boundary */ /* Probably breaks if putenv is called before collector */ /* initialization. */# define STACKBOTTOM ((ptr_t)(((word)(environ) | (getpagesize()-1))+1))/* # define HEURISTIC2 */ /* Normally HEURISTIC2 is too conervative, since */ /* the text segment immediately follows the stack. */ /* Hence we give an upper pound. */ /* This is currently unused, since we disabled HEURISTIC2 */ extern int __start[];# define HEURISTIC2_LIMIT ((ptr_t)((word)(__start) & ~(getpagesize()-1)))# ifndef GC_OSF1_THREADS /* Unresolved signal issues with threads. */# define MPROTECT_VDB# endif# define DYNAMIC_LOADING# endif# ifdef LINUX# define OS_TYPE "LINUX"# define LINUX_STACKBOTTOM# ifdef __ELF__# define SEARCH_FOR_DATA_START# define DYNAMIC_LOADING# else# define DATASTART ((ptr_t) 0x140000000)# endif extern int _end[];# define DATAEND (_end)# define MPROTECT_VDB /* Has only been superficially tested. May not */ /* work on all versions. */# endif# endif# ifdef IA64# define MACH_TYPE "IA64"# define USE_GENERIC_PUSH_REGS /* We need to get preserved registers in addition to register */ /* windows. That's easiest to do with setjmp. */# ifdef PARALLEL_MARK# define USE_MARK_BYTES /* Compare-and-exchange is too expensive to use for */ /* setting mark bits. */# endif# ifdef HPUX# ifdef _ILP32# define CPP_WORDSZ 32# define ALIGN_DOUBLE /* Requires 8 byte alignment for malloc */# define ALIGNMENT 4# else# ifndef _LP64 ---> unknown ABI# endif# define CPP_WORDSZ 64# define ALIGN_DOUBLE /* Requires 16 byte alignment for malloc */# define ALIGNMENT 8# endif# define OS_TYPE "HPUX" extern int __data_start[];# define DATASTART ((ptr_t)(__data_start)) /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */ /* to this. Note that the GC must be initialized before the */ /* first putenv call. */ extern char ** environ;# define STACKBOTTOM ((ptr_t)environ)# define HPUX_STACKBOTTOM# define DYNAMIC_LOADING# include <unistd.h># define GETPAGESIZE() sysconf(_SC_PAGE_SIZE) /* The following was empirically determined, and is probably */ /* not very robust. */ /* Note that the backing store base seems to be at a nice */ /* address minus one page. */# define BACKING_STORE_DISPLACEMENT 0x1000000# define BACKING_STORE_ALIGNMENT 0x1000 extern ptr_t GC_register_stackbottom;# define BACKING_STORE_BASE GC_register_stackbottom /* Known to be wrong for recent HP/UX versions!!! */# endif# ifdef LINUX# define CPP_WORDSZ 64# define ALIGN_DOUBLE /* Requires 16 byte alignment for malloc */# define ALIGNMENT 8# define OS_TYPE "LINUX" /* The following works on NUE and older kernels: *//* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */ /* This does not work on NUE: */# define LINUX_STACKBOTTOM /* We also need the base address of the register stack */ /* backing store. This is computed in */ /* GC_linux_register_stack_base based on the following */ /* constants: */# define BACKING_STORE_ALIGNMENT 0x100000# define BACKING_STORE_DISPLACEMENT 0x80000000 extern ptr_t GC_register_stackbottom;# define BACKING_STORE_BASE GC_register_stackbottom# define SEARCH_FOR_DATA_START# ifdef __GNUC__# define DYNAMIC_LOADING# else /* In the Intel compiler environment, we seem to end up with */ /* statically linked executables and an undefined reference */ /* to _DYNAMIC */# endif# define MPROTECT_VDB /* Requires Linux 2.3.47 or later. */ extern int _end[];# define DATAEND (_end)# ifdef __GNUC__# ifndef __INTEL_COMPILER# define PREFETCH(x) \ __asm__ (" lfetch [%0]": : "r"(x))# define PREFETCH_FOR_WRITE(x) \ __asm__ (" lfetch.excl [%0]": : "r"(x))# define CLEAR_DOUBLE(x) \ __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))# else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -