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-2004 Hewlett-Packard Development Company, L.P.
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.
18 * This header is private to the gc. It is almost always included from
19 * gc_priv.h. However it is possible to include it by itself if just the
20 * configuration macros are needed. In that
21 * case, a few declarations relying on types declared in gc_priv.h will be
30 /* Fake ptr_t declaration, just to avoid compilation errors. */
31 /* This avoids many instances if "ifndef GC_PRIVATE_H" below. */
32 typedef struct GC_undefined_struct * ptr_t;
35 /* Machine dependent parameters. Some tuning parameters can be found */
36 /* near the top of gc_private.h. */
38 /* Machine specific parts contributed by various people. See README file. */
40 /* First a unified test for Linux: */
41 # if defined(linux) || defined(__linux__)
47 /* And one for NetBSD: */
48 # if defined(__NetBSD__)
52 /* And one for OpenBSD: */
53 # if defined(__OpenBSD__)
57 /* And one for FreeBSD: */
58 # if defined(__FreeBSD__) && !defined(FREEBSD)
62 /* Determine the machine type: */
63 # if defined(__arm__) || defined(__thumb__)
65 # if !defined(LINUX) && !defined(NETBSD)
67 # define mach_type_known
70 # if defined(sun) && defined(mc68000)
73 # define mach_type_known
75 # if defined(hp9000s300)
78 # define mach_type_known
80 # if defined(OPENBSD) && defined(m68k)
82 # define mach_type_known
84 # if defined(OPENBSD) && defined(__sparc__)
86 # define mach_type_known
88 # if defined(NETBSD) && (defined(m68k) || defined(__m68k__))
90 # define mach_type_known
92 # if defined(NETBSD) && defined(__powerpc__)
94 # define mach_type_known
96 # if defined(NETBSD) && (defined(__arm32__) || defined(__arm__))
98 # define mach_type_known
100 # if defined(NETBSD) && defined(__sh__)
102 # define mach_type_known
111 # define mach_type_known
113 # if defined(__NetBSD__) && defined(__vax__)
115 # define mach_type_known
117 # if defined(mips) || defined(__mips) || defined(_mips)
119 # if defined(nec_ews) || defined(_nec_ews)
122 # if !defined(LINUX) && !defined(EWS4800) && !defined(NETBSD)
123 # if defined(ultrix) || defined(__ultrix)
126 # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \
127 || defined(__SYSTYPE_SVR4__)
128 # define IRIX5 /* or IRIX 6.X */
130 # define RISCOS /* or IRIX 4.X */
134 # if defined(__NetBSD__) && defined(__MIPSEL__)
137 # define mach_type_known
139 # if defined(DGUX) && (defined(i386) || defined(__i386__))
144 # define mach_type_known
146 # if defined(sequent) && (defined(i386) || defined(__i386__))
149 # define mach_type_known
151 # if defined(sun) && (defined(i386) || defined(__i386__))
154 # define mach_type_known
156 # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
159 # define mach_type_known
163 # define mach_type_known
165 # if defined(sun) && (defined(sparc) || defined(__sparc))
167 /* Test for SunOS 5.x */
174 # define mach_type_known
176 # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
177 && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
180 # define mach_type_known
184 # define mach_type_known
186 # if defined(__NetBSD__) && defined(__sparc__)
188 # define mach_type_known
190 # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
191 /* The above test may need refinement */
193 # if defined(_SCO_ELF)
198 # define mach_type_known
200 # if defined(_AUX_SOURCE)
203 # define mach_type_known
205 # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
206 || defined(hppa) || defined(__hppa__)
208 # if !defined(LINUX) && !defined(HPUX)
211 # define mach_type_known
213 # if defined(__ia64) && defined(_HPUX_SOURCE)
218 # define mach_type_known
220 # if defined(__BEOS__) && defined(_X86_)
223 # define mach_type_known
225 # if defined(LINUX) && (defined(i386) || defined(__i386__))
227 # define mach_type_known
229 # if defined(LINUX) && defined(__x86_64__)
231 # define mach_type_known
233 # if defined(LINUX) && (defined(__ia64__) || defined(__ia64))
235 # define mach_type_known
237 # if defined(LINUX) && defined(__arm__)
239 # define mach_type_known
241 # if defined(LINUX) && defined(__cris__)
245 # define mach_type_known
247 # if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || \
248 defined(powerpc64) || defined(__powerpc64__))
250 # define mach_type_known
252 # if defined(FREEBSD) && (defined(powerpc) || defined(__powerpc__))
254 # define mach_type_known
256 # if defined(LINUX) && defined(__mc68000__)
258 # define mach_type_known
260 # if defined(LINUX) && (defined(sparc) || defined(__sparc__))
262 # define mach_type_known
264 # if defined(LINUX) && defined(__arm__)
266 # define mach_type_known
268 # if defined(LINUX) && defined(__sh__)
270 # define mach_type_known
272 # if defined(LINUX) && defined(__m32r__)
274 # define mach_type_known
276 # if defined(__alpha) || defined(__alpha__)
278 # if !defined(LINUX) && !defined(NETBSD) && !defined(OPENBSD) && !defined(FREEBSD)
279 # define OSF1 /* a.k.a Digital Unix */
281 # define mach_type_known
283 # if defined(_AMIGA) && !defined(AMIGA)
288 # define mach_type_known
290 # if defined(THINK_C) || defined(__MWERKS__) && !defined(__powerc)
293 # define mach_type_known
295 # if defined(__MWERKS__) && defined(__powerc) && !defined(__MACH__)
298 # define mach_type_known
300 # if defined(macosx) || (defined(__APPLE__) && defined(__MACH__))
302 # if defined(__ppc__) || defined(__ppc64__)
304 # define mach_type_known
305 # elif defined(__i386__)
307 # define mach_type_known
308 # define DARWIN_DONT_PARSE_STACK
309 # define OS_TYPE "DARWIN"
310 # define DYNAMIC_LOADING
311 /* XXX: see get_end(3), get_etext() and get_end() should not be used.
312 These aren't used when dyld support is enabled (it is by default) */
313 # define DATASTART ((ptr_t) get_etext())
314 # define DATAEND ((ptr_t) get_end())
315 # define STACKBOTTOM ((ptr_t) 0xc0000000)
317 # define USE_MMAP_ANON
318 # define USE_ASM_PUSH_REGS
319 /* This is potentially buggy. It needs more testing. See the comments in
320 os_dep.c. It relies on threads to track writes. */
321 # ifdef GC_DARWIN_THREADS
322 /* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
325 # define GETPAGESIZE() getpagesize()
326 /* There seems to be some issues with trylock hanging on darwin. This
327 should be looked into some more */
328 # define NO_PTHREAD_TRYLOCK
331 # if defined(NeXT) && defined(mc68000)
334 # define mach_type_known
336 # if defined(NeXT) && (defined(i386) || defined(__i386__))
339 # define mach_type_known
341 # if defined(__OpenBSD__) && (defined(i386) || defined(__i386__))
344 # define mach_type_known
346 # if defined(FREEBSD) && (defined(i386) || defined(__i386__))
348 # define mach_type_known
350 # if defined(__NetBSD__) && (defined(i386) || defined(__i386__))
352 # define mach_type_known
354 # if defined(__NetBSD__) && defined(__x86_64__)
356 # define mach_type_known
358 # if defined(FREEBSD) && defined(__sparc__)
360 # define mach_type_known
362 # if defined(bsdi) && (defined(i386) || defined(__i386__))
365 # define mach_type_known
367 # if !defined(mach_type_known) && defined(__386BSD__)
370 # define mach_type_known
372 # if defined(_CX_UX) && defined(_M88K)
375 # define mach_type_known
377 # if defined(DGUX) && defined(m88k)
380 # define mach_type_known
382 # if defined(_WIN32_WCE)
383 /* SH3, SH4, MIPS already defined for corresponding architectures */
384 # if defined(SH3) || defined(SH4)
394 # define mach_type_known
396 # if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
397 || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
399 # define MSWIN32 /* or Win32s */
400 # define mach_type_known
402 # if defined(_MSC_VER) && defined(_M_IA64)
404 # define MSWIN32 /* Really win64, but we don't treat 64-bit */
405 /* variants as a differnt platform. */
408 # if defined(__DJGPP__)
411 # define DJGPP /* MSDOS running the DJGPP port of GCC */
413 # define mach_type_known
415 # if defined(__CYGWIN32__) || defined(__CYGWIN__)
418 # define mach_type_known
420 # if defined(__MINGW32__)
423 # define mach_type_known
425 # if defined(__BORLANDC__)
428 # define mach_type_known
430 # if defined(_UTS) && !defined(mach_type_known)
433 # define mach_type_known
437 # define mach_type_known
439 # if defined(__embedded__) && defined(PPC)
442 # define mach_type_known
445 # if defined(__WATCOMC__) && defined(__386__)
447 # if !defined(OS2) && !defined(MSWIN32) && !defined(DOS4GW)
448 # if defined(__OS2__)
451 # if defined(__WINDOWS_386__) || defined(__NT__)
458 # define mach_type_known
460 # if defined(__s390__) && defined(LINUX)
462 # define mach_type_known
464 # if defined(__GNU__)
465 # if defined(__i386__)
466 /* The Debian Hurd running on generic PC */
469 # define mach_type_known
473 /* Feel free to add more clauses here */
475 /* Or manually define the machine type here. A machine type is */
476 /* characterized by the architecture. Some */
477 /* machine types are further subdivided by OS. */
478 /* the macros ULTRIX, RISCOS, and BSD to distinguish. */
479 /* Note that SGI IRIX is treated identically to RISCOS. */
480 /* SYSV on an M68K actually means A/UX. */
481 /* The distinction in these cases is usually the stack starting address */
482 # ifndef mach_type_known
483 --> unknown machine type
485 /* Mapping is: M68K ==> Motorola 680X0 */
486 /* (SUNOS4,HP,NEXT, and SYSV (A/UX), */
487 /* MACOS and AMIGA variants) */
488 /* I386 ==> Intel 386 */
489 /* (SEQUENT, OS2, SCO, LINUX, NETBSD, */
490 /* FREEBSD, THREE86BSD, MSWIN32, */
491 /* BSDI,SUNOS5, NEXT, other variants) */
492 /* NS32K ==> Encore Multimax */
493 /* MIPS ==> R2000 or R3000 */
494 /* (RISCOS, ULTRIX variants) */
495 /* VAX ==> DEC VAX */
496 /* (BSD, ULTRIX variants) */
497 /* RS6000 ==> IBM RS/6000 AIX3.X */
498 /* RT ==> IBM PC/RT */
499 /* HP_PA ==> HP9000/700 & /800 */
501 /* SPARC ==> SPARC v7/v8/v9 */
502 /* (SUNOS4, SUNOS5, LINUX, */
503 /* DRSNX variants) */
504 /* ALPHA ==> DEC Alpha */
505 /* (OSF1 and LINUX variants) */
506 /* M88K ==> Motorola 88XX0 */
507 /* (CX_UX and DGUX) */
508 /* S370 ==> 370-like machine */
509 /* running Amdahl UTS4 */
510 /* S390 ==> 390-like machine */
512 /* ARM32 ==> Intel StrongARM */
513 /* IA64 ==> Intel IPF */
515 /* (LINUX and HPUX) */
516 /* SH ==> Hitachi SuperH */
517 /* (LINUX & MSWINCE) */
518 /* X86_64 ==> AMD x86-64 */
519 /* POWERPC ==> IBM/Apple PowerPC */
520 /* (MACOS(<=9),DARWIN(incl.MACOSX),*/
521 /* LINUX, NETBSD, NOSYS variants) */
522 /* Handles 32 and 64-bit variants. */
523 /* AIX should be handled here, but */
524 /* that's called an RS6000. */
525 /* CRIS ==> Axis Etrax */
526 /* M32R ==> Renesas M32R */
530 * For each architecture and OS, the following need to be defined:
532 * CPP_WORDSZ is a simple integer constant representing the word size.
533 * in bits. We assume byte addressibility, where a byte has 8 bits.
534 * We also assume CPP_WORDSZ is either 32 or 64.
535 * (We care about the length of pointers, not hardware
536 * bus widths. Thus a 64 bit processor with a C compiler that uses
537 * 32 bit pointers should use CPP_WORDSZ of 32, not 64. Default is 32.)
539 * MACH_TYPE is a string representation of the machine type.
540 * OS_TYPE is analogous for the OS.
542 * ALIGNMENT is the largest N, such that
543 * all pointer are guaranteed to be aligned on N byte boundaries.
544 * defining it to be 1 will always work, but perform poorly.
546 * DATASTART is the beginning of the data segment.
547 * On some platforms SEARCH_FOR_DATA_START is defined.
548 * SEARCH_FOR_DATASTART will cause GC_data_start to
549 * be set to an address determined by accessing data backwards from _end
550 * until an unmapped page is found. DATASTART will be defined to be
552 * On UNIX-like systems, the collector will scan the area between DATASTART
553 * and DATAEND for root pointers.
555 * DATAEND, if not `end' where `end' is defined as ``extern int end[];''.
556 * RTH suggests gaining access to linker script synth'd values with
557 * this idiom instead of `&end' where `end' is defined as ``extern int end;'' .
558 * Otherwise, ``GCC will assume these are in .sdata/.sbss'' and it will, e.g.,
559 * cause failures on alpha*-*-* with ``-msmall-data or -fpic'' or mips-*-*
560 * without any special options.
562 * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
565 * STACKBOTTOM is the cool end of the stack, which is usually the
566 * highest address in the stack.
567 * Under PCR or OS/2, we have other ways of finding thread stacks.
568 * For each machine, the following should:
569 * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
570 * 2) define exactly one of
571 * STACKBOTTOM (should be defined to be an expression)
575 * If STACKBOTTOM is defined, then it's value will be used directly as the
576 * stack base. If LINUX_STACKBOTTOM is defined, then it will be determined
577 * with a method appropriate for most Linux systems. Currently we look
578 * first for __libc_stack_end, and if that fails read it from /proc.
579 * If either of the last two macros are defined, then STACKBOTTOM is computed
580 * during collector startup using one of the following two heuristics:
581 * HEURISTIC1: Take an address inside GC_init's frame, and round it up to
582 * the next multiple of STACK_GRAN.
583 * HEURISTIC2: Take an address inside GC_init's frame, increment it repeatedly
584 * in small steps (decrement if STACK_GROWS_UP), and read the value
585 * at each location. Remember the value when the first
586 * Segmentation violation or Bus error is signalled. Round that
587 * to the nearest plausible page boundary, and use that instead
590 * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines,
591 * the value of environ is a pointer that can serve as STACKBOTTOM.
592 * I expect that HEURISTIC2 can be replaced by this approach, which
593 * interferes far less with debugging. However it has the disadvantage
594 * that it's confused by a putenv call before the collector is initialized.
595 * This could be dealt with by intercepting putenv ...
597 * If no expression for STACKBOTTOM can be found, and neither of the above
598 * heuristics are usable, the collector can still be used with all of the above
599 * undefined, provided one of the following is done:
600 * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s)
601 * without reference to STACKBOTTOM. This is appropriate for use in
602 * conjunction with thread packages, since there will be multiple stacks.
603 * (Allocating thread stacks in the heap, and treating them as ordinary
604 * heap data objects is also possible as a last resort. However, this is
605 * likely to introduce significant amounts of excess storage retention
606 * unless the dead parts of the thread stacks are periodically cleared.)
607 * 2) Client code may set GC_stackbottom before calling any GC_ routines.
608 * If the author of the client code controls the main program, this is
609 * easily accomplished by introducing a new main program, setting
610 * GC_stackbottom to the address of a local variable, and then calling
611 * the original main program. The new main program would read something
614 * # include "gc_private.h"
616 * main(argc, argv, envp)
618 * char **argv, **envp;
622 * GC_stackbottom = (ptr_t)(&dummy);
623 * return(real_main(argc, argv, envp));
627 * Each architecture may also define the style of virtual dirty bit
628 * implementation to be used:
629 * MPROTECT_VDB: Write protect the heap and catch faults.
630 * PROC_VDB: Use the SVR4 /proc primitives to read dirty bits.
632 * An architecture may define DYNAMIC_LOADING if dynamic_load.c
633 * defined GC_register_dynamic_libraries() for the architecture.
635 * An architecture may define PREFETCH(x) to preload the cache with *x.
636 * This defaults to a no-op.
638 * PREFETCH_FOR_WRITE(x) is used if *x is about to be written.
640 * An architecture may also define CLEAR_DOUBLE(x) to be a fast way to
641 * clear the two words at GC_malloc-aligned address x. By default,
642 * word stores of 0 are used instead.
644 * HEAP_START may be defined as the initial address hint for mmap-based
648 /* If we are using a recent version of gcc, we can use __builtin_unwind_init()
649 * to push the relevant registers onto the stack. This generally makes
650 * USE_GENERIC_PUSH_REGS the preferred approach for marking from registers.
652 # if defined(__GNUC__) && ((__GNUC__ >= 3) || \
653 (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) \
654 && !defined(__INTEL_COMPILER) \
655 && !defined(__PATHCC__)
656 # define HAVE_BUILTIN_UNWIND_INIT
659 # define STACK_GRAN 0x1000000
661 # define MACH_TYPE "M68K"
664 # define OS_TYPE "OPENBSD"
667 # define DATASTART GC_data_start
668 # define DYNAMIC_LOADING
671 # define DATASTART ((ptr_t)(etext))
673 # define USE_GENERIC_PUSH_REGS
676 # define OS_TYPE "NETBSD"
679 # define DATASTART GC_data_start
680 # define DYNAMIC_LOADING
683 # define DATASTART ((ptr_t)(etext))
685 # define USE_GENERIC_PUSH_REGS
688 # define OS_TYPE "LINUX"
689 # define STACKBOTTOM ((ptr_t)0xf0000000)
690 # define USE_GENERIC_PUSH_REGS
691 /* We never got around to the assembly version. */
692 /* # define MPROTECT_VDB - Reported to not work 9/17/01 */
694 # define DYNAMIC_LOADING
695 # include <features.h>
696 # if defined(__GLIBC__)&& __GLIBC__>=2
697 # define SEARCH_FOR_DATA_START
699 extern char **__environ;
700 # define DATASTART ((ptr_t)(&__environ))
701 /* hideous kludge: __environ is the first */
702 /* word in crt0.o, and delimits the start */
703 /* of the data segment, no matter which */
704 /* ld options were passed through. */
705 /* We could use _etext instead, but that */
706 /* would include .rodata, which may */
707 /* contain large read-only data tables */
708 /* that we'd rather not scan. */
709 # endif /* !GLIBC2 */
711 # define DATAEND (_end)
714 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
718 # define OS_TYPE "SUNOS4"
720 # define DATASTART ((ptr_t)((((word) (etext)) + 0x1ffff) & ~0x1ffff))
721 # define HEURISTIC1 /* differs */
722 # define DYNAMIC_LOADING
725 # define OS_TYPE "HP"
727 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
728 # define STACKBOTTOM ((ptr_t) 0xffeffffc)
729 /* empirically determined. seems to work. */
731 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
734 # define OS_TYPE "SYSV"
736 # define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \
738 +((word)etext & 0x1fff))
739 /* This only works for shared-text binaries with magic number 0413.
740 The other sorts of SysV binaries put the data at the end of the text,
741 in which case the default of etext would work. Unfortunately,
742 handling both would require having the magic-number available.
745 # define STACKBOTTOM ((ptr_t)0xFFFFFFFE)
746 /* The stack starts at the top of memory, but */
747 /* 0x0 cannot be used as setjump_test complains */
748 /* that the stack direction is incorrect. Two */
749 /* bytes down from 0x0 should be safe enough. */
751 # include <sys/mmu.h>
752 # define GETPAGESIZE() PAGESIZE /* Is this still right? */
755 # define OS_TYPE "AMIGA"
756 /* STACKBOTTOM and DATASTART handled specially */
758 # define DATAEND /* not needed */
759 # define GETPAGESIZE() 4096
765 # define OS_TYPE "MACOS"
766 /* see os_dep.c for details of global data segments. */
767 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
768 # define DATAEND /* not needed */
769 # define GETPAGESIZE() 4096
772 # define OS_TYPE "NEXT"
773 # define DATASTART ((ptr_t) get_etext())
774 # define STACKBOTTOM ((ptr_t) 0x4000000)
775 # define DATAEND /* not needed */
779 # if defined(POWERPC)
780 # define MACH_TYPE "POWERPC"
782 # define ALIGNMENT 2 /* Still necessary? Could it be 4? */
786 # define OS_TYPE "MACOS"
787 /* see os_dep.c for details of global data segments. */
788 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
789 # define DATAEND /* not needed */
792 # if defined(__powerpc64__)
794 # define CPP_WORDSZ 64
796 # define HBLKSIZE 4096
801 # define OS_TYPE "LINUX"
802 /* HEURISTIC1 has been reliably reported to fail for a 32-bit */
803 /* executable on a 64 bit kernel. */
804 # define LINUX_STACKBOTTOM
805 # define DYNAMIC_LOADING
806 # define SEARCH_FOR_DATA_START
808 # define DATAEND (_end)
813 # define CPP_WORDSZ 64
817 # define OS_TYPE "DARWIN"
818 # define DYNAMIC_LOADING
819 /* XXX: see get_end(3), get_etext() and get_end() should not be used.
820 These aren't used when dyld support is enabled (it is by default) */
821 # define DATASTART ((ptr_t) get_etext())
822 # define DATAEND ((ptr_t) get_end())
823 # define STACKBOTTOM ((ptr_t) 0xc0000000)
825 # define USE_MMAP_ANON
826 # define USE_ASM_PUSH_REGS
827 /* This is potentially buggy. It needs more testing. See the comments in
828 os_dep.c. It relies on threads to track writes. */
829 # ifdef GC_DARWIN_THREADS
830 /* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
833 # define GETPAGESIZE() getpagesize()
834 # if defined(USE_PPC_PREFETCH) && defined(__GNUC__)
835 /* The performance impact of prefetches is untested */
836 # define PREFETCH(x) \
837 __asm__ __volatile__ ("dcbt 0,%0" : : "r" ((const void *) (x)))
838 # define PREFETCH_FOR_WRITE(x) \
839 __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))
841 /* There seems to be some issues with trylock hanging on darwin. This
842 should be looked into some more */
843 # define NO_PTHREAD_TRYLOCK
847 # define OS_TYPE "FREEBSD"
848 # ifndef GC_FREEBSD_THREADS
849 # define MPROTECT_VDB
851 # define SIG_SUSPEND SIGUSR1
852 # define SIG_THR_RESTART SIGUSR2
853 # define FREEBSD_STACKBOTTOM
855 # define DYNAMIC_LOADING
858 extern char * GC_FreeBSDGetDataStart();
859 # define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
863 # define OS_TYPE "NETBSD"
866 # define DATASTART GC_data_start
867 # define DYNAMIC_LOADING
871 # define OS_TYPE "NOSYS"
872 extern void __end[], __dso_handle[];
873 # define DATASTART (__dso_handle) /* OK, that's ugly. */
874 # define DATAEND (__end)
875 /* Stack starts at 0xE0000000 for the simulator. */
877 # define STACK_GRAN 0x10000000
883 # define MACH_TYPE "VAX"
884 # define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
886 # define DATASTART ((ptr_t)(etext))
888 # define OS_TYPE "BSD"
890 /* HEURISTIC2 may be OK, but it's hard to test. */
893 # define OS_TYPE "ULTRIX"
894 # define STACKBOTTOM ((ptr_t) 0x7fffc800)
899 # define MACH_TYPE "RT"
901 # define DATASTART ((ptr_t) 0x10000000)
902 # define STACKBOTTOM ((ptr_t) 0x1fffd800)
906 # define MACH_TYPE "SPARC"
907 # if defined(__arch64__) || defined(__sparcv9)
909 # define CPP_WORDSZ 64
910 # define ELF_CLASS ELFCLASS64
912 # define ALIGNMENT 4 /* Required by hardware */
913 # define CPP_WORDSZ 32
915 # define ALIGN_DOUBLE
916 # ifdef _FILE_OFFSET_BITS
917 # undef _FILE_OFFSET_BITS /* libelf.h & procfs.h doesn't compile with large file support */
918 # define _FILE_OFFSET_BITS 32
921 # define OS_TYPE "SUNOS5"
924 extern ptr_t GC_SysVGetDataStart();
925 # define DATASTART GC_SysVGetDataStart(0x10000, _etext)
926 # define DATAEND (_end)
927 # if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
929 /* Otherwise we now use calloc. Mmap may result in the */
930 /* heap interleaved with thread stacks, which can result in */
931 /* excessive blacklisting. Sbrk is unusable since it */
932 /* doesn't interact correctly with the system malloc. */
935 # define HEAP_START (ptr_t)0x40000000
937 # define HEAP_START DATAEND
940 /* HEURISTIC1 reportedly no longer works under 2.7. */
941 /* HEURISTIC2 probably works, but this appears to be preferable. */
942 /* Apparently USRSTACK is defined to be USERLIMIT, but in some */
943 /* installations that's undefined. We work around this with a */
945 # include <sys/vmparam.h>
947 /* This should work everywhere, but doesn't. */
948 # define STACKBOTTOM USRSTACK
953 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
954 /* getpagesize() appeared to be missing from at least one */
955 /* Solaris 5.4 installation. Weird. */
956 # define DYNAMIC_LOADING
959 # define OS_TYPE "SUNOS4"
960 /* [If you have a weak stomach, don't read this.] */
961 /* We would like to use: */
962 /* # define DATASTART ((ptr_t)((((word) (etext)) + 0x1fff) & ~0x1fff)) */
963 /* This fails occasionally, due to an ancient, but very */
964 /* persistent ld bug. etext is set 32 bytes too high. */
965 /* We instead read the text segment size from the a.out */
966 /* header, which happens to be mapped into our address space */
967 /* at the start of the text segment. The detective work here */
968 /* was done by Robert Ehrlich, Manuel Serrano, and Bernard */
969 /* Serpette of INRIA. */
970 /* This assumes ZMAGIC, i.e. demand-loadable executables. */
971 # define TEXTSTART 0x2000
972 # define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
973 # define MPROTECT_VDB
975 # define DYNAMIC_LOADING
978 # define OS_TYPE "DRSNX"
979 extern ptr_t GC_SysVGetDataStart();
981 # define DATASTART GC_SysVGetDataStart(0x10000, etext)
982 # define MPROTECT_VDB
983 # define STACKBOTTOM ((ptr_t) 0xdfff0000)
984 # define DYNAMIC_LOADING
987 # define OS_TYPE "LINUX"
989 # define DYNAMIC_LOADING
991 Linux Sparc/a.out not supported
995 # define DATAEND (_end)
997 extern ptr_t GC_SysVGetDataStart();
999 # define DATASTART GC_SysVGetDataStart(0x100000, _etext)
1001 # define DATASTART GC_SysVGetDataStart(0x10000, _etext)
1003 # define LINUX_STACKBOTTOM
1006 # define OS_TYPE "OPENBSD"
1007 # define STACKBOTTOM ((ptr_t) 0xf8000000)
1009 # define DATASTART ((ptr_t)(etext))
1012 # define OS_TYPE "NETBSD"
1015 # define DATASTART GC_data_start
1016 # define DYNAMIC_LOADING
1018 extern char etext[];
1019 # define DATASTART ((ptr_t)(etext))
1023 # define OS_TYPE "FREEBSD"
1024 # define SIG_SUSPEND SIGUSR1
1025 # define SIG_THR_RESTART SIGUSR2
1026 # define FREEBSD_STACKBOTTOM
1028 # define DYNAMIC_LOADING
1030 extern char etext[];
1031 extern char edata[];
1033 # define NEED_FIND_LIMIT
1034 # define DATASTART ((ptr_t)(&etext))
1035 # define DATAEND (GC_find_limit (DATASTART, TRUE))
1036 # define DATASTART2 ((ptr_t)(&edata))
1037 # define DATAEND2 ((ptr_t)(&end))
1042 # define MACH_TYPE "I386"
1043 # if defined(__LP64__) || defined(_WIN64)
1044 # define CPP_WORDSZ 64
1045 # define ALIGNMENT 8
1047 # define CPP_WORDSZ 32
1048 # define ALIGNMENT 4
1049 /* Appears to hold for all "32 bit" compilers */
1050 /* except Borland. The -a4 option fixes */
1052 /* Ivan Demakov: For Watcom the option is -zp4. */
1054 # ifndef SMALL_CONFIG
1055 # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
1056 /* improvement on Pentiums. */
1058 # ifdef HAVE_BUILTIN_UNWIND_INIT
1059 # define USE_GENERIC_PUSH_REGS
1062 # define OS_TYPE "SEQUENT"
1064 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
1065 # define STACKBOTTOM ((ptr_t) 0x3ffff000)
1068 # define OS_TYPE "BEOS"
1070 # define GETPAGESIZE() B_PAGE_SIZE
1072 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
1075 # define OS_TYPE "SUNOS5"
1076 extern int _etext[], _end[];
1077 extern ptr_t GC_SysVGetDataStart();
1078 # define DATASTART GC_SysVGetDataStart(0x1000, _etext)
1079 # define DATAEND (_end)
1080 /* # define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7, */
1081 /* but reportedly breaks under 2.8. It appears that the stack */
1082 /* base is a property of the executable, so this should not break */
1083 /* old executables. */
1084 /* HEURISTIC2 probably works, but this appears to be preferable. */
1085 # include <sys/vm.h>
1086 # define STACKBOTTOM USRSTACK
1087 /* At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
1088 /* It appears to be fixed in 2.8 and 2.9. */
1089 # ifdef SOLARIS25_PROC_VDB_BUG_FIXED
1090 /* Reading of dirty bits doesn't seem to work even in solaris 10 */
1091 /*# define PROC_VDB */
1093 # define DYNAMIC_LOADING
1094 # if !defined(USE_MMAP) && defined(REDIRECT_MALLOC)
1096 /* Otherwise we now use calloc. Mmap may result in the */
1097 /* heap interleaved with thread stacks, which can result in */
1098 /* excessive blacklisting. Sbrk is unusable since it */
1099 /* doesn't interact correctly with the system malloc. */
1102 # define HEAP_START (ptr_t)0x40000000
1104 # define HEAP_START DATAEND
1108 # define OS_TYPE "SCO"
1110 # define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \
1112 +((word)etext & 0xfff))
1113 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
1116 # define OS_TYPE "SCO_ELF"
1118 # define DATASTART ((ptr_t)(etext))
1119 # define STACKBOTTOM ((ptr_t) 0x08048000)
1120 # define DYNAMIC_LOADING
1121 # define ELF_CLASS ELFCLASS32
1124 # define OS_TYPE "DGUX"
1125 extern int _etext, _end;
1126 extern ptr_t GC_SysVGetDataStart();
1127 # define DATASTART GC_SysVGetDataStart(0x1000, &_etext)
1128 # define DATAEND (&_end)
1129 # define STACK_GROWS_DOWN
1131 # include <unistd.h>
1132 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
1133 # define DYNAMIC_LOADING
1136 # endif /* USE_MMAP */
1137 # define MAP_FAILED (void *) -1
1139 # define HEAP_START (ptr_t)0x40000000
1140 # else /* USE_MMAP */
1141 # define HEAP_START DATAEND
1142 # endif /* USE_MMAP */
1147 /* The Intel compiler doesn't like inline assembly */
1148 # define USE_GENERIC_PUSH_REGS
1150 # define OS_TYPE "LINUX"
1151 # define LINUX_STACKBOTTOM
1155 # define STACK_GRAN 0x10000000
1156 /* STACKBOTTOM is usually 0xc0000000, but this changes with */
1157 /* different kernel configurations. In particular, systems */
1158 /* with 2GB physical memory will usually move the user */
1159 /* address space limit, and hence initial SP to 0x80000000. */
1161 # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)
1162 # define MPROTECT_VDB
1164 /* We seem to get random errors in incremental mode, */
1165 /* possibly because Linux threads is itself a malloc client */
1166 /* and can't deal with the signals. */
1168 # define HEAP_START (ptr_t)0x1000
1169 /* This encourages mmap to give us low addresses, */
1170 /* thus allowing the heap to grow to ~3GB */
1172 # define DYNAMIC_LOADING
1173 # ifdef UNDEFINED /* includes ro data */
1174 extern int _etext[];
1175 # define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
1177 # include <features.h>
1178 # if defined(__GLIBC__) && __GLIBC__ >= 2
1179 # define SEARCH_FOR_DATA_START
1181 extern char **__environ;
1182 # define DATASTART ((ptr_t)(&__environ))
1183 /* hideous kludge: __environ is the first */
1184 /* word in crt0.o, and delimits the start */
1185 /* of the data segment, no matter which */
1186 /* ld options were passed through. */
1187 /* We could use _etext instead, but that */
1188 /* would include .rodata, which may */
1189 /* contain large read-only data tables */
1190 /* that we'd rather not scan. */
1193 # define DATAEND (_end)
1196 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
1198 # ifdef USE_I686_PREFETCH
1199 /* FIXME: Thus should use __builtin_prefetch, but we'll leave that */
1200 /* for the next rtelease. */
1201 # define PREFETCH(x) \
1202 __asm__ __volatile__ (" prefetchnta %0": : "m"(*(char *)(x)))
1203 /* Empirically prefetcht0 is much more effective at reducing */
1204 /* cache miss stalls for the targetted load instructions. But it */
1205 /* seems to interfere enough with other cache traffic that the net */
1206 /* result is worse than prefetchnta. */
1208 /* Using prefetches for write seems to have a slight negative */
1209 /* impact on performance, at least for a PIII/500. */
1210 # define PREFETCH_FOR_WRITE(x) \
1211 __asm__ __volatile__ (" prefetcht0 %0": : "m"(*(char *)(x)))
1214 # ifdef USE_3DNOW_PREFETCH
1215 # define PREFETCH(x) \
1216 __asm__ __volatile__ (" prefetch %0": : "m"(*(char *)(x)))
1217 # define PREFETCH_FOR_WRITE(x) \
1218 __asm__ __volatile__ (" prefetchw %0": : "m"(*(char *)(x)))
1222 # define OS_TYPE "CYGWIN32"
1223 # define DATASTART ((ptr_t)GC_DATASTART) /* From gc.h */
1224 # define DATAEND ((ptr_t)GC_DATAEND)
1226 # define STACK_GRAN 0x10000
1230 # define OS_TYPE "OS2"
1231 /* STACKBOTTOM and DATASTART are handled specially in */
1232 /* os_dep.c. OS2 actually has the right */
1234 # define DATAEND /* not needed */
1235 # define USE_GENERIC_PUSH_REGS
1238 # define OS_TYPE "MSWIN32"
1239 /* STACKBOTTOM and DATASTART are handled specially in */
1241 # ifndef __WATCOMC__
1242 # define MPROTECT_VDB
1244 # define DATAEND /* not needed */
1247 # define OS_TYPE "MSWINCE"
1248 # define DATAEND /* not needed */
1251 # define OS_TYPE "DJGPP"
1252 # include "stubinfo.h"
1255 extern int __djgpp_stack_limit;
1256 # define DATASTART ((ptr_t)((((word) (etext)) + 0x1ff) & ~0x1ff))
1257 /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
1259 # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
1260 /* This may not be right. */
1263 # define OS_TYPE "OPENBSD"
1266 # define OS_TYPE "FREEBSD"
1267 # ifndef GC_FREEBSD_THREADS
1268 # define MPROTECT_VDB
1270 # define SIG_SUSPEND SIGTSTP
1271 # define SIG_THR_RESTART SIGCONT
1272 # define FREEBSD_STACKBOTTOM
1274 # define DYNAMIC_LOADING
1276 extern char etext[];
1277 extern char * GC_FreeBSDGetDataStart();
1278 # define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
1281 # define OS_TYPE "NETBSD"
1283 # define DYNAMIC_LOADING
1287 # define OS_TYPE "THREE86BSD"
1290 # define OS_TYPE "BSDI"
1292 # if defined(OPENBSD) || defined(NETBSD) \
1293 || defined(THREE86BSD) || defined(BSDI)
1295 extern char etext[];
1296 # define DATASTART ((ptr_t)(etext))
1299 # define OS_TYPE "NEXT"
1300 # define DATASTART ((ptr_t) get_etext())
1301 # define STACKBOTTOM ((ptr_t)0xc0000000)
1302 # define DATAEND /* not needed */
1305 # define OS_TYPE "DOS4GW"
1306 extern long __nullarea;
1308 extern char *_STACKTOP;
1309 /* Depending on calling conventions Watcom C either precedes
1310 or does not precedes with undescore names of C-variables.
1311 Make sure startup code variables always have the same names. */
1312 #pragma aux __nullarea "*";
1313 #pragma aux _end "*";
1314 # define STACKBOTTOM ((ptr_t) _STACKTOP)
1315 /* confused? me too. */
1316 # define DATASTART ((ptr_t) &__nullarea)
1317 # define DATAEND ((ptr_t) &_end)
1320 # define OS_TYPE "HURD"
1321 # define STACK_GROWS_DOWN
1323 extern int __data_start[];
1324 # define DATASTART ( (ptr_t) (__data_start))
1326 # define DATAEND ( (ptr_t) (_end))
1327 /* # define MPROTECT_VDB Not quite working yet? */
1328 # define DYNAMIC_LOADING
1333 # define MACH_TYPE "NS32K"
1334 # define ALIGNMENT 4
1335 extern char **environ;
1336 # define DATASTART ((ptr_t)(&environ))
1337 /* hideous kludge: environ is the first */
1338 /* word in crt0.o, and delimits the start */
1339 /* of the data segment, no matter which */
1340 /* ld options were passed through. */
1341 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
1345 # define MACH_TYPE "MIPS"
1347 /* This was developed for a linuxce style platform. Probably */
1348 /* needs to be tweaked for workstation class machines. */
1349 # define OS_TYPE "LINUX"
1350 # define DYNAMIC_LOADING
1352 # define DATAEND (_end)
1353 extern int __data_start[];
1354 # define DATASTART ((ptr_t)(__data_start))
1355 # define ALIGNMENT 4
1356 # define USE_GENERIC_PUSH_REGS
1357 # if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
1358 # define LINUX_STACKBOTTOM
1360 # define STACKBOTTOM 0x80000000
1365 # if defined(_MIPS_SZPTR) && (_MIPS_SZPTR == 64)
1366 extern int _fdata[], _end[];
1367 # define DATASTART ((ptr_t)_fdata)
1368 # define DATAEND ((ptr_t)_end)
1369 # define CPP_WORDSZ _MIPS_SZPTR
1370 # define ALIGNMENT (_MIPS_SZPTR/8)
1372 extern int etext[], edata[], end[];
1373 extern int _DYNAMIC_LINKING[], _gp[];
1374 # define DATASTART ((ptr_t)((((word)etext + 0x3ffff) & ~0x3ffff) \
1375 + ((word)etext & 0xffff)))
1376 # define DATAEND (edata)
1377 # define DATASTART2 (_DYNAMIC_LINKING \
1378 ? (ptr_t)(((word)_gp + 0x8000 + 0x3ffff) & ~0x3ffff) \
1380 # define DATAEND2 (end)
1381 # define ALIGNMENT 4
1383 # define OS_TYPE "EWS4800"
1384 # define USE_GENERIC_PUSH_REGS 1
1388 # define DATASTART (ptr_t)0x10000000
1389 /* Could probably be slightly higher since */
1390 /* startup code allocates lots of stuff. */
1391 # define OS_TYPE "ULTRIX"
1392 # define ALIGNMENT 4
1396 # define DATASTART (ptr_t)0x10000000
1397 # define OS_TYPE "RISCOS"
1398 # define ALIGNMENT 4 /* Required by hardware */
1402 extern int _fdata[];
1403 # define DATASTART ((ptr_t)(_fdata))
1405 # define HEAP_START (ptr_t)0x30000000
1407 # define HEAP_START DATASTART
1409 /* Lowest plausible heap address. */
1410 /* In the MMAP case, we map there. */
1411 /* In either case it is used to identify */
1412 /* heap sections so they're not */
1413 /* considered as roots. */
1414 # define OS_TYPE "IRIX5"
1415 /*# define MPROTECT_VDB DOB: this should work, but there is evidence */
1416 /* of recent breakage. */
1418 # define CPP_WORDSZ _MIPS_SZPTR
1419 # define ALIGNMENT (_MIPS_SZPTR/8)
1420 # if CPP_WORDSZ != 64
1421 # define ALIGN_DOUBLE
1424 # define ALIGNMENT 4
1425 # define ALIGN_DOUBLE
1427 # define DYNAMIC_LOADING
1430 # define OS_TYPE "MSWINCE"
1431 # define ALIGNMENT 4
1432 # define DATAEND /* not needed */
1434 # if defined(NETBSD)
1435 # define ALIGNMENT 4
1436 # define OS_TYPE "NETBSD"
1438 # define USE_GENERIC_PUSH_REGS
1441 # define DATASTART GC_data_start
1442 # define NEED_FIND_LIMIT
1443 # define DYNAMIC_LOADING
1445 # define DATASTART ((ptr_t) 0x10000000)
1446 # define STACKBOTTOM ((ptr_t) 0x7ffff000)
1452 # define MACH_TYPE "RS6000"
1457 # undef IA64 /* DOB: some AIX installs stupidly define IA64 in /usr/include/sys/systemcfg.h */
1460 # define ALIGNMENT 8
1461 # define CPP_WORDSZ 64
1462 # define STACKBOTTOM ((ptr_t)0x1000000000000000)
1464 # define ALIGNMENT 4
1465 # define CPP_WORDSZ 32
1466 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
1469 # define USE_MMAP_ANON
1470 /* From AIX linker man page:
1471 _text Specifies the first location of the program.
1472 _etext Specifies the first location after the program.
1473 _data Specifies the first location of the data.
1474 _edata Specifies the first location after the initialized data
1475 _end or end Specifies the first location after all data.
1477 extern int _data[], _end[];
1478 # define DATASTART ((ptr_t)((ulong)_data))
1479 # define DATAEND ((ptr_t)((ulong)_end))
1481 # define USE_GENERIC_PUSH_REGS
1482 # define DYNAMIC_LOADING
1483 /* For really old versions of AIX, this may have to be removed. */
1487 # define MACH_TYPE "HP_PA"
1489 # define CPP_WORDSZ 64
1490 # define ALIGNMENT 8
1492 # define CPP_WORDSZ 32
1493 # define ALIGNMENT 4
1494 # define ALIGN_DOUBLE
1496 # if !defined(GC_HPUX_THREADS) && !defined(GC_LINUX_THREADS)
1497 # ifndef LINUX /* For now. */
1498 # define MPROTECT_VDB
1501 # define GENERIC_COMPARE_AND_SWAP
1502 /* No compare-and-swap instruction. Use pthread mutexes */
1503 /* when we absolutely have to. */
1504 # ifdef PARALLEL_MARK
1505 # define USE_MARK_BYTES
1506 /* Minimize compare-and-swap usage. */
1509 # define STACK_GROWS_UP
1511 # define OS_TYPE "HPUX"
1512 extern int __data_start[];
1513 # define DATASTART ((ptr_t)(__data_start))
1515 /* The following appears to work for 7xx systems running HP/UX */
1516 /* 9.xx Furthermore, it might result in much faster */
1517 /* collections than HEURISTIC2, which may involve scanning */
1518 /* segments that directly precede the stack. It is not the */
1519 /* default, since it may not work on older machine/OS */
1520 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
1522 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
1524 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1525 /* to this. Note that the GC must be initialized before the */
1526 /* first putenv call. */
1527 extern char ** environ;
1528 # define STACKBOTTOM ((ptr_t)environ)
1530 # define DYNAMIC_LOADING
1531 # include <unistd.h>
1532 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1534 # define PREFETCH(x) { \
1535 register long addr = (long)(x); \
1536 (void) _asm ("LDW", 0, 0, addr, 0); \
1541 # define OS_TYPE "LINUX"
1542 # define LINUX_STACKBOTTOM
1543 # define DYNAMIC_LOADING
1544 # define SEARCH_FOR_DATA_START
1546 # define DATAEND (&_end)
1551 # define MACH_TYPE "ALPHA"
1552 # define ALIGNMENT 8
1553 # define CPP_WORDSZ 64
1555 # define USE_GENERIC_PUSH_REGS
1556 /* Gcc and probably the DEC/Compaq compiler spill pointers to preserved */
1557 /* fp registers in some cases when the target is a 21264. The assembly */
1558 /* code doesn't handle that yet, and version dependencies make that a */
1559 /* bit tricky. Do the easy thing for now. */
1562 # define OS_TYPE "NETBSD"
1564 # define DATASTART GC_data_start
1565 # define ELFCLASS32 32
1566 # define ELFCLASS64 64
1567 # define ELF_CLASS ELFCLASS64
1568 # define DYNAMIC_LOADING
1571 # define OS_TYPE "OPENBSD"
1573 # ifdef __ELF__ /* since OpenBSD/Alpha 2.9 */
1574 # define DATASTART GC_data_start
1575 # define ELFCLASS32 32
1576 # define ELFCLASS64 64
1577 # define ELF_CLASS ELFCLASS64
1578 # else /* ECOFF, until OpenBSD/Alpha 2.7 */
1579 # define DATASTART ((ptr_t) 0x140000000)
1583 # define OS_TYPE "FREEBSD"
1584 /* MPROTECT_VDB is not yet supported at all on FreeBSD/alpha. */
1585 # define SIG_SUSPEND SIGTSTP
1586 # define SIG_THR_RESTART SIGCONT
1587 # define FREEBSD_STACKBOTTOM
1589 # define DYNAMIC_LOADING
1591 /* Handle unmapped hole alpha*-*-freebsd[45]* puts between etext and edata. */
1592 extern char etext[];
1593 extern char edata[];
1595 # define NEED_FIND_LIMIT
1596 # define DATASTART ((ptr_t)(&etext))
1597 # define DATAEND (GC_find_limit (DATASTART, TRUE))
1598 # define DATASTART2 ((ptr_t)(&edata))
1599 # define DATAEND2 ((ptr_t)(&end))
1602 # define OS_TYPE "OSF1"
1603 # define DATASTART ((ptr_t) 0x140000000)
1605 # define DATAEND ((ptr_t) &_end)
1606 extern char ** environ;
1607 /* round up from the value of environ to the nearest page boundary */
1608 /* Probably breaks if putenv is called before collector */
1609 /* initialization. */
1610 # define STACKBOTTOM ((ptr_t)(((word)(environ) | (getpagesize()-1))+1))
1611 /* # define HEURISTIC2 */
1612 /* Normally HEURISTIC2 is too conervative, since */
1613 /* the text segment immediately follows the stack. */
1614 /* Hence we give an upper pound. */
1615 /* This is currently unused, since we disabled HEURISTIC2 */
1616 extern int __start[];
1617 # define HEURISTIC2_LIMIT ((ptr_t)((word)(__start) & ~(getpagesize()-1)))
1618 # ifndef GC_OSF1_THREADS
1619 /* Unresolved signal issues with threads. */
1620 # define MPROTECT_VDB
1622 # define DYNAMIC_LOADING
1625 # define OS_TYPE "LINUX"
1626 # define LINUX_STACKBOTTOM
1628 # define SEARCH_FOR_DATA_START
1629 # define DYNAMIC_LOADING
1631 # define DATASTART ((ptr_t) 0x140000000)
1634 # define DATAEND (_end)
1635 # define MPROTECT_VDB
1636 /* Has only been superficially tested. May not */
1637 /* work on all versions. */
1642 # define MACH_TYPE "IA64"
1643 # define USE_GENERIC_PUSH_REGS
1644 /* We need to get preserved registers in addition to register */
1645 /* windows. That's easiest to do with setjmp. */
1646 # ifdef PARALLEL_MARK
1647 # define USE_MARK_BYTES
1648 /* Compare-and-exchange is too expensive to use for */
1649 /* setting mark bits. */
1653 # define CPP_WORDSZ 32
1654 # define ALIGN_DOUBLE
1655 /* Requires 8 byte alignment for malloc */
1656 # define ALIGNMENT 4
1661 # define CPP_WORDSZ 64
1662 # define ALIGN_DOUBLE
1663 /* Requires 16 byte alignment for malloc */
1664 # define ALIGNMENT 8
1666 # define OS_TYPE "HPUX"
1667 extern int __data_start[];
1668 # define DATASTART ((ptr_t)(__data_start))
1669 /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2 */
1670 /* to this. Note that the GC must be initialized before the */
1671 /* first putenv call. */
1672 extern char ** environ;
1673 # define STACKBOTTOM ((ptr_t)environ)
1674 # define HPUX_STACKBOTTOM
1675 # define DYNAMIC_LOADING
1676 # include <unistd.h>
1677 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
1678 /* The following was empirically determined, and is probably */
1679 /* not very robust. */
1680 /* Note that the backing store base seems to be at a nice */
1681 /* address minus one page. */
1682 # define BACKING_STORE_DISPLACEMENT 0x1000000
1683 # define BACKING_STORE_ALIGNMENT 0x1000
1684 extern ptr_t GC_register_stackbottom;
1685 # define BACKING_STORE_BASE GC_register_stackbottom
1686 /* Known to be wrong for recent HP/UX versions!!! */
1689 # define CPP_WORDSZ 64
1690 # define ALIGN_DOUBLE
1691 /* Requires 16 byte alignment for malloc */
1692 # define ALIGNMENT 8
1693 # define OS_TYPE "LINUX"
1694 /* The following works on NUE and older kernels: */
1695 /* # define STACKBOTTOM ((ptr_t) 0xa000000000000000l) */
1696 /* This does not work on NUE: */
1697 # define LINUX_STACKBOTTOM
1698 /* We also need the base address of the register stack */
1699 /* backing store. This is computed in */
1700 /* GC_linux_register_stack_base based on the following */
1702 # define BACKING_STORE_ALIGNMENT 0x100000
1703 # define BACKING_STORE_DISPLACEMENT 0x80000000
1704 extern ptr_t GC_register_stackbottom;
1705 # define BACKING_STORE_BASE GC_register_stackbottom
1706 # define SEARCH_FOR_DATA_START
1708 # define DYNAMIC_LOADING
1710 /* In the Intel compiler environment, we seem to end up with */
1711 /* statically linked executables and an undefined reference */
1714 # define MPROTECT_VDB
1715 /* Requires Linux 2.3.47 or later. */
1717 # define DATAEND (_end)
1719 # ifndef __INTEL_COMPILER
1720 # define PREFETCH(x) \
1721 __asm__ (" lfetch [%0]": : "r"(x))
1722 # define PREFETCH_FOR_WRITE(x) \
1723 __asm__ (" lfetch.excl [%0]": : "r"(x))
1724 # define CLEAR_DOUBLE(x) \
1725 __asm__ (" stf.spill [%0]=f0": : "r"((void *)(x)))
1727 # include <ia64intrin.h>
1728 # define PREFETCH(x) \
1729 __lfetch(__lfhint_none, (x))
1730 # define PREFETCH_FOR_WRITE(x) \
1731 __lfetch(__lfhint_nta, (x))
1732 # define CLEAR_DOUBLE(x) \
1733 __stf_spill((void *)(x), 0)
1734 # endif // __INTEL_COMPILER
1738 /* FIXME: This is a very partial guess. There is no port, yet. */
1739 # define OS_TYPE "MSWIN32"
1740 /* STACKBOTTOM and DATASTART are handled specially in */
1742 # define DATAEND /* not needed */
1743 # if defined(_WIN64)
1744 # define CPP_WORDSZ 64
1746 # define CPP_WORDSZ 32 /* Is this possible? */
1748 # define ALIGNMENT 8
1753 # define MACH_TYPE "M88K"
1754 # define ALIGNMENT 4
1755 # define ALIGN_DOUBLE
1758 # define OS_TYPE "CX_UX"
1759 # define DATASTART ((((word)etext + 0x3fffff) & ~0x3fffff) + 0x10000)
1762 # define OS_TYPE "DGUX"
1763 extern ptr_t GC_SysVGetDataStart();
1764 # define DATASTART GC_SysVGetDataStart(0x10000, etext)
1766 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
1770 /* If this still works, and if anyone cares, this should probably */
1771 /* be moved to the S390 category. */
1772 # define MACH_TYPE "S370"
1773 # define ALIGNMENT 4 /* Required by hardware */
1774 # define USE_GENERIC_PUSH_REGS
1776 # define OS_TYPE "UTS4"
1778 extern int _etext[];
1780 extern ptr_t GC_SysVGetDataStart();
1781 # define DATASTART GC_SysVGetDataStart(0x10000, _etext)
1782 # define DATAEND (_end)
1788 # define MACH_TYPE "S390"
1789 # define USE_GENERIC_PUSH_REGS
1791 # define ALIGNMENT 4
1792 # define CPP_WORDSZ 32
1794 # define ALIGNMENT 8
1795 # define CPP_WORDSZ 64
1798 # define HBLKSIZE 4096
1801 # define OS_TYPE "LINUX"
1802 # define LINUX_STACKBOTTOM
1803 # define DYNAMIC_LOADING
1804 extern int __data_start[];
1805 # define DATASTART ((ptr_t)(__data_start))
1807 # define DATAEND (_end)
1808 # define CACHE_LINE_SIZE 256
1809 # define GETPAGESIZE() 4096
1814 # define ALIGNMENT 4
1815 extern int _etext[];
1816 # define DATASTART ((ptr_t)(_etext))
1821 # define CPP_WORDSZ 32
1822 # define MACH_TYPE "ARM32"
1823 # define ALIGNMENT 4
1825 # define OS_TYPE "NETBSD"
1828 # define DATASTART GC_data_start
1829 # define DYNAMIC_LOADING
1831 extern char etext[];
1832 # define DATASTART ((ptr_t)(etext))
1834 # define USE_GENERIC_PUSH_REGS
1837 # define OS_TYPE "LINUX"
1838 # define LINUX_STACKBOTTOM
1840 # define STACK_GRAN 0x10000000
1841 # define USE_GENERIC_PUSH_REGS
1843 # define DYNAMIC_LOADING
1844 # include <features.h>
1845 # if defined(__GLIBC__) && __GLIBC__ >= 2
1846 # define SEARCH_FOR_DATA_START
1848 extern char **__environ;
1849 # define DATASTART ((ptr_t)(&__environ))
1850 /* hideous kludge: __environ is the first */
1851 /* word in crt0.o, and delimits the start */
1852 /* of the data segment, no matter which */
1853 /* ld options were passed through. */
1854 /* We could use _etext instead, but that */
1855 /* would include .rodata, which may */
1856 /* contain large read-only data tables */
1857 /* that we'd rather not scan. */
1860 # define DATAEND (_end)
1863 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
1867 # define OS_TYPE "MSWINCE"
1868 # define DATAEND /* not needed */
1871 /* __data_start is usually defined in the target linker script. */
1872 extern int __data_start[];
1873 # define DATASTART (ptr_t)(__data_start)
1874 # define USE_GENERIC_PUSH_REGS
1875 /* __stack_base__ is set in newlib/libc/sys/arm/crt0.S */
1876 extern void *__stack_base__;
1877 # define STACKBOTTOM ((ptr_t) (__stack_base__))
1882 # define MACH_TYPE "CRIS"
1883 # define CPP_WORDSZ 32
1884 # define ALIGNMENT 1
1885 # define OS_TYPE "LINUX"
1886 # define DYNAMIC_LOADING
1887 # define LINUX_STACKBOTTOM
1888 # define USE_GENERIC_PUSH_REGS
1889 # define SEARCH_FOR_DATA_START
1891 # define DATAEND (_end)
1895 # define MACH_TYPE "SH"
1896 # define ALIGNMENT 4
1898 # define OS_TYPE "MSWINCE"
1899 # define DATAEND /* not needed */
1902 # define OS_TYPE "LINUX"
1903 # define LINUX_STACKBOTTOM
1904 # define USE_GENERIC_PUSH_REGS
1905 # define DYNAMIC_LOADING
1906 # define SEARCH_FOR_DATA_START
1908 # define DATAEND (_end)
1911 # define OS_TYPE "NETBSD"
1913 # define DATASTART GC_data_start
1914 # define USE_GENERIC_PUSH_REGS
1915 # define DYNAMIC_LOADING
1920 # define MACH_TYPE "SH4"
1921 # define OS_TYPE "MSWINCE"
1922 # define ALIGNMENT 4
1923 # define DATAEND /* not needed */
1927 # define CPP_WORDSZ 32
1928 # define MACH_TYPE "M32R"
1929 # define ALIGNMENT 4
1931 # define OS_TYPE "LINUX"
1932 # define LINUX_STACKBOTTOM
1934 # define STACK_GRAN 0x10000000
1935 # define USE_GENERIC_PUSH_REGS
1936 # define DYNAMIC_LOADING
1937 # define SEARCH_FOR_DATA_START
1939 # define DATAEND (_end)
1944 # define MACH_TYPE "X86_64"
1945 # define ALIGNMENT 8
1946 # define CPP_WORDSZ 64
1948 # define HBLKSIZE 4096
1950 # define CACHE_LINE_SIZE 64
1951 # define USE_GENERIC_PUSH_REGS
1953 # define OS_TYPE "LINUX"
1954 # define LINUX_STACKBOTTOM
1956 # define FALLBACK_TO_MMAP
1958 # if !defined(GC_LINUX_THREADS) || !defined(REDIRECT_MALLOC)
1959 # define MPROTECT_VDB
1961 /* We seem to get random errors in incremental mode, */
1962 /* possibly because Linux threads is itself a malloc client */
1963 /* and can't deal with the signals. */
1966 # define DYNAMIC_LOADING
1967 # ifdef UNDEFINED /* includes ro data */
1968 extern int _etext[];
1969 # define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
1971 # include <features.h>
1972 # define SEARCH_FOR_DATA_START
1974 # define DATAEND (_end)
1977 # define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
1979 # if defined(__GNUC__) && __GNUC >= 3
1980 # define PREFETCH(x) __builtin_prefetch((x), 0, 0)
1981 # define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
1985 # define OS_TYPE "NETBSD"
1987 # define DYNAMIC_LOADING
1990 extern char etext[];
1991 # define SEARCH_FOR_DATA_START
1995 #if defined(LINUX) && defined(USE_MMAP)
1996 /* The kernel may do a somewhat better job merging mappings etc. */
1997 /* with anonymous mappings. */
1998 # define USE_MMAP_ANON
2001 #if defined(LINUX) && defined(REDIRECT_MALLOC)
2002 /* Rld appears to allocate some memory with its own allocator, and */
2003 /* some through malloc, which might be redirected. To make this */
2004 /* work with collectable memory, we have to scan memory allocated */
2005 /* by rld's internal malloc. */
2006 # define USE_PROC_FOR_LIBRARIES
2009 # ifndef STACK_GROWS_UP
2010 # define STACK_GROWS_DOWN
2014 # define CPP_WORDSZ 32
2023 # define DATAEND (end)
2026 # if defined(SVR4) && !defined(GETPAGESIZE)
2027 # include <unistd.h>
2028 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
2031 # ifndef GETPAGESIZE
2032 # if defined(SUNOS5) || defined(IRIX5)
2033 # include <unistd.h>
2035 # define GETPAGESIZE() getpagesize()
2038 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
2039 /* OS has SVR4 generic features. Probably others also qualify. */
2043 # if defined(SUNOS5) || defined(DRSNX)
2044 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
2047 /* OS has SUNOS5 style signal handlers. */
2055 # if defined(FREEBSD) && (__FreeBSD__ >= 4)
2059 # if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
2060 || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
2061 || defined(DGUX) || defined(BSD) || defined(SUNOS4) \
2062 || defined(_AIX) || defined(DARWIN) || defined(OSF1)
2063 # define UNIX_LIKE /* Basic Unix-like system calls work. */
2066 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
2071 # undef DYNAMIC_LOADING
2076 # undef MPROTECT_VDB
2081 /* Postponed for now. */
2083 # undef MPROTECT_VDB
2086 # ifdef SMALL_CONFIG
2087 /* Presumably not worth the space it takes. */
2089 # undef MPROTECT_VDB
2093 # undef MPROTECT_VDB /* Can't deal with address space holes. */
2096 # ifdef PARALLEL_MARK
2097 # undef MPROTECT_VDB /* For now. */
2100 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
2101 # define DEFAULT_VDB
2105 # define PREFETCH(x)
2106 # define NO_PREFETCH
2109 # ifndef PREFETCH_FOR_WRITE
2110 # define PREFETCH_FOR_WRITE(x)
2111 # define NO_PREFETCH_FOR_WRITE
2114 # ifndef CACHE_LINE_SIZE
2115 # define CACHE_LINE_SIZE 32 /* Wild guess */
2119 # define REGISTER_LIBRARIES_EARLY
2120 /* We sometimes use dl_iterate_phdr, which may acquire an internal */
2121 /* lock. This isn't safe after the world has stopped. So we must */
2122 /* call GC_register_dynamic_libraries before stopping the world. */
2123 /* For performance reasons, this may be beneficial on other */
2124 /* platforms as well, though it should be avoided in win32. */
2127 # if defined(SEARCH_FOR_DATA_START)
2128 extern ptr_t GC_data_start;
2129 # define DATASTART GC_data_start
2132 # ifndef CLEAR_DOUBLE
2133 # define CLEAR_DOUBLE(x) \
2134 ((word*)x)[0] = 0; \
2136 # endif /* CLEAR_DOUBLE */
2138 /* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */
2139 # if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS)
2140 # define GC_SOLARIS_THREADS
2143 # if defined(GC_IRIX_THREADS) && !defined(IRIX5)
2144 --> inconsistent configuration
2146 # if defined(GC_LINUX_THREADS) && !defined(LINUX)
2147 --> inconsistent configuration
2149 # if defined(GC_SOLARIS_THREADS) && !defined(SUNOS5)
2150 --> inconsistent configuration
2152 # if defined(GC_HPUX_THREADS) && !defined(HPUX)
2153 --> inconsistent configuration
2155 # if defined(GC_AIX_THREADS) && !defined(_AIX)
2156 --> inconsistent configuration
2158 # if defined(GC_WIN32_THREADS) && !defined(MSWIN32) && !defined(CYGWIN32)
2159 --> inconsistent configuration
2162 # if defined(PCR) || defined(SRC_M3) || \
2163 defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) || \
2164 defined(GC_PTHREADS)
2168 # if defined(HP_PA) || defined(M88K) \
2169 || defined(POWERPC) && !defined(DARWIN) \
2170 || defined(LINT) || defined(MSWINCE) || defined(ARM32) || defined(CRIS) \
2171 || (defined(I386) && defined(__LCC__))
2172 /* Use setjmp based hack to mark from callee-save registers. */
2173 /* The define should move to the individual platform */
2175 # define USE_GENERIC_PUSH_REGS
2178 # if defined(MSWINCE)
2183 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
2184 /* include assembly code to do it well. */
2187 /* Can we save call chain in objects for debugging? */
2188 /* SET NFRAMES (# of saved frames) and NARGS (#of args for each */
2189 /* frame) to reasonable values for the platform. */
2190 /* Set SAVE_CALL_CHAIN if we can. SAVE_CALL_COUNT can be specified */
2191 /* at build time, though we feel free to adjust it slightly. */
2192 /* Define NEED_CALLINFO if we either save the call stack or */
2193 /* GC_ADD_CALLER is defined. */
2194 /* GC_CAN_SAVE_CALL_STACKS is set in gc.h. */
2197 # define CAN_SAVE_CALL_ARGS
2199 #if (defined(I386) || defined(X86_64)) && defined(LINUX)
2200 /* SAVE_CALL_CHAIN is supported if the code is compiled to save */
2201 /* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
2202 # define CAN_SAVE_CALL_ARGS
2205 # if defined(SAVE_CALL_COUNT) && !defined(GC_ADD_CALLER) \
2206 && defined(GC_CAN_SAVE_CALL_STACKS)
2207 # define SAVE_CALL_CHAIN
2209 # ifdef SAVE_CALL_CHAIN
2210 # if defined(SAVE_CALL_NARGS) && defined(CAN_SAVE_CALL_ARGS)
2211 # define NARGS SAVE_CALL_NARGS
2213 # define NARGS 0 /* Number of arguments to save for each call. */
2216 # ifdef SAVE_CALL_CHAIN
2217 # ifndef SAVE_CALL_COUNT
2218 # define NFRAMES 6 /* Number of frames to save. Even for */
2219 /* alignment reasons. */
2221 # define NFRAMES ((SAVE_CALL_COUNT + 1) & ~1)
2223 # define NEED_CALLINFO
2224 # endif /* SAVE_CALL_CHAIN */
2225 # ifdef GC_ADD_CALLER
2228 # define NEED_CALLINFO
2231 # if defined(MAKE_BACK_GRAPH) && !defined(DBG_HDRS_ALL)
2232 # define DBG_HDRS_ALL
2235 # if defined(POINTER_MASK) && !defined(POINTER_SHIFT)
2236 # define POINTER_SHIFT 0
2239 # if defined(POINTER_SHIFT) && !defined(POINTER_MASK)
2240 # define POINTER_MASK ((GC_word)(-1))
2243 # if !defined(FIXUP_POINTER) && defined(POINTER_MASK)
2244 # define FIXUP_POINTER(p) (p) = ((p) & (POINTER_MASK) << POINTER_SHIFT)
2247 # if defined(FIXUP_POINTER)
2248 # define NEED_FIXUP_POINTER 1
2250 # define NEED_FIXUP_POINTER 0
2251 # define FIXUP_POINTER(p)
2255 /* This relies on some type definitions from gc_priv.h, from */
2256 /* where it's normally included. */
2258 /* How to get heap memory from the OS: */
2259 /* Note that sbrk()-like allocation is preferred, since it */
2260 /* usually makes it possible to merge consecutively allocated */
2261 /* chunks. It also avoids unintented recursion with */
2262 /* -DREDIRECT_MALLOC. */
2263 /* GET_MEM() returns a HLKSIZE aligned chunk. */
2264 /* 0 is taken to mean failure. */
2265 /* In the case os USE_MMAP, the argument must also be a */
2266 /* physical page size. */
2267 /* GET_MEM is currently not assumed to retrieve 0 filled space, */
2268 /* though we should perhaps take advantage of the case in which */
2270 struct hblk; /* See gc_priv.h. */
2272 char * real_malloc();
2273 # define GET_MEM(bytes) HBLKPTR(real_malloc((size_t)bytes + GC_page_size) \
2277 void * os2_alloc(size_t bytes);
2278 # define GET_MEM(bytes) HBLKPTR((ptr_t)os2_alloc((size_t)bytes \
2282 # if defined(NEXT) || defined(DOS4GW) || \
2283 (defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) || \
2284 (defined(SUNOS5) && !defined(USE_MMAP))
2285 # define GET_MEM(bytes) HBLKPTR((size_t) \
2286 calloc(1, (size_t)bytes + GC_page_size) \
2290 extern ptr_t GC_win32_get_mem();
2291 # define GET_MEM(bytes) (struct hblk *)GC_win32_get_mem(bytes)
2294 # if defined(USE_TEMPORARY_MEMORY)
2295 extern Ptr GC_MacTemporaryNewPtr(size_t size,
2296 Boolean clearMemory);
2297 # define GET_MEM(bytes) HBLKPTR( \
2298 GC_MacTemporaryNewPtr(bytes + GC_page_size, true) \
2301 # define GET_MEM(bytes) HBLKPTR( \
2302 NewPtrClear(bytes + GC_page_size) + GC_page_size-1)
2306 extern ptr_t GC_wince_get_mem();
2307 # define GET_MEM(bytes) (struct hblk *)GC_wince_get_mem(bytes)
2309 # if defined(AMIGA) && defined(GC_AMIGA_FASTALLOC)
2310 extern void *GC_amiga_get_mem(size_t size);
2311 # define GET_MEM(bytes) HBLKPTR((size_t) \
2312 GC_amiga_get_mem((size_t)bytes + GC_page_size) \
2315 extern ptr_t GC_unix_get_mem();
2316 # define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes)
2325 #endif /* GC_PRIVATE_H */
2327 #if defined(_AIX) && !defined(__GNUC__) && !defined(__STDC__)
2328 /* IBMs xlc compiler doesn't appear to follow the convention of */
2329 /* defining __STDC__ to be zero in extended mode. */
2333 # endif /* GCCONFIG_H */