2 * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
3 * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
4 * Copyright (c) 1996 by Silicon Graphics. All rights reserved.
5 * Copyright (c) 2000 by Hewlett-Packard Company. All rights reserved.
7 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
10 * Permission is hereby granted to use or copy this program
11 * for any purpose, provided the above notices are retained on all copies.
12 * Permission to modify the code and to distribute modified code is granted,
13 * provided the above notices are retained, and a notice that the code was
14 * modified is included with the above copyright notice.
21 /* Machine dependent parameters. Some tuning parameters can be found */
22 /* near the top of gc_private.h. */
24 /* Machine specific parts contributed by various people. See README file. */
26 /* First a unified test for Linux: */
27 # if defined(linux) || defined(__linux__)
31 /* And one for NetBSD: */
32 # if defined(__NetBSD__)
36 /* And one for OpenBSD: */
37 # if defined(__OpenBSD__)
41 /* Determine the machine type: */
42 # if defined(sun) && defined(mc68000)
45 # define mach_type_known
47 # if defined(hp9000s300)
50 # define mach_type_known
52 # if defined(OPENBSD) && defined(m68k)
54 # define mach_type_known
56 # if defined(OPENBSD) && defined(__sparc__)
58 # define mach_type_known
60 # if defined(NETBSD) && defined(m68k)
62 # define mach_type_known
64 # if defined(NETBSD) && defined(__powerpc__)
66 # define mach_type_known
68 # if defined(NETBSD) && defined(__arm32__)
70 # define mach_type_known
79 # define mach_type_known
81 # if defined(mips) || defined(__mips)
84 # if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
87 # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \
88 || defined(__SYSTYPE_SVR4__)
89 # define IRIX5 /* or IRIX 6.X */
91 # define RISCOS /* or IRIX 4.X */
95 # if defined(__NetBSD__) && defined(__MIPSEL__)
98 # define mach_type_known
100 # if defined(sequent) && (defined(i386) || defined(__i386__))
103 # define mach_type_known
105 # if defined(sun) && (defined(i386) || defined(__i386__))
108 # define mach_type_known
110 # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
113 # define mach_type_known
117 # define mach_type_known
119 # if defined(sun) && (defined(sparc) || defined(__sparc))
121 /* Test for SunOS 5.x */
128 # define mach_type_known
130 # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
131 && !defined(__OpenBSD__) && !(__NetBSD__)
134 # define mach_type_known
138 # define mach_type_known
140 # if defined(__NetBSD__) && defined(__sparc__)
142 # define mach_type_known
144 # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
145 /* The above test may need refinement */
147 # if defined(_SCO_ELF)
152 # define mach_type_known
154 # if defined(_AUX_SOURCE)
157 # define mach_type_known
159 # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
160 || defined(hppa) || defined(__hppa__)
165 # define mach_type_known
167 # if defined(__ia64) && defined(_HPUX_SOURCE)
170 # define mach_type_known
172 # if defined(__BEOS__) && defined(_X86_)
175 # define mach_type_known
177 # if defined(LINUX) && (defined(i386) || defined(__i386__))
179 # define mach_type_known
181 # if defined(LINUX) && (defined(__ia64__) || defined(__ia64))
183 # define mach_type_known
185 # if defined(LINUX) && (defined(powerpc) || defined(__powerpc__))
187 # define mach_type_known
189 # if defined(LINUX) && defined(__mc68000__)
191 # define mach_type_known
193 # if defined(LINUX) && (defined(sparc) || defined(__sparc__))
195 # define mach_type_known
197 # if defined(LINUX) && defined(__arm__)
199 # define mach_type_known
201 # if defined(LINUX) && defined(__sh__)
203 # define mach_type_known
205 # if defined(__alpha) || defined(__alpha__)
207 # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD)
208 # define OSF1 /* a.k.a Digital Unix */
210 # define mach_type_known
212 # if defined(_AMIGA) && !defined(AMIGA)
217 # define mach_type_known
219 # if defined(THINK_C) || defined(__MWERKS__) && !defined(__powerc)
222 # define mach_type_known
224 # if defined(__MWERKS__) && defined(__powerc)
227 # define mach_type_known
229 # if defined(macosx) || \
230 defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
233 # define mach_type_known
235 # if defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
238 --> Not really supported, but at least we recognize it.
240 # if defined(NeXT) && defined(mc68000)
243 # define mach_type_known
245 # if defined(NeXT) && (defined(i386) || defined(__i386__))
248 # define mach_type_known
250 # if defined(__OpenBSD__) && (defined(i386) || defined(__i386__))
253 # define mach_type_known
255 # if defined(__FreeBSD__) && (defined(i386) || defined(__i386__))
258 # define mach_type_known
260 # if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
262 # define mach_type_known
264 # if defined(bsdi) && (defined(i386) || defined(__i386__))
267 # define mach_type_known
269 # if !defined(mach_type_known) && defined(__386BSD__)
272 # define mach_type_known
274 # if defined(_CX_UX) && defined(_M88K)
277 # define mach_type_known
282 # define mach_type_known
284 # if defined(_WIN32_WCE)
285 /* SH3, SH4, MIPS already defined for corresponding architectures */
286 # if defined(SH3) || defined(SH4)
296 # define mach_type_known
298 # if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
299 || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
301 # define MSWIN32 /* or Win32s */
302 # define mach_type_known
305 # if defined(__DJGPP__)
308 # define DJGPP /* MSDOS running the DJGPP port of GCC */
310 # define mach_type_known
312 # if defined(__CYGWIN32__) || defined(__CYGWIN__)
315 # define mach_type_known
317 # if defined(__MINGW32__)
320 # define mach_type_known
322 # if defined(__BORLANDC__)
325 # define mach_type_known
327 # if defined(_UTS) && !defined(mach_type_known)
330 # define mach_type_known
334 # define mach_type_known
336 # if defined(__embedded__) && defined(PPC)
339 # define mach_type_known
342 # if defined(__WATCOMC__) && defined(__386__)
344 # if !defined(OS2) && !defined(MSWIN32) && !defined(DOS4GW)
345 # if defined(__OS2__)
348 # if defined(__WINDOWS_386__) || defined(__NT__)
355 # define mach_type_known
357 # if defined(__s390__) && defined(LINUX)
359 # define mach_type_known
361 # if defined(__GNU__)
362 # if defined(__i386__)
363 /* The Debian Hurd running on generic PC */
366 # define mach_type_known
370 /* Feel free to add more clauses here */
372 /* Or manually define the machine type here. A machine type is */
373 /* characterized by the architecture. Some */
374 /* machine types are further subdivided by OS. */
375 /* the macros ULTRIX, RISCOS, and BSD to distinguish. */
376 /* Note that SGI IRIX is treated identically to RISCOS. */
377 /* SYSV on an M68K actually means A/UX. */
378 /* The distinction in these cases is usually the stack starting address */
379 # ifndef mach_type_known
380 --> unknown machine type
382 /* Mapping is: M68K ==> Motorola 680X0 */
383 /* (SUNOS4,HP,NEXT, and SYSV (A/UX), */
384 /* MACOS and AMIGA variants) */
385 /* I386 ==> Intel 386 */
386 /* (SEQUENT, OS2, SCO, LINUX, NETBSD, */
387 /* FREEBSD, THREE86BSD, MSWIN32, */
388 /* BSDI,SUNOS5, NEXT, other variants) */
389 /* NS32K ==> Encore Multimax */
390 /* MIPS ==> R2000 or R3000 */
391 /* (RISCOS, ULTRIX variants) */
392 /* VAX ==> DEC VAX */
393 /* (BSD, ULTRIX variants) */
394 /* RS6000 ==> IBM RS/6000 AIX3.X */
395 /* RT ==> IBM PC/RT */
396 /* HP_PA ==> HP9000/700 & /800 */
398 /* SPARC ==> SPARC v7/v8/v9 */
399 /* (SUNOS4, SUNOS5, LINUX, */
400 /* DRSNX variants) */
401 /* ALPHA ==> DEC Alpha */
402 /* (OSF1 and LINUX variants) */
403 /* M88K ==> Motorola 88XX0 */
404 /* (CX_UX and DGUX) */
405 /* S370 ==> 370-like machine */
406 /* running Amdahl UTS4 */
407 /* or a 390 running LINUX */
408 /* ARM32 ==> Intel StrongARM */
409 /* IA64 ==> Intel IPF */
411 /* (LINUX and HPUX) */
412 /* IA64_32 ==> IA64 w/32 bit ABI */
414 /* SH ==> Hitachi SuperH */
415 /* (LINUX & MSWINCE) */
419 * For each architecture and OS, the following need to be defined:
421 * CPP_WORD_SZ is a simple integer constant representing the word size.
422 * in bits. We assume byte addressibility, where a byte has 8 bits.
423 * We also assume CPP_WORD_SZ is either 32 or 64.
424 * (We care about the length of pointers, not hardware
425 * bus widths. Thus a 64 bit processor with a C compiler that uses
426 * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
428 * MACH_TYPE is a string representation of the machine type.
429 * OS_TYPE is analogous for the OS.
431 * ALIGNMENT is the largest N, such that
432 * all pointer are guaranteed to be aligned on N byte boundaries.
433 * defining it to be 1 will always work, but perform poorly.
435 * DATASTART is the beginning of the data segment.
436 * On UNIX systems, the collector will scan the area between DATASTART
437 * and DATAEND for root pointers.
439 * DATAEND, if not &end.
441 * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
444 * STACKBOTTOM is the cool end of the stack, which is usually the
445 * highest address in the stack.
446 * Under PCR or OS/2, we have other ways of finding thread stacks.
447 * For each machine, the following should:
448 * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
449 * 2) define exactly one of
450 * STACKBOTTOM (should be defined to be an expression)
453 * If either of the last two macros are defined, then STACKBOTTOM is computed
454 * during collector startup using one of the following two heuristics:
455 * HEURISTIC1: Take an address inside GC_init's frame, and round it up to
456 * the next multiple of STACK_GRAN.
457 * HEURISTIC2: Take an address inside GC_init's frame, increment it repeatedly
458 * in small steps (decrement if STACK_GROWS_UP), and read the value
459 * at each location. Remember the value when the first
460 * Segmentation violation or Bus error is signalled. Round that
461 * to the nearest plausible page boundary, and use that instead
464 * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines,
465 * the value of environ is a pointer that can serve as STACKBOTTOM.
466 * I expect that HEURISTIC2 can be replaced by this approach, which
467 * interferes far less with debugging. However it has the disadvantage
468 * that it's confused by a putenv call before the collector is initialized.
469 * This could be dealt with by intercepting putenv ...
471 * If no expression for STACKBOTTOM can be found, and neither of the above
472 * heuristics are usable, the collector can still be used with all of the above
473 * undefined, provided one of the following is done:
474 * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s)
475 * without reference to STACKBOTTOM. This is appropriate for use in
476 * conjunction with thread packages, since there will be multiple stacks.
477 * (Allocating thread stacks in the heap, and treating them as ordinary
478 * heap data objects is also possible as a last resort. However, this is
479 * likely to introduce significant amounts of excess storage retention
480 * unless the dead parts of the thread stacks are periodically cleared.)
481 * 2) Client code may set GC_stackbottom before calling any GC_ routines.
482 * If the author of the client code controls the main program, this is
483 * easily accomplished by introducing a new main program, setting
484 * GC_stackbottom to the address of a local variable, and then calling
485 * the original main program. The new main program would read something
488 * # include "gc_private.h"
490 * main(argc, argv, envp)
492 * char **argv, **envp;
496 * GC_stackbottom = (ptr_t)(&dummy);
497 * return(real_main(argc, argv, envp));
501 * Each architecture may also define the style of virtual dirty bit
502 * implementation to be used:
503 * MPROTECT_VDB: Write protect the heap and catch faults.
504 * PROC_VDB: Use the SVR4 /proc primitives to read dirty bits.
506 * An architecture may define DYNAMIC_LOADING if dynamic_load.c
507 * defined GC_register_dynamic_libraries() for the architecture.
509 * An architecture may define PREFETCH(x) to preload the cache with *x.
510 * This defaults to a no-op.
512 * PREFETCH_FOR_WRITE(x) is used if *x is about to be written.
514 * An architecture may also define CLEAR_DOUBLE(x) to be a fast way to
515 * clear the two words at GC_malloc-aligned address x. By default,
516 * word stores of 0 are used instead.
519 /* If we are using a recent version of gcc, we can use __builtin_unwind_init()
520 * to push the relevant registers onto the stack. This generally makes
521 * USE_GENERIC_PUSH_REGS the preferred approach for marking from registers.
523 # if defined(__GNUC__) && ((__GNUC__ >= 3) || \
524 (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
525 # define HAVE_BUILTIN_UNWIND_INIT
528 # define STACK_GRAN 0x1000000
530 # define MACH_TYPE "M68K"
533 # define OS_TYPE "OPENBSD"
536 # define DATASTART ((ptr_t)(&etext))
539 # define OS_TYPE "NETBSD"
542 # define DATASTART ((ptr_t)(&etext))
545 # define OS_TYPE "LINUX"
546 # define STACKBOTTOM ((ptr_t)0xf0000000)
547 /* # define MPROTECT_VDB - Reported to not work 9/17/01 */
549 # define DYNAMIC_LOADING
550 # include <features.h>
551 # if defined(__GLIBC__)&& __GLIBC__>=2
552 # define LINUX_DATA_START
554 extern char **__environ;
555 # define DATASTART ((ptr_t)(&__environ))
556 /* hideous kludge: __environ is the first */
557 /* word in crt0.o, and delimits the start */
558 /* of the data segment, no matter which */
559 /* ld options were passed through. */
560 /* We could use _etext instead, but that */
561 /* would include .rodata, which may */
562 /* contain large read-only data tables */
563 /* that we'd rather not scan. */
564 # endif /* !GLIBC2 */
566 # define DATAEND (&_end)
569 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
573 # define OS_TYPE "SUNOS4"
575 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ffff) & ~0x1ffff))
576 # define HEURISTIC1 /* differs */
577 # define DYNAMIC_LOADING
580 # define OS_TYPE "HP"
582 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
583 # define STACKBOTTOM ((ptr_t) 0xffeffffc)
584 /* empirically determined. seems to work. */
586 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
589 # define OS_TYPE "SYSV"
591 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
593 +((word)&etext & 0x1fff))
594 /* This only works for shared-text binaries with magic number 0413.
595 The other sorts of SysV binaries put the data at the end of the text,
596 in which case the default of &etext would work. Unfortunately,
597 handling both would require having the magic-number available.
600 # define STACKBOTTOM ((ptr_t)0xFFFFFFFE)
601 /* The stack starts at the top of memory, but */
602 /* 0x0 cannot be used as setjump_test complains */
603 /* that the stack direction is incorrect. Two */
604 /* bytes down from 0x0 should be safe enough. */
606 # include <sys/mmu.h>
607 # define GETPAGESIZE() PAGESIZE /* Is this still right? */
610 # define OS_TYPE "AMIGA"
611 /* STACKBOTTOM and DATASTART handled specially */
613 # define DATAEND /* not needed */
614 # define GETPAGESIZE() 4096
620 # define OS_TYPE "MACOS"
621 /* see os_dep.c for details of global data segments. */
622 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
623 # define DATAEND /* not needed */
624 # define GETPAGESIZE() 4096
627 # define OS_TYPE "NEXT"
628 # define DATASTART ((ptr_t) get_etext())
629 # define STACKBOTTOM ((ptr_t) 0x4000000)
630 # define DATAEND /* not needed */
635 # define MACH_TYPE "POWERPC"
637 # define ALIGNMENT 2 /* Still necessary? Could it be 4? */
641 # define OS_TYPE "MACOS"
642 /* see os_dep.c for details of global data segments. */
643 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
644 # define DATAEND /* not needed */
647 # define ALIGNMENT 4 /* Guess. Can someone verify? */
648 /* This was 2, but that didn't sound right. */
649 # define OS_TYPE "LINUX"
651 # define DYNAMIC_LOADING
653 # define STACK_GRAN 0x10000000
654 /* Stack usually starts at 0x80000000 */
655 # define LINUX_DATA_START
657 # define DATAEND (&_end)
660 /* There are reasons to suspect this may not be reliable. */
662 # define OS_TYPE "MACOSX"
663 # define DATASTART ((ptr_t) get_etext())
664 # define STACKBOTTOM ((ptr_t) 0xc0000000)
665 # define DATAEND /* not needed */
666 # define MPROTECT_VDB
668 # define GETPAGESIZE() getpagesize()
672 # define OS_TYPE "NETBSD"
675 # define DATASTART GC_data_start
676 # define DYNAMIC_LOADING
680 # define OS_TYPE "NOSYS"
681 extern void __end, __dso_handle;
682 # define DATASTART (&__dso_handle) /* OK, that's ugly. */
683 # define DATAEND (&__end)
684 /* Stack starts at 0xE0000000 for the simulator. */
686 # define STACK_GRAN 0x10000000
692 # define MACH_TYPE "VAX"
693 # define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
695 # define DATASTART ((ptr_t)(&etext))
697 # define OS_TYPE "BSD"
699 /* HEURISTIC2 may be OK, but it's hard to test. */
702 # define OS_TYPE "ULTRIX"
703 # define STACKBOTTOM ((ptr_t) 0x7fffc800)
708 # define MACH_TYPE "RT"
710 # define DATASTART ((ptr_t) 0x10000000)
711 # define STACKBOTTOM ((ptr_t) 0x1fffd800)
715 # define MACH_TYPE "SPARC"
716 # if defined(__arch64__) || defined(__sparcv9)
718 # define CPP_WORDSZ 64
719 # define ELF_CLASS ELFCLASS64
721 # define ALIGNMENT 4 /* Required by hardware */
723 # define ALIGN_DOUBLE
725 # define OS_TYPE "SUNOS5"
728 extern char * GC_SysVGetDataStart();
729 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
730 # define DATAEND (&_end)
735 # define HEAP_START (ptr_t)0x40000000
737 # define HEAP_START DATAEND
740 /* HEURISTIC1 reportedly no longer works under 2.7. */
741 /* HEURISTIC2 probably works, but this appears to be preferable. */
742 /* Apparently USRSTACK is defined to be USERLIMIT, but in some */
743 /* installations that's undefined. We work around this with a */
745 # include <sys/vmparam.h>
747 /* This should work everywhere, but doesn't. */
748 # define STACKBOTTOM USRSTACK
753 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
754 /* getpagesize() appeared to be missing from at least one */
755 /* Solaris 5.4 installation. Weird. */
756 # define DYNAMIC_LOADING
759 # define OS_TYPE "SUNOS4"
760 /* [If you have a weak stomach, don't read this.] */
761 /* We would like to use: */
762 /* # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */
763 /* This fails occasionally, due to an ancient, but very */
764 /* persistent ld bug. &etext is set 32 bytes too high. */
765 /* We instead read the text segment size from the a.out */
766 /* header, which happens to be mapped into our address space */
767 /* at the start of the text segment. The detective work here */
768 /* was done by Robert Ehrlich, Manuel Serrano, and Bernard */
769 /* Serpette of INRIA. */
770 /* This assumes ZMAGIC, i.e. demand-loadable executables. */
771 # define TEXTSTART 0x2000
772 # define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
773 # define MPROTECT_VDB
775 # define DYNAMIC_LOADING
778 # define CPP_WORDSZ 32
779 # define OS_TYPE "DRSNX"
780 extern char * GC_SysVGetDataStart();
782 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
783 # define MPROTECT_VDB
784 # define STACKBOTTOM ((ptr_t) 0xdfff0000)
785 # define DYNAMIC_LOADING
788 # define OS_TYPE "LINUX"
790 # define DYNAMIC_LOADING
792 Linux Sparc/a.out not supported
796 # define DATAEND (&_end)
799 # define STACKBOTTOM ((ptr_t) 0x80000000000ULL)
800 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, &_etext)
801 # define CPP_WORDSZ 64
803 # define STACKBOTTOM ((ptr_t) 0xf0000000)
804 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
808 # define OS_TYPE "OPENBSD"
809 # define STACKBOTTOM ((ptr_t) 0xf8000000)
811 # define DATASTART ((ptr_t)(&etext))
814 # define OS_TYPE "NETBSD"
817 # define DATASTART GC_data_start
818 # define DYNAMIC_LOADING
821 # define DATASTART ((ptr_t)(&etext))
827 # define MACH_TYPE "I386"
828 # define ALIGNMENT 4 /* Appears to hold for all "32 bit" compilers */
829 /* except Borland. The -a4 option fixes */
831 /* Ivan Demakov: For Watcom the option is -zp4. */
832 # ifndef SMALL_CONFIG
833 # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
834 /* improvement on Pentiums. */
836 # ifdef HAVE_BUILTIN_UNWIND_INIT
837 # define USE_GENERIC_PUSH_REGS
840 # define OS_TYPE "SEQUENT"
842 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
843 # define STACKBOTTOM ((ptr_t) 0x3ffff000)
846 # define OS_TYPE "BEOS"
848 # define GETPAGESIZE() B_PAGE_SIZE
850 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
853 # define OS_TYPE "SUNOS5"
854 extern int _etext, _end;
855 extern char * GC_SysVGetDataStart();
856 # define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
857 # define DATAEND (&_end)
858 /* # define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7, */
859 /* but reportedly breaks under 2.8. It appears that the stack */
860 /* base is a property of the executable, so this should not break */
861 /* old executables. */
862 /* HEURISTIC2 probably works, but this appears to be preferable. */
863 # include <sys/vmparam.h>
864 # define STACKBOTTOM USRSTACK
865 /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
866 # ifdef SOLARIS25_PROC_VDB_BUG_FIXED
869 # define DYNAMIC_LOADING
874 # define HEAP_START (ptr_t)0x40000000
876 # define HEAP_START DATAEND
880 # define OS_TYPE "SCO"
882 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
884 +((word)&etext & 0xfff))
885 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
888 # define OS_TYPE "SCO_ELF"
890 # define DATASTART ((ptr_t)(&etext))
891 # define STACKBOTTOM ((ptr_t) 0x08048000)
892 # define DYNAMIC_LOADING
893 # define ELF_CLASS ELFCLASS32
896 # define OS_TYPE "LINUX"
897 # define LINUX_STACKBOTTOM
901 # define STACK_GRAN 0x10000000
902 /* STACKBOTTOM is usually 0xc0000000, but this changes with */
903 /* different kernel configurations. In particular, systems */
904 /* with 2GB physical memory will usually move the user */
905 /* address space limit, and hence initial SP to 0x80000000. */
907 # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)
908 # define MPROTECT_VDB
910 /* We seem to get random errors in incremental mode, */
911 /* possibly because Linux threads is itself a malloc client */
912 /* and can't deal with the signals. */
915 # define DYNAMIC_LOADING
916 # ifdef UNDEFINED /* includes ro data */
918 # define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
920 # include <features.h>
921 # if defined(__GLIBC__) && __GLIBC__ >= 2
922 # define LINUX_DATA_START
924 extern char **__environ;
925 # define DATASTART ((ptr_t)(&__environ))
926 /* hideous kludge: __environ is the first */
927 /* word in crt0.o, and delimits the start */
928 /* of the data segment, no matter which */
929 /* ld options were passed through. */
930 /* We could use _etext instead, but that */
931 /* would include .rodata, which may */
932 /* contain large read-only data tables */
933 /* that we'd rather not scan. */
936 # define DATAEND (&_end)
939 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
941 # ifdef USE_I686_PREFETCH
942 # define PREFETCH(x) \
943 __asm__ __volatile__ (" prefetchnta %0": : "m"(*(char *)(x)))
944 /* Empirically prefetcht0 is much more effective at reducing */
945 /* cache miss stalls for the targetted load instructions. But it */
946 /* seems to interfere enough with other cache traffic that the net */
947 /* result is worse than prefetchnta. */
949 /* Using prefetches for write seems to have a slight negative */
950 /* impact on performance, at least for a PIII/500. */
951 # define PREFETCH_FOR_WRITE(x) \
952 __asm__ __volatile__ (" prefetcht0 %0": : "m"(*(char *)(x)))
955 # ifdef USE_3DNOW_PREFETCH
956 # define PREFETCH(x) \
957 __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))
958 # define PREFETCH_FOR_WRITE(x) \
959 __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))
963 # define OS_TYPE "CYGWIN32"
964 extern int _data_start__;
965 extern int _data_end__;
966 extern int _bss_start__;
967 extern int _bss_end__;
968 /* For binutils 2.9.1, we have */
969 /* DATASTART = _data_start__ */
970 /* DATAEND = _bss_end__ */
971 /* whereas for some earlier versions it was */
972 /* DATASTART = _bss_start__ */
973 /* DATAEND = _data_end__ */
974 /* To get it right for both, we take the */
975 /* minumum/maximum of the two. */
976 # define MAX(x,y) ((x) > (y) ? (x) : (y))
977 # define MIN(x,y) ((x) < (y) ? (x) : (y))
978 # define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
979 # define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__))
981 # define STACK_GRAN 0x10000
985 # define OS_TYPE "OS2"
986 /* STACKBOTTOM and DATASTART are handled specially in */
987 /* os_dep.c. OS2 actually has the right */
989 # define DATAEND /* not needed */
990 # define USE_GENERIC_PUSH_REGS
993 # define OS_TYPE "MSWIN32"
994 /* STACKBOTTOM and DATASTART are handled specially in */
997 # define MPROTECT_VDB
999 # define DATAEND /* not needed */
1002 # define OS_TYPE "MSWINCE"
1003 # define DATAEND /* not needed */
1006 # define OS_TYPE "DJGPP"
1007 # include "stubinfo.h"
1010 extern int __djgpp_stack_limit;
1011 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
1012 /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
1014 # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
1015 /* This may not be right. */
1018 # define OS_TYPE "OPENBSD"
1021 # define OS_TYPE "FREEBSD"
1022 # ifndef GC_FREEBSD_THREADS
1023 # define MPROTECT_VDB
1025 # define SIG_SUSPEND SIGUSR1
1026 # define SIG_THR_RESTART SIGUSR2
1027 # define FREEBSD_STACKBOTTOM
1029 # define DYNAMIC_LOADING
1033 # define OS_TYPE "NETBSD"
1036 # define OS_TYPE "THREE86BSD"
1039 # define OS_TYPE "BSDI"
1041 # if defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1042 || defined(THREE86BSD) || defined(BSDI)
1045 # define DATASTART ((ptr_t)(&etext))
1048 # define OS_TYPE "NEXT"
1049 # define DATASTART ((ptr_t) get_etext())
1050 # define STACKBOTTOM ((ptr_t)0xc0000000)
1051 # define DATAEND /* not needed */
1054 # define OS_TYPE "DOS4GW"
1055 extern long __nullarea;
1057 extern char *_STACKTOP;
1058 /* Depending on calling conventions Watcom C either precedes
1059 or does not precedes with undescore names of C-variables.
1060 Make sure startup code variables always have the same names. */
1061 #pragma aux __nullarea "*";
1062 #pragma aux _end "*";
1063 # define STACKBOTTOM ((ptr_t) _STACKTOP)
1064 /* confused? me too. */
1065 # define DATASTART ((ptr_t) &__nullarea)
1066 # define DATAEND ((ptr_t) &_end)
1069 # define OS_TYPE "HURD"
1070 # define STACK_GROWS_DOWN
1072 extern int __data_start;
1073 # define DATASTART ( (ptr_t) (&__data_start))
1075 # define DATAEND ( (ptr_t) (&_end))
1076 /* # define MPROTECT_VDB Not quite working yet? */
1077 # define DYNAMIC_LOADING
1082 # define MACH_TYPE "NS32K"
1083 # define ALIGNMENT 4
1084 extern char **environ;
1085 # define DATASTART ((ptr_t)(&environ))
1086 /* hideous kludge: environ is the first */
1087 /* word in crt0.o, and delimits the start */
1088 /* of the data segment, no matter which */
1089 /* ld options were passed through. */
1090 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
1094 # define MACH_TYPE "MIPS"
1096 /* This was developed for a linuxce style platform. Probably */
1097 /* needs to be tweaked for workstation class machines. */
1098 # define OS_TYPE "LINUX"
1099 extern int __data_start;
1100 # define DATASTART ((ptr_t)(&__data_start))
1101 # define ALIGNMENT 4
1102 # define USE_GENERIC_PUSH_REGS
1103 # define STACKBOTTOM ((ptr_t)0x7fff8000)
1104 /* Older toolchains may need 0x80000000. */
1105 /* In many cases, this should probably use LINUX_STACKBOTTOM */
1106 /* instead. But some kernel versions seem to give the wrong */
1107 /* value from /proc. */
1111 # define DATASTART (ptr_t)0x10000000
1112 /* Could probably be slightly higher since */
1113 /* startup code allocates lots of stuff. */
1114 # define OS_TYPE "ULTRIX"
1115 # define ALIGNMENT 4
1119 # define DATASTART (ptr_t)0x10000000
1120 # define OS_TYPE "RISCOS"
1121 # define ALIGNMENT 4 /* Required by hardware */
1126 # define DATASTART ((ptr_t)(&_fdata))
1128 # define HEAP_START (ptr_t)0x30000000
1130 # define HEAP_START DATASTART
1132 /* Lowest plausible heap address. */
1133 /* In the MMAP case, we map there. */
1134 /* In either case it is used to identify */
1135 /* heap sections so they're not */
1136 /* considered as roots. */
1137 # define OS_TYPE "IRIX5"
1138 # define MPROTECT_VDB
1140 # define CPP_WORDSZ _MIPS_SZPTR
1141 # define ALIGNMENT (_MIPS_SZPTR/8)
1142 # if CPP_WORDSZ != 64
1143 # define ALIGN_DOUBLE
1146 # define ALIGNMENT 4
1147 # define ALIGN_DOUBLE
1149 # define DYNAMIC_LOADING
1152 # define OS_TYPE "MSWINCE"
1153 # define ALIGNMENT 4
1154 # define DATAEND /* not needed */
1156 # if defined(NETBSD)
1157 /* This also checked for __MIPSEL__ . Why? NETBSD recognition */
1158 /* should be handled at the top of the file. */
1159 # define ALIGNMENT 4
1160 # define OS_TYPE "NETBSD"
1162 # define USE_GENERIC_PUSH_REGS
1165 # define DATASTART GC_data_start
1166 # define NEED_FIND_LIMIT
1167 # define DYNAMIC_LOADING
1169 # define DATASTART ((ptr_t) 0x10000000)
1170 # define STACKBOTTOM ((ptr_t) 0x7ffff000)
1176 # define MACH_TYPE "RS6000"
1177 # define ALIGNMENT 4
1178 # define DATASTART ((ptr_t)0x20000000)
1180 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
1181 # define DYNAMIC_LOADING
1182 /* For really old versions of AIX, this may have to be removed. */
1186 # define MACH_TYPE "HP_PA"
1188 # define CPP_WORDSZ 64
1189 # define ALIGNMENT 8
1191 # define CPP_WORDSZ 32
1192 # define ALIGNMENT 4
1193 # define ALIGN_DOUBLE
1195 # if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)
1196 # ifndef LINUX /* For now. */
1197 # define MPROTECT_VDB
1200 # define GENERIC_COMPARE_AND_SWAP
1201 /* No compare-and-swap instruction. Use pthread mutexes */
1202 /* when we absolutely have to. */
1203 # ifdef PARALLEL_MARK
1204 # define USE_MARK_BYTES
1205 /* Minimize compare-and-swap usage. */
1208 # define STACK_GROWS_UP
1210 # define OS_TYPE "HPUX"
1211 extern int __data_start;
1212 # define DATASTART ((ptr_t)(&__data_start))
1214 /* The following appears to work for 7xx systems running HP/UX */
1215 /* 9.xx Furthermore, it might result in much faster */
1216 /* collections than HEURISTIC2, which may involve scanning */
1217 /* segments that directly precede the stack. It is not the */
1218 /* default, since it may not work on older machine/OS */
1219 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
1221 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
1223 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1224 /* to this. Note that the GC must be initialized before the */
1225 /* first putenv call. */
1226 extern char ** environ;
1227 # define STACKBOTTOM ((ptr_t)environ)
1229 # define DYNAMIC_LOADING
1230 # include <unistd.h>
1231 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1233 # define PREFETCH(x) { \
1234 register long addr = (long)(x); \
1235 (void) _asm ("LDW", 0, 0, addr, 0); \
1240 # define OS_TYPE "LINUX"
1241 # define LINUX_STACKBOTTOM
1242 # define DYNAMIC_LOADING
1243 # define LINUX_DATA_START
1245 # define DATAEND (&_end)
1250 # define MACH_TYPE "ALPHA"
1251 # define ALIGNMENT 8
1253 # define OS_TYPE "NETBSD"
1255 # define DATASTART GC_data_start
1256 # define ELFCLASS32 32
1257 # define ELFCLASS64 64
1258 # define ELF_CLASS ELFCLASS64
1259 # define CPP_WORDSZ 64
1260 # define DYNAMIC_LOADING
1263 # define OS_TYPE "OPENBSD"
1265 # define CPP_WORDSZ 64
1266 # ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
1267 # define DATASTART GC_data_start
1268 # define ELFCLASS32 32
1269 # define ELFCLASS64 64
1270 # define ELF_CLASS ELFCLASS64
1271 # else /* ECOFF, until OpenBSD/Alpha 2.7 */
1272 # define DATASTART ((ptr_t) 0x140000000)
1276 # define OS_TYPE "OSF1"
1277 # define DATASTART ((ptr_t) 0x140000000)
1279 # define DATAEND ((ptr_t) &_end)
1280 extern char ** environ;
1281 /* round up from the value of environ to the nearest page boundary */
1282 /* Probably breaks if putenv is called before collector */
1283 /* initialization. */
1284 # define STACKBOTTOM ((ptr_t)(((word)(environ) | (getpagesize()-1))+1))
1285 /* # define HEURISTIC2 */
1286 /* Normally HEURISTIC2 is too conervative, since */
1287 /* the text segment immediately follows the stack. */
1288 /* Hence we give an upper pound. */
1289 /* This is currently unused, since we disabled HEURISTIC2 */
1291 # define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
1292 # define CPP_WORDSZ 64
1293 # define MPROTECT_VDB
1294 # define DYNAMIC_LOADING
1297 # define OS_TYPE "LINUX"
1298 # define CPP_WORDSZ 64
1299 # define STACKBOTTOM ((ptr_t) 0x120000000)
1301 # define SEARCH_FOR_DATA_START
1302 # define DATASTART GC_data_start
1303 # define DYNAMIC_LOADING
1305 # define DATASTART ((ptr_t) 0x140000000)
1308 # define DATAEND (&_end)
1309 # define MPROTECT_VDB
1310 /* Has only been superficially tested. May not */
1311 /* work on all versions. */
1316 # define MACH_TYPE "IA64"
1317 # define USE_GENERIC_PUSH_REGS
1318 /* We need to get preserved registers in addition to register */
1319 /* windows. That's easiest to do with setjmp. */
1320 # ifdef PARALLEL_MARK
1321 # define USE_MARK_BYTES
1322 /* Compare-and-exchange is too expensive to use for */
1323 /* setting mark bits. */
1327 # define CPP_WORDSZ 32
1328 # define ALIGN_DOUBLE
1329 /* Requires 8 byte alignment for malloc */
1330 # define ALIGNMENT 4
1335 # define CPP_WORDSZ 64
1336 # define ALIGN_DOUBLE
1337 /* Requires 16 byte alignment for malloc */
1338 # define ALIGNMENT 8
1340 # define OS_TYPE "HPUX"
1341 extern int __data_start;
1342 # define DATASTART ((ptr_t)(&__data_start))
1343 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1344 /* to this. Note that the GC must be initialized before the */
1345 /* first putenv call. */
1346 extern char ** environ;
1347 # define STACKBOTTOM ((ptr_t)environ)
1348 # define DYNAMIC_LOADING
1349 # include <unistd.h>
1350 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1351 /* The following was empirically determined, and is probably */
1352 /* not very robust. */
1353 /* Note that the backing store base seems to be at a nice */
1354 /* address minus one page. */
1355 # define BACKING_STORE_DISPLACEMENT 0x1000000
1356 # define BACKING_STORE_ALIGNMENT 0x1000
1357 # define BACKING_STORE_BASE \
1358 (ptr_t)(((word)GC_stackbottom - BACKING_STORE_DISPLACEMENT - 1) \
1359 & ~(BACKING_STORE_ALIGNMENT - 1))
1362 # define CPP_WORDSZ 64
1363 # define ALIGN_DOUBLE
1364 /* Requires 16 byte alignment for malloc */
1365 # define ALIGNMENT 8
1366 # define OS_TYPE "LINUX"
1367 /* The following works on NUE and older kernels: */
1368 /* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
1369 /* This does not work on NUE: */
1370 # define LINUX_STACKBOTTOM
1371 /* We also need the base address of the register stack */
1372 /* backing store. This is computed in */
1373 /* GC_linux_register_stack_base based on the following */
1375 # define BACKING_STORE_ALIGNMENT 0x100000
1376 # define BACKING_STORE_DISPLACEMENT 0x80000000
1377 extern char * GC_register_stackbottom;
1378 # define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)
1379 # define SEARCH_FOR_DATA_START
1380 # define DATASTART GC_data_start
1381 # define DYNAMIC_LOADING
1382 # define MPROTECT_VDB
1383 /* Requires Linux 2.3.47 or later. */
1385 # define DATAEND (&_end)
1387 # define PREFETCH(x) \
1388 __asm__ (" lfetch [%0]": : "r"((void *)(x)))
1389 # define PREFETCH_FOR_WRITE(x) \
1390 __asm__ (" lfetch.excl [%0]": : "r"((void *)(x)))
1391 # define CLEAR_DOUBLE(x) \
1392 __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))
1398 # define MACH_TYPE "M88K"
1399 # define ALIGNMENT 4
1400 # define ALIGN_DOUBLE
1403 # define OS_TYPE "CX_UX"
1404 # define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
1407 # define OS_TYPE "DGUX"
1408 extern char * GC_SysVGetDataStart();
1409 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
1411 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
1415 # define MACH_TYPE "S370"
1416 # define ALIGNMENT 4 /* Required by hardware */
1417 # define USE_GENERIC_PUSH_REGS
1419 # define OS_TYPE "UTS4"
1423 extern char * GC_SysVGetDataStart();
1424 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
1425 # define DATAEND (&_end)
1429 # define OS_TYPE "LINUX"
1431 # define DYNAMIC_LOADING
1432 extern int __data_start;
1433 # define DATASTART ((ptr_t)(&__data_start))
1438 # define ALIGNMENT 4
1440 # define DATASTART ((ptr_t)(&_etext))
1445 # define CPP_WORDSZ 32
1446 # define MACH_TYPE "ARM32"
1447 # define ALIGNMENT 4
1449 # define OS_TYPE "NETBSD"
1452 # define DATASTART ((ptr_t)(&etext))
1453 # define USE_GENERIC_PUSH_REGS
1456 # define OS_TYPE "LINUX"
1459 # define STACK_GRAN 0x10000000
1460 # define USE_GENERIC_PUSH_REGS
1462 # define DYNAMIC_LOADING
1463 # include <features.h>
1464 # if defined(__GLIBC__) && __GLIBC__ >= 2
1465 # define LINUX_DATA_START
1467 extern char **__environ;
1468 # define DATASTART ((ptr_t)(&__environ))
1469 /* hideous kludge: __environ is the first */
1470 /* word in crt0.o, and delimits the start */
1471 /* of the data segment, no matter which */
1472 /* ld options were passed through. */
1473 /* We could use _etext instead, but that */
1474 /* would include .rodata, which may */
1475 /* contain large read-only data tables */
1476 /* that we'd rather not scan. */
1479 # define DATAEND (&_end)
1482 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
1486 # define OS_TYPE "MSWINCE"
1487 # define DATAEND /* not needed */
1492 # define MACH_TYPE "SH"
1493 # define ALIGNMENT 4
1495 # define OS_TYPE "MSWINCE"
1496 # define DATAEND /* not needed */
1499 # define OS_TYPE "LINUX"
1500 # define STACKBOTTOM ((ptr_t) 0x7c000000)
1501 # define USE_GENERIC_PUSH_REGS
1502 # define DYNAMIC_LOADING
1503 # define LINUX_DATA_START
1505 # define DATAEND (&_end)
1510 # define MACH_TYPE "SH4"
1511 # define OS_TYPE "MSWINCE"
1512 # define ALIGNMENT 4
1513 # define DATAEND /* not needed */
1516 #ifdef LINUX_DATA_START
1517 /* Some Linux distributions arrange to define __data_start. Some */
1518 /* define data_start as a weak symbol. The latter is technically */
1519 /* broken, since the user program may define data_start, in which */
1520 /* case we lose. Nonetheless, we try both, prefering __data_start. */
1521 /* We assume gcc. */
1522 # pragma weak __data_start
1523 extern int __data_start;
1524 # pragma weak data_start
1525 extern int data_start;
1526 # define DATASTART ((ptr_t)(&__data_start != 0? &__data_start : &data_start))
1529 #if defined(LINUX) && defined(REDIRECT_MALLOC)
1530 /* Rld appears to allocate some memory with its own allocator, and */
1531 /* some through malloc, which might be redirected. To make this */
1532 /* work with collectable memory, we have to scan memory allocated */
1533 /* by rld's internal malloc. */
1534 # define USE_PROC_FOR_LIBRARIES
1537 # ifndef STACK_GROWS_UP
1538 # define STACK_GROWS_DOWN
1542 # define CPP_WORDSZ 32
1551 # define DATAEND (&end)
1554 # if defined(SVR4) && !defined(GETPAGESIZE)
1555 # include <unistd.h>
1556 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
1559 # ifndef GETPAGESIZE
1560 # if defined(SUNOS5) || defined(IRIX5)
1561 # include <unistd.h>
1563 # define GETPAGESIZE() getpagesize()
1566 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
1567 /* OS has SVR4 generic features. Probably others also qualify. */
1571 # if defined(SUNOS5) || defined(DRSNX)
1572 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
1575 /* OS has SUNOS5 style signal handlers. */
1583 # if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \
1584 || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1585 || defined(BSD) || defined(AIX) || defined(MACOSX) || defined(OSF1)
1586 # define UNIX_LIKE /* Basic Unix-like system calls work. */
1589 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
1594 # undef DYNAMIC_LOADING
1599 # undef MPROTECT_VDB
1604 /* Postponed for now. */
1606 # undef MPROTECT_VDB
1609 # ifdef SMALL_CONFIG
1610 /* Presumably not worth the space it takes. */
1612 # undef MPROTECT_VDB
1616 # undef MPROTECT_VDB /* Can't deal with address space holes. */
1619 # ifdef PARALLEL_MARK
1620 # undef MPROTECT_VDB /* For now. */
1623 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
1624 # define DEFAULT_VDB
1628 # define PREFETCH(x)
1629 # define NO_PREFETCH
1632 # ifndef PREFETCH_FOR_WRITE
1633 # define PREFETCH_FOR_WRITE(x)
1634 # define NO_PREFETCH_FOR_WRITE
1637 # ifndef CACHE_LINE_SIZE
1638 # define CACHE_LINE_SIZE 32 /* Wild guess */
1641 # ifndef CLEAR_DOUBLE
1642 # define CLEAR_DOUBLE(x) \
1643 ((word*)x)[0] = 0; \
1645 # endif /* CLEAR_DOUBLE */
1647 /* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */
1648 # if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
1649 # define GC_SOLARIS_THREADS
1652 # if defined(GC_IRIX_THREADS) && !defined(IRIX5)
1653 --> inconsistent configuration
1655 # if defined(GC_LINUX_THREADS) && !defined(LINUX)
1656 --> inconsistent configuration
1658 # if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
1659 --> inconsistent configuration
1661 # if defined(GC_HPUX_THREADS) && !defined(HPUX)
1662 --> inconsistent configuration
1664 # if defined(GC_WIN32_THREADS) && !defined(MSWIN32)
1665 /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect */
1666 /* the necessary code is mostly there, but nobody has actually made */
1667 /* sure the right combination of pieces is compiled in, etc. */
1668 --> inconsistent configuration
1671 # if defined(PCR) || defined(SRC_M3) || \
1672 defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \
1673 defined(GC_PTHREADS)
1677 # if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(MACOSX) \
1678 || defined(LINT) || defined(MSWINCE) \
1679 || (defined(I386) && defined(__LCC__))
1680 /* Use setjmp based hack to mark from callee-save registers. */
1681 /* The define should move to the individual platform */
1683 # define USE_GENERIC_PUSH_REGS
1685 # if defined(I386) && defined(LINUX)
1686 /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
1687 /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
1688 # ifdef SAVE_CALL_COUNT
1689 # define SAVE_CALL_CHAIN
1693 # define SAVE_CALL_CHAIN
1694 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
1695 /* include assembly code to do it well. */
1698 # endif /* GCCONFIG_H */