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.
6 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
7 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
9 * Permission is hereby granted to use or copy this program
10 * for any purpose, provided the above notices are retained on all copies.
11 * Permission to modify the code and to distribute modified code is granted,
12 * provided the above notices are retained, and a notice that the code was
13 * modified is included with the above copyright notice.
20 /* Machine dependent parameters. Some tuning parameters can be found */
21 /* near the top of gc_private.h. */
23 /* Machine specific parts contributed by various people. See README file. */
25 /* First a unified test for Linux: */
26 # if defined(linux) || defined(__linux__)
30 /* Determine the machine type: */
31 # if defined(sun) && defined(mc68000)
34 # define mach_type_known
36 # if defined(hp9000s300)
39 # define mach_type_known
41 # if defined(__NetBSD__) && defined(m68k)
44 # define mach_type_known
53 # define mach_type_known
55 # if defined(mips) || defined(__mips)
57 # if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
60 # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4__)
61 # define IRIX5 /* or IRIX 6.X */
63 # define RISCOS /* or IRIX 4.X */
66 # define mach_type_known
68 # if defined(sequent) && defined(i386)
71 # define mach_type_known
73 # if defined(sun) && defined(i386)
76 # define mach_type_known
78 # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
81 # define mach_type_known
85 # define mach_type_known
87 # if defined(sun) && (defined(sparc) || defined(__sparc))
89 /* Test for SunOS 5.x */
96 # define mach_type_known
98 # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux)
101 # define mach_type_known
105 # define mach_type_known
107 # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
108 /* The above test may need refinement */
110 # if defined(_SCO_ELF)
115 # define mach_type_known
117 # if defined(_AUX_SOURCE)
120 # define mach_type_known
122 # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) \
123 || defined(hppa) || defined(__hppa__)
125 # define mach_type_known
127 # if defined(LINUX) && defined(i386)
129 # define mach_type_known
131 # if defined(LINUX) && defined(powerpc)
133 # define mach_type_known
135 # if defined(LINUX) && defined(__mc68000__)
137 # define mach_type_known
139 # if defined(linux) && defined(sparc)
142 # define mach_type_known
144 # if defined(__alpha) || defined(__alpha__)
147 # define OSF1 /* a.k.a Digital Unix */
149 # define mach_type_known
154 # define mach_type_known
156 # if defined(THINK_C) || defined(__MWERKS__) && !defined(__powerc)
159 # define mach_type_known
161 # if defined(__MWERKS__) && defined(__powerc)
164 # define mach_type_known
166 # if defined(NeXT) && defined(mc68000)
169 # define mach_type_known
171 # if defined(NeXT) && defined(i386)
174 # define mach_type_known
176 # if defined(__FreeBSD__) && defined(i386)
179 # define mach_type_known
181 # if defined(__NetBSD__) && defined(i386)
184 # define mach_type_known
186 # if defined(bsdi) && defined(i386)
189 # define mach_type_known
191 # if !defined(mach_type_known) && defined(__386BSD__)
194 # define mach_type_known
196 # if defined(_CX_UX) && defined(_M88K)
199 # define mach_type_known
204 # define mach_type_known
206 # if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
209 # define MSWIN32 /* or Win32s */
210 # define mach_type_known
212 # if defined(__DJGPP__)
215 # define DJGPP /* MSDOS running the DJGPP port of GCC */
217 # define mach_type_known
219 # if defined(__CYGWIN32__)
222 # define mach_type_known
224 # if defined(__BORLANDC__)
227 # define mach_type_known
229 # if defined(_UTS) && !defined(mach_type_known)
232 # define mach_type_known
235 # if defined(__WATCOMC__) && defined(__386__)
237 # if !defined(OS2) && !defined(MSWIN32) && !defined(DOS4GW)
238 # if defined(__OS2__)
241 # if defined(__WINDOWS_386__) || defined(__NT__)
248 # define mach_type_known
251 /* Feel free to add more clauses here */
253 /* Or manually define the machine type here. A machine type is */
254 /* characterized by the architecture. Some */
255 /* machine types are further subdivided by OS. */
256 /* the macros ULTRIX, RISCOS, and BSD to distinguish. */
257 /* Note that SGI IRIX is treated identically to RISCOS. */
258 /* SYSV on an M68K actually means A/UX. */
259 /* The distinction in these cases is usually the stack starting address */
260 # ifndef mach_type_known
261 --> unknown machine type
263 /* Mapping is: M68K ==> Motorola 680X0 */
264 /* (SUNOS4,HP,NEXT, and SYSV (A/UX), */
265 /* MACOS and AMIGA variants) */
266 /* I386 ==> Intel 386 */
267 /* (SEQUENT, OS2, SCO, LINUX, NETBSD, */
268 /* FREEBSD, THREE86BSD, MSWIN32, */
269 /* BSDI,SUNOS5, NEXT, other variants) */
270 /* NS32K ==> Encore Multimax */
271 /* MIPS ==> R2000 or R3000 */
272 /* (RISCOS, ULTRIX variants) */
273 /* VAX ==> DEC VAX */
274 /* (BSD, ULTRIX variants) */
275 /* RS6000 ==> IBM RS/6000 AIX3.X */
276 /* RT ==> IBM PC/RT */
277 /* HP_PA ==> HP9000/700 & /800 */
279 /* SPARC ==> SPARC under SunOS */
280 /* (SUNOS4, SUNOS5, */
281 /* DRSNX variants) */
282 /* ALPHA ==> DEC Alpha */
283 /* (OSF1 and LINUX variants) */
284 /* M88K ==> Motorola 88XX0 */
285 /* (CX_UX and DGUX) */
286 /* S370 ==> 370-like machine */
287 /* running Amdahl UTS4 */
291 * For each architecture and OS, the following need to be defined:
293 * CPP_WORD_SZ is a simple integer constant representing the word size.
294 * in bits. We assume byte addressibility, where a byte has 8 bits.
295 * We also assume CPP_WORD_SZ is either 32 or 64.
296 * (We care about the length of pointers, not hardware
297 * bus widths. Thus a 64 bit processor with a C compiler that uses
298 * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
300 * MACH_TYPE is a string representation of the machine type.
301 * OS_TYPE is analogous for the OS.
303 * ALIGNMENT is the largest N, such that
304 * all pointer are guaranteed to be aligned on N byte boundaries.
305 * defining it to be 1 will always work, but perform poorly.
307 * DATASTART is the beginning of the data segment.
308 * On UNIX systems, the collector will scan the area between DATASTART
309 * and DATAEND for root pointers.
311 * DATAEND, if not &end.
313 * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
316 * STACKBOTTOM is the cool end of the stack, which is usually the
317 * highest address in the stack.
318 * Under PCR or OS/2, we have other ways of finding thread stacks.
319 * For each machine, the following should:
320 * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
321 * 2) define exactly one of
322 * STACKBOTTOM (should be defined to be an expression)
325 * If either of the last two macros are defined, then STACKBOTTOM is computed
326 * during collector startup using one of the following two heuristics:
327 * HEURISTIC1: Take an address inside GC_init's frame, and round it up to
328 * the next multiple of STACK_GRAN.
329 * HEURISTIC2: Take an address inside GC_init's frame, increment it repeatedly
330 * in small steps (decrement if STACK_GROWS_UP), and read the value
331 * at each location. Remember the value when the first
332 * Segmentation violation or Bus error is signalled. Round that
333 * to the nearest plausible page boundary, and use that instead
336 * If no expression for STACKBOTTOM can be found, and neither of the above
337 * heuristics are usable, the collector can still be used with all of the above
338 * undefined, provided one of the following is done:
339 * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s)
340 * without reference to STACKBOTTOM. This is appropriate for use in
341 * conjunction with thread packages, since there will be multiple stacks.
342 * (Allocating thread stacks in the heap, and treating them as ordinary
343 * heap data objects is also possible as a last resort. However, this is
344 * likely to introduce significant amounts of excess storage retention
345 * unless the dead parts of the thread stacks are periodically cleared.)
346 * 2) Client code may set GC_stackbottom before calling any GC_ routines.
347 * If the author of the client code controls the main program, this is
348 * easily accomplished by introducing a new main program, setting
349 * GC_stackbottom to the address of a local variable, and then calling
350 * the original main program. The new main program would read something
353 * # include "gc_private.h"
355 * main(argc, argv, envp)
357 * char **argv, **envp;
361 * GC_stackbottom = (ptr_t)(&dummy);
362 * return(real_main(argc, argv, envp));
366 * Each architecture may also define the style of virtual dirty bit
367 * implementation to be used:
368 * MPROTECT_VDB: Write protect the heap and catch faults.
369 * PROC_VDB: Use the SVR4 /proc primitives to read dirty bits.
371 * An architecture may define DYNAMIC_LOADING if dynamic_load.c
372 * defined GC_register_dynamic_libraries() for the architecture.
376 # define STACK_GRAN 0x1000000
378 # define MACH_TYPE "M68K"
381 # define OS_TYPE "NETBSD"
384 # define DATASTART ((ptr_t)(&etext))
387 # define OS_TYPE "LINUX"
388 # define STACKBOTTOM ((ptr_t)0xf0000000)
389 # define MPROTECT_VDB
391 # define DYNAMIC_LOADING
392 extern char **__environ;
393 # define DATASTART ((ptr_t)(&__environ))
394 /* hideous kludge: __environ is the first */
395 /* word in crt0.o, and delimits the start */
396 /* of the data segment, no matter which */
397 /* ld options were passed through. */
398 /* We could use _etext instead, but that */
399 /* would include .rodata, which may */
400 /* contain large read-only data tables */
401 /* that we'd rather not scan. */
403 # define DATAEND (&_end)
406 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
410 # define OS_TYPE "SUNOS4"
412 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ffff) & ~0x1ffff))
413 # define HEURISTIC1 /* differs */
414 # define DYNAMIC_LOADING
417 # define OS_TYPE "HP"
419 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
420 # define STACKBOTTOM ((ptr_t) 0xffeffffc)
421 /* empirically determined. seems to work. */
423 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
426 # define OS_TYPE "SYSV"
428 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
430 +((word)&etext & 0x1fff))
431 /* This only works for shared-text binaries with magic number 0413.
432 The other sorts of SysV binaries put the data at the end of the text,
433 in which case the default of &etext would work. Unfortunately,
434 handling both would require having the magic-number available.
437 # define STACKBOTTOM ((ptr_t)0xFFFFFFFE)
438 /* The stack starts at the top of memory, but */
439 /* 0x0 cannot be used as setjump_test complains */
440 /* that the stack direction is incorrect. Two */
441 /* bytes down from 0x0 should be safe enough. */
443 # include <sys/mmu.h>
444 # define GETPAGESIZE() PAGESIZE /* Is this still right? */
447 # define OS_TYPE "AMIGA"
448 /* STACKBOTTOM and DATASTART handled specially */
450 # define DATAEND /* not needed */
451 # define GETPAGESIZE() 4096
457 # define OS_TYPE "MACOS"
458 /* see os_dep.c for details of global data segments. */
459 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
460 # define DATAEND /* not needed */
461 # define GETPAGESIZE() 4096
464 # define OS_TYPE "NEXT"
465 # define DATASTART ((ptr_t) get_etext())
466 # define STACKBOTTOM ((ptr_t) 0x4000000)
467 # define DATAEND /* not needed */
472 # define MACH_TYPE "POWERPC"
478 # define OS_TYPE "MACOS"
479 /* see os_dep.c for details of global data segments. */
480 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
481 # define DATAEND /* not needed */
484 # define OS_TYPE "LINUX"
485 # define STACKBOTTOM ((ptr_t)0x80000000)
486 # define DATASTART GC_data_start
488 # define DATAEND (&_end)
493 # define MACH_TYPE "VAX"
494 # define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
496 # define DATASTART ((ptr_t)(&etext))
498 # define OS_TYPE "BSD"
500 /* HEURISTIC2 may be OK, but it's hard to test. */
503 # define OS_TYPE "ULTRIX"
504 # define STACKBOTTOM ((ptr_t) 0x7fffc800)
509 # define MACH_TYPE "RT"
511 # define DATASTART ((ptr_t) 0x10000000)
512 # define STACKBOTTOM ((ptr_t) 0x1fffd800)
516 # define MACH_TYPE "SPARC"
517 # define ALIGNMENT 4 /* Required by hardware */
518 # define ALIGN_DOUBLE
521 # define OS_TYPE "SUNOS5"
524 extern char * GC_SysVGetDataStart();
525 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
526 # define DATAEND (&_end)
531 # define HEAP_START (ptr_t)0x40000000
533 # define HEAP_START DATAEND
536 /* HEURISTIC1 reportedly no longer works under 2.7. Thus we */
537 /* switched to HEURISTIC2, eventhough it creates some debugging */
541 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
542 /* getpagesize() appeared to be missing from at least one */
543 /* Solaris 5.4 installation. Weird. */
544 # define DYNAMIC_LOADING
547 # define OS_TYPE "SUNOS4"
548 /* [If you have a weak stomach, don't read this.] */
549 /* We would like to use: */
550 /* # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */
551 /* This fails occasionally, due to an ancient, but very */
552 /* persistent ld bug. &etext is set 32 bytes too high. */
553 /* We instead read the text segment size from the a.out */
554 /* header, which happens to be mapped into our address space */
555 /* at the start of the text segment. The detective work here */
556 /* was done by Robert Ehrlich, Manuel Serrano, and Bernard */
557 /* Serpette of INRIA. */
558 /* This assumes ZMAGIC, i.e. demand-loadable executables. */
559 # define TEXTSTART 0x2000
560 # define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
561 # define MPROTECT_VDB
563 # define DYNAMIC_LOADING
566 # define CPP_WORDSZ 32
567 # define OS_TYPE "DRSNX"
568 extern char * GC_SysVGetDataStart();
570 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
571 # define MPROTECT_VDB
572 # define STACKBOTTOM ((ptr_t) 0xdfff0000)
573 # define DYNAMIC_LOADING
576 # define OS_TYPE "LINUX"
578 # define DATASTART GC_data_start
579 # define DYNAMIC_LOADING
581 Linux Sparc non elf ?
584 # define DATAEND (&_end)
586 # define STACKBOTTOM ((ptr_t) 0xf0000000)
591 # define MACH_TYPE "I386"
592 # define ALIGNMENT 4 /* Appears to hold for all "32 bit" compilers */
593 /* except Borland. The -a4 option fixes */
595 /* Ivan Demakov: For Watcom the option is -zp4. */
596 # ifndef SMALL_CONFIG
597 # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
598 /* improvement on Pentiums. */
601 # define OS_TYPE "SEQUENT"
603 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
604 # define STACKBOTTOM ((ptr_t) 0x3ffff000)
607 # define OS_TYPE "SUNOS5"
608 extern int etext, _start;
609 extern char * GC_SysVGetDataStart();
610 # define DATASTART GC_SysVGetDataStart(0x1000, &etext)
611 # define STACKBOTTOM ((ptr_t)(&_start))
612 /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
613 /*# define PROC_VDB*/
614 # define DYNAMIC_LOADING
619 # define HEAP_START (ptr_t)0x40000000
621 # define HEAP_START DATAEND
625 # define OS_TYPE "SCO"
627 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
629 +((word)&etext & 0xfff))
630 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
633 # define OS_TYPE "SCO_ELF"
635 # define DATASTART ((ptr_t)(&etext))
636 # define STACKBOTTOM ((ptr_t) 0x08048000)
637 # define DYNAMIC_LOADING
638 # define ELF_CLASS ELFCLASS32
641 # define OS_TYPE "LINUX"
642 # define STACKBOTTOM ((ptr_t)0xc0000000)
643 /* Appears to be 0xe0000000 for at least one 2.1.91 kernel. */
644 /* Probably needs to be more flexible, but I don't yet */
645 /* fully understand how flexible. */
646 # if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
647 # define MPROTECT_VDB
649 /* We seem to get random errors in incremental mode, */
650 /* possibly because Linux threads is itself a malloc client */
651 /* and can't deal with the signals. */
654 # define DYNAMIC_LOADING
655 # ifdef UNDEFINED /* includes ro data */
657 # define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
659 # include <features.h>
660 # if defined(__GLIBC__) && __GLIBC__ >= 2
661 extern int __data_start;
662 # define DATASTART ((ptr_t)(&__data_start))
664 extern char **__environ;
665 # define DATASTART ((ptr_t)(&__environ))
666 /* hideous kludge: __environ is the first */
667 /* word in crt0.o, and delimits the start */
668 /* of the data segment, no matter which */
669 /* ld options were passed through. */
670 /* We could use _etext instead, but that */
671 /* would include .rodata, which may */
672 /* contain large read-only data tables */
673 /* that we'd rather not scan. */
676 # define DATAEND (&_end)
679 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
683 # define OS_TYPE "CYGWIN32"
684 extern int _data_start__;
685 extern int _data_end__;
686 extern int _bss_start__;
687 extern int _bss_end__;
688 /* For binutils 2.9.1, we have */
689 /* DATASTART = _data_start__ */
690 /* DATAEND = _bss_end__ */
691 /* whereas for some earlier versions it was */
692 /* DATASTART = _bss_start__ */
693 /* DATAEND = _data_end__ */
694 /* To get it right for both, we take the */
695 /* minumum/maximum of the two. */
696 # define MAX(x,y) ((x) > (y) ? (x) : (y))
697 # define MIN(x,y) ((x) < (y) ? (x) : (y))
698 # define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
699 # define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__))
701 # define STACK_GRAN 0x10000
705 # define OS_TYPE "OS2"
706 /* STACKBOTTOM and DATASTART are handled specially in */
707 /* os_dep.c. OS2 actually has the right */
709 # define DATAEND /* not needed */
712 # define OS_TYPE "MSWIN32"
713 /* STACKBOTTOM and DATASTART are handled specially in */
716 # define MPROTECT_VDB
718 # define DATAEND /* not needed */
721 # define OS_TYPE "DJGPP"
722 # include "stubinfo.h"
725 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
726 # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
728 /* This may not be right. */
731 # define OS_TYPE "FREEBSD"
732 # define MPROTECT_VDB
735 # define OS_TYPE "NETBSD"
738 # define OS_TYPE "THREE86BSD"
741 # define OS_TYPE "BSDI"
743 # if defined(FREEBSD) || defined(NETBSD) \
744 || defined(THREE86BSD) || defined(BSDI)
747 # define DATASTART ((ptr_t)(&etext))
750 # define OS_TYPE "NEXT"
751 # define DATASTART ((ptr_t) get_etext())
752 # define STACKBOTTOM ((ptr_t)0xc0000000)
753 # define DATAEND /* not needed */
756 # define OS_TYPE "DOS4GW"
757 extern long __nullarea;
759 extern char *_STACKTOP;
760 /* Depending on calling conventions Watcom C either precedes
761 or does not precedes with undescore names of C-variables.
762 Make sure startup code variables always have the same names. */
763 #pragma aux __nullarea "*";
764 #pragma aux _end "*";
765 # define STACKBOTTOM ((ptr_t) _STACKTOP)
766 /* confused? me too. */
767 # define DATASTART ((ptr_t) &__nullarea)
768 # define DATAEND ((ptr_t) &_end)
773 # define MACH_TYPE "NS32K"
775 extern char **environ;
776 # define DATASTART ((ptr_t)(&environ))
777 /* hideous kludge: environ is the first */
778 /* word in crt0.o, and delimits the start */
779 /* of the data segment, no matter which */
780 /* ld options were passed through. */
781 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
785 # define MACH_TYPE "MIPS"
787 # define DATASTART (ptr_t)0x10000000
788 /* Could probably be slightly higher since */
789 /* startup code allocates lots of stuff. */
792 # define DATASTART ((ptr_t)(&_fdata))
794 # define HEAP_START (ptr_t)0x30000000
796 # define HEAP_START DATASTART
798 /* Lowest plausible heap address. */
799 /* In the MMAP case, we map there. */
800 /* In either case it is used to identify */
801 /* heap sections so they're not */
802 /* considered as roots. */
805 /* # define STACKBOTTOM ((ptr_t)0x7fff8000) sometimes also works. */
807 # define OS_TYPE "ULTRIX"
811 # define OS_TYPE "RISCOS"
812 # define ALIGNMENT 4 /* Required by hardware */
815 # define OS_TYPE "IRIX5"
816 # define MPROTECT_VDB
818 # define CPP_WORDSZ _MIPS_SZPTR
819 # define ALIGNMENT (_MIPS_SZPTR/8)
820 # if CPP_WORDSZ != 64
821 # define ALIGN_DOUBLE
825 # define ALIGN_DOUBLE
827 # define DYNAMIC_LOADING
832 # define MACH_TYPE "RS6000"
834 # define DATASTART ((ptr_t)0x20000000)
836 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
837 # define DYNAMIC_LOADING
838 /* For really old versions of AIX, this may have to be removed. */
842 # define MACH_TYPE "HP_PA"
844 # define ALIGN_DOUBLE
845 extern int __data_start;
846 # define DATASTART ((ptr_t)(&__data_start))
848 /* The following appears to work for 7xx systems running HP/UX */
849 /* 9.xx Furthermore, it might result in much faster */
850 /* collections than HEURISTIC2, which may involve scanning */
851 /* segments that directly precede the stack. It is not the */
852 /* default, since it may not work on older machine/OS */
853 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
855 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
859 # define STACK_GROWS_UP
860 # define DYNAMIC_LOADING
862 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
863 /* They misspelled the Posix macro? */
867 # define MACH_TYPE "ALPHA"
870 # define OS_TYPE "OSF1"
871 # define DATASTART ((ptr_t) 0x140000000)
873 # define DATAEND ((ptr_t) &_end)
875 /* Normally HEURISTIC2 is too conervative, since */
876 /* the text segment immediately follows the stack. */
877 /* Hence we give an upper pound. */
879 # define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
880 # define CPP_WORDSZ 64
881 # define MPROTECT_VDB
882 # define DYNAMIC_LOADING
885 # define OS_TYPE "LINUX"
886 # define CPP_WORDSZ 64
887 # define STACKBOTTOM ((ptr_t) 0x120000000)
889 extern int __data_start;
890 # define DATASTART &__data_start
891 # define DYNAMIC_LOADING
893 # define DATASTART ((ptr_t) 0x140000000)
896 # define DATAEND (&_end)
897 /* As of 1.3.90, I couldn't find a way to retrieve the correct */
898 /* fault address from a signal handler. */
899 /* Hence MPROTECT_VDB is broken. */
904 # define MACH_TYPE "M88K"
906 # define ALIGN_DOUBLE
909 # define OS_TYPE "CX_UX"
910 # define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
913 # define OS_TYPE "DGUX"
914 extern char * GC_SysVGetDataStart();
915 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
917 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
921 # define MACH_TYPE "S370"
922 # define OS_TYPE "UTS4"
923 # define ALIGNMENT 4 /* Required by hardware */
927 extern char * GC_SysVGetDataStart();
928 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
929 # define DATAEND (&_end)
933 # ifndef STACK_GROWS_UP
934 # define STACK_GROWS_DOWN
938 # define CPP_WORDSZ 32
947 # define DATAEND (&end)
950 # if defined(SVR4) && !defined(GETPAGESIZE)
952 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
956 # if defined(SUNOS5) || defined(IRIX5)
959 # define GETPAGESIZE() getpagesize()
962 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
963 /* OS has SVR4 generic features. Probably others also qualify. */
967 # if defined(SUNOS5) || defined(DRSNX)
968 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
971 /* OS has SUNOS5 style signal handlers. */
975 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
980 # undef DYNAMIC_LOADING
990 /* Postponed for now. */
996 /* Presumably not worth the space it takes. */
1001 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
1002 # define DEFAULT_VDB
1005 # if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
1006 # define SOLARIS_THREADS
1008 # if defined(IRIX_THREADS) && !defined(IRIX5)
1009 --> inconsistent configuration
1011 # if defined(IRIX_JDK_THREADS) && !defined(IRIX5)
1012 --> inconsistent configuration
1014 # if defined(LINUX_THREADS) && !defined(LINUX)
1015 --> inconsistent configuration
1017 # if defined(SOLARIS_THREADS) && !defined(SUNOS5)
1018 --> inconsistent configuration
1020 # if defined(PCR) || defined(SRC_M3) || \
1021 defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
1022 defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
1023 defined(IRIX_JDK_THREADS)
1027 # if defined(SPARC) && !defined(LINUX)
1028 # define SAVE_CALL_CHAIN
1029 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
1030 /* include assembly code to do it well. */