📄 gcconfig.h
字号:
/* 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# define BACKING_STORE_BASE \ (ptr_t)(((word)GC_stackbottom - BACKING_STORE_DISPLACEMENT - 1) \ & ~(BACKING_STORE_ALIGNMENT - 1))# 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 char * GC_register_stackbottom;# define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)# define SEARCH_FOR_DATA_START# define DATASTART GC_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__# define PREFETCH(x) \ __asm__ (" lfetch [%0]": : "r"((void *)(x)))# define PREFETCH_FOR_WRITE(x) \ __asm__ (" lfetch.excl [%0]": : "r"((void *)(x)))# define CLEAR_DOUBLE(x) \ __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))# endif# endif# endif# ifdef M88K# define MACH_TYPE "M88K"# define ALIGNMENT 4# define ALIGN_DOUBLE extern int etext[];# ifdef CX_UX# define OS_TYPE "CX_UX"# define DATASTART ((((word)etext + 0x3fffff) & ~0x3fffff) + 0x10000)# endif# ifdef DGUX# define OS_TYPE "DGUX" extern char * GC_SysVGetDataStart();# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, etext)# endif# define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */# endif# ifdef S370# define MACH_TYPE "S370"# define ALIGNMENT 4 /* Required by hardware */# define USE_GENERIC_PUSH_REGS# ifdef UTS4# define OS_TYPE "UTS4" extern int etext[]; extern int _etext[]; extern int _end[]; extern char * GC_SysVGetDataStart();# define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, _etext)# define DATAEND (_end)# define HEURISTIC2# endif# endif# ifdef S390# define MACH_TYPE "S390"# define USE_GENERIC_PUSH_REGS# ifndef __s390x__# define ALIGNMENT 4# define CPP_WORDSZ 32# else# define ALIGNMENT 8# define CPP_WORDSZ 64# define HBLKSIZE 4096# endif# ifdef LINUX# define OS_TYPE "LINUX"# define LINUX_STACKBOTTOM# define DYNAMIC_LOADING extern int __data_start[];# define DATASTART ((ptr_t)(__data_start)) extern int _end[];# define DATAEND (_end)# define CACHE_LINE_SIZE 256# define GETPAGESIZE() 4096# endif# endif# if defined(PJ)# define ALIGNMENT 4 extern int _etext[];# define DATASTART ((ptr_t)(_etext))# define HEURISTIC1# endif# ifdef ARM32# define CPP_WORDSZ 32# define MACH_TYPE "ARM32"# define ALIGNMENT 4# ifdef NETBSD# define OS_TYPE "NETBSD"# define HEURISTIC2 extern char etext[];# define DATASTART ((ptr_t)(etext))# define USE_GENERIC_PUSH_REGS# endif# ifdef LINUX# define OS_TYPE "LINUX"# define HEURISTIC1# undef STACK_GRAN# define STACK_GRAN 0x10000000# define USE_GENERIC_PUSH_REGS# ifdef __ELF__# define DYNAMIC_LOADING# include <features.h># if defined(__GLIBC__) && __GLIBC__ >= 2# define LINUX_DATA_START# else 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. */ /* We could use _etext instead, but that */ /* would include .rodata, which may */ /* contain large read-only data tables */ /* that we'd rather not scan. */# endif extern int _end[];# define DATAEND (_end)# else extern int etext[];# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))# endif# endif# ifdef MSWINCE# define OS_TYPE "MSWINCE"# define DATAEND /* not needed */# endif# ifdef NOSYS /* __data_start is usually defined in the target linker script. */ extern int __data_start[];# define DATASTART (ptr_t)(__data_start)# define USE_GENERIC_PUSH_REGS /* __stack_base__ is set in newlib/libc/sys/arm/crt0.S */ extern void *__stack_base__;# define STACKBOTTOM ((ptr_t) (__stack_base__))# endif#endif# ifdef SH# define MACH_TYPE "SH"# define ALIGNMENT 4# ifdef MSWINCE# define OS_TYPE "MSWINCE"# define DATAEND /* not needed */# endif# ifdef LINUX# define OS_TYPE "LINUX"# define STACKBOTTOM ((ptr_t) 0x7c000000)# define USE_GENERIC_PUSH_REGS# define DYNAMIC_LOADING# define LINUX_DATA_START extern int _end[];# define DATAEND (_end)# endif# endif # ifdef SH4# define MACH_TYPE "SH4"# define OS_TYPE "MSWINCE"# define ALIGNMENT 4# define DATAEND /* not needed */# endif# ifdef X86_64# define MACH_TYPE "X86_64"# define ALIGNMENT 8# define CPP_WORDSZ 64# define HBLKSIZE 4096# define CACHE_LINE_SIZE 64# define USE_GENERIC_PUSH_REGS# ifdef LINUX# define OS_TYPE "LINUX"# define LINUX_STACKBOTTOM# if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)# define MPROTECT_VDB# else /* We seem to get random errors in incremental mode, */ /* possibly because Linux threads is itself a malloc client */ /* and can't deal with the signals. */# endif# ifdef __ELF__# define DYNAMIC_LOADING# ifdef UNDEFINED /* includes ro data */ extern int _etext[];# define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))# endif# include <features.h># define LINUX_DATA_START extern int _end[];# define DATAEND (_end)# else extern int etext[];# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))# endif# define PREFETCH(x) \ __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))# define PREFETCH_FOR_WRITE(x) \ __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))# endif# endif#ifdef LINUX_DATA_START /* Some Linux distributions arrange to define __data_start. Some */ /* define data_start as a weak symbol. The latter is technically */ /* broken, since the user program may define data_start, in which */ /* case we lose. Nonetheless, we try both, prefering __data_start. */ /* We assume gcc. */# pragma weak __data_start extern int __data_start[];# pragma weak data_start extern int data_start[];# define DATASTART ((ptr_t)(__data_start != 0? __data_start : data_start))#endif#if defined(LINUX) && defined(REDIRECT_MALLOC) /* Rld appears to allocate some memory with its own allocator, and */ /* some through malloc, which might be redirected. To make this */ /* work with collectable memory, we have to scan memory allocated */ /* by rld's internal malloc. */# define USE_PROC_FOR_LIBRARIES#endif # ifndef STACK_GROWS_UP# define STACK_GROWS_DOWN# endif# ifndef CPP_WORDSZ# define CPP_WORDSZ 32# endif# ifndef OS_TYPE# define OS_TYPE ""# endif# ifndef DATAEND extern int end[];# define DATAEND (end)# endif# if defined(SVR4) && !defined(GETPAGESIZE)# include <unistd.h># define GETPAGESIZE() sysconf(_SC_PAGESIZE)# endif# ifndef GETPAGESIZE# if defined(SUNOS5) || defined(IRIX5)# include <unistd.h># endif# define GETPAGESIZE() getpagesize()# endif# if defined(SUNOS5) || defined(DRSNX) || defined(UTS4) /* OS has SVR4 generic features. Probably others also qualify. */# define SVR4# endif# if defined(SUNOS5) || defined(DRSNX) /* OS has SUNOS5 style semi-undocumented interface to dynamic */ /* loader. */# define SUNOS5DL /* OS has SUNOS5 style signal handlers. */# define SUNOS5SIGS# endif# if defined(HPUX)# define SUNOS5SIGS# endif# if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \ || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \ || defined(BSD) || defined(_AIX) || defined(MACOSX) || defined(OSF1)# define UNIX_LIKE /* Basic Unix-like system calls work. */# endif# if CPP_WORDSZ != 32 && CPP_WORDSZ != 64 -> bad word size# endif# ifdef PCR# undef DYNAMIC_LOADING# undef STACKBOTTOM# undef HEURISTIC1# undef HEURISTIC2# undef PROC_VDB# undef MPROTECT_VDB# define PCR_VDB# endif# ifdef SRC_M3/* Postponed for now. */# undef PROC_VDB# undef MPROTECT_VDB# endif# ifdef SMALL_CONFIG/* Presumably not worth the space it takes. */# undef PROC_VDB# undef MPROTECT_VDB# endif# ifdef USE_MUNMAP# undef MPROTECT_VDB /* Can't deal with address space holes. */# endif# ifdef PARALLEL_MARK# undef MPROTECT_VDB /* For now. */# endif# if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)# define DEFAULT_VDB# endif# ifndef PREFETCH# define PREFETCH(x)# define NO_PREFETCH# endif# ifndef PREFETCH_FOR_WRITE# define PREFETCH_FOR_WRITE(x)# define NO_PREFETCH_FOR_WRITE# endif# ifndef CACHE_LINE_SIZE# define CACHE_LINE_SIZE 32 /* Wild guess */# endif# ifdef LINUX# define REGISTER_LIBRARIES_EARLY /* We sometimes use dl_iterate_phdr, which may acquire an internal */ /* lock. This isn't safe after the world has stopped. So we must */ /* call GC_register_dynamic_libraries before stopping the world. */ /* For performance reasons, this may be beneficial on other */ /* platforms as well, though it should be avoided in win32. */# endif /* LINUX */# if defined(SEARCH_FOR_DATA_START) && defined(GC_PRIVATE_H) extern ptr_t GC_data_start;# endif# ifndef CLEAR_DOUBLE# define CLEAR_DOUBLE(x) \ ((word*)x)[0] = 0; \ ((word*)x)[1] = 0;# endif /* CLEAR_DOUBLE *//* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */# if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)# define GC_SOLARIS_THREADS# endif# if defined(GC_IRIX_THREADS) && !defined(IRIX5)--> inconsistent configuration# endif# if defined(GC_LINUX_THREADS) && !defined(LINUX)--> inconsistent configuration# endif# if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)--> inconsistent configuration# endif# if defined(GC_HPUX_THREADS) && !defined(HPUX)--> inconsistent configuration# endif# if defined(GC_WIN32_THREADS) && !defined(MSWIN32) /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect */ /* the necessary code is mostly there, but nobody has actually made */ /* sure the right combination of pieces is compiled in, etc. */--> inconsistent configuration# endif# if defined(PCR) || defined(SRC_M3) || \ defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \ defined(GC_PTHREADS)# define THREADS# endif# if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(MACOSX) \ || defined(LINT) || defined(MSWINCE) \ || (defined(I386) && defined(__LCC__)) /* Use setjmp based hack to mark from callee-save registers. */ /* The define should move to the individual platform */ /* descriptions. */# define USE_GENERIC_PUSH_REGS# endif# if defined(SPARC)# define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */ /* include assembly code to do it well. */# endif/* Can we save call chain in objects for debugging? *//* SET NFRAMES (# of saved frames) and NARGS (#of args for each frame) *//* to reasonable values for the platform. *//* Set SAVE_CALL_CHAIN if we can. SAVE_CALL_COUNT can be specified at *//* build time, though we feel free to adjust it slightly. *//* Define NEED_CALLINFO if we either save the call stack or *//* GC_ADD_CALLER is defined. */#ifdef LINUX# include <features.h># if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2# define HAVE_BUILTIN_BACKTRACE# endif#endif#if defined(SPARC)# define CAN_SAVE_CALL_STACKS# define CAN_SAVE_CALL_ARGS#endif#if (defined(I386) || defined(X86_64)) && defined(LINUX) /* SAVE_CALL_CHAIN is supported if the code is compiled to save */ /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */# define CAN_SAVE_CALL_STACKS# define CAN_SAVE_CALL_ARGS#endif#if defined(HAVE_BUILTIN_BACKTRACE) && !defined(CAN_SAVE_CALL_STACKS)# define CAN_SAVE_CALL_STACKS#endif# if defined(SAVE_CALL_COUNT) && !defined(GC_ADD_CALLER) \ && defined(CAN_SAVE_CALL_STACKS)# define SAVE_CALL_CHAIN # endif# ifdef SAVE_CALL_CHAIN# if defined(SAVE_CALL_NARGS) && defined(CAN_SAVE_CALL_ARGS)# define NARGS SAVE_CALL_NARGS# else# define NARGS 0 /* Number of arguments to save for each call. */# endif# endif# ifdef SAVE_CALL_CHAIN# ifndef SAVE_CALL_COUNT# define NFRAMES 6 /* Number of frames to save. Even for */ /* alignment reasons. */# else# define NFRAMES ((SAVE_CALL_COUNT + 1) & ~1)# endif# define NEED_CALLINFO# endif /* SAVE_CALL_CHAIN */# ifdef GC_ADD_CALLER# define NFRAMES 1# define NARGS 0# define NEED_CALLINFO# endif# if defined(MAKE_BACK_GRAPH) && !defined(DBG_HDRS_ALL)# define DBG_HDRS_ALL# endif# endif /* GCCONFIG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -