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, _start;
842 extern char * GC_SysVGetDataStart();
843 # define DATASTART GC_SysVGetDataStart(0x1000, &etext)
844 /* # define STACKBOTTOM ((ptr_t)(&_start)) worked through 2.7, */
845 /* but reportedly breaks under 2.8. It appears that the stack */
846 /* base is a property of the executable, so this should not break */
847 /* old executables. */
848 /* HEURISTIC2 probably works, but this appears to be preferable. */
849 # include <sys/vmparam.h>
850 # define STACKBOTTOM USRSTACK
851 /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
852 /*# define PROC_VDB*/
853 # define DYNAMIC_LOADING
858 # define HEAP_START (ptr_t)0x40000000
860 # define HEAP_START DATAEND
864 # define OS_TYPE "SCO"
866 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
868 +((word)&etext & 0xfff))
869 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
872 # define OS_TYPE "SCO_ELF"
874 # define DATASTART ((ptr_t)(&etext))
875 # define STACKBOTTOM ((ptr_t) 0x08048000)
876 # define DYNAMIC_LOADING
877 # define ELF_CLASS ELFCLASS32
880 # define OS_TYPE "LINUX"
881 # define LINUX_STACKBOTTOM
885 # define STACK_GRAN 0x10000000
886 /* STACKBOTTOM is usually 0xc0000000, but this changes with */
887 /* different kernel configurations. In particular, systems */
888 /* with 2GB physical memory will usually move the user */
889 /* address space limit, and hence initial SP to 0x80000000. */
891 # if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
892 # define MPROTECT_VDB
894 /* We seem to get random errors in incremental mode, */
895 /* possibly because Linux threads is itself a malloc client */
896 /* and can't deal with the signals. */
899 # define DYNAMIC_LOADING
900 # ifdef UNDEFINED /* includes ro data */
902 # define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
904 # include <features.h>
905 # if defined(__GLIBC__) && __GLIBC__ >= 2
906 # define LINUX_DATA_START
908 extern char **__environ;
909 # define DATASTART ((ptr_t)(&__environ))
910 /* hideous kludge: __environ is the first */
911 /* word in crt0.o, and delimits the start */
912 /* of the data segment, no matter which */
913 /* ld options were passed through. */
914 /* We could use _etext instead, but that */
915 /* would include .rodata, which may */
916 /* contain large read-only data tables */
917 /* that we'd rather not scan. */
920 # define DATAEND (&_end)
923 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
925 # ifdef USE_I686_PREFETCH
926 # define PREFETCH(x) \
927 __asm__ __volatile__ (" prefetchnta %0": : "m"(*(char *)(x)))
928 /* Empirically prefetcht0 is much more effective at reducing */
929 /* cache miss stalls for the targetted load instructions. But it */
930 /* seems to interfere enough with other cache traffic that the net */
931 /* result is worse than prefetchnta. */
933 /* Using prefetches for write seems to have a slight negative */
934 /* impact on performance, at least for a PIII/500. */
935 # define PREFETCH_FOR_WRITE(x) \
936 __asm__ __volatile__ (" prefetcht0 %0": : "m"(*(char *)(x)))
939 # ifdef USE_3DNOW_PREFETCH
940 # define PREFETCH(x) \
941 __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))
942 # define PREFETCH_FOR_WRITE(x) \
943 __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))
947 # define OS_TYPE "CYGWIN32"
948 extern int _data_start__;
949 extern int _data_end__;
950 extern int _bss_start__;
951 extern int _bss_end__;
952 /* For binutils 2.9.1, we have */
953 /* DATASTART = _data_start__ */
954 /* DATAEND = _bss_end__ */
955 /* whereas for some earlier versions it was */
956 /* DATASTART = _bss_start__ */
957 /* DATAEND = _data_end__ */
958 /* To get it right for both, we take the */
959 /* minumum/maximum of the two. */
960 # define MAX(x,y) ((x) > (y) ? (x) : (y))
961 # define MIN(x,y) ((x) < (y) ? (x) : (y))
962 # define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
963 # define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__))
965 # define STACK_GRAN 0x10000
969 # define OS_TYPE "OS2"
970 /* STACKBOTTOM and DATASTART are handled specially in */
971 /* os_dep.c. OS2 actually has the right */
973 # define DATAEND /* not needed */
974 # define USE_GENERIC_PUSH_REGS
977 # define OS_TYPE "MSWIN32"
978 /* STACKBOTTOM and DATASTART are handled specially in */
981 # define MPROTECT_VDB
983 # define DATAEND /* not needed */
986 # define OS_TYPE "MSWINCE"
987 # define DATAEND /* not needed */
990 # define OS_TYPE "DJGPP"
991 # include "stubinfo.h"
994 extern int __djgpp_stack_limit;
995 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
996 /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
998 # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
999 /* This may not be right. */
1002 # define OS_TYPE "OPENBSD"
1005 # define OS_TYPE "FREEBSD"
1006 # define MPROTECT_VDB
1007 # define FREEBSD_STACKBOTTOM
1010 # define OS_TYPE "NETBSD"
1013 # define OS_TYPE "THREE86BSD"
1016 # define OS_TYPE "BSDI"
1018 # if defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1019 || defined(THREE86BSD) || defined(BSDI)
1022 # define DATASTART ((ptr_t)(&etext))
1025 # define OS_TYPE "NEXT"
1026 # define DATASTART ((ptr_t) get_etext())
1027 # define STACKBOTTOM ((ptr_t)0xc0000000)
1028 # define DATAEND /* not needed */
1031 # define OS_TYPE "DOS4GW"
1032 extern long __nullarea;
1034 extern char *_STACKTOP;
1035 /* Depending on calling conventions Watcom C either precedes
1036 or does not precedes with undescore names of C-variables.
1037 Make sure startup code variables always have the same names. */
1038 #pragma aux __nullarea "*";
1039 #pragma aux _end "*";
1040 # define STACKBOTTOM ((ptr_t) _STACKTOP)
1041 /* confused? me too. */
1042 # define DATASTART ((ptr_t) &__nullarea)
1043 # define DATAEND ((ptr_t) &_end)
1046 # define OS_TYPE "HURD"
1047 # define STACK_GROWS_DOWN
1049 extern int __data_start;
1050 # define DATASTART ( (ptr_t) (&__data_start))
1052 # define DATAEND ( (ptr_t) (&_end))
1053 /* # define MPROTECT_VDB Not quite working yet? */
1054 # define DYNAMIC_LOADING
1059 # define MACH_TYPE "NS32K"
1060 # define ALIGNMENT 4
1061 extern char **environ;
1062 # define DATASTART ((ptr_t)(&environ))
1063 /* hideous kludge: environ is the first */
1064 /* word in crt0.o, and delimits the start */
1065 /* of the data segment, no matter which */
1066 /* ld options were passed through. */
1067 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
1071 # define MACH_TYPE "MIPS"
1073 /* This was developed for a linuxce style platform. Probably */
1074 /* needs to be tweaked for workstation class machines. */
1075 # define OS_TYPE "LINUX"
1076 extern int __data_start;
1077 # define DATASTART ((ptr_t)(&__data_start))
1078 # define ALIGNMENT 4
1079 # define USE_GENERIC_PUSH_REGS
1080 # define STACKBOTTOM ((ptr_t)0x7fff8000)
1081 /* Older toolchains may need 0x80000000. */
1082 /* In many cases, this should probably use LINUX_STACKBOTTOM */
1083 /* instead. But some kernel versions seem to give the wrong */
1084 /* value from /proc. */
1088 # define DATASTART (ptr_t)0x10000000
1089 /* Could probably be slightly higher since */
1090 /* startup code allocates lots of stuff. */
1091 # define OS_TYPE "ULTRIX"
1092 # define ALIGNMENT 4
1096 # define DATASTART (ptr_t)0x10000000
1097 # define OS_TYPE "RISCOS"
1098 # define ALIGNMENT 4 /* Required by hardware */
1103 # define DATASTART ((ptr_t)(&_fdata))
1105 # define HEAP_START (ptr_t)0x30000000
1107 # define HEAP_START DATASTART
1109 /* Lowest plausible heap address. */
1110 /* In the MMAP case, we map there. */
1111 /* In either case it is used to identify */
1112 /* heap sections so they're not */
1113 /* considered as roots. */
1114 # define OS_TYPE "IRIX5"
1115 # define MPROTECT_VDB
1117 # define CPP_WORDSZ _MIPS_SZPTR
1118 # define ALIGNMENT (_MIPS_SZPTR/8)
1119 # if CPP_WORDSZ != 64
1120 # define ALIGN_DOUBLE
1123 # define ALIGNMENT 4
1124 # define ALIGN_DOUBLE
1126 # define DYNAMIC_LOADING
1129 # define OS_TYPE "MSWINCE"
1130 # define ALIGNMENT 4
1131 # define DATAEND /* not needed */
1133 # if defined(NETBSD)
1134 /* This also checked for __MIPSEL__ . Why? NETBSD recognition */
1135 /* should be handled at the top of the file. */
1136 # define ALIGNMENT 4
1137 # define OS_TYPE "NETBSD"
1139 # define USE_GENERIC_PUSH_REGS
1142 # define DATASTART GC_data_start
1143 # define NEED_FIND_LIMIT
1144 # define DYNAMIC_LOADING
1146 # define DATASTART ((ptr_t) 0x10000000)
1147 # define STACKBOTTOM ((ptr_t) 0x7ffff000)
1153 # define MACH_TYPE "RS6000"
1154 # define ALIGNMENT 4
1155 # define DATASTART ((ptr_t)0x20000000)
1157 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
1158 # define DYNAMIC_LOADING
1159 /* For really old versions of AIX, this may have to be removed. */
1163 # define MACH_TYPE "HP_PA"
1164 # define OS_TYPE "HPUX"
1166 # define CPP_WORDSZ 64
1167 # define ALIGNMENT 8
1169 # define CPP_WORDSZ 32
1170 # define ALIGNMENT 4
1171 # define ALIGN_DOUBLE
1173 # if !defined(GC_HPUX_THREADS) && !defined(HPUX_THREADS) \
1174 && !defined(GC_LINUX_THREADS) && !defined(LINUX_THREADS)
1175 # ifndef LINUX /* For now. */
1176 # define MPROTECT_VDB
1179 # define GENERIC_COMPARE_AND_SWAP
1180 /* No compare-and-swap instruction. Use pthread mutexes */
1181 /* when we absolutely have to. */
1182 # ifdef PARALLEL_MARK
1183 # define USE_MARK_BYTES
1184 /* Minimize compare-and-swap usage. */
1187 # define STACK_GROWS_UP
1189 extern int __data_start;
1190 # define DATASTART ((ptr_t)(&__data_start))
1192 /* The following appears to work for 7xx systems running HP/UX */
1193 /* 9.xx Furthermore, it might result in much faster */
1194 /* collections than HEURISTIC2, which may involve scanning */
1195 /* segments that directly precede the stack. It is not the */
1196 /* default, since it may not work on older machine/OS */
1197 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
1199 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
1201 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1202 /* to this. Note that the GC must be initialized before the */
1203 /* first putenv call. */
1204 extern char ** environ;
1205 # define STACKBOTTOM ((ptr_t)environ)
1207 # define DYNAMIC_LOADING
1208 # include <unistd.h>
1209 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1211 # define PREFETCH(x) { \
1212 register long addr = (long)(x); \
1213 (void) _asm ("LDW", 0, 0, addr, 0); \
1218 # define OS_TYPE "LINUX"
1219 # define LINUX_STACKBOTTOM
1220 # define DYNAMIC_LOADING
1221 # define LINUX_DATA_START
1223 # define DATAEND (&_end)
1228 # define MACH_TYPE "ALPHA"
1229 # define ALIGNMENT 8
1231 # define OS_TYPE "NETBSD"
1233 # define DATASTART GC_data_start
1234 # define ELFCLASS32 32
1235 # define ELFCLASS64 64
1236 # define ELF_CLASS ELFCLASS64
1237 # define CPP_WORDSZ 64
1238 # define DYNAMIC_LOADING
1241 # define OS_TYPE "OSF1"
1242 # define DATASTART ((ptr_t) 0x140000000)
1244 # define DATAEND ((ptr_t) &_end)
1245 extern char ** environ;
1246 /* round up from the value of environ to the nearest page boundary */
1247 /* Probably breaks if putenv is called before collector */
1248 /* initialization. */
1249 # define STACKBOTTOM ((ptr_t)(((word)(environ) | (getpagesize()-1))+1))
1250 /* # define HEURISTIC2 */
1251 /* Normally HEURISTIC2 is too conervative, since */
1252 /* the text segment immediately follows the stack. */
1253 /* Hence we give an upper pound. */
1254 /* This is currently unused, since we disabled HEURISTIC2 */
1256 # define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
1257 # define CPP_WORDSZ 64
1258 # define MPROTECT_VDB
1259 # define DYNAMIC_LOADING
1262 # define OS_TYPE "LINUX"
1263 # define CPP_WORDSZ 64
1264 # define STACKBOTTOM ((ptr_t) 0x120000000)
1266 # define SEARCH_FOR_DATA_START
1267 # define DATASTART GC_data_start
1268 # define DYNAMIC_LOADING
1270 # define DATASTART ((ptr_t) 0x140000000)
1273 # define DATAEND (&_end)
1274 # define MPROTECT_VDB
1275 /* Has only been superficially tested. May not */
1276 /* work on all versions. */
1281 # define MACH_TYPE "IA64"
1282 # define ALIGN_DOUBLE
1283 /* Requires 16 byte alignment for malloc */
1284 # define ALIGNMENT 8
1285 # define USE_GENERIC_PUSH_REGS
1286 /* We need to get preserved registers in addition to register */
1287 /* windows. That's easiest to do with setjmp. */
1288 # ifdef PARALLEL_MARK
1289 # define USE_MARK_BYTES
1290 /* Compare-and-exchange is too expensive to use for */
1291 /* setting mark bits. */
1297 # define OS_TYPE "LINUX"
1298 # define CPP_WORDSZ 64
1299 /* The following works on NUE and older kernels: */
1300 /* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
1301 /* This does not work on NUE: */
1302 # define LINUX_STACKBOTTOM
1303 /* We also need the base address of the register stack */
1304 /* backing store. This is computed in */
1305 /* GC_linux_register_stack_base based on the following */
1307 # define BACKING_STORE_ALIGNMENT 0x100000
1308 # define BACKING_STORE_DISPLACEMENT 0x80000000
1309 extern char * GC_register_stackbottom;
1310 # define BACKING_STORE_BASE ((ptr_t)GC_register_stackbottom)
1311 # define SEARCH_FOR_DATA_START
1312 # define DATASTART GC_data_start
1313 # define DYNAMIC_LOADING
1314 # define MPROTECT_VDB
1315 /* Requires Linux 2.3.47 or later. */
1317 # define DATAEND (&_end)
1319 # define PREFETCH(x) \
1320 __asm__ (" lfetch [%0]": : "r"((void *)(x)))
1321 # define PREFETCH_FOR_WRITE(x) \
1322 __asm__ (" lfetch.excl [%0]": : "r"((void *)(x)))
1323 # define CLEAR_DOUBLE(x) \
1324 __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))
1330 # define MACH_TYPE "M88K"
1331 # define ALIGNMENT 4
1332 # define ALIGN_DOUBLE
1335 # define OS_TYPE "CX_UX"
1336 # define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
1339 # define OS_TYPE "DGUX"
1340 extern char * GC_SysVGetDataStart();
1341 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
1343 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
1347 # define MACH_TYPE "S370"
1348 # define ALIGNMENT 4 /* Required by hardware */
1349 # define USE_GENERIC_PUSH_REGS
1351 # define OS_TYPE "UTS4"
1355 extern char * GC_SysVGetDataStart();
1356 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
1357 # define DATAEND (&_end)
1361 # define OS_TYPE "LINUX"
1363 # define DYNAMIC_LOADING
1364 extern int __data_start;
1365 # define DATASTART ((ptr_t)(&__data_start))
1370 # define ALIGNMENT 4
1372 # define DATASTART ((ptr_t)(&_etext))
1377 # define CPP_WORDSZ 32
1378 # define MACH_TYPE "ARM32"
1379 # define ALIGNMENT 4
1381 # define OS_TYPE "NETBSD"
1384 # define DATASTART ((ptr_t)(&etext))
1385 # define USE_GENERIC_PUSH_REGS
1388 # define OS_TYPE "LINUX"
1391 # define STACK_GRAN 0x10000000
1392 # define USE_GENERIC_PUSH_REGS
1394 # define DYNAMIC_LOADING
1395 # include <features.h>
1396 # if defined(__GLIBC__) && __GLIBC__ >= 2
1397 # define LINUX_DATA_START
1399 extern char **__environ;
1400 # define DATASTART ((ptr_t)(&__environ))
1401 /* hideous kludge: __environ is the first */
1402 /* word in crt0.o, and delimits the start */
1403 /* of the data segment, no matter which */
1404 /* ld options were passed through. */
1405 /* We could use _etext instead, but that */
1406 /* would include .rodata, which may */
1407 /* contain large read-only data tables */
1408 /* that we'd rather not scan. */
1411 # define DATAEND (&_end)
1414 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
1418 # define OS_TYPE "MSWINCE"
1419 # define DATAEND /* not needed */
1424 # define MACH_TYPE "SH"
1425 # define ALIGNMENT 4
1427 # define OS_TYPE "MSWINCE"
1428 # define DATAEND /* not needed */
1431 # define OS_TYPE "LINUX"
1432 # define STACKBOTTOM ((ptr_t) 0x7c000000)
1433 # define USE_GENERIC_PUSH_REGS
1434 # define DYNAMIC_LOADING
1435 # define LINUX_DATA_START
1437 # define DATAEND (&_end)
1442 # define MACH_TYPE "SH4"
1443 # define OS_TYPE "MSWINCE"
1444 # define ALIGNMENT 4
1445 # define DATAEND /* not needed */
1448 #ifdef LINUX_DATA_START
1449 /* Some Linux distributions arrange to define __data_start. Some */
1450 /* define data_start as a weak symbol. The latter is technically */
1451 /* broken, since the user program may define data_start, in which */
1452 /* case we lose. Nonetheless, we try both, prefering __data_start. */
1453 /* We assume gcc. */
1454 # pragma weak __data_start
1455 extern int __data_start;
1456 # pragma weak data_start
1457 extern int data_start;
1458 # define DATASTART ((ptr_t)(&__data_start != 0? &__data_start : &data_start))
1461 #if defined(LINUX) && defined(REDIRECT_MALLOC)
1462 /* Rld appears to allocate some memory with its own allocator, and */
1463 /* some through malloc, which might be redirected. To make this */
1464 /* work with collectable memory, we have to scan memory allocated */
1465 /* by rld's internal malloc. */
1466 # define USE_PROC_FOR_LIBRARIES
1469 # ifndef STACK_GROWS_UP
1470 # define STACK_GROWS_DOWN
1474 # define CPP_WORDSZ 32
1483 # define DATAEND (&end)
1486 # if defined(SVR4) && !defined(GETPAGESIZE)
1487 # include <unistd.h>
1488 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
1491 # ifndef GETPAGESIZE
1492 # if defined(SUNOS5) || defined(IRIX5)
1493 # include <unistd.h>
1495 # define GETPAGESIZE() getpagesize()
1498 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
1499 /* OS has SVR4 generic features. Probably others also qualify. */
1503 # if defined(SUNOS5) || defined(DRSNX)
1504 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
1507 /* OS has SUNOS5 style signal handlers. */
1515 # if defined(SVR4) || defined(LINUX) || defined(IRIX) || defined(HPUX) \
1516 || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
1517 || defined(BSD) || defined(AIX) || defined(MACOSX) || defined(OSF1)
1518 # define UNIX_LIKE /* Basic Unix-like system calls work. */
1521 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
1526 # undef DYNAMIC_LOADING
1531 # undef MPROTECT_VDB
1536 /* Postponed for now. */
1538 # undef MPROTECT_VDB
1541 # ifdef SMALL_CONFIG
1542 /* Presumably not worth the space it takes. */
1544 # undef MPROTECT_VDB
1548 # undef MPROTECT_VDB /* Can't deal with address space holes. */
1551 # ifdef PARALLEL_MARK
1552 # undef MPROTECT_VDB /* For now. */
1555 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
1556 # define DEFAULT_VDB
1560 # define PREFETCH(x)
1561 # define NO_PREFETCH
1564 # ifndef PREFETCH_FOR_WRITE
1565 # define PREFETCH_FOR_WRITE(x)
1566 # define NO_PREFETCH_FOR_WRITE
1569 # ifndef CACHE_LINE_SIZE
1570 # define CACHE_LINE_SIZE 32 /* Wild guess */
1573 # ifndef CLEAR_DOUBLE
1574 # define CLEAR_DOUBLE(x) \
1575 ((word*)x)[0] = 0; \
1577 # endif /* CLEAR_DOUBLE */
1579 /* Internally to the collector we test only the XXX_THREADS macros */
1580 /* not the GC_XXX_THREADS versions. Here we make sure the latter */
1581 /* are treated as equivalent. */
1582 #if defined(GC_SOLARIS_THREADS) && !defined(_SOLARIS_THREADS)
1583 # define _SOLARIS_THREADS
1585 #if defined(GC_SOLARIS_THREADS) && !defined(_SOLARIS_PTHREADS)
1586 # define _SOLARIS_PTHREADS
1588 #if defined(GC_IRIX_THREADS) && !defined(IRIX_THREADS)
1589 # define IRIX_THREADS
1591 #if defined(GC_LINUX_THREADS) && !defined(LINUX_THREADS)
1592 # define LINUX_THREADS
1594 #if defined(GC_WIN32_THREADS) && !defined(WIN32_THREADS)
1595 # define WIN32_THREADS
1597 #if defined(GC_HPUX_THREADS) && !defined(HPUX_THREADS)
1598 # define HPUX_THREADS
1600 #if defined(GC_OSF1_THREADS) && !defined(OSF1_THREADS)
1601 # define OSF1_THREADS
1604 /* Internally we use SOLARIS_THREADS to test for either old or pthreads. */
1605 # if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
1606 # define SOLARIS_THREADS
1608 # if defined(IRIX_THREADS) && !defined(IRIX5)
1609 --> inconsistent configuration
1611 # if defined(LINUX_THREADS) && !defined(LINUX)
1612 --> inconsistent configuration
1614 # if defined(SOLARIS_THREADS) && !defined(SUNOS5)
1615 --> inconsistent configuration
1617 # if defined(HPUX_THREADS) && !defined(HPUX)
1618 --> inconsistent configuration
1620 # if defined(WIN32_THREADS) && !defined(MSWIN32)
1621 /* Ideally CYGWIN32 should work, in addition to MSWIN32. I suspect the necessary code */
1622 /* is mostly there, but nobody has actually made sure the right combination of pieces is */
1623 /* compiled in, etc. */
1624 --> inconsistent configuration
1626 # if defined(PCR) || defined(SRC_M3) || \
1627 defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
1628 defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
1629 defined(HPUX_THREADS) || defined(OSF1_THREADS)
1633 # if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(MACOSX) \
1634 || defined(LINT) || defined(MSWINCE) \
1635 || (defined(I386) && defined(__LCC__))
1636 /* Use setjmp based hack to mark from callee-save registers. */
1637 /* The define should move to the individual platform */
1639 # define USE_GENERIC_PUSH_REGS
1641 # if defined(I386) && defined(LINUX)
1642 /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
1643 /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
1644 # ifdef SAVE_CALL_COUNT
1645 # define SAVE_CALL_CHAIN
1649 # define SAVE_CALL_CHAIN
1650 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
1651 /* include assembly code to do it well. */
1654 # endif /* GCCONFIG_H */