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(__OpenBSD__) && defined(m68k)
44 # define mach_type_known
46 # if defined(__NetBSD__) && defined(m68k)
49 # define mach_type_known
58 # define mach_type_known
60 # if defined(mips) || defined(__mips)
62 # if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
65 # if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4__)
66 # define IRIX5 /* or IRIX 6.X */
68 # define RISCOS /* or IRIX 4.X */
71 # define mach_type_known
73 # if defined(sequent) && defined(i386)
76 # define mach_type_known
78 # if defined(sun) && defined(i386)
81 # define mach_type_known
83 # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
86 # define mach_type_known
90 # define mach_type_known
92 # if defined(sun) && (defined(sparc) || defined(__sparc))
94 /* Test for SunOS 5.x */
101 # define mach_type_known
103 # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux)
106 # define mach_type_known
110 # define mach_type_known
112 # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
113 /* The above test may need refinement */
115 # if defined(_SCO_ELF)
120 # define mach_type_known
122 # if defined(_AUX_SOURCE)
125 # define mach_type_known
127 # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) \
128 || defined(hppa) || defined(__hppa__)
130 # define mach_type_known
132 # if defined(LINUX) && defined(i386)
134 # define mach_type_known
136 # if defined(LINUX) && defined(powerpc)
138 # define mach_type_known
140 # if defined(LINUX) && defined(__mc68000__)
142 # define mach_type_known
144 # if defined(linux) && defined(sparc)
147 # define mach_type_known
149 # if defined(__alpha) || defined(__alpha__)
152 # define OSF1 /* a.k.a Digital Unix */
154 # define mach_type_known
159 # define mach_type_known
161 # if defined(THINK_C) || defined(__MWERKS__) && !defined(__powerc)
164 # define mach_type_known
166 # if defined(__MWERKS__) && defined(__powerc)
169 # define mach_type_known
171 # if defined(NeXT) && defined(mc68000)
174 # define mach_type_known
176 # if defined(NeXT) && defined(i386)
179 # define mach_type_known
181 # if defined(__OpenBSD__) && defined(i386)
184 # define mach_type_known
186 # if defined(__FreeBSD__) && defined(i386)
189 # define mach_type_known
191 # if defined(__NetBSD__) && defined(i386)
194 # define mach_type_known
196 # if defined(bsdi) && defined(i386)
199 # define mach_type_known
201 # if !defined(mach_type_known) && defined(__386BSD__)
204 # define mach_type_known
206 # if defined(_CX_UX) && defined(_M88K)
209 # define mach_type_known
214 # define mach_type_known
216 # if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
217 || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
219 # define MSWIN32 /* or Win32s */
220 # define mach_type_known
222 # if defined(__DJGPP__)
225 # define DJGPP /* MSDOS running the DJGPP port of GCC */
227 # define mach_type_known
229 # if defined(__CYGWIN32__) || defined(__CYGWIN__)
232 # define mach_type_known
234 # if defined(__BORLANDC__)
237 # define mach_type_known
239 # if defined(_UTS) && !defined(mach_type_known)
242 # define mach_type_known
245 # if defined(__WATCOMC__) && defined(__386__)
247 # if !defined(OS2) && !defined(MSWIN32) && !defined(DOS4GW)
248 # if defined(__OS2__)
251 # if defined(__WINDOWS_386__) || defined(__NT__)
258 # define mach_type_known
261 /* Feel free to add more clauses here */
263 /* Or manually define the machine type here. A machine type is */
264 /* characterized by the architecture. Some */
265 /* machine types are further subdivided by OS. */
266 /* the macros ULTRIX, RISCOS, and BSD to distinguish. */
267 /* Note that SGI IRIX is treated identically to RISCOS. */
268 /* SYSV on an M68K actually means A/UX. */
269 /* The distinction in these cases is usually the stack starting address */
270 # ifndef mach_type_known
271 --> unknown machine type
273 /* Mapping is: M68K ==> Motorola 680X0 */
274 /* (SUNOS4,HP,NEXT, and SYSV (A/UX), */
275 /* MACOS and AMIGA variants) */
276 /* I386 ==> Intel 386 */
277 /* (SEQUENT, OS2, SCO, LINUX, NETBSD, */
278 /* FREEBSD, THREE86BSD, MSWIN32, */
279 /* BSDI,SUNOS5, NEXT, other variants) */
280 /* NS32K ==> Encore Multimax */
281 /* MIPS ==> R2000 or R3000 */
282 /* (RISCOS, ULTRIX variants) */
283 /* VAX ==> DEC VAX */
284 /* (BSD, ULTRIX variants) */
285 /* RS6000 ==> IBM RS/6000 AIX3.X */
286 /* RT ==> IBM PC/RT */
287 /* HP_PA ==> HP9000/700 & /800 */
289 /* SPARC ==> SPARC under SunOS */
290 /* (SUNOS4, SUNOS5, */
291 /* DRSNX variants) */
292 /* ALPHA ==> DEC Alpha */
293 /* (OSF1 and LINUX variants) */
294 /* M88K ==> Motorola 88XX0 */
295 /* (CX_UX and DGUX) */
296 /* S370 ==> 370-like machine */
297 /* running Amdahl UTS4 */
301 * For each architecture and OS, the following need to be defined:
303 * CPP_WORD_SZ is a simple integer constant representing the word size.
304 * in bits. We assume byte addressibility, where a byte has 8 bits.
305 * We also assume CPP_WORD_SZ is either 32 or 64.
306 * (We care about the length of pointers, not hardware
307 * bus widths. Thus a 64 bit processor with a C compiler that uses
308 * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
310 * MACH_TYPE is a string representation of the machine type.
311 * OS_TYPE is analogous for the OS.
313 * ALIGNMENT is the largest N, such that
314 * all pointer are guaranteed to be aligned on N byte boundaries.
315 * defining it to be 1 will always work, but perform poorly.
317 * DATASTART is the beginning of the data segment.
318 * On UNIX systems, the collector will scan the area between DATASTART
319 * and DATAEND for root pointers.
321 * DATAEND, if not &end.
323 * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
326 * STACKBOTTOM is the cool end of the stack, which is usually the
327 * highest address in the stack.
328 * Under PCR or OS/2, we have other ways of finding thread stacks.
329 * For each machine, the following should:
330 * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
331 * 2) define exactly one of
332 * STACKBOTTOM (should be defined to be an expression)
335 * If either of the last two macros are defined, then STACKBOTTOM is computed
336 * during collector startup using one of the following two heuristics:
337 * HEURISTIC1: Take an address inside GC_init's frame, and round it up to
338 * the next multiple of STACK_GRAN.
339 * HEURISTIC2: Take an address inside GC_init's frame, increment it repeatedly
340 * in small steps (decrement if STACK_GROWS_UP), and read the value
341 * at each location. Remember the value when the first
342 * Segmentation violation or Bus error is signalled. Round that
343 * to the nearest plausible page boundary, and use that instead
346 * If no expression for STACKBOTTOM can be found, and neither of the above
347 * heuristics are usable, the collector can still be used with all of the above
348 * undefined, provided one of the following is done:
349 * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s)
350 * without reference to STACKBOTTOM. This is appropriate for use in
351 * conjunction with thread packages, since there will be multiple stacks.
352 * (Allocating thread stacks in the heap, and treating them as ordinary
353 * heap data objects is also possible as a last resort. However, this is
354 * likely to introduce significant amounts of excess storage retention
355 * unless the dead parts of the thread stacks are periodically cleared.)
356 * 2) Client code may set GC_stackbottom before calling any GC_ routines.
357 * If the author of the client code controls the main program, this is
358 * easily accomplished by introducing a new main program, setting
359 * GC_stackbottom to the address of a local variable, and then calling
360 * the original main program. The new main program would read something
363 * # include "gc_private.h"
365 * main(argc, argv, envp)
367 * char **argv, **envp;
371 * GC_stackbottom = (ptr_t)(&dummy);
372 * return(real_main(argc, argv, envp));
376 * Each architecture may also define the style of virtual dirty bit
377 * implementation to be used:
378 * MPROTECT_VDB: Write protect the heap and catch faults.
379 * PROC_VDB: Use the SVR4 /proc primitives to read dirty bits.
381 * An architecture may define DYNAMIC_LOADING if dynamic_load.c
382 * defined GC_register_dynamic_libraries() for the architecture.
386 # define STACK_GRAN 0x1000000
388 # define MACH_TYPE "M68K"
391 # define OS_TYPE "OPENBSD"
394 # define DATASTART ((ptr_t)(&etext))
397 # define OS_TYPE "NETBSD"
400 # define DATASTART ((ptr_t)(&etext))
403 # define OS_TYPE "LINUX"
404 # define STACKBOTTOM ((ptr_t)0xf0000000)
405 # define MPROTECT_VDB
407 # define DYNAMIC_LOADING
408 extern char **__environ
;
409 # define DATASTART ((ptr_t)(&__environ))
410 /* hideous kludge: __environ is the first */
411 /* word in crt0.o, and delimits the start */
412 /* of the data segment, no matter which */
413 /* ld options were passed through. */
414 /* We could use _etext instead, but that */
415 /* would include .rodata, which may */
416 /* contain large read-only data tables */
417 /* that we'd rather not scan. */
419 # define DATAEND (&_end)
422 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
426 # define OS_TYPE "SUNOS4"
428 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ffff) & ~0x1ffff))
429 # define HEURISTIC1 /* differs */
430 # define DYNAMIC_LOADING
433 # define OS_TYPE "HP"
435 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
436 # define STACKBOTTOM ((ptr_t) 0xffeffffc)
437 /* empirically determined. seems to work. */
439 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
442 # define OS_TYPE "SYSV"
444 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
446 +((word)&etext & 0x1fff))
447 /* This only works for shared-text binaries with magic number 0413.
448 The other sorts of SysV binaries put the data at the end of the text,
449 in which case the default of &etext would work. Unfortunately,
450 handling both would require having the magic-number available.
453 # define STACKBOTTOM ((ptr_t)0xFFFFFFFE)
454 /* The stack starts at the top of memory, but */
455 /* 0x0 cannot be used as setjump_test complains */
456 /* that the stack direction is incorrect. Two */
457 /* bytes down from 0x0 should be safe enough. */
459 # include <sys/mmu.h>
460 # define GETPAGESIZE() PAGESIZE /* Is this still right? */
463 # define OS_TYPE "AMIGA"
464 /* STACKBOTTOM and DATASTART handled specially */
466 # define DATAEND /* not needed */
467 # define GETPAGESIZE() 4096
473 # define OS_TYPE "MACOS"
474 /* see os_dep.c for details of global data segments. */
475 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
476 # define DATAEND /* not needed */
477 # define GETPAGESIZE() 4096
480 # define OS_TYPE "NEXT"
481 # define DATASTART ((ptr_t) get_etext())
482 # define STACKBOTTOM ((ptr_t) 0x4000000)
483 # define DATAEND /* not needed */
488 # define MACH_TYPE "POWERPC"
494 # define OS_TYPE "MACOS"
495 /* see os_dep.c for details of global data segments. */
496 # define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
497 # define DATAEND /* not needed */
500 # define OS_TYPE "LINUX"
503 # define STACK_GRAN 0x10000000
504 # define DATASTART GC_data_start
506 # define DATAEND (&_end)
511 # define MACH_TYPE "VAX"
512 # define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
514 # define DATASTART ((ptr_t)(&etext))
516 # define OS_TYPE "BSD"
518 /* HEURISTIC2 may be OK, but it's hard to test. */
521 # define OS_TYPE "ULTRIX"
522 # define STACKBOTTOM ((ptr_t) 0x7fffc800)
527 # define MACH_TYPE "RT"
529 # define DATASTART ((ptr_t) 0x10000000)
530 # define STACKBOTTOM ((ptr_t) 0x1fffd800)
534 # define MACH_TYPE "SPARC"
535 # define ALIGNMENT 4 /* Required by hardware */
536 # define ALIGN_DOUBLE
539 # define OS_TYPE "SUNOS5"
542 extern char * GC_SysVGetDataStart();
543 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
544 # define DATAEND (&_end)
549 # define HEAP_START (ptr_t)0x40000000
551 # define HEAP_START DATAEND
554 /* HEURISTIC1 reportedly no longer works under 2.7. Thus we */
555 /* switched to HEURISTIC2, eventhough it creates some debugging */
559 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
560 /* getpagesize() appeared to be missing from at least one */
561 /* Solaris 5.4 installation. Weird. */
562 # define DYNAMIC_LOADING
565 # define OS_TYPE "SUNOS4"
566 /* [If you have a weak stomach, don't read this.] */
567 /* We would like to use: */
568 /* # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */
569 /* This fails occasionally, due to an ancient, but very */
570 /* persistent ld bug. &etext is set 32 bytes too high. */
571 /* We instead read the text segment size from the a.out */
572 /* header, which happens to be mapped into our address space */
573 /* at the start of the text segment. The detective work here */
574 /* was done by Robert Ehrlich, Manuel Serrano, and Bernard */
575 /* Serpette of INRIA. */
576 /* This assumes ZMAGIC, i.e. demand-loadable executables. */
577 # define TEXTSTART 0x2000
578 # define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
579 # define MPROTECT_VDB
581 # define DYNAMIC_LOADING
584 # define CPP_WORDSZ 32
585 # define OS_TYPE "DRSNX"
586 extern char * GC_SysVGetDataStart();
588 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
589 # define MPROTECT_VDB
590 # define STACKBOTTOM ((ptr_t) 0xdfff0000)
591 # define DYNAMIC_LOADING
594 # define OS_TYPE "LINUX"
596 # define DATASTART GC_data_start
597 # define DYNAMIC_LOADING
599 Linux Sparc non elf
?
602 # define DATAEND (&_end)
604 # define STACKBOTTOM ((ptr_t) 0xf0000000)
609 # define MACH_TYPE "I386"
610 # define ALIGNMENT 4 /* Appears to hold for all "32 bit" compilers */
611 /* except Borland. The -a4 option fixes */
613 /* Ivan Demakov: For Watcom the option is -zp4. */
614 # ifndef SMALL_CONFIG
615 # define ALIGN_DOUBLE /* Not strictly necessary, but may give speed */
616 /* improvement on Pentiums. */
619 # define OS_TYPE "SEQUENT"
621 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
622 # define STACKBOTTOM ((ptr_t) 0x3ffff000)
625 # define OS_TYPE "SUNOS5"
626 extern int etext
, _start
;
627 extern char * GC_SysVGetDataStart();
628 # define DATASTART GC_SysVGetDataStart(0x1000, &etext)
629 # define STACKBOTTOM ((ptr_t)(&_start))
630 /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
631 /*# define PROC_VDB*/
632 # define DYNAMIC_LOADING
637 # define HEAP_START (ptr_t)0x40000000
639 # define HEAP_START DATAEND
643 # define OS_TYPE "SCO"
645 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
647 +((word)&etext & 0xfff))
648 # define STACKBOTTOM ((ptr_t) 0x7ffffffc)
651 # define OS_TYPE "SCO_ELF"
653 # define DATASTART ((ptr_t)(&etext))
654 # define STACKBOTTOM ((ptr_t) 0x08048000)
655 # define DYNAMIC_LOADING
656 # define ELF_CLASS ELFCLASS32
659 # define OS_TYPE "LINUX"
660 # define STACKBOTTOM ((ptr_t)0xc0000000)
661 /* Appears to be 0xe0000000 for at least one 2.1.91 kernel. */
662 /* Probably needs to be more flexible, but I don't yet */
663 /* fully understand how flexible. */
664 # if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
665 # define MPROTECT_VDB
667 /* We seem to get random errors in incremental mode, */
668 /* possibly because Linux threads is itself a malloc client */
669 /* and can't deal with the signals. */
672 # define DYNAMIC_LOADING
673 # ifdef UNDEFINED /* includes ro data */
675 # define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
677 # include <features.h>
678 # if defined(__GLIBC__) && __GLIBC__ >= 2
679 extern int __data_start
;
680 # define DATASTART ((ptr_t)(&__data_start))
682 extern char **__environ
;
683 # define DATASTART ((ptr_t)(&__environ))
684 /* hideous kludge: __environ is the first */
685 /* word in crt0.o, and delimits the start */
686 /* of the data segment, no matter which */
687 /* ld options were passed through. */
688 /* We could use _etext instead, but that */
689 /* would include .rodata, which may */
690 /* contain large read-only data tables */
691 /* that we'd rather not scan. */
694 # define DATAEND (&_end)
697 # define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
701 # define OS_TYPE "CYGWIN32"
702 extern int _data_start__
;
703 extern int _data_end__
;
704 extern int _bss_start__
;
705 extern int _bss_end__
;
706 /* For binutils 2.9.1, we have */
707 /* DATASTART = _data_start__ */
708 /* DATAEND = _bss_end__ */
709 /* whereas for some earlier versions it was */
710 /* DATASTART = _bss_start__ */
711 /* DATAEND = _data_end__ */
712 /* To get it right for both, we take the */
713 /* minumum/maximum of the two. */
714 # define MAX(x,y) ((x) > (y) ? (x) : (y))
715 # define MIN(x,y) ((x) < (y) ? (x) : (y))
716 # define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
717 # define DATAEND ((ptr_t) MAX(&_data_end__, &_bss_end__))
719 # define STACK_GRAN 0x10000
723 # define OS_TYPE "OS2"
724 /* STACKBOTTOM and DATASTART are handled specially in */
725 /* os_dep.c. OS2 actually has the right */
727 # define DATAEND /* not needed */
730 # define OS_TYPE "MSWIN32"
731 /* STACKBOTTOM and DATASTART are handled specially in */
734 # define MPROTECT_VDB
736 # define DATAEND /* not needed */
739 # define OS_TYPE "DJGPP"
740 # include "stubinfo.h"
743 extern int __djgpp_stack_limit
;
744 # define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
745 /* # define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
747 # define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
748 /* This may not be right. */
751 # define OS_TYPE "OPENBSD"
754 # define OS_TYPE "FREEBSD"
755 # define MPROTECT_VDB
758 # define OS_TYPE "NETBSD"
761 # define OS_TYPE "THREE86BSD"
764 # define OS_TYPE "BSDI"
766 # if defined(OPENBSD) || defined(FREEBSD) || defined(NETBSD) \
767 || defined(THREE86BSD) || defined(BSDI)
770 # define DATASTART ((ptr_t)(&etext))
773 # define OS_TYPE "NEXT"
774 # define DATASTART ((ptr_t) get_etext())
775 # define STACKBOTTOM ((ptr_t)0xc0000000)
776 # define DATAEND /* not needed */
779 # define OS_TYPE "DOS4GW"
780 extern long __nullarea
;
782 extern char *_STACKTOP
;
783 /* Depending on calling conventions Watcom C either precedes
784 or does not precedes with undescore names of C-variables.
785 Make sure startup code variables always have the same names. */
786 #pragma aux __nullarea "*";
787 #pragma aux _end "*";
788 # define STACKBOTTOM ((ptr_t) _STACKTOP)
789 /* confused? me too. */
790 # define DATASTART ((ptr_t) &__nullarea)
791 # define DATAEND ((ptr_t) &_end)
796 # define MACH_TYPE "NS32K"
798 extern char **environ
;
799 # define DATASTART ((ptr_t)(&environ))
800 /* hideous kludge: environ is the first */
801 /* word in crt0.o, and delimits the start */
802 /* of the data segment, no matter which */
803 /* ld options were passed through. */
804 # define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
808 # define MACH_TYPE "MIPS"
810 # define DATASTART (ptr_t)0x10000000
811 /* Could probably be slightly higher since */
812 /* startup code allocates lots of stuff. */
815 # define DATASTART ((ptr_t)(&_fdata))
817 # define HEAP_START (ptr_t)0x30000000
819 # define HEAP_START DATASTART
821 /* Lowest plausible heap address. */
822 /* In the MMAP case, we map there. */
823 /* In either case it is used to identify */
824 /* heap sections so they're not */
825 /* considered as roots. */
828 /* # define STACKBOTTOM ((ptr_t)0x7fff8000) sometimes also works. */
830 # define OS_TYPE "ULTRIX"
834 # define OS_TYPE "RISCOS"
835 # define ALIGNMENT 4 /* Required by hardware */
838 # define OS_TYPE "IRIX5"
839 # define MPROTECT_VDB
841 # define CPP_WORDSZ _MIPS_SZPTR
842 # define ALIGNMENT (_MIPS_SZPTR/8)
843 # if CPP_WORDSZ != 64
844 # define ALIGN_DOUBLE
848 # define ALIGN_DOUBLE
850 # define DYNAMIC_LOADING
855 # define MACH_TYPE "RS6000"
857 # define DATASTART ((ptr_t)0x20000000)
859 # define STACKBOTTOM ((ptr_t)((ulong)&errno))
860 # define DYNAMIC_LOADING
861 /* For really old versions of AIX, this may have to be removed. */
865 # define MACH_TYPE "HP_PA"
867 # define ALIGN_DOUBLE
868 extern int __data_start
;
869 # define DATASTART ((ptr_t)(&__data_start))
871 /* The following appears to work for 7xx systems running HP/UX */
872 /* 9.xx Furthermore, it might result in much faster */
873 /* collections than HEURISTIC2, which may involve scanning */
874 /* segments that directly precede the stack. It is not the */
875 /* default, since it may not work on older machine/OS */
876 /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
878 # define STACKBOTTOM ((ptr_t) 0x7b033000) /* from /etc/conf/h/param.h */
882 # define STACK_GROWS_UP
883 # define DYNAMIC_LOADING
885 # define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
886 /* They misspelled the Posix macro? */
890 # define MACH_TYPE "ALPHA"
893 # define OS_TYPE "OSF1"
894 # define DATASTART ((ptr_t) 0x140000000)
896 # define DATAEND ((ptr_t) &_end)
898 /* Normally HEURISTIC2 is too conervative, since */
899 /* the text segment immediately follows the stack. */
900 /* Hence we give an upper pound. */
902 # define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
903 # define CPP_WORDSZ 64
904 # define MPROTECT_VDB
905 # define DYNAMIC_LOADING
908 # define OS_TYPE "LINUX"
909 # define CPP_WORDSZ 64
910 # define STACKBOTTOM ((ptr_t) 0x120000000)
912 extern int __data_start
;
913 # define DATASTART &__data_start
914 # define DYNAMIC_LOADING
916 # define DATASTART ((ptr_t) 0x140000000)
919 # define DATAEND (&_end)
920 # define MPROTECT_VDB
921 /* Has only been superficially tested. May not */
922 /* work on all versions. */
927 # define MACH_TYPE "M88K"
929 # define ALIGN_DOUBLE
932 # define OS_TYPE "CX_UX"
933 # define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
936 # define OS_TYPE "DGUX"
937 extern char * GC_SysVGetDataStart();
938 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
940 # define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
944 # define MACH_TYPE "S370"
945 # define OS_TYPE "UTS4"
946 # define ALIGNMENT 4 /* Required by hardware */
950 extern char * GC_SysVGetDataStart();
951 # define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
952 # define DATAEND (&_end)
956 # ifndef STACK_GROWS_UP
957 # define STACK_GROWS_DOWN
961 # define CPP_WORDSZ 32
970 # define DATAEND (&end)
973 # if defined(SVR4) && !defined(GETPAGESIZE)
975 # define GETPAGESIZE() sysconf(_SC_PAGESIZE)
979 # if defined(SUNOS5) || defined(IRIX5)
982 # define GETPAGESIZE() getpagesize()
985 # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
986 /* OS has SVR4 generic features. Probably others also qualify. */
990 # if defined(SUNOS5) || defined(DRSNX)
991 /* OS has SUNOS5 style semi-undocumented interface to dynamic */
994 /* OS has SUNOS5 style signal handlers. */
998 # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
1003 # undef DYNAMIC_LOADING
1008 # undef MPROTECT_VDB
1013 /* Postponed for now. */
1015 # undef MPROTECT_VDB
1018 # ifdef SMALL_CONFIG
1019 /* Presumably not worth the space it takes. */
1021 # undef MPROTECT_VDB
1024 # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
1025 # define DEFAULT_VDB
1028 # if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
1029 # define SOLARIS_THREADS
1031 # if defined(IRIX_THREADS) && !defined(IRIX5)
1032 --> inconsistent configuration
1034 # if defined(IRIX_JDK_THREADS) && !defined(IRIX5)
1035 --> inconsistent configuration
1037 # if defined(LINUX_THREADS) && !defined(LINUX)
1038 --> inconsistent configuration
1040 # if defined(SOLARIS_THREADS) && !defined(SUNOS5)
1041 --> inconsistent configuration
1043 # if defined(PCR) || defined(SRC_M3) || \
1044 defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
1045 defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
1046 defined(IRIX_JDK_THREADS)
1050 # if defined(HP_PA) || defined(M88K) || defined(POWERPC) \
1051 || (defined(I386) && defined(OS2)) || defined(UTS4) || defined(LINT)
1052 /* Use setjmp based hack to mark from callee-save registers. */
1053 # define USE_GENERIC_PUSH_REGS
1055 # if defined(SPARC) && !defined(LINUX)
1056 # define SAVE_CALL_CHAIN
1057 # define ASM_CLEAR_CODE /* Stack clearing is crucial, and we */
1058 /* include assembly code to do it well. */