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)
719 # define ALIGNMENT 4 /* Required by hardware */
721 # define ALIGN_DOUBLE
723 # define OS_TYPE "SUNOS5"
726 extern char * GC_SysVGetDataStart();
727 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
728 # define DATAEND (&_end)
733 # define HEAP_START (ptr_t)0x40000000
735 # define HEAP_START DATAEND
738 /* HEURISTIC1 reportedly no longer works under 2.7. */
739 /* HEURISTIC2 probably works, but this appears to be preferable. */
740 /* Apparently USRSTACK is defined to be USERLIMIT, but in some */
741 /* installations that's undefined. We work around this with a */
743 # include <sys/vmparam.h>
745 /* This should work everywhere, but doesn't. */
746 # define STACKBOTTOM USRSTACK
751 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
752 /* getpagesize() appeared to be missing from at least one */
753 /* Solaris 5.4 installation. Weird. */
754 # define DYNAMIC_LOADING
757 # define OS_TYPE "SUNOS4"
758 /* [If you have a weak stomach, don't read this.] */
759 /* We would like to use: */
760 /* # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */
761 /* This fails occasionally, due to an ancient, but very */
762 /* persistent ld bug. &etext is set 32 bytes too high. */
763 /* We instead read the text segment size from the a.out */
764 /* header, which happens to be mapped into our address space */
765 /* at the start of the text segment. The detective work here */
766 /* was done by Robert Ehrlich, Manuel Serrano, and Bernard */
767 /* Serpette of INRIA. */
768 /* This assumes ZMAGIC, i.e. demand-loadable executables. */
769 # define TEXTSTART 0x2000
770 # define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
771 # define MPROTECT_VDB
773 # define DYNAMIC_LOADING
776 # define CPP_WORDSZ 32
777 # define OS_TYPE "DRSNX"
778 extern char * GC_SysVGetDataStart();
780 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
781 # define MPROTECT_VDB
782 # define STACKBOTTOM ((ptr_t) 0xdfff0000)
783 # define DYNAMIC_LOADING
786 # define OS_TYPE "LINUX"
788 # define DYNAMIC_LOADING
790 Linux Sparc/a.out not supported
794 # define DATAEND (&_end)
797 # define STACKBOTTOM ((ptr_t) 0x80000000000ULL)
798 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, &_etext)
799 # define CPP_WORDSZ 64
801 # define STACKBOTTOM ((ptr_t) 0xf0000000)
802 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
806 # define OS_TYPE "OPENBSD"
807 # define STACKBOTTOM ((ptr_t) 0xf8000000)
809 # define DATASTART ((ptr_t)(&etext))
812 # define OS_TYPE "NETBSD"
815 # define DATASTART GC_data_start
816 # define DYNAMIC_LOADING
819 # define DATASTART ((ptr_t)(&etext))
825 # define MACH_TYPE "I386"
826 # define ALIGNMENT 4 /* Appears to hold for all "32 bit" compilers */
827 /* except Borland. The -a4 option fixes */
829 /* Ivan Demakov: For Watcom the option is -zp4. */
830 # ifndef SMALL_CONFIG
831 # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
832 /* improvement on Pentiums. */
834 # ifdef HAVE_BUILTIN_UNWIND_INIT
835 # define USE_GENERIC_PUSH_REGS
838 # define OS_TYPE "SEQUENT"
840 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
841 # define STACKBOTTOM ((ptr_t) 0x3ffff000)
844 # define OS_TYPE "BEOS"
846 # define GETPAGESIZE() B_PAGE_SIZE
848 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
851 # define OS_TYPE "SUNOS5"
852 extern int _etext, _end;
853 extern char * GC_SysVGetDataStart();
854 # define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
855 # define DATAEND (&_end)
856 /* # define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7, */
857 /* but reportedly breaks under 2.8. It appears that the stack */
858 /* base is a property of the executable, so this should not break */
859 /* old executables. */
860 /* HEURISTIC2 probably works, but this appears to be preferable. */
861 # include <sys/vmparam.h>
862 # define STACKBOTTOM USRSTACK
863 /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
864 # ifdef SOLARIS25_PROC_VDB_BUG_FIXED
867 # define DYNAMIC_LOADING
872 # define HEAP_START (ptr_t)0x40000000
874 # define HEAP_START DATAEND
878 # define OS_TYPE "SCO"
880 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
882 +((word)&etext & 0xfff))
883 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
886 # define OS_TYPE "SCO_ELF"
888 # define DATASTART ((ptr_t)(&etext))
889 # define STACKBOTTOM ((ptr_t) 0x08048000)
890 # define DYNAMIC_LOADING
891 # define ELF_CLASS ELFCLASS32
894 # define OS_TYPE "LINUX"
895 # define LINUX_STACKBOTTOM
899 # define STACK_GRAN 0x10000000
900 /* STACKBOTTOM is usually 0xc0000000, but this changes with */
901 /* different kernel configurations. In particular, systems */
902 /* with 2GB physical memory will usually move the user */
903 /* address space limit, and hence initial SP to 0x80000000. */
905 # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)
906 # define MPROTECT_VDB
908 /* We seem to get random errors in incremental mode, */
909 /* possibly because Linux threads is itself a malloc client */
910 /* and can't deal with the signals. */
913 # define DYNAMIC_LOADING
914 # ifdef UNDEFINED /* includes ro data */
916 # define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
918 # include <features.h>
919 # if defined(__GLIBC__) && __GLIBC__ >= 2
920 # define LINUX_DATA_START
922 extern char **__environ;
923 # define DATASTART ((ptr_t)(&__environ))
924 /* hideous kludge: __environ is the first */
925 /* word in crt0.o, and delimits the start */
926 /* of the data segment, no matter which */
927 /* ld options were passed through. */
928 /* We could use _etext instead, but that */
929 /* would include .rodata, which may */
930 /* contain large read-only data tables */
931 /* that we'd rather not scan. */
934 # define DATAEND (&_end)
937 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
939 # ifdef USE_I686_PREFETCH
940 # define PREFETCH(x) \
941 __asm__ __volatile__ (" prefetchnta %0": : "m"(*(char *)(x)))
942 /* Empirically prefetcht0 is much more effective at reducing */
943 /* cache miss stalls for the targetted load instructions. But it */
944 /* seems to interfere enough with other cache traffic that the net */
945 /* result is worse than prefetchnta. */
947 /* Using prefetches for write seems to have a slight negative */
948 /* impact on performance, at least for a PIII/500. */
949 # define PREFETCH_FOR_WRITE(x) \
950 __asm__ __volatile__ (" prefetcht0 %0": : "m"(*(char *)(x)))
953 # ifdef USE_3DNOW_PREFETCH
954 # define PREFETCH(x) \
955 __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))
956 # define PREFETCH_FOR_WRITE(x) \
957 __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))
961 # define OS_TYPE "CYGWIN32"
962 extern int _data_start__;
963 extern int _data_end__;
964 extern int _bss_start__;
965 extern int _bss_end__;
966 /* For binutils 2.9.1, we have */
967 /* DATASTART = _data_start__ */
968 /* DATAEND = _bss_end__ */
969 /* whereas for some earlier versions it was */
970 /* DATASTART = _bss_start__ */
971 /* DATAEND = _data_end__ */
972 /* To get it right for both, we take the */
973 /* minumum/maximum of the two. */
974 # define MAX(x,y) ((x) > (y) ? (x) : (y))
975 # define MIN(x,y) ((x) < (y) ? (x) : (y))
976 # define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
977 # define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__))
979 # define STACK_GRAN 0x10000
983 # define OS_TYPE "OS2"
984 /* STACKBOTTOM and DATASTART are handled specially in */
985 /* os_dep.c. OS2 actually has the right */
987 # define DATAEND /* not needed */
988 # define USE_GENERIC_PUSH_REGS
991 # define OS_TYPE "MSWIN32"
992 /* STACKBOTTOM and DATASTART are handled specially in */
995 # define MPROTECT_VDB
997 # define DATAEND /* not needed */
1000 # define OS_TYPE "MSWINCE"
1001 # define DATAEND /* not needed */
1004 # define OS_TYPE "DJGPP"
1005 # include "stubinfo.h"
1008 extern int __djgpp_stack_limit;
1009 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
1010 /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
1012 # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
1013 /* This may not be right. */
1016 # define OS_TYPE "OPENBSD"
1019 # define OS_TYPE "FREEBSD"
1020 # define MPROTECT_VDB
1021 # define FREEBSD_STACKBOTTOM
1023 # define DYNAMIC_LOADING
1027 # define OS_TYPE "NETBSD"
1030 # define OS_TYPE "THREE86BSD"
1033 # define OS_TYPE "BSDI"
1035 # if defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1036 || defined(THREE86BSD) || defined(BSDI)
1039 # define DATASTART ((ptr_t)(&etext))
1042 # define OS_TYPE "NEXT"
1043 # define DATASTART ((ptr_t) get_etext())
1044 # define STACKBOTTOM ((ptr_t)0xc0000000)
1045 # define DATAEND /* not needed */
1048 # define OS_TYPE "DOS4GW"
1049 extern long __nullarea;
1051 extern char *_STACKTOP;
1052 /* Depending on calling conventions Watcom C either precedes
1053 or does not precedes with undescore names of C-variables.
1054 Make sure startup code variables always have the same names. */
1055 #pragma aux __nullarea "*";
1056 #pragma aux _end "*";
1057 # define STACKBOTTOM ((ptr_t) _STACKTOP)
1058 /* confused? me too. */
1059 # define DATASTART ((ptr_t) &__nullarea)
1060 # define DATAEND ((ptr_t) &_end)
1063 # define OS_TYPE "HURD"
1064 # define STACK_GROWS_DOWN
1066 extern int __data_start;
1067 # define DATASTART ( (ptr_t) (&__data_start))
1069 # define DATAEND ( (ptr_t) (&_end))
1070 /* # define MPROTECT_VDB Not quite working yet? */
1071 # define DYNAMIC_LOADING
1076 # define MACH_TYPE "NS32K"
1077 # define ALIGNMENT 4
1078 extern char **environ;
1079 # define DATASTART ((ptr_t)(&environ))
1080 /* hideous kludge: environ is the first */
1081 /* word in crt0.o, and delimits the start */
1082 /* of the data segment, no matter which */
1083 /* ld options were passed through. */
1084 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
1088 # define MACH_TYPE "MIPS"
1090 /* This was developed for a linuxce style platform. Probably */
1091 /* needs to be tweaked for workstation class machines. */
1092 # define OS_TYPE "LINUX"
1093 extern int __data_start;
1094 # define DATASTART ((ptr_t)(&__data_start))
1095 # define ALIGNMENT 4
1096 # define USE_GENERIC_PUSH_REGS
1097 # define STACKBOTTOM ((ptr_t)0x7fff8000)
1098 /* Older toolchains may need 0x80000000. */
1099 /* In many cases, this should probably use LINUX_STACKBOTTOM */
1100 /* instead. But some kernel versions seem to give the wrong */
1101 /* value from /proc. */
1105 # define DATASTART (ptr_t)0x10000000
1106 /* Could probably be slightly higher since */
1107 /* startup code allocates lots of stuff. */
1108 # define OS_TYPE "ULTRIX"
1109 # define ALIGNMENT 4
1113 # define DATASTART (ptr_t)0x10000000
1114 # define OS_TYPE "RISCOS"
1115 # define ALIGNMENT 4 /* Required by hardware */
1120 # define DATASTART ((ptr_t)(&_fdata))
1122 # define HEAP_START (ptr_t)0x30000000
1124 # define HEAP_START DATASTART
1126 /* Lowest plausible heap address. */
1127 /* In the MMAP case, we map there. */
1128 /* In either case it is used to identify */
1129 /* heap sections so they're not */
1130 /* considered as roots. */
1131 # define OS_TYPE "IRIX5"
1132 # define MPROTECT_VDB
1134 # define CPP_WORDSZ _MIPS_SZPTR
1135 # define ALIGNMENT (_MIPS_SZPTR/8)
1136 # if CPP_WORDSZ != 64
1137 # define ALIGN_DOUBLE
1140 # define ALIGNMENT 4
1141 # define ALIGN_DOUBLE
1143 # define DYNAMIC_LOADING
1146 # define OS_TYPE "MSWINCE"
1147 # define ALIGNMENT 4
1148 # define DATAEND /* not needed */
1150 # if defined(NETBSD)
1151 /* This also checked for __MIPSEL__ . Why? NETBSD recognition */
1152 /* should be handled at the top of the file. */
1153 # define ALIGNMENT 4
1154 # define OS_TYPE "NETBSD"
1156 # define USE_GENERIC_PUSH_REGS
1159 # define DATASTART GC_data_start
1160 # define NEED_FIND_LIMIT
1161 # define DYNAMIC_LOADING
1163 # define DATASTART ((ptr_t) 0x10000000)
1164 # define STACKBOTTOM ((ptr_t) 0x7ffff000)
1170 # define MACH_TYPE "RS6000"
1171 # define ALIGNMENT 4
1172 # define DATASTART ((ptr_t)0x20000000)
1174 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
1175 # define DYNAMIC_LOADING
1176 /* For really old versions of AIX, this may have to be removed. */
1180 # define MACH_TYPE "HP_PA"
1182 # define CPP_WORDSZ 64
1183 # define ALIGNMENT 8
1185 # define CPP_WORDSZ 32
1186 # define ALIGNMENT 4
1187 # define ALIGN_DOUBLE
1189 # if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)
1190 # ifndef LINUX /* For now. */
1191 # define MPROTECT_VDB
1194 # define GENERIC_COMPARE_AND_SWAP
1195 /* No compare-and-swap instruction. Use pthread mutexes */
1196 /* when we absolutely have to. */
1197 # ifdef PARALLEL_MARK
1198 # define USE_MARK_BYTES
1199 /* Minimize compare-and-swap usage. */
1202 # define STACK_GROWS_UP
1204 # define OS_TYPE "HPUX"
1205 extern int __data_start;
1206 # define DATASTART ((ptr_t)(&__data_start))
1208 /* The following appears to work for 7xx systems running HP/UX */
1209 /* 9.xx Furthermore, it might result in much faster */
1210 /* collections than HEURISTIC2, which may involve scanning */
1211 /* segments that directly precede the stack. It is not the */
1212 /* default, since it may not work on older machine/OS */
1213 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
1215 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
1217 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1218 /* to this. Note that the GC must be initialized before the */
1219 /* first putenv call. */
1220 extern char ** environ;
1221 # define STACKBOTTOM ((ptr_t)environ)
1223 # define DYNAMIC_LOADING
1224 # include <unistd.h>
1225 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1227 # define PREFETCH(x) { \
1228 register long addr = (long)(x); \
1229 (void) _asm ("LDW", 0, 0, addr, 0); \
1234 # define OS_TYPE "LINUX"
1235 # define LINUX_STACKBOTTOM
1236 # define DYNAMIC_LOADING
1237 # define LINUX_DATA_START
1239 # define DATAEND (&_end)
1244 # define MACH_TYPE "ALPHA"
1245 # define ALIGNMENT 8
1247 # define OS_TYPE "NETBSD"
1249 # define DATASTART GC_data_start
1250 # define ELFCLASS32 32
1251 # define ELFCLASS64 64
1252 # define ELF_CLASS ELFCLASS64
1253 # define CPP_WORDSZ 64
1254 # define DYNAMIC_LOADING
1257 # define OS_TYPE "OPENBSD"
1259 # define CPP_WORDSZ 64
1260 # ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
1261 # define DATASTART GC_data_start
1262 # define ELFCLASS32 32
1263 # define ELFCLASS64 64
1264 # define ELF_CLASS ELFCLASS64
1265 # else /* ECOFF, until OpenBSD/Alpha 2.7 */
1266 # define DATASTART ((ptr_t) 0x140000000)
1270 # define OS_TYPE "OSF1"
1271 # define DATASTART ((ptr_t) 0x140000000)
1273 # define DATAEND ((ptr_t) &_end)
1274 extern char ** environ;
1275 /* round up from the value of environ to the nearest page boundary */
1276 /* Probably breaks if putenv is called before collector */
1277 /* initialization. */
1278 # define STACKBOTTOM ((ptr_t)(((word)(environ) | (getpagesize()-1))+1))
1279 /* # define HEURISTIC2 */
1280 /* Normally HEURISTIC2 is too conervative, since */
1281 /* the text segment immediately follows the stack. */
1282 /* Hence we give an upper pound. */
1283 /* This is currently unused, since we disabled HEURISTIC2 */
1285 # define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
1286 # define CPP_WORDSZ 64
1287 # define MPROTECT_VDB
1288 # define DYNAMIC_LOADING
1291 # define OS_TYPE "LINUX"
1292 # define CPP_WORDSZ 64
1293 # define STACKBOTTOM ((ptr_t) 0x120000000)
1295 # define SEARCH_FOR_DATA_START
1296 # define DATASTART GC_data_start
1297 # define DYNAMIC_LOADING
1299 # define DATASTART ((ptr_t) 0x140000000)
1302 # define DATAEND (&_end)
1303 # define MPROTECT_VDB
1304 /* Has only been superficially tested. May not */
1305 /* work on all versions. */
1310 # define MACH_TYPE "IA64"
1311 # define USE_GENERIC_PUSH_REGS
1312 /* We need to get preserved registers in addition to register */
1313 /* windows. That's easiest to do with setjmp. */
1314 # ifdef PARALLEL_MARK
1315 # define USE_MARK_BYTES
1316 /* Compare-and-exchange is too expensive to use for */
1317 /* setting mark bits. */
1321 # define CPP_WORDSZ 32
1322 # define ALIGN_DOUBLE
1323 /* Requires 8 byte alignment for malloc */
1324 # define ALIGNMENT 4
1329 # define CPP_WORDSZ 64
1330 # define ALIGN_DOUBLE
1331 /* Requires 16 byte alignment for malloc */
1332 # define ALIGNMENT 8
1334 # define OS_TYPE "HPUX"
1335 extern int __data_start;
1336 # define DATASTART ((ptr_t)(&__data_start))
1337 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1338 /* to this. Note that the GC must be initialized before the */
1339 /* first putenv call. */
1340 extern char ** environ;
1341 # define STACKBOTTOM ((ptr_t)environ)
1342 # define DYNAMIC_LOADING
1343 # include <unistd.h>
1344 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1345 /* The following was empirically determined, and is probably */
1346 /* not very robust. */
1347 /* Note that the backing store base seems to be at a nice */
1348 /* address minus one page. */
1349 # define BACKING_STORE_DISPLACEMENT 0x1000000
1350 # define BACKING_STORE_ALIGNMENT 0x1000
1351 # define BACKING_STORE_BASE \
1352 (ptr_t)(((word)GC_stackbottom - BACKING_STORE_DISPLACEMENT - 1) \
1353 & ~(BACKING_STORE_ALIGNMENT - 1))
1356 # define CPP_WORDSZ 64
1357 # define ALIGN_DOUBLE
1358 /* Requires 16 byte alignment for malloc */
1359 # define ALIGNMENT 8
1360 # define OS_TYPE "LINUX"
1361 /* The following works on NUE and older kernels: */
1362 /* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
1363 /* This does not work on NUE: */
1364 # define LINUX_STACKBOTTOM
1365 /* We also need the base address of the register stack */
1366 /* backing store. This is computed in */
1367 /* GC_linux_register_stack_base based on the following */
1369 # define BACKING_STORE_ALIGNMENT 0x100000
1370 # define BACKING_STORE_DISPLACEMENT 0x80000000
1371 extern char * GC_register_stackbottom;
1372 # define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)
1373 # define SEARCH_FOR_DATA_START
1374 # define DATASTART GC_data_start
1375 # define DYNAMIC_LOADING
1376 # define MPROTECT_VDB
1377 /* Requires Linux 2.3.47 or later. */
1379 # define DATAEND (&_end)
1381 # define PREFETCH(x) \
1382 __asm__ (" lfetch [%0]": : "r"((void *)(x)))
1383 # define PREFETCH_FOR_WRITE(x) \
1384 __asm__ (" lfetch.excl [%0]": : "r"((void *)(x)))
1385 # define CLEAR_DOUBLE(x) \
1386 __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))
1392 # define MACH_TYPE "M88K"
1393 # define ALIGNMENT 4
1394 # define ALIGN_DOUBLE
1397 # define OS_TYPE "CX_UX"
1398 # define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
1401 # define OS_TYPE "DGUX"
1402 extern char * GC_SysVGetDataStart();
1403 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
1405 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
1409 # define MACH_TYPE "S370"
1410 # define ALIGNMENT 4 /* Required by hardware */
1411 # define USE_GENERIC_PUSH_REGS
1413 # define OS_TYPE "UTS4"
1417 extern char * GC_SysVGetDataStart();
1418 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
1419 # define DATAEND (&_end)
1423 # define OS_TYPE "LINUX"
1425 # define DYNAMIC_LOADING
1426 extern int __data_start;
1427 # define DATASTART ((ptr_t)(&__data_start))
1432 # define ALIGNMENT 4
1434 # define DATASTART ((ptr_t)(&_etext))
1439 # define CPP_WORDSZ 32
1440 # define MACH_TYPE "ARM32"
1441 # define ALIGNMENT 4
1443 # define OS_TYPE "NETBSD"
1446 # define DATASTART ((ptr_t)(&etext))
1447 # define USE_GENERIC_PUSH_REGS
1450 # define OS_TYPE "LINUX"
1453 # define STACK_GRAN 0x10000000
1454 # define USE_GENERIC_PUSH_REGS
1456 # define DYNAMIC_LOADING
1457 # include <features.h>
1458 # if defined(__GLIBC__) && __GLIBC__ >= 2
1459 # define LINUX_DATA_START
1461 extern char **__environ;
1462 # define DATASTART ((ptr_t)(&__environ))
1463 /* hideous kludge: __environ is the first */
1464 /* word in crt0.o, and delimits the start */
1465 /* of the data segment, no matter which */
1466 /* ld options were passed through. */
1467 /* We could use _etext instead, but that */
1468 /* would include .rodata, which may */
1469 /* contain large read-only data tables */
1470 /* that we'd rather not scan. */
1473 # define DATAEND (&_end)
1476 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
1480 # define OS_TYPE "MSWINCE"
1481 # define DATAEND /* not needed */
1486 # define MACH_TYPE "SH"
1487 # define ALIGNMENT 4
1489 # define OS_TYPE "MSWINCE"
1490 # define DATAEND /* not needed */
1493 # define OS_TYPE "LINUX"
1494 # define STACKBOTTOM ((ptr_t) 0x7c000000)
1495 # define USE_GENERIC_PUSH_REGS
1496 # define DYNAMIC_LOADING
1497 # define LINUX_DATA_START
1499 # define DATAEND (&_end)
1504 # define MACH_TYPE "SH4"
1505 # define OS_TYPE "MSWINCE"
1506 # define ALIGNMENT 4
1507 # define DATAEND /* not needed */
1510 #ifdef LINUX_DATA_START
1511 /* Some Linux distributions arrange to define __data_start. Some */
1512 /* define data_start as a weak symbol. The latter is technically */
1513 /* broken, since the user program may define data_start, in which */
1514 /* case we lose. Nonetheless, we try both, prefering __data_start. */
1515 /* We assume gcc. */
1516 # pragma weak __data_start
1517 extern int __data_start;
1518 # pragma weak data_start
1519 extern int data_start;
1520 # define DATASTART ((ptr_t)(&__data_start != 0? &__data_start : &data_start))
1523 #if defined(LINUX) && defined(REDIRECT_MALLOC)
1524 /* Rld appears to allocate some memory with its own allocator, and */
1525 /* some through malloc, which might be redirected. To make this */
1526 /* work with collectable memory, we have to scan memory allocated */
1527 /* by rld's internal malloc. */
1528 # define USE_PROC_FOR_LIBRARIES
1531 # ifndef STACK_GROWS_UP
1532 # define STACK_GROWS_DOWN
1536 # define CPP_WORDSZ 32
1545 # define DATAEND (&end)
1548 # if defined(SVR4) && !defined(GETPAGESIZE)
1549 # include <unistd.h>
1550 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
1553 # ifndef GETPAGESIZE
1554 # if defined(SUNOS5) || defined(IRIX5)
1555 # include <unistd.h>
1557 # define GETPAGESIZE() getpagesize()
1560 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
1561 /* OS has SVR4 generic features. Probably others also qualify. */
1565 # if defined(SUNOS5) || defined(DRSNX)
1566 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
1569 /* OS has SUNOS5 style signal handlers. */
1577 # if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \
1578 || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1579 || defined(BSD) || defined(AIX) || defined(MACOSX) || defined(OSF1)
1580 # define UNIX_LIKE /* Basic Unix-like system calls work. */
1583 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
1588 # undef DYNAMIC_LOADING
1593 # undef MPROTECT_VDB
1598 /* Postponed for now. */
1600 # undef MPROTECT_VDB
1603 # ifdef SMALL_CONFIG
1604 /* Presumably not worth the space it takes. */
1606 # undef MPROTECT_VDB
1610 # undef MPROTECT_VDB /* Can't deal with address space holes. */
1613 # ifdef PARALLEL_MARK
1614 # undef MPROTECT_VDB /* For now. */
1617 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
1618 # define DEFAULT_VDB
1622 # define PREFETCH(x)
1623 # define NO_PREFETCH
1626 # ifndef PREFETCH_FOR_WRITE
1627 # define PREFETCH_FOR_WRITE(x)
1628 # define NO_PREFETCH_FOR_WRITE
1631 # ifndef CACHE_LINE_SIZE
1632 # define CACHE_LINE_SIZE 32 /* Wild guess */
1635 # ifndef CLEAR_DOUBLE
1636 # define CLEAR_DOUBLE(x) \
1637 ((word*)x)[0] = 0; \
1639 # endif /* CLEAR_DOUBLE */
1641 /* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */
1642 # if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
1643 # define GC_SOLARIS_THREADS
1646 # if defined(GC_IRIX_THREADS) && !defined(IRIX5)
1647 --> inconsistent configuration
1649 # if defined(GC_LINUX_THREADS) && !defined(LINUX)
1650 --> inconsistent configuration
1652 # if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
1653 --> inconsistent configuration
1655 # if defined(GC_HPUX_THREADS) && !defined(HPUX)
1656 --> inconsistent configuration
1658 # if defined(GC_WIN32_THREADS) && !defined(MSWIN32)
1659 /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect */
1660 /* the necessary code is mostly there, but nobody has actually made */
1661 /* sure the right combination of pieces is compiled in, etc. */
1662 --> inconsistent configuration
1665 # if defined(PCR) || defined(SRC_M3) || \
1666 defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \
1667 defined(GC_PTHREADS)
1671 # if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(MACOSX) \
1672 || defined(LINT) || defined(MSWINCE) \
1673 || (defined(I386) && defined(__LCC__))
1674 /* Use setjmp based hack to mark from callee-save registers. */
1675 /* The define should move to the individual platform */
1677 # define USE_GENERIC_PUSH_REGS
1679 # if defined(I386) && defined(LINUX)
1680 /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
1681 /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
1682 # ifdef SAVE_CALL_COUNT
1683 # define SAVE_CALL_CHAIN
1687 # define SAVE_CALL_CHAIN
1688 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
1689 /* include assembly code to do it well. */
1692 # endif /* GCCONFIG_H */