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 /* Determine the machine type: */
37 # if defined(sun) && defined(mc68000)
40 # define mach_type_known
42 # if defined(hp9000s300)
45 # define mach_type_known
47 # if defined(__OpenBSD__) && defined(m68k)
50 # define mach_type_known
52 # if defined(__OpenBSD__) && defined(__sparc__)
55 # define mach_type_known
57 # if defined(__NetBSD__) && defined(m68k)
59 # define mach_type_known
61 # if defined(__NetBSD__) && defined(__powerpc__)
63 # define mach_type_known
65 # if defined(__NetBSD__) && defined(__arm32__)
67 # define mach_type_known
76 # define mach_type_known
78 # if defined(mips) || defined(__mips)
81 # if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
84 # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \
85 || defined(__SYSTYPE_SVR4__)
86 # define IRIX5 /* or IRIX 6.X */
88 # define RISCOS /* or IRIX 4.X */
92 # if defined(__NetBSD__) && defined(__MIPSEL__)
95 # define mach_type_known
97 # if defined(sequent) && (defined(i386) || defined(__i386__))
100 # define mach_type_known
102 # if defined(sun) && (defined(i386) || defined(__i386__))
105 # define mach_type_known
107 # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
110 # define mach_type_known
114 # define mach_type_known
116 # if defined(sun) && (defined(sparc) || defined(__sparc))
118 /* Test for SunOS 5.x */
125 # define mach_type_known
127 # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
128 && !defined(__OpenBSD__) && !(__NetBSD__)
131 # define mach_type_known
135 # define mach_type_known
137 # if defined(__NetBSD__) && defined(__sparc__)
139 # define mach_type_known
141 # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
142 /* The above test may need refinement */
144 # if defined(_SCO_ELF)
149 # define mach_type_known
151 # if defined(_AUX_SOURCE)
154 # define mach_type_known
156 # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
157 || defined(hppa) || defined(__hppa__)
162 # define mach_type_known
164 # if defined(__BEOS__) && defined(_X86_)
167 # define mach_type_known
169 # if defined(LINUX) && (defined(i386) || defined(__i386__))
171 # define mach_type_known
173 # if defined(LINUX) && (defined(__ia64__) || defined(__ia64))
175 # define mach_type_known
177 # if defined(LINUX) && (defined(powerpc) || defined(__powerpc__))
179 # define mach_type_known
181 # if defined(LINUX) && defined(__mc68000__)
183 # define mach_type_known
185 # if defined(LINUX) && (defined(sparc) || defined(__sparc__))
187 # define mach_type_known
189 # if defined(LINUX) && defined(__arm__)
191 # define mach_type_known
193 # if defined(LINUX) && defined(__sh__)
195 # define mach_type_known
197 # if defined(__alpha) || defined(__alpha__)
199 # if !defined(LINUX) && !defined(NETBSD)
200 # define OSF1 /* a.k.a Digital Unix */
202 # define mach_type_known
204 # if defined(_AMIGA) && !defined(AMIGA)
209 # define mach_type_known
211 # if defined(THINK_C) || defined(__MWERKS__) && !defined(__powerc)
214 # define mach_type_known
216 # if defined(__MWERKS__) && defined(__powerc)
219 # define mach_type_known
221 # if defined(macosx) || \
222 defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
225 # define mach_type_known
227 # if defined(__APPLE__) && defined(__MACH__) && defined(__i386__)
230 --> Not really supported, but at least we recognize it.
232 # if defined(NeXT) && defined(mc68000)
235 # define mach_type_known
237 # if defined(NeXT) && (defined(i386) || defined(__i386__))
240 # define mach_type_known
242 # if defined(__OpenBSD__) && (defined(i386) || defined(__i386__))
245 # define mach_type_known
247 # if defined(__FreeBSD__) && (defined(i386) || defined(__i386__))
250 # define mach_type_known
252 # if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
254 # define mach_type_known
256 # if defined(bsdi) && (defined(i386) || defined(__i386__))
259 # define mach_type_known
261 # if !defined(mach_type_known) && defined(__386BSD__)
264 # define mach_type_known
266 # if defined(_CX_UX) && defined(_M88K)
269 # define mach_type_known
274 # define mach_type_known
276 # if defined(_WIN32_WCE)
277 /* SH3, SH4, MIPS already defined for corresponding architectures */
278 # if defined(SH3) || defined(SH4)
288 # define mach_type_known
290 # if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
291 || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
293 # define MSWIN32 /* or Win32s */
294 # define mach_type_known
297 # if defined(__DJGPP__)
300 # define DJGPP /* MSDOS running the DJGPP port of GCC */
302 # define mach_type_known
304 # if defined(__CYGWIN32__) || defined(__CYGWIN__)
307 # define mach_type_known
309 # if defined(__MINGW32__)
312 # define mach_type_known
314 # if defined(__BORLANDC__)
317 # define mach_type_known
319 # if defined(_UTS) && !defined(mach_type_known)
322 # define mach_type_known
326 # define mach_type_known
328 # if defined(__embedded__) && defined(PPC)
331 # define mach_type_known
334 # if defined(__WATCOMC__) && defined(__386__)
336 # if !defined(OS2) && !defined(MSWIN32) && !defined(DOS4GW)
337 # if defined(__OS2__)
340 # if defined(__WINDOWS_386__) || defined(__NT__)
347 # define mach_type_known
349 # if defined(__s390__) && defined(LINUX)
351 # define mach_type_known
353 # if defined(__GNU__)
354 # if defined(__i386__)
355 /* The Debian Hurd running on generic PC */
358 # define mach_type_known
362 /* Feel free to add more clauses here */
364 /* Or manually define the machine type here. A machine type is */
365 /* characterized by the architecture. Some */
366 /* machine types are further subdivided by OS. */
367 /* the macros ULTRIX, RISCOS, and BSD to distinguish. */
368 /* Note that SGI IRIX is treated identically to RISCOS. */
369 /* SYSV on an M68K actually means A/UX. */
370 /* The distinction in these cases is usually the stack starting address */
371 # ifndef mach_type_known
372 --> unknown machine type
374 /* Mapping is: M68K ==> Motorola 680X0 */
375 /* (SUNOS4,HP,NEXT, and SYSV (A/UX), */
376 /* MACOS and AMIGA variants) */
377 /* I386 ==> Intel 386 */
378 /* (SEQUENT, OS2, SCO, LINUX, NETBSD, */
379 /* FREEBSD, THREE86BSD, MSWIN32, */
380 /* BSDI,SUNOS5, NEXT, other variants) */
381 /* NS32K ==> Encore Multimax */
382 /* MIPS ==> R2000 or R3000 */
383 /* (RISCOS, ULTRIX variants) */
384 /* VAX ==> DEC VAX */
385 /* (BSD, ULTRIX variants) */
386 /* RS6000 ==> IBM RS/6000 AIX3.X */
387 /* RT ==> IBM PC/RT */
388 /* HP_PA ==> HP9000/700 & /800 */
390 /* SPARC ==> SPARC v7/v8/v9 */
391 /* (SUNOS4, SUNOS5, LINUX, */
392 /* DRSNX variants) */
393 /* ALPHA ==> DEC Alpha */
394 /* (OSF1 and LINUX variants) */
395 /* M88K ==> Motorola 88XX0 */
396 /* (CX_UX and DGUX) */
397 /* S370 ==> 370-like machine */
398 /* running Amdahl UTS4 */
399 /* or a 390 running LINUX */
400 /* ARM32 ==> Intel StrongARM */
401 /* IA64 ==> Intel IA64 */
403 /* SH ==> Hitachi SuperH */
404 /* (LINUX & MSWINCE) */
408 * For each architecture and OS, the following need to be defined:
410 * CPP_WORD_SZ is a simple integer constant representing the word size.
411 * in bits. We assume byte addressibility, where a byte has 8 bits.
412 * We also assume CPP_WORD_SZ is either 32 or 64.
413 * (We care about the length of pointers, not hardware
414 * bus widths. Thus a 64 bit processor with a C compiler that uses
415 * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
417 * MACH_TYPE is a string representation of the machine type.
418 * OS_TYPE is analogous for the OS.
420 * ALIGNMENT is the largest N, such that
421 * all pointer are guaranteed to be aligned on N byte boundaries.
422 * defining it to be 1 will always work, but perform poorly.
424 * DATASTART is the beginning of the data segment.
425 * On UNIX systems, the collector will scan the area between DATASTART
426 * and DATAEND for root pointers.
428 * DATAEND, if not &end.
430 * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
433 * STACKBOTTOM is the cool end of the stack, which is usually the
434 * highest address in the stack.
435 * Under PCR or OS/2, we have other ways of finding thread stacks.
436 * For each machine, the following should:
437 * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
438 * 2) define exactly one of
439 * STACKBOTTOM (should be defined to be an expression)
442 * If either of the last two macros are defined, then STACKBOTTOM is computed
443 * during collector startup using one of the following two heuristics:
444 * HEURISTIC1: Take an address inside GC_init's frame, and round it up to
445 * the next multiple of STACK_GRAN.
446 * HEURISTIC2: Take an address inside GC_init's frame, increment it repeatedly
447 * in small steps (decrement if STACK_GROWS_UP), and read the value
448 * at each location. Remember the value when the first
449 * Segmentation violation or Bus error is signalled. Round that
450 * to the nearest plausible page boundary, and use that instead
453 * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines,
454 * the value of environ is a pointer that can serve as STACKBOTTOM.
455 * I expect that HEURISTIC2 can be replaced by this approach, which
456 * interferes far less with debugging. However it has the disadvantage
457 * that it's confused by a putenv call before the collector is initialized.
458 * This could be dealt with by intercepting putenv ...
460 * If no expression for STACKBOTTOM can be found, and neither of the above
461 * heuristics are usable, the collector can still be used with all of the above
462 * undefined, provided one of the following is done:
463 * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s)
464 * without reference to STACKBOTTOM. This is appropriate for use in
465 * conjunction with thread packages, since there will be multiple stacks.
466 * (Allocating thread stacks in the heap, and treating them as ordinary
467 * heap data objects is also possible as a last resort. However, this is
468 * likely to introduce significant amounts of excess storage retention
469 * unless the dead parts of the thread stacks are periodically cleared.)
470 * 2) Client code may set GC_stackbottom before calling any GC_ routines.
471 * If the author of the client code controls the main program, this is
472 * easily accomplished by introducing a new main program, setting
473 * GC_stackbottom to the address of a local variable, and then calling
474 * the original main program. The new main program would read something
477 * # include "gc_private.h"
479 * main(argc, argv, envp)
481 * char **argv, **envp;
485 * GC_stackbottom = (ptr_t)(&dummy);
486 * return(real_main(argc, argv, envp));
490 * Each architecture may also define the style of virtual dirty bit
491 * implementation to be used:
492 * MPROTECT_VDB: Write protect the heap and catch faults.
493 * PROC_VDB: Use the SVR4 /proc primitives to read dirty bits.
495 * An architecture may define DYNAMIC_LOADING if dynamic_load.c
496 * defined GC_register_dynamic_libraries() for the architecture.
498 * An architecture may define PREFETCH(x) to preload the cache with *x.
499 * This defaults to a no-op.
501 * PREFETCH_FOR_WRITE(x) is used if *x is about to be written.
503 * An architecture may also define CLEAR_DOUBLE(x) to be a fast way to
504 * clear the two words at GC_malloc-aligned address x. By default,
505 * word stores of 0 are used instead.
508 /* If we are using a recent version of gcc, we can use __builtin_unwind_init()
509 * to push the relevant registers onto the stack. This generally makes
510 * USE_GENERIC_PUSH_REGS the preferred approach for marking from registers.
512 # if defined(__GNUC__) && ((__GNUC__ >= 3) || \
513 (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
514 # define HAVE_BUILTIN_UNWIND_INIT
517 # define STACK_GRAN 0x1000000
519 # define MACH_TYPE "M68K"
522 # define OS_TYPE "OPENBSD"
525 # define DATASTART ((ptr_t)(&etext))
528 # define OS_TYPE "NETBSD"
531 # define DATASTART ((ptr_t)(&etext))
534 # define OS_TYPE "LINUX"
535 # define STACKBOTTOM ((ptr_t)0xf0000000)
536 # define MPROTECT_VDB
538 # define DYNAMIC_LOADING
539 # include <features.h>
540 # if defined(__GLIBC__)&& __GLIBC__>=2
541 # define LINUX_DATA_START
543 extern char **__environ;
544 # define DATASTART ((ptr_t)(&__environ))
545 /* hideous kludge: __environ is the first */
546 /* word in crt0.o, and delimits the start */
547 /* of the data segment, no matter which */
548 /* ld options were passed through. */
549 /* We could use _etext instead, but that */
550 /* would include .rodata, which may */
551 /* contain large read-only data tables */
552 /* that we'd rather not scan. */
553 # endif /* !GLIBC2 */
555 # define DATAEND (&_end)
558 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
562 # define OS_TYPE "SUNOS4"
564 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ffff) & ~0x1ffff))
565 # define HEURISTIC1 /* differs */
566 # define DYNAMIC_LOADING
569 # define OS_TYPE "HP"
571 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
572 # define STACKBOTTOM ((ptr_t) 0xffeffffc)
573 /* empirically determined. seems to work. */
575 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
578 # define OS_TYPE "SYSV"
580 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
582 +((word)&etext & 0x1fff))
583 /* This only works for shared-text binaries with magic number 0413.
584 The other sorts of SysV binaries put the data at the end of the text,
585 in which case the default of &etext would work. Unfortunately,
586 handling both would require having the magic-number available.
589 # define STACKBOTTOM ((ptr_t)0xFFFFFFFE)
590 /* The stack starts at the top of memory, but */
591 /* 0x0 cannot be used as setjump_test complains */
592 /* that the stack direction is incorrect. Two */
593 /* bytes down from 0x0 should be safe enough. */
595 # include <sys/mmu.h>
596 # define GETPAGESIZE() PAGESIZE /* Is this still right? */
599 # define OS_TYPE "AMIGA"
600 /* STACKBOTTOM and DATASTART handled specially */
602 # define DATAEND /* not needed */
603 # define GETPAGESIZE() 4096
609 # define OS_TYPE "MACOS"
610 /* see os_dep.c for details of global data segments. */
611 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
612 # define DATAEND /* not needed */
613 # define GETPAGESIZE() 4096
616 # define OS_TYPE "NEXT"
617 # define DATASTART ((ptr_t) get_etext())
618 # define STACKBOTTOM ((ptr_t) 0x4000000)
619 # define DATAEND /* not needed */
624 # define MACH_TYPE "POWERPC"
626 # define ALIGNMENT 2 /* Still necessary? Could it be 4? */
630 # define OS_TYPE "MACOS"
631 /* see os_dep.c for details of global data segments. */
632 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
633 # define DATAEND /* not needed */
636 # define ALIGNMENT 4 /* Guess. Can someone verify? */
637 /* This was 2, but that didn't sound right. */
638 # define OS_TYPE "LINUX"
640 # define DYNAMIC_LOADING
642 # define STACK_GRAN 0x10000000
643 /* Stack usually starts at 0x80000000 */
644 # define LINUX_DATA_START
646 # define DATAEND (&_end)
649 /* There are reasons to suspect this may not be reliable. */
651 # define OS_TYPE "MACOSX"
652 # define DATASTART ((ptr_t) get_etext())
653 # define STACKBOTTOM ((ptr_t) 0xc0000000)
654 # define DATAEND /* not needed */
655 # define MPROTECT_VDB
657 # define GETPAGESIZE() getpagesize()
661 # define OS_TYPE "NETBSD"
664 # define DATASTART GC_data_start
665 # define DYNAMIC_LOADING
669 # define OS_TYPE "NOSYS"
670 extern void __end, __dso_handle;
671 # define DATASTART (&__dso_handle) /* OK, that's ugly. */
672 # define DATAEND (&__end)
673 /* Stack starts at 0xE0000000 for the simulator. */
675 # define STACK_GRAN 0x10000000
681 # define MACH_TYPE "VAX"
682 # define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
684 # define DATASTART ((ptr_t)(&etext))
686 # define OS_TYPE "BSD"
688 /* HEURISTIC2 may be OK, but it's hard to test. */
691 # define OS_TYPE "ULTRIX"
692 # define STACKBOTTOM ((ptr_t) 0x7fffc800)
697 # define MACH_TYPE "RT"
699 # define DATASTART ((ptr_t) 0x10000000)
700 # define STACKBOTTOM ((ptr_t) 0x1fffd800)
704 # define MACH_TYPE "SPARC"
705 # if defined(__arch64__) || defined(__sparcv9)
708 # define ALIGNMENT 4 /* Required by hardware */
710 # define ALIGN_DOUBLE
712 # define OS_TYPE "SUNOS5"
715 extern char * GC_SysVGetDataStart();
716 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
717 # define DATAEND (&_end)
722 # define HEAP_START (ptr_t)0x40000000
724 # define HEAP_START DATAEND
727 /* HEURISTIC1 reportedly no longer works under 2.7. */
728 /* HEURISTIC2 probably works, but this appears to be preferable. */
729 /* Apparently USRSTACK is defined to be USERLIMIT, but in some */
730 /* installations that's undefined. We work around this with a */
732 # include <sys/vmparam.h>
734 /* This should work everywhere, but doesn't. */
735 # define STACKBOTTOM USRSTACK
740 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
741 /* getpagesize() appeared to be missing from at least one */
742 /* Solaris 5.4 installation. Weird. */
743 # define DYNAMIC_LOADING
746 # define OS_TYPE "SUNOS4"
747 /* [If you have a weak stomach, don't read this.] */
748 /* We would like to use: */
749 /* # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */
750 /* This fails occasionally, due to an ancient, but very */
751 /* persistent ld bug. &etext is set 32 bytes too high. */
752 /* We instead read the text segment size from the a.out */
753 /* header, which happens to be mapped into our address space */
754 /* at the start of the text segment. The detective work here */
755 /* was done by Robert Ehrlich, Manuel Serrano, and Bernard */
756 /* Serpette of INRIA. */
757 /* This assumes ZMAGIC, i.e. demand-loadable executables. */
758 # define TEXTSTART 0x2000
759 # define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
760 # define MPROTECT_VDB
762 # define DYNAMIC_LOADING
765 # define CPP_WORDSZ 32
766 # define OS_TYPE "DRSNX"
767 extern char * GC_SysVGetDataStart();
769 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
770 # define MPROTECT_VDB
771 # define STACKBOTTOM ((ptr_t) 0xdfff0000)
772 # define DYNAMIC_LOADING
775 # define OS_TYPE "LINUX"
777 # define DYNAMIC_LOADING
779 Linux Sparc/a.out not supported
783 # define DATAEND (&_end)
786 # define STACKBOTTOM ((ptr_t) 0x80000000000ULL)
787 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x100000, &_etext)
788 # define CPP_WORDSZ 64
790 # define STACKBOTTOM ((ptr_t) 0xf0000000)
791 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
795 # define OS_TYPE "OPENBSD"
796 # define STACKBOTTOM ((ptr_t) 0xf8000000)
798 # define DATASTART ((ptr_t)(&etext))
801 # define OS_TYPE "NETBSD"
804 # define DATASTART GC_data_start
805 # define DYNAMIC_LOADING
808 # define DATASTART ((ptr_t)(&etext))
814 # define MACH_TYPE "I386"
815 # define ALIGNMENT 4 /* Appears to hold for all "32 bit" compilers */
816 /* except Borland. The -a4 option fixes */
818 /* Ivan Demakov: For Watcom the option is -zp4. */
819 # ifndef SMALL_CONFIG
820 # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
821 /* improvement on Pentiums. */
823 # ifdef HAVE_BUILTIN_UNWIND_INIT
824 # define USE_GENERIC_PUSH_REGS
827 # define OS_TYPE "SEQUENT"
829 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
830 # define STACKBOTTOM ((ptr_t) 0x3ffff000)
833 # define OS_TYPE "BEOS"
835 # define GETPAGESIZE() B_PAGE_SIZE
837 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
840 # define OS_TYPE "SUNOS5"
841 extern int _etext, _end;
842 extern char * GC_SysVGetDataStart();
843 # define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
844 # define DATAEND (&_end)
845 /* # define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7, */
846 /* but reportedly breaks under 2.8. It appears that the stack */
847 /* base is a property of the executable, so this should not break */
848 /* old executables. */
849 /* HEURISTIC2 probably works, but this appears to be preferable. */
850 # include <sys/vmparam.h>
851 # define STACKBOTTOM USRSTACK
852 /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
853 # ifdef SOLARIS25_PROC_VDB_BUG_FIXED
856 # define DYNAMIC_LOADING
861 # define HEAP_START (ptr_t)0x40000000
863 # define HEAP_START DATAEND
867 # define OS_TYPE "SCO"
869 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
871 +((word)&etext & 0xfff))
872 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
875 # define OS_TYPE "SCO_ELF"
877 # define DATASTART ((ptr_t)(&etext))
878 # define STACKBOTTOM ((ptr_t) 0x08048000)
879 # define DYNAMIC_LOADING
880 # define ELF_CLASS ELFCLASS32
883 # define OS_TYPE "LINUX"
884 # define LINUX_STACKBOTTOM
888 # define STACK_GRAN 0x10000000
889 /* STACKBOTTOM is usually 0xc0000000, but this changes with */
890 /* different kernel configurations. In particular, systems */
891 /* with 2GB physical memory will usually move the user */
892 /* address space limit, and hence initial SP to 0x80000000. */
894 # if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
895 # define MPROTECT_VDB
897 /* We seem to get random errors in incremental mode, */
898 /* possibly because Linux threads is itself a malloc client */
899 /* and can't deal with the signals. */
902 # define DYNAMIC_LOADING
903 # ifdef UNDEFINED /* includes ro data */
905 # define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
907 # include <features.h>
908 # if defined(__GLIBC__) && __GLIBC__ >= 2
909 # define LINUX_DATA_START
911 extern char **__environ;
912 # define DATASTART ((ptr_t)(&__environ))
913 /* hideous kludge: __environ is the first */
914 /* word in crt0.o, and delimits the start */
915 /* of the data segment, no matter which */
916 /* ld options were passed through. */
917 /* We could use _etext instead, but that */
918 /* would include .rodata, which may */
919 /* contain large read-only data tables */
920 /* that we'd rather not scan. */
923 # define DATAEND (&_end)
926 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
928 # ifdef USE_I686_PREFETCH
929 # define PREFETCH(x) \
930 __asm__ __volatile__ (" prefetchnta %0": : "m"(*(char *)(x)))
931 /* Empirically prefetcht0 is much more effective at reducing */
932 /* cache miss stalls for the targetted load instructions. But it */
933 /* seems to interfere enough with other cache traffic that the net */
934 /* result is worse than prefetchnta. */
936 /* Using prefetches for write seems to have a slight negative */
937 /* impact on performance, at least for a PIII/500. */
938 # define PREFETCH_FOR_WRITE(x) \
939 __asm__ __volatile__ (" prefetcht0 %0": : "m"(*(char *)(x)))
942 # ifdef USE_3DNOW_PREFETCH
943 # define PREFETCH(x) \
944 __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))
945 # define PREFETCH_FOR_WRITE(x) \
946 __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))
950 # define OS_TYPE "CYGWIN32"
951 extern int _data_start__;
952 extern int _data_end__;
953 extern int _bss_start__;
954 extern int _bss_end__;
955 /* For binutils 2.9.1, we have */
956 /* DATASTART = _data_start__ */
957 /* DATAEND = _bss_end__ */
958 /* whereas for some earlier versions it was */
959 /* DATASTART = _bss_start__ */
960 /* DATAEND = _data_end__ */
961 /* To get it right for both, we take the */
962 /* minumum/maximum of the two. */
963 # define MAX(x,y) ((x) > (y) ? (x) : (y))
964 # define MIN(x,y) ((x) < (y) ? (x) : (y))
965 # define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
966 # define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__))
968 # define STACK_GRAN 0x10000
972 # define OS_TYPE "OS2"
973 /* STACKBOTTOM and DATASTART are handled specially in */
974 /* os_dep.c. OS2 actually has the right */
976 # define DATAEND /* not needed */
977 # define USE_GENERIC_PUSH_REGS
980 # define OS_TYPE "MSWIN32"
981 /* STACKBOTTOM and DATASTART are handled specially in */
984 # define MPROTECT_VDB
986 # define DATAEND /* not needed */
989 # define OS_TYPE "MSWINCE"
990 # define DATAEND /* not needed */
993 # define OS_TYPE "DJGPP"
994 # include "stubinfo.h"
997 extern int __djgpp_stack_limit;
998 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
999 /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
1001 # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
1002 /* This may not be right. */
1005 # define OS_TYPE "OPENBSD"
1008 # define OS_TYPE "FREEBSD"
1009 # define MPROTECT_VDB
1010 # define FREEBSD_STACKBOTTOM
1013 # define OS_TYPE "NETBSD"
1016 # define OS_TYPE "THREE86BSD"
1019 # define OS_TYPE "BSDI"
1021 # if defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1022 || defined(THREE86BSD) || defined(BSDI)
1025 # define DATASTART ((ptr_t)(&etext))
1028 # define OS_TYPE "NEXT"
1029 # define DATASTART ((ptr_t) get_etext())
1030 # define STACKBOTTOM ((ptr_t)0xc0000000)
1031 # define DATAEND /* not needed */
1034 # define OS_TYPE "DOS4GW"
1035 extern long __nullarea;
1037 extern char *_STACKTOP;
1038 /* Depending on calling conventions Watcom C either precedes
1039 or does not precedes with undescore names of C-variables.
1040 Make sure startup code variables always have the same names. */
1041 #pragma aux __nullarea "*";
1042 #pragma aux _end "*";
1043 # define STACKBOTTOM ((ptr_t) _STACKTOP)
1044 /* confused? me too. */
1045 # define DATASTART ((ptr_t) &__nullarea)
1046 # define DATAEND ((ptr_t) &_end)
1049 # define OS_TYPE "HURD"
1050 # define STACK_GROWS_DOWN
1052 extern int __data_start;
1053 # define DATASTART ( (ptr_t) (&__data_start))
1055 # define DATAEND ( (ptr_t) (&_end))
1056 /* # define MPROTECT_VDB Not quite working yet? */
1057 # define DYNAMIC_LOADING
1062 # define MACH_TYPE "NS32K"
1063 # define ALIGNMENT 4
1064 extern char **environ;
1065 # define DATASTART ((ptr_t)(&environ))
1066 /* hideous kludge: environ is the first */
1067 /* word in crt0.o, and delimits the start */
1068 /* of the data segment, no matter which */
1069 /* ld options were passed through. */
1070 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
1074 # define MACH_TYPE "MIPS"
1076 /* This was developed for a linuxce style platform. Probably */
1077 /* needs to be tweaked for workstation class machines. */
1078 # define OS_TYPE "LINUX"
1079 extern int __data_start;
1080 # define DATASTART ((ptr_t)(&__data_start))
1081 # define ALIGNMENT 4
1082 # define USE_GENERIC_PUSH_REGS
1083 # define STACKBOTTOM ((ptr_t)0x7fff8000)
1084 /* Older toolchains may need 0x80000000. */
1085 /* In many cases, this should probably use LINUX_STACKBOTTOM */
1086 /* instead. But some kernel versions seem to give the wrong */
1087 /* value from /proc. */
1091 # define DATASTART (ptr_t)0x10000000
1092 /* Could probably be slightly higher since */
1093 /* startup code allocates lots of stuff. */
1094 # define OS_TYPE "ULTRIX"
1095 # define ALIGNMENT 4
1099 # define DATASTART (ptr_t)0x10000000
1100 # define OS_TYPE "RISCOS"
1101 # define ALIGNMENT 4 /* Required by hardware */
1106 # define DATASTART ((ptr_t)(&_fdata))
1108 # define HEAP_START (ptr_t)0x30000000
1110 # define HEAP_START DATASTART
1112 /* Lowest plausible heap address. */
1113 /* In the MMAP case, we map there. */
1114 /* In either case it is used to identify */
1115 /* heap sections so they're not */
1116 /* considered as roots. */
1117 # define OS_TYPE "IRIX5"
1118 # define MPROTECT_VDB
1120 # define CPP_WORDSZ _MIPS_SZPTR
1121 # define ALIGNMENT (_MIPS_SZPTR/8)
1122 # if CPP_WORDSZ != 64
1123 # define ALIGN_DOUBLE
1126 # define ALIGNMENT 4
1127 # define ALIGN_DOUBLE
1129 # define DYNAMIC_LOADING
1132 # define OS_TYPE "MSWINCE"
1133 # define ALIGNMENT 4
1134 # define DATAEND /* not needed */
1136 # if defined(NETBSD)
1137 /* This also checked for __MIPSEL__ . Why? NETBSD recognition */
1138 /* should be handled at the top of the file. */
1139 # define ALIGNMENT 4
1140 # define OS_TYPE "NETBSD"
1142 # define USE_GENERIC_PUSH_REGS
1145 # define DATASTART GC_data_start
1146 # define NEED_FIND_LIMIT
1147 # define DYNAMIC_LOADING
1149 # define DATASTART ((ptr_t) 0x10000000)
1150 # define STACKBOTTOM ((ptr_t) 0x7ffff000)
1156 # define MACH_TYPE "RS6000"
1157 # define ALIGNMENT 4
1158 # define DATASTART ((ptr_t)0x20000000)
1160 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
1161 # define DYNAMIC_LOADING
1162 /* For really old versions of AIX, this may have to be removed. */
1166 # define MACH_TYPE "HP_PA"
1167 # define OS_TYPE "HPUX"
1169 # define CPP_WORDSZ 64
1170 # define ALIGNMENT 8
1172 # define CPP_WORDSZ 32
1173 # define ALIGNMENT 4
1174 # define ALIGN_DOUBLE
1176 # if !defined(GC_HPUX_THREADS) && !defined(HPUX_THREADS) \
1177 && !defined(GC_LINUX_THREADS) && !defined(LINUX_THREADS)
1178 # ifndef LINUX /* For now. */
1179 # define MPROTECT_VDB
1182 # define GENERIC_COMPARE_AND_SWAP
1183 /* No compare-and-swap instruction. Use pthread mutexes */
1184 /* when we absolutely have to. */
1185 # ifdef PARALLEL_MARK
1186 # define USE_MARK_BYTES
1187 /* Minimize compare-and-swap usage. */
1190 # define STACK_GROWS_UP
1192 extern int __data_start;
1193 # define DATASTART ((ptr_t)(&__data_start))
1195 /* The following appears to work for 7xx systems running HP/UX */
1196 /* 9.xx Furthermore, it might result in much faster */
1197 /* collections than HEURISTIC2, which may involve scanning */
1198 /* segments that directly precede the stack. It is not the */
1199 /* default, since it may not work on older machine/OS */
1200 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
1202 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
1204 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1205 /* to this. Note that the GC must be initialized before the */
1206 /* first putenv call. */
1207 extern char ** environ;
1208 # define STACKBOTTOM ((ptr_t)environ)
1210 # define DYNAMIC_LOADING
1211 # include <unistd.h>
1212 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1214 # define PREFETCH(x) { \
1215 register long addr = (long)(x); \
1216 (void) _asm ("LDW", 0, 0, addr, 0); \
1221 # define OS_TYPE "LINUX"
1222 # define LINUX_STACKBOTTOM
1223 # define DYNAMIC_LOADING
1224 # define LINUX_DATA_START
1226 # define DATAEND (&_end)
1231 # define MACH_TYPE "ALPHA"
1232 # define ALIGNMENT 8
1234 # define OS_TYPE "NETBSD"
1236 # define DATASTART GC_data_start
1237 # define ELFCLASS32 32
1238 # define ELFCLASS64 64
1239 # define ELF_CLASS ELFCLASS64
1240 # define CPP_WORDSZ 64
1241 # define DYNAMIC_LOADING
1244 # define OS_TYPE "OSF1"
1245 # define DATASTART ((ptr_t) 0x140000000)
1247 # define DATAEND ((ptr_t) &_end)
1248 extern char ** environ;
1249 /* round up from the value of environ to the nearest page boundary */
1250 /* Probably breaks if putenv is called before collector */
1251 /* initialization. */
1252 # define STACKBOTTOM ((ptr_t)(((word)(environ) | (getpagesize()-1))+1))
1253 /* # define HEURISTIC2 */
1254 /* Normally HEURISTIC2 is too conervative, since */
1255 /* the text segment immediately follows the stack. */
1256 /* Hence we give an upper pound. */
1257 /* This is currently unused, since we disabled HEURISTIC2 */
1259 # define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
1260 # define CPP_WORDSZ 64
1261 # define MPROTECT_VDB
1262 # define DYNAMIC_LOADING
1265 # define OS_TYPE "LINUX"
1266 # define CPP_WORDSZ 64
1267 # define STACKBOTTOM ((ptr_t) 0x120000000)
1269 # define SEARCH_FOR_DATA_START
1270 # define DATASTART GC_data_start
1271 # define DYNAMIC_LOADING
1273 # define DATASTART ((ptr_t) 0x140000000)
1276 # define DATAEND (&_end)
1277 # define MPROTECT_VDB
1278 /* Has only been superficially tested. May not */
1279 /* work on all versions. */
1284 # define MACH_TYPE "IA64"
1285 # define ALIGN_DOUBLE
1286 /* Requires 16 byte alignment for malloc */
1287 # define ALIGNMENT 8
1288 # define USE_GENERIC_PUSH_REGS
1289 /* We need to get preserved registers in addition to register */
1290 /* windows. That's easiest to do with setjmp. */
1291 # ifdef PARALLEL_MARK
1292 # define USE_MARK_BYTES
1293 /* Compare-and-exchange is too expensive to use for */
1294 /* setting mark bits. */
1300 # define OS_TYPE "LINUX"
1301 # define CPP_WORDSZ 64
1302 /* The following works on NUE and older kernels: */
1303 /* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
1304 /* This does not work on NUE: */
1305 # define LINUX_STACKBOTTOM
1306 /* We also need the base address of the register stack */
1307 /* backing store. This is computed in */
1308 /* GC_linux_register_stack_base based on the following */
1310 # define BACKING_STORE_ALIGNMENT 0x100000
1311 # define BACKING_STORE_DISPLACEMENT 0x80000000
1312 extern char * GC_register_stackbottom;
1313 # define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)
1314 # define SEARCH_FOR_DATA_START
1315 # define DATASTART GC_data_start
1316 # define DYNAMIC_LOADING
1317 # define MPROTECT_VDB
1318 /* Requires Linux 2.3.47 or later. */
1320 # define DATAEND (&_end)
1322 # define PREFETCH(x) \
1323 __asm__ (" lfetch [%0]": : "r"((void *)(x)))
1324 # define PREFETCH_FOR_WRITE(x) \
1325 __asm__ (" lfetch.excl [%0]": : "r"((void *)(x)))
1326 # define CLEAR_DOUBLE(x) \
1327 __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))
1333 # define MACH_TYPE "M88K"
1334 # define ALIGNMENT 4
1335 # define ALIGN_DOUBLE
1338 # define OS_TYPE "CX_UX"
1339 # define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
1342 # define OS_TYPE "DGUX"
1343 extern char * GC_SysVGetDataStart();
1344 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
1346 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
1350 # define MACH_TYPE "S370"
1351 # define ALIGNMENT 4 /* Required by hardware */
1352 # define USE_GENERIC_PUSH_REGS
1354 # define OS_TYPE "UTS4"
1358 extern char * GC_SysVGetDataStart();
1359 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
1360 # define DATAEND (&_end)
1364 # define OS_TYPE "LINUX"
1366 # define DYNAMIC_LOADING
1367 extern int __data_start;
1368 # define DATASTART ((ptr_t)(&__data_start))
1373 # define ALIGNMENT 4
1375 # define DATASTART ((ptr_t)(&_etext))
1380 # define CPP_WORDSZ 32
1381 # define MACH_TYPE "ARM32"
1382 # define ALIGNMENT 4
1384 # define OS_TYPE "NETBSD"
1387 # define DATASTART ((ptr_t)(&etext))
1388 # define USE_GENERIC_PUSH_REGS
1391 # define OS_TYPE "LINUX"
1394 # define STACK_GRAN 0x10000000
1395 # define USE_GENERIC_PUSH_REGS
1397 # define DYNAMIC_LOADING
1398 # include <features.h>
1399 # if defined(__GLIBC__) && __GLIBC__ >= 2
1400 # define LINUX_DATA_START
1402 extern char **__environ;
1403 # define DATASTART ((ptr_t)(&__environ))
1404 /* hideous kludge: __environ is the first */
1405 /* word in crt0.o, and delimits the start */
1406 /* of the data segment, no matter which */
1407 /* ld options were passed through. */
1408 /* We could use _etext instead, but that */
1409 /* would include .rodata, which may */
1410 /* contain large read-only data tables */
1411 /* that we'd rather not scan. */
1414 # define DATAEND (&_end)
1417 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
1421 # define OS_TYPE "MSWINCE"
1422 # define DATAEND /* not needed */
1427 # define MACH_TYPE "SH"
1428 # define ALIGNMENT 4
1430 # define OS_TYPE "MSWINCE"
1431 # define DATAEND /* not needed */
1434 # define OS_TYPE "LINUX"
1435 # define STACKBOTTOM ((ptr_t) 0x7c000000)
1436 # define USE_GENERIC_PUSH_REGS
1437 # define DYNAMIC_LOADING
1438 # define LINUX_DATA_START
1440 # define DATAEND (&_end)
1445 # define MACH_TYPE "SH4"
1446 # define OS_TYPE "MSWINCE"
1447 # define ALIGNMENT 4
1448 # define DATAEND /* not needed */
1451 #ifdef LINUX_DATA_START
1452 /* Some Linux distributions arrange to define __data_start. Some */
1453 /* define data_start as a weak symbol. The latter is technically */
1454 /* broken, since the user program may define data_start, in which */
1455 /* case we lose. Nonetheless, we try both, prefering __data_start. */
1456 /* We assume gcc. */
1457 # pragma weak __data_start
1458 extern int __data_start;
1459 # pragma weak data_start
1460 extern int data_start;
1461 # define DATASTART ((ptr_t)(&__data_start != 0? &__data_start : &data_start))
1464 #if defined(LINUX) && defined(REDIRECT_MALLOC)
1465 /* Rld appears to allocate some memory with its own allocator, and */
1466 /* some through malloc, which might be redirected. To make this */
1467 /* work with collectable memory, we have to scan memory allocated */
1468 /* by rld's internal malloc. */
1469 # define USE_PROC_FOR_LIBRARIES
1472 # ifndef STACK_GROWS_UP
1473 # define STACK_GROWS_DOWN
1477 # define CPP_WORDSZ 32
1486 # define DATAEND (&end)
1489 # if defined(SVR4) && !defined(GETPAGESIZE)
1490 # include <unistd.h>
1491 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
1494 # ifndef GETPAGESIZE
1495 # if defined(SUNOS5) || defined(IRIX5)
1496 # include <unistd.h>
1498 # define GETPAGESIZE() getpagesize()
1501 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
1502 /* OS has SVR4 generic features. Probably others also qualify. */
1506 # if defined(SUNOS5) || defined(DRSNX)
1507 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
1510 /* OS has SUNOS5 style signal handlers. */
1518 # if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \
1519 || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1520 || defined(BSD) || defined(AIX) || defined(MACOSX) || defined(OSF1)
1521 # define UNIX_LIKE /* Basic Unix-like system calls work. */
1524 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
1529 # undef DYNAMIC_LOADING
1534 # undef MPROTECT_VDB
1539 /* Postponed for now. */
1541 # undef MPROTECT_VDB
1544 # ifdef SMALL_CONFIG
1545 /* Presumably not worth the space it takes. */
1547 # undef MPROTECT_VDB
1551 # undef MPROTECT_VDB /* Can't deal with address space holes. */
1554 # ifdef PARALLEL_MARK
1555 # undef MPROTECT_VDB /* For now. */
1558 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
1559 # define DEFAULT_VDB
1563 # define PREFETCH(x)
1564 # define NO_PREFETCH
1567 # ifndef PREFETCH_FOR_WRITE
1568 # define PREFETCH_FOR_WRITE(x)
1569 # define NO_PREFETCH_FOR_WRITE
1572 # ifndef CACHE_LINE_SIZE
1573 # define CACHE_LINE_SIZE 32 /* Wild guess */
1576 # ifndef CLEAR_DOUBLE
1577 # define CLEAR_DOUBLE(x) \
1578 ((word*)x)[0] = 0; \
1580 # endif /* CLEAR_DOUBLE */
1582 /* Internally to the collector we test only the XXX_THREADS macros */
1583 /* not the GC_XXX_THREADS versions. Here we make sure the latter */
1584 /* are treated as equivalent. */
1585 #if defined(GC_SOLARIS_THREADS) && !defined(_SOLARIS_THREADS)
1586 # define _SOLARIS_THREADS
1588 #if defined(GC_SOLARIS_THREADS) && !defined(_SOLARIS_PTHREADS)
1589 # define _SOLARIS_PTHREADS
1591 #if defined(GC_IRIX_THREADS) && !defined(IRIX_THREADS)
1592 # define IRIX_THREADS
1594 #if defined(GC_LINUX_THREADS) && !defined(LINUX_THREADS)
1595 # define LINUX_THREADS
1597 #if defined(GC_WIN32_THREADS) && !defined(WIN32_THREADS)
1598 # define WIN32_THREADS
1600 #if defined(GC_HPUX_THREADS) && !defined(HPUX_THREADS)
1601 # define HPUX_THREADS
1603 #if defined(GC_OSF1_THREADS) && !defined(OSF1_THREADS)
1604 # define OSF1_THREADS
1607 /* Internally we use SOLARIS_THREADS to test for either old or pthreads. */
1608 # if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
1609 # define SOLARIS_THREADS
1611 # if defined(IRIX_THREADS) && !defined(IRIX5)
1612 --> inconsistent configuration
1614 # if defined(LINUX_THREADS) && !defined(LINUX)
1615 --> inconsistent configuration
1617 # if defined(SOLARIS_THREADS) && !defined(SUNOS5)
1618 --> inconsistent configuration
1620 # if defined(HPUX_THREADS) && !defined(HPUX)
1621 --> inconsistent configuration
1623 # if defined(WIN32_THREADS) && !defined(MSWIN32)
1624 /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect the necessary code */
1625 /* is mostly there, but nobody has actually made sure the right combination of pieces is */
1626 /* compiled in, etc. */
1627 --> inconsistent configuration
1629 # if defined(PCR) || defined(SRC_M3) || \
1630 defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
1631 defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
1632 defined(HPUX_THREADS) || defined(OSF1_THREADS)
1636 # if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(MACOSX) \
1637 || defined(LINT) || defined(MSWINCE) \
1638 || (defined(I386) && defined(__LCC__))
1639 /* Use setjmp based hack to mark from callee-save registers. */
1640 /* The define should move to the individual platform */
1642 # define USE_GENERIC_PUSH_REGS
1644 # if defined(I386) && defined(LINUX)
1645 /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
1646 /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
1647 # ifdef SAVE_CALL_COUNT
1648 # define SAVE_CALL_CHAIN
1652 # define SAVE_CALL_CHAIN
1653 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
1654 /* include assembly code to do it well. */
1657 # endif /* GCCONFIG_H */