[BACK]Return to gcconfig.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / gc5.3

Annotation of OpenXM_contrib2/asir2000/gc5.3/gcconfig.h, Revision 1.1

1.1     ! noro        1: /*
        !             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:  *
        !             6:  * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
        !             7:  * OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
        !             8:  *
        !             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.
        !            14:  */
        !            15:
        !            16: #ifndef GCCONFIG_H
        !            17:
        !            18: # define GCCONFIG_H
        !            19:
        !            20: /* Machine dependent parameters.  Some tuning parameters can be found  */
        !            21: /* near the top of gc_private.h.                                       */
        !            22:
        !            23: /* Machine specific parts contributed by various people.  See README file. */
        !            24:
        !            25: /* First a unified test for Linux: */
        !            26: # if defined(linux) || defined(__linux__)
        !            27: #    define LINUX
        !            28: # endif
        !            29:
        !            30: /* Determine the machine type: */
        !            31: # if defined(sun) && defined(mc68000)
        !            32: #    define M68K
        !            33: #    define SUNOS4
        !            34: #    define mach_type_known
        !            35: # endif
        !            36: # if defined(hp9000s300)
        !            37: #    define M68K
        !            38: #    define HP
        !            39: #    define mach_type_known
        !            40: # endif
        !            41: # if defined(__OpenBSD__) && defined(m68k)
        !            42: #    define M68K
        !            43: #    define OPENBSD
        !            44: #    define mach_type_known
        !            45: # endif
        !            46: # if defined(__OpenBSD__) && defined(__sparc__)
        !            47: #    define SPARC
        !            48: #    define OPENBSD
        !            49: #    define mach_type_known
        !            50: # endif
        !            51: # if defined(__NetBSD__) && defined(m68k)
        !            52: #    define M68K
        !            53: #    define NETBSD
        !            54: #    define mach_type_known
        !            55: # endif
        !            56: # if defined(__NetBSD__) && defined(arm32)
        !            57: #    define ARM32
        !            58: #    define NETBSD
        !            59: #    define mach_type_known
        !            60: # endif
        !            61: # if defined(vax)
        !            62: #    define VAX
        !            63: #    ifdef ultrix
        !            64: #      define ULTRIX
        !            65: #    else
        !            66: #      define BSD
        !            67: #    endif
        !            68: #    define mach_type_known
        !            69: # endif
        !            70: # if defined(mips) || defined(__mips)
        !            71: #    define MIPS
        !            72: #    if !defined(LINUX)
        !            73: #      if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
        !            74: #       define ULTRIX
        !            75: #      else
        !            76: #       if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) \
        !            77:            || defined(__SYSTYPE_SVR4__)
        !            78: #         define IRIX5   /* or IRIX 6.X */
        !            79: #       else
        !            80: #         define RISCOS  /* or IRIX 4.X */
        !            81: #       endif
        !            82: #      endif
        !            83: #    endif /* !LINUX */
        !            84: #    define mach_type_known
        !            85: # endif
        !            86: # if defined(sequent) && defined(i386)
        !            87: #    define I386
        !            88: #    define SEQUENT
        !            89: #    define mach_type_known
        !            90: # endif
        !            91: # if defined(sun) && defined(i386)
        !            92: #    define I386
        !            93: #    define SUNOS5
        !            94: #    define mach_type_known
        !            95: # endif
        !            96: # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__)
        !            97: #    define I386
        !            98: #    define OS2
        !            99: #    define mach_type_known
        !           100: # endif
        !           101: # if defined(ibm032)
        !           102: #   define RT
        !           103: #   define mach_type_known
        !           104: # endif
        !           105: # if defined(sun) && (defined(sparc) || defined(__sparc))
        !           106: #   define SPARC
        !           107:     /* Test for SunOS 5.x */
        !           108: #     include <errno.h>
        !           109: #     ifdef ECHRNG
        !           110: #       define SUNOS5
        !           111: #     else
        !           112: #      define SUNOS4
        !           113: #     endif
        !           114: #   define mach_type_known
        !           115: # endif
        !           116: # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \
        !           117:      && !defined(__OpenBSD__)
        !           118: #   define SPARC
        !           119: #   define DRSNX
        !           120: #   define mach_type_known
        !           121: # endif
        !           122: # if defined(_IBMR2)
        !           123: #   define RS6000
        !           124: #   define mach_type_known
        !           125: # endif
        !           126: # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386)
        !           127:        /* The above test may need refinement   */
        !           128: #   define I386
        !           129: #   if defined(_SCO_ELF)
        !           130: #     define SCO_ELF
        !           131: #   else
        !           132: #     define SCO
        !           133: #   endif
        !           134: #   define mach_type_known
        !           135: # endif
        !           136: # if defined(_AUX_SOURCE)
        !           137: #   define M68K
        !           138: #   define SYSV
        !           139: #   define mach_type_known
        !           140: # endif
        !           141: # if defined(_PA_RISC1_0) || defined(_PA_RISC1_1) || defined(_PA_RISC2_0) \
        !           142:      || defined(hppa) || defined(__hppa__)
        !           143: #   define HP_PA
        !           144: #   ifndef LINUX
        !           145: #     define HPUX
        !           146: #   endif
        !           147: #   define mach_type_known
        !           148: # endif
        !           149: # if defined(LINUX) && (defined(i386) || defined(__i386__))
        !           150: #    define I386
        !           151: #    define mach_type_known
        !           152: # endif
        !           153: # if defined(LINUX) && (defined(__ia64__) || defined(__ia64))
        !           154: #    define IA64
        !           155: #    define mach_type_known
        !           156: # endif
        !           157: # if defined(LINUX) && defined(powerpc)
        !           158: #    define POWERPC
        !           159: #    define mach_type_known
        !           160: # endif
        !           161: # if defined(LINUX) && defined(__mc68000__)
        !           162: #    define M68K
        !           163: #    define mach_type_known
        !           164: # endif
        !           165: # if defined(LINUX) && (defined(sparc) || defined(__sparc__))
        !           166: #    define SPARC
        !           167: #    define mach_type_known
        !           168: # endif
        !           169: # if defined(LINUX) && defined(arm)
        !           170: #    define ARM32
        !           171: #    define mach_type_known
        !           172: # endif
        !           173: # if defined(__alpha) || defined(__alpha__)
        !           174: #   define ALPHA
        !           175: #   if !defined(LINUX)
        !           176: #     define OSF1      /* a.k.a Digital Unix */
        !           177: #   endif
        !           178: #   define mach_type_known
        !           179: # endif
        !           180: # if defined(_AMIGA) && !defined(AMIGA)
        !           181: #   define AMIGA
        !           182: # endif
        !           183: # ifdef AMIGA
        !           184: #   define M68K
        !           185: #   define mach_type_known
        !           186: # endif
        !           187: # if defined(THINK_C) || defined(__MWERKS__) && !defined(__powerc)
        !           188: #   define M68K
        !           189: #   define MACOS
        !           190: #   define mach_type_known
        !           191: # endif
        !           192: # if defined(__MWERKS__) && defined(__powerc)
        !           193: #   define POWERPC
        !           194: #   define MACOS
        !           195: #   define mach_type_known
        !           196: # endif
        !           197: # if defined(macosx)
        !           198: #    define MACOSX
        !           199: #    define POWERPC
        !           200: #    define mach_type_known
        !           201: # endif
        !           202: # if defined(NeXT) && defined(mc68000)
        !           203: #   define M68K
        !           204: #   define NEXT
        !           205: #   define mach_type_known
        !           206: # endif
        !           207: # if defined(NeXT) && defined(i386)
        !           208: #   define I386
        !           209: #   define NEXT
        !           210: #   define mach_type_known
        !           211: # endif
        !           212: # if defined(__OpenBSD__) && defined(i386)
        !           213: #   define I386
        !           214: #   define OPENBSD
        !           215: #   define mach_type_known
        !           216: # endif
        !           217: # if defined(__FreeBSD__) && defined(i386)
        !           218: #   define I386
        !           219: #   define FREEBSD
        !           220: #   define mach_type_known
        !           221: # endif
        !           222: # if defined(__NetBSD__) && defined(i386)
        !           223: #   define I386
        !           224: #   define NETBSD
        !           225: #   define mach_type_known
        !           226: # endif
        !           227: # if defined(bsdi) && defined(i386)
        !           228: #    define I386
        !           229: #    define BSDI
        !           230: #    define mach_type_known
        !           231: # endif
        !           232: # if !defined(mach_type_known) && defined(__386BSD__)
        !           233: #   define I386
        !           234: #   define THREE86BSD
        !           235: #   define mach_type_known
        !           236: # endif
        !           237: # if defined(_CX_UX) && defined(_M88K)
        !           238: #   define M88K
        !           239: #   define CX_UX
        !           240: #   define mach_type_known
        !           241: # endif
        !           242: # if defined(DGUX)
        !           243: #   define M88K
        !           244:     /* DGUX defined */
        !           245: #   define mach_type_known
        !           246: # endif
        !           247: # if (defined(_MSDOS) || defined(_MSC_VER)) && (_M_IX86 >= 300) \
        !           248:      || defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__CYGWIN__)
        !           249: #   define I386
        !           250: #   define MSWIN32     /* or Win32s */
        !           251: #   define mach_type_known
        !           252: # endif
        !           253: # if defined(__DJGPP__)
        !           254: #   define I386
        !           255: #   ifndef DJGPP
        !           256: #     define DJGPP  /* MSDOS running the DJGPP port of GCC */
        !           257: #   endif
        !           258: #   define mach_type_known
        !           259: # endif
        !           260: # if defined(__CYGWIN32__) || defined(__CYGWIN__)
        !           261: #   define I386
        !           262: #   define CYGWIN32
        !           263: #   define mach_type_known
        !           264: # endif
        !           265: # if defined(__MINGW32__)
        !           266: #   define I386
        !           267: #   define MSWIN32
        !           268: #   define mach_type_known
        !           269: # endif
        !           270: # if defined(__BORLANDC__)
        !           271: #   define I386
        !           272: #   define MSWIN32
        !           273: #   define mach_type_known
        !           274: # endif
        !           275: # if defined(_UTS) && !defined(mach_type_known)
        !           276: #   define S370
        !           277: #   define UTS4
        !           278: #   define mach_type_known
        !           279: # endif
        !           280: # if defined(__pj__)
        !           281: #   define PJ
        !           282: #   define mach_type_known
        !           283: # endif
        !           284: /* Ivan Demakov */
        !           285: # if defined(__WATCOMC__) && defined(__386__)
        !           286: #   define I386
        !           287: #   if !defined(OS2) && !defined(MSWIN32) && !defined(DOS4GW)
        !           288: #     if defined(__OS2__)
        !           289: #       define OS2
        !           290: #     else
        !           291: #       if defined(__WINDOWS_386__) || defined(__NT__)
        !           292: #         define MSWIN32
        !           293: #       else
        !           294: #         define DOS4GW
        !           295: #       endif
        !           296: #     endif
        !           297: #   endif
        !           298: #   define mach_type_known
        !           299: # endif
        !           300:
        !           301: /* Feel free to add more clauses here */
        !           302:
        !           303: /* Or manually define the machine type here.  A machine type is        */
        !           304: /* characterized by the architecture.  Some                            */
        !           305: /* machine types are further subdivided by OS.                         */
        !           306: /* the macros ULTRIX, RISCOS, and BSD to distinguish.                  */
        !           307: /* Note that SGI IRIX is treated identically to RISCOS.                        */
        !           308: /* SYSV on an M68K actually means A/UX.                                        */
        !           309: /* The distinction in these cases is usually the stack starting address */
        !           310: # ifndef mach_type_known
        !           311:        --> unknown machine type
        !           312: # endif
        !           313:                    /* Mapping is: M68K       ==> Motorola 680X0        */
        !           314:                    /*             (SUNOS4,HP,NEXT, and SYSV (A/UX),    */
        !           315:                    /*             MACOS and AMIGA variants)            */
        !           316:                    /*             I386       ==> Intel 386             */
        !           317:                    /*              (SEQUENT, OS2, SCO, LINUX, NETBSD,  */
        !           318:                    /*               FREEBSD, THREE86BSD, MSWIN32,      */
        !           319:                    /*               BSDI,SUNOS5, NEXT, other variants) */
        !           320:                     /*             NS32K      ==> Encore Multimax      */
        !           321:                     /*             MIPS       ==> R2000 or R3000       */
        !           322:                     /*                 (RISCOS, ULTRIX variants)       */
        !           323:                     /*            VAX        ==> DEC VAX               */
        !           324:                     /*                 (BSD, ULTRIX variants)          */
        !           325:                     /*            RS6000     ==> IBM RS/6000 AIX3.X    */
        !           326:                     /*            RT         ==> IBM PC/RT             */
        !           327:                     /*            HP_PA      ==> HP9000/700 & /800     */
        !           328:                     /*                           HP/UX                 */
        !           329:                    /*             SPARC      ==> SPARC under SunOS     */
        !           330:                    /*                  (SUNOS4, SUNOS5,                */
        !           331:                    /*                   DRSNX variants)                */
        !           332:                    /*             ALPHA      ==> DEC Alpha             */
        !           333:                    /*                  (OSF1 and LINUX variants)       */
        !           334:                    /*             M88K       ==> Motorola 88XX0        */
        !           335:                    /*                  (CX_UX and DGUX)                */
        !           336:                    /*             S370       ==> 370-like machine      */
        !           337:                    /*                  running Amdahl UTS4             */
        !           338:                    /*             ARM32      ==> Intel StrongARM       */
        !           339:                    /*             IA64       ==> Intel IA64            */
        !           340:                    /*                            (e.g. Itanium)        */
        !           341:
        !           342:
        !           343: /*
        !           344:  * For each architecture and OS, the following need to be defined:
        !           345:  *
        !           346:  * CPP_WORD_SZ is a simple integer constant representing the word size.
        !           347:  * in bits.  We assume byte addressibility, where a byte has 8 bits.
        !           348:  * We also assume CPP_WORD_SZ is either 32 or 64.
        !           349:  * (We care about the length of pointers, not hardware
        !           350:  * bus widths.  Thus a 64 bit processor with a C compiler that uses
        !           351:  * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.)
        !           352:  *
        !           353:  * MACH_TYPE is a string representation of the machine type.
        !           354:  * OS_TYPE is analogous for the OS.
        !           355:  *
        !           356:  * ALIGNMENT is the largest N, such that
        !           357:  * all pointer are guaranteed to be aligned on N byte boundaries.
        !           358:  * defining it to be 1 will always work, but perform poorly.
        !           359:  *
        !           360:  * DATASTART is the beginning of the data segment.
        !           361:  * On UNIX systems, the collector will scan the area between DATASTART
        !           362:  * and DATAEND for root pointers.
        !           363:  *
        !           364:  * DATAEND, if not &end.
        !           365:  *
        !           366:  * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice
        !           367:  * the pointer size.
        !           368:  *
        !           369:  * STACKBOTTOM is the cool end of the stack, which is usually the
        !           370:  * highest address in the stack.
        !           371:  * Under PCR or OS/2, we have other ways of finding thread stacks.
        !           372:  * For each machine, the following should:
        !           373:  * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and
        !           374:  * 2) define exactly one of
        !           375:  *     STACKBOTTOM (should be defined to be an expression)
        !           376:  *     HEURISTIC1
        !           377:  *     HEURISTIC2
        !           378:  * If either of the last two macros are defined, then STACKBOTTOM is computed
        !           379:  * during collector startup using one of the following two heuristics:
        !           380:  * HEURISTIC1:  Take an address inside GC_init's frame, and round it up to
        !           381:  *             the next multiple of STACK_GRAN.
        !           382:  * HEURISTIC2:  Take an address inside GC_init's frame, increment it repeatedly
        !           383:  *             in small steps (decrement if STACK_GROWS_UP), and read the value
        !           384:  *             at each location.  Remember the value when the first
        !           385:  *             Segmentation violation or Bus error is signalled.  Round that
        !           386:  *             to the nearest plausible page boundary, and use that instead
        !           387:  *             of STACKBOTTOM.
        !           388:  *
        !           389:  * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines,
        !           390:  * the value of environ is a pointer that can serve as STACKBOTTOM.
        !           391:  * I expect that HEURISTIC2 can be replaced by this approach, which
        !           392:  * interferes far less with debugging.
        !           393:  *
        !           394:  * If no expression for STACKBOTTOM can be found, and neither of the above
        !           395:  * heuristics are usable, the collector can still be used with all of the above
        !           396:  * undefined, provided one of the following is done:
        !           397:  * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s)
        !           398:  *    without reference to STACKBOTTOM.  This is appropriate for use in
        !           399:  *    conjunction with thread packages, since there will be multiple stacks.
        !           400:  *    (Allocating thread stacks in the heap, and treating them as ordinary
        !           401:  *    heap data objects is also possible as a last resort.  However, this is
        !           402:  *    likely to introduce significant amounts of excess storage retention
        !           403:  *    unless the dead parts of the thread stacks are periodically cleared.)
        !           404:  * 2) Client code may set GC_stackbottom before calling any GC_ routines.
        !           405:  *    If the author of the client code controls the main program, this is
        !           406:  *    easily accomplished by introducing a new main program, setting
        !           407:  *    GC_stackbottom to the address of a local variable, and then calling
        !           408:  *    the original main program.  The new main program would read something
        !           409:  *    like:
        !           410:  *
        !           411:  *             # include "gc_private.h"
        !           412:  *
        !           413:  *             main(argc, argv, envp)
        !           414:  *             int argc;
        !           415:  *             char **argv, **envp;
        !           416:  *             {
        !           417:  *                 int dummy;
        !           418:  *
        !           419:  *                 GC_stackbottom = (ptr_t)(&dummy);
        !           420:  *                 return(real_main(argc, argv, envp));
        !           421:  *             }
        !           422:  *
        !           423:  *
        !           424:  * Each architecture may also define the style of virtual dirty bit
        !           425:  * implementation to be used:
        !           426:  *   MPROTECT_VDB: Write protect the heap and catch faults.
        !           427:  *   PROC_VDB: Use the SVR4 /proc primitives to read dirty bits.
        !           428:  *
        !           429:  * An architecture may define DYNAMIC_LOADING if dynamic_load.c
        !           430:  * defined GC_register_dynamic_libraries() for the architecture.
        !           431:  *
        !           432:  * An architecture may define PREFETCH(x) to preload the cache with *x.
        !           433:  * This defaults to a no-op.
        !           434:  *
        !           435:  * PREFETCH_FOR_WRITE(x) is used if *x is about to be written.
        !           436:  *
        !           437:  * An architecture may also define CLEAR_DOUBLE(x) to be a fast way to
        !           438:  * clear the two words at GC_malloc-aligned address x.  By default,
        !           439:  * word stores of 0 are used instead.
        !           440:  */
        !           441:
        !           442:
        !           443: # define STACK_GRAN 0x1000000
        !           444: # ifdef M68K
        !           445: #   define MACH_TYPE "M68K"
        !           446: #   define ALIGNMENT 2
        !           447: #   ifdef OPENBSD
        !           448: #      define OS_TYPE "OPENBSD"
        !           449: #      define HEURISTIC2
        !           450:        extern char etext;
        !           451: #      define DATASTART ((ptr_t)(&etext))
        !           452: #   endif
        !           453: #   ifdef NETBSD
        !           454: #      define OS_TYPE "NETBSD"
        !           455: #      define HEURISTIC2
        !           456:        extern char etext;
        !           457: #      define DATASTART ((ptr_t)(&etext))
        !           458: #   endif
        !           459: #   ifdef LINUX
        !           460: #       define OS_TYPE "LINUX"
        !           461: #       define STACKBOTTOM ((ptr_t)0xf0000000)
        !           462: #       define MPROTECT_VDB
        !           463: #       ifdef __ELF__
        !           464: #            define DYNAMIC_LOADING
        !           465:              extern char **__environ;
        !           466: #            define DATASTART ((ptr_t)(&__environ))
        !           467:                              /* hideous kludge: __environ is the first */
        !           468:                              /* word in crt0.o, and delimits the start */
        !           469:                              /* of the data segment, no matter which   */
        !           470:                              /* ld options were passed through.        */
        !           471:                              /* We could use _etext instead, but that  */
        !           472:                              /* would include .rodata, which may       */
        !           473:                              /* contain large read-only data tables    */
        !           474:                              /* that we'd rather not scan.             */
        !           475:              extern int _end;
        !           476: #            define DATAEND (&_end)
        !           477: #       else
        !           478:              extern int etext;
        !           479: #            define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
        !           480: #       endif
        !           481: #   endif
        !           482: #   ifdef SUNOS4
        !           483: #      define OS_TYPE "SUNOS4"
        !           484:        extern char etext;
        !           485: #      define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ffff) & ~0x1ffff))
        !           486: #      define HEURISTIC1       /* differs      */
        !           487: #      define DYNAMIC_LOADING
        !           488: #   endif
        !           489: #   ifdef HP
        !           490: #      define OS_TYPE "HP"
        !           491:        extern char etext;
        !           492: #       define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
        !           493: #       define STACKBOTTOM ((ptr_t) 0xffeffffc)
        !           494:                              /* empirically determined.  seems to work. */
        !           495: #      include <unistd.h>
        !           496: #      define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
        !           497: #   endif
        !           498: #   ifdef SYSV
        !           499: #      define OS_TYPE "SYSV"
        !           500:        extern etext;
        !           501: #      define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
        !           502:                                   & ~0x3fffff) \
        !           503:                                  +((word)&etext & 0x1fff))
        !           504:        /* This only works for shared-text binaries with magic number 0413.
        !           505:           The other sorts of SysV binaries put the data at the end of the text,
        !           506:           in which case the default of &etext would work.  Unfortunately,
        !           507:           handling both would require having the magic-number available.
        !           508:                                -- Parag
        !           509:           */
        !           510: #      define STACKBOTTOM ((ptr_t)0xFFFFFFFE)
        !           511:                        /* The stack starts at the top of memory, but   */
        !           512:                        /* 0x0 cannot be used as setjump_test complains */
        !           513:                        /* that the stack direction is incorrect.  Two  */
        !           514:                        /* bytes down from 0x0 should be safe enough.   */
        !           515:                        /*              --Parag                         */
        !           516: #      include <sys/mmu.h>
        !           517: #      define GETPAGESIZE() PAGESIZE   /* Is this still right? */
        !           518: #   endif
        !           519: #   ifdef AMIGA
        !           520: #      define OS_TYPE "AMIGA"
        !           521:                /* STACKBOTTOM and DATASTART handled specially  */
        !           522:                /* in os_dep.c                                  */
        !           523: #      define DATAEND  /* not needed */
        !           524: #      define GETPAGESIZE() 4096
        !           525: #   endif
        !           526: #   ifdef MACOS
        !           527: #     ifndef __LOWMEM__
        !           528: #     include <LowMem.h>
        !           529: #     endif
        !           530: #     define OS_TYPE "MACOS"
        !           531:                        /* see os_dep.c for details of global data segments. */
        !           532: #     define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
        !           533: #     define DATAEND   /* not needed */
        !           534: #     define GETPAGESIZE() 4096
        !           535: #   endif
        !           536: #   ifdef NEXT
        !           537: #      define OS_TYPE "NEXT"
        !           538: #      define DATASTART ((ptr_t) get_etext())
        !           539: #      define STACKBOTTOM ((ptr_t) 0x4000000)
        !           540: #      define DATAEND  /* not needed */
        !           541: #   endif
        !           542: # endif
        !           543:
        !           544: # ifdef POWERPC
        !           545: #   define MACH_TYPE "POWERPC"
        !           546: #   ifdef MACOS
        !           547: #     define ALIGNMENT 2  /* Still necessary?  Could it be 4?  */
        !           548: #     ifndef __LOWMEM__
        !           549: #     include <LowMem.h>
        !           550: #     endif
        !           551: #     define OS_TYPE "MACOS"
        !           552:                        /* see os_dep.c for details of global data segments. */
        !           553: #     define STACKBOTTOM ((ptr_t) LMGetCurStackBase())
        !           554: #     define DATAEND  /* not needed */
        !           555: #   endif
        !           556: #   ifdef LINUX
        !           557: #     define ALIGNMENT 4       /* Guess.  Can someone verify?  */
        !           558:                                /* This was 2, but that didn't sound right. */
        !           559: #     define OS_TYPE "LINUX"
        !           560: #     define HEURISTIC1
        !           561: #     define DYNAMIC_LOADING
        !           562: #     undef STACK_GRAN
        !           563: #     define STACK_GRAN 0x10000000
        !           564:        /* Stack usually starts at 0x80000000 */
        !           565: #     define LINUX_DATA_START
        !           566:       extern int _end;
        !           567: #     define DATAEND (&_end)
        !           568: #   endif
        !           569: #   ifdef MACOSX
        !           570: #     define ALIGNMENT 4
        !           571: #     define OS_TYPE "MACOSX"
        !           572: #     define DATASTART ((ptr_t) get_etext())
        !           573: #     define STACKBOTTOM ((ptr_t) 0xc0000000)
        !           574: #     define DATAEND   /* not needed */
        !           575: #   endif
        !           576: # endif
        !           577:
        !           578: # ifdef VAX
        !           579: #   define MACH_TYPE "VAX"
        !           580: #   define ALIGNMENT 4 /* Pointers are longword aligned by 4.2 C compiler */
        !           581:     extern char etext;
        !           582: #   define DATASTART ((ptr_t)(&etext))
        !           583: #   ifdef BSD
        !           584: #      define OS_TYPE "BSD"
        !           585: #      define HEURISTIC1
        !           586:                        /* HEURISTIC2 may be OK, but it's hard to test. */
        !           587: #   endif
        !           588: #   ifdef ULTRIX
        !           589: #      define OS_TYPE "ULTRIX"
        !           590: #      define STACKBOTTOM ((ptr_t) 0x7fffc800)
        !           591: #   endif
        !           592: # endif
        !           593:
        !           594: # ifdef RT
        !           595: #   define MACH_TYPE "RT"
        !           596: #   define ALIGNMENT 4
        !           597: #   define DATASTART ((ptr_t) 0x10000000)
        !           598: #   define STACKBOTTOM ((ptr_t) 0x1fffd800)
        !           599: # endif
        !           600:
        !           601: # ifdef SPARC
        !           602: #   define MACH_TYPE "SPARC"
        !           603: #   define ALIGNMENT 4 /* Required by hardware */
        !           604: #   define ALIGN_DOUBLE
        !           605:     extern int etext;
        !           606: #   ifdef SUNOS5
        !           607: #      define OS_TYPE "SUNOS5"
        !           608:        extern int _etext;
        !           609:        extern int _end;
        !           610:        extern char * GC_SysVGetDataStart();
        !           611: #       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
        !           612: #      define DATAEND (&_end)
        !           613: #      ifndef USE_MMAP
        !           614: #          define USE_MMAP
        !           615: #      endif
        !           616: #       ifdef USE_MMAP
        !           617: #         define HEAP_START (ptr_t)0x40000000
        !           618: #       else
        !           619: #        define HEAP_START DATAEND
        !           620: #       endif
        !           621: #      define PROC_VDB
        !           622: /*     HEURISTIC1 reportedly no longer works under 2.7.  Thus we       */
        !           623: /*     switched to HEURISTIC2, eventhough it creates some debugging    */
        !           624: /*     issues.                                                         */
        !           625: #if MPI
        !           626:        extern int *StackBottom;
        !           627: #      define STACKBOTTOM (ptr_t)(StackBottom)
        !           628: #else
        !           629: #      define HEURISTIC2
        !           630: #endif
        !           631: #      include <unistd.h>
        !           632: #       define GETPAGESIZE()  sysconf(_SC_PAGESIZE)
        !           633:                /* getpagesize() appeared to be missing from at least one */
        !           634:                /* Solaris 5.4 installation.  Weird.                      */
        !           635: #      define DYNAMIC_LOADING
        !           636: #   endif
        !           637: #   ifdef SUNOS4
        !           638: #      define OS_TYPE "SUNOS4"
        !           639:        /* [If you have a weak stomach, don't read this.]               */
        !           640:        /* We would like to use:                                        */
        !           641: /* #       define DATASTART ((ptr_t)((((word) (&etext)) + 0x1fff) & ~0x1fff)) */
        !           642:        /* This fails occasionally, due to an ancient, but very         */
        !           643:        /* persistent ld bug.  &etext is set 32 bytes too high.         */
        !           644:        /* We instead read the text segment size from the a.out         */
        !           645:        /* header, which happens to be mapped into our address space    */
        !           646:        /* at the start of the text segment.  The detective work here   */
        !           647:        /* was done by Robert Ehrlich, Manuel Serrano, and Bernard      */
        !           648:        /* Serpette of INRIA.                                           */
        !           649:        /* This assumes ZMAGIC, i.e. demand-loadable executables.       */
        !           650: #      define TEXTSTART 0x2000
        !           651: #       define DATASTART ((ptr_t)(*(int *)(TEXTSTART+0x4)+TEXTSTART))
        !           652: #      define MPROTECT_VDB
        !           653: #      define HEURISTIC1
        !           654: #      define DYNAMIC_LOADING
        !           655: #   endif
        !           656: #   ifdef DRSNX
        !           657: #       define CPP_WORDSZ 32
        !           658: #      define OS_TYPE "DRSNX"
        !           659:        extern char * GC_SysVGetDataStart();
        !           660:        extern int etext;
        !           661: #       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
        !           662: #      define MPROTECT_VDB
        !           663: #       define STACKBOTTOM ((ptr_t) 0xdfff0000)
        !           664: #      define DYNAMIC_LOADING
        !           665: #   endif
        !           666: #   ifdef LINUX
        !           667: #     define OS_TYPE "LINUX"
        !           668: #     ifdef __ELF__
        !           669: #       define LINUX_DATA_START
        !           670: #       define DYNAMIC_LOADING
        !           671: #     else
        !           672:           Linux Sparc non elf ?
        !           673: #     endif
        !           674:       extern int _end;
        !           675: #     define DATAEND (&_end)
        !           676: #     define SVR4
        !           677: #     define STACKBOTTOM ((ptr_t) 0xf0000000)
        !           678: #   endif
        !           679: #   ifdef OPENBSD
        !           680: #     define OS_TYPE "OPENBSD"
        !           681: #     define STACKBOTTOM ((ptr_t) 0xf8000000)
        !           682: #     define DATASTART ((ptr_t)(&etext))
        !           683: #   endif
        !           684: # endif
        !           685:
        !           686: # ifdef I386
        !           687: #   define MACH_TYPE "I386"
        !           688: #   define ALIGNMENT 4 /* Appears to hold for all "32 bit" compilers   */
        !           689:                        /* except Borland.  The -a4 option fixes        */
        !           690:                        /* Borland.                                     */
        !           691:                         /* Ivan Demakov: For Watcom the option is -zp4. */
        !           692: #   ifndef SMALL_CONFIG
        !           693: #     define ALIGN_DOUBLE /* Not strictly necessary, but may give speed   */
        !           694:                          /* improvement on Pentiums.                     */
        !           695: #   endif
        !           696: #   ifdef SEQUENT
        !           697: #      define OS_TYPE "SEQUENT"
        !           698:        extern int etext;
        !           699: #       define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
        !           700: #       define STACKBOTTOM ((ptr_t) 0x3ffff000)
        !           701: #   endif
        !           702: #   ifdef SUNOS5
        !           703: #      define OS_TYPE "SUNOS5"
        !           704:        extern int etext, _start;
        !           705:        extern char * GC_SysVGetDataStart();
        !           706: #       define DATASTART GC_SysVGetDataStart(0x1000, &etext)
        !           707: #      define STACKBOTTOM ((ptr_t)(&_start))
        !           708: /** At least in Solaris 2.5, PROC_VDB gives wrong values for dirty bits. */
        !           709: /*#    define PROC_VDB*/
        !           710: #      define DYNAMIC_LOADING
        !           711: #      ifndef USE_MMAP
        !           712: #          define USE_MMAP
        !           713: #      endif
        !           714: #       ifdef USE_MMAP
        !           715: #         define HEAP_START (ptr_t)0x40000000
        !           716: #       else
        !           717: #        define HEAP_START DATAEND
        !           718: #       endif
        !           719: #   endif
        !           720: #   ifdef SCO
        !           721: #      define OS_TYPE "SCO"
        !           722:        extern int etext;
        !           723: #      define DATASTART ((ptr_t)((((word) (&etext)) + 0x3fffff) \
        !           724:                                  & ~0x3fffff) \
        !           725:                                 +((word)&etext & 0xfff))
        !           726: #      define STACKBOTTOM ((ptr_t) 0x7ffffffc)
        !           727: #   endif
        !           728: #   ifdef SCO_ELF
        !           729: #       define OS_TYPE "SCO_ELF"
        !           730:         extern int etext;
        !           731: #       define DATASTART ((ptr_t)(&etext))
        !           732: #       define STACKBOTTOM ((ptr_t) 0x08048000)
        !           733: #       define DYNAMIC_LOADING
        !           734: #      define ELF_CLASS ELFCLASS32
        !           735: #   endif
        !           736: #   ifdef LINUX
        !           737: #      define OS_TYPE "LINUX"
        !           738: #       define LINUX_STACKBOTTOM
        !           739: #      if 0
        !           740: #        define HEURISTIC1
        !           741: #         undef STACK_GRAN
        !           742: #         define STACK_GRAN 0x10000000
        !           743:          /* STACKBOTTOM is usually 0xc0000000, but this changes with   */
        !           744:          /* different kernel configurations.  In particular, systems   */
        !           745:          /* with 2GB physical memory will usually move the user        */
        !           746:          /* address space limit, and hence initial SP to 0x80000000.   */
        !           747: #       endif
        !           748: #       if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
        !           749: #          define MPROTECT_VDB
        !           750: #      else
        !           751:            /* We seem to get random errors in incremental mode,        */
        !           752:            /* possibly because Linux threads is itself a malloc client */
        !           753:            /* and can't deal with the signals.                         */
        !           754: #      endif
        !           755: #       ifdef __ELF__
        !           756: #            define DYNAMIC_LOADING
        !           757: #           ifdef UNDEFINED    /* includes ro data */
        !           758:               extern int _etext;
        !           759: #              define DATASTART ((ptr_t)((((word) (&_etext)) + 0xfff) & ~0xfff))
        !           760: #           endif
        !           761: #           include <features.h>
        !           762: #           if defined(__GLIBC__) && __GLIBC__ >= 2
        !           763: #               define LINUX_DATA_START
        !           764: #           else
        !           765:                 extern char **__environ;
        !           766: #                define DATASTART ((ptr_t)(&__environ))
        !           767:                              /* hideous kludge: __environ is the first */
        !           768:                              /* word in crt0.o, and delimits the start */
        !           769:                              /* of the data segment, no matter which   */
        !           770:                              /* ld options were passed through.        */
        !           771:                              /* We could use _etext instead, but that  */
        !           772:                              /* would include .rodata, which may       */
        !           773:                              /* contain large read-only data tables    */
        !           774:                              /* that we'd rather not scan.             */
        !           775: #           endif
        !           776:             extern int _end;
        !           777: #           define DATAEND (&_end)
        !           778: #      else
        !           779:             extern int etext;
        !           780: #            define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
        !           781: #       endif
        !           782: #      ifdef USE_I686_PREFETCH
        !           783: #        define PREFETCH(x) \
        !           784:            __asm__ __volatile__ ("     prefetchnta     %0": : "m"(*(char *)(x)))
        !           785:            /* Empirically prefetcht0 is much more effective at reducing        */
        !           786:            /* cache miss stalls for the targetted load instructions.  But it   */
        !           787:            /* seems to interfere enough with other cache traffic that the net  */
        !           788:            /* result is worse than prefetchnta.                                */
        !           789: #         if 0
        !           790:            /* Using prefetches for write seems to have a slight negative       */
        !           791:            /* impact on performance, at least for a PIII/500.                  */
        !           792: #          define PREFETCH_FOR_WRITE(x) \
        !           793:              __asm__ __volatile__ ("   prefetcht0      %0": : "m"(*(char *)(x)))
        !           794: #        endif
        !           795: #      endif
        !           796: #      ifdef USE_3DNOW_PREFETCH
        !           797: #        define PREFETCH(x) \
        !           798:            __asm__ __volatile__ ("     prefetch        %0": : "m"(*(char *)(x)))
        !           799: #        define PREFETCH_FOR_WRITE(x)
        !           800:            __asm__ __volatile__ ("     prefetchw       %0": : "m"(*(char *)(x)))
        !           801: #      endif
        !           802: #   endif
        !           803: #   ifdef CYGWIN32
        !           804: #       define OS_TYPE "CYGWIN32"
        !           805:           extern int _data_start__;
        !           806:           extern int _data_end__;
        !           807:           extern int _bss_start__;
        !           808:           extern int _bss_end__;
        !           809:        /* For binutils 2.9.1, we have                  */
        !           810:        /*      DATASTART   = _data_start__             */
        !           811:        /*      DATAEND     = _bss_end__                */
        !           812:        /* whereas for some earlier versions it was     */
        !           813:        /*      DATASTART   = _bss_start__              */
        !           814:        /*      DATAEND     = _data_end__               */
        !           815:        /* To get it right for both, we take the        */
        !           816:        /* minumum/maximum of the two.                  */
        !           817: #      define MAX(x,y) ((x) > (y) ? (x) : (y))
        !           818: #      define MIN(x,y) ((x) < (y) ? (x) : (y))
        !           819: #       define DATASTART ((ptr_t) MIN(&_data_start__, &_bss_start__))
        !           820: #       define DATAEND  ((ptr_t) MAX(&_data_end__, &_bss_end__))
        !           821: #      undef STACK_GRAN
        !           822: #       define STACK_GRAN 0x10000
        !           823: #       define HEURISTIC1
        !           824: #   endif
        !           825: #   ifdef OS2
        !           826: #      define OS_TYPE "OS2"
        !           827:                /* STACKBOTTOM and DATASTART are handled specially in   */
        !           828:                /* os_dep.c. OS2 actually has the right                 */
        !           829:                /* system call!                                         */
        !           830: #      define DATAEND  /* not needed */
        !           831: #   endif
        !           832: #   ifdef MSWIN32
        !           833: #      define OS_TYPE "MSWIN32"
        !           834:                /* STACKBOTTOM and DATASTART are handled specially in   */
        !           835:                /* os_dep.c.                                            */
        !           836: #       ifndef __WATCOMC__
        !           837: #        define MPROTECT_VDB
        !           838: #      endif
        !           839: #       define DATAEND  /* not needed */
        !           840: #   endif
        !           841: #   ifdef DJGPP
        !           842: #       define OS_TYPE "DJGPP"
        !           843: #       include "stubinfo.h"
        !           844:         extern int etext;
        !           845:         extern int _stklen;
        !           846:         extern int __djgpp_stack_limit;
        !           847: #       define DATASTART ((ptr_t)((((word) (&etext)) + 0x1ff) & ~0x1ff))
        !           848: /* #       define STACKBOTTOM ((ptr_t)((word) _stubinfo + _stubinfo->size \
        !           849:                                                      + _stklen)) */
        !           850: #       define STACKBOTTOM ((ptr_t)((word) __djgpp_stack_limit + _stklen))
        !           851:                /* This may not be right.  */
        !           852: #   endif
        !           853: #   ifdef OPENBSD
        !           854: #      define OS_TYPE "OPENBSD"
        !           855: #   endif
        !           856: #   ifdef FREEBSD
        !           857: #      define OS_TYPE "FREEBSD"
        !           858: #      define MPROTECT_VDB
        !           859: #   endif
        !           860: #   ifdef NETBSD
        !           861: #      define OS_TYPE "NETBSD"
        !           862: #   endif
        !           863: #   ifdef THREE86BSD
        !           864: #      define OS_TYPE "THREE86BSD"
        !           865: #   endif
        !           866: #   ifdef BSDI
        !           867: #      define OS_TYPE "BSDI"
        !           868: #   endif
        !           869: #   if defined(OPENBSD) || defined(FREEBSD) || defined(NETBSD) \
        !           870:         || defined(THREE86BSD) || defined(BSDI)
        !           871: #      define HEURISTIC2
        !           872:        extern char etext;
        !           873: #      define DATASTART ((ptr_t)(&etext))
        !           874: #   endif
        !           875: #   ifdef NEXT
        !           876: #      define OS_TYPE "NEXT"
        !           877: #      define DATASTART ((ptr_t) get_etext())
        !           878: #      define STACKBOTTOM ((ptr_t)0xc0000000)
        !           879: #      define DATAEND  /* not needed */
        !           880: #   endif
        !           881: #   ifdef DOS4GW
        !           882: #     define OS_TYPE "DOS4GW"
        !           883:       extern long __nullarea;
        !           884:       extern char _end;
        !           885:       extern char *_STACKTOP;
        !           886:       /* Depending on calling conventions Watcom C either precedes
        !           887:          or does not precedes with undescore names of C-variables.
        !           888:          Make sure startup code variables always have the same names.  */
        !           889:       #pragma aux __nullarea "*";
        !           890:       #pragma aux _end "*";
        !           891: #     define STACKBOTTOM ((ptr_t) _STACKTOP)
        !           892:                          /* confused? me too. */
        !           893: #     define DATASTART ((ptr_t) &__nullarea)
        !           894: #     define DATAEND ((ptr_t) &_end)
        !           895: #   endif
        !           896: # endif
        !           897:
        !           898: # ifdef NS32K
        !           899: #   define MACH_TYPE "NS32K"
        !           900: #   define ALIGNMENT 4
        !           901:     extern char **environ;
        !           902: #   define DATASTART ((ptr_t)(&environ))
        !           903:                              /* hideous kludge: environ is the first   */
        !           904:                              /* word in crt0.o, and delimits the start */
        !           905:                              /* of the data segment, no matter which   */
        !           906:                              /* ld options were passed through.        */
        !           907: #   define STACKBOTTOM ((ptr_t) 0xfffff000) /* for Encore */
        !           908: # endif
        !           909:
        !           910: # ifdef MIPS
        !           911: #   define MACH_TYPE "MIPS"
        !           912: /* #   define STACKBOTTOM ((ptr_t)0x7fff8000)  sometimes also works.  */
        !           913: #   ifdef LINUX
        !           914:       /* This was developed for a linuxce style platform.  Probably    */
        !           915:       /* needs to be tweaked for workstation class machines.           */
        !           916: #     define OS_TYPE "LINUX"
        !           917:       extern int __data_start;
        !           918: #     define DATASTART ((ptr_t)(&__data_start))
        !           919: #     define ALIGNMENT 4
        !           920: #     define USE_GENERIC_PUSH_REGS 1
        !           921: #     define STACKBOTTOM 0x80000000
        !           922:        /* In many cases, this should probably use LINUX_STACKBOTTOM    */
        !           923:        /* instead. But some kernel versions seem to give the wrong     */
        !           924:        /* value from /proc.                                            */
        !           925: #   endif /* Linux */
        !           926: #   ifdef ULTRIX
        !           927: #      define HEURISTIC2
        !           928: #       define DATASTART (ptr_t)0x10000000
        !           929:                              /* Could probably be slightly higher since */
        !           930:                              /* startup code allocates lots of stuff.   */
        !           931: #      define OS_TYPE "ULTRIX"
        !           932: #       define ALIGNMENT 4
        !           933: #   endif
        !           934: #   ifdef RISCOS
        !           935: #      define HEURISTIC2
        !           936: #       define DATASTART (ptr_t)0x10000000
        !           937: #      define OS_TYPE "RISCOS"
        !           938: #      define ALIGNMENT 4  /* Required by hardware */
        !           939: #   endif
        !           940: #   ifdef IRIX5
        !           941: #      define HEURISTIC2
        !           942:         extern int _fdata;
        !           943: #       define DATASTART ((ptr_t)(&_fdata))
        !           944: #       ifdef USE_MMAP
        !           945: #         define HEAP_START (ptr_t)0x30000000
        !           946: #       else
        !           947: #        define HEAP_START DATASTART
        !           948: #       endif
        !           949:                              /* Lowest plausible heap address.         */
        !           950:                              /* In the MMAP case, we map there.        */
        !           951:                              /* In either case it is used to identify  */
        !           952:                              /* heap sections so they're not           */
        !           953:                              /* considered as roots.                   */
        !           954: #      define OS_TYPE "IRIX5"
        !           955: #       define MPROTECT_VDB
        !           956: #       ifdef _MIPS_SZPTR
        !           957: #        define CPP_WORDSZ _MIPS_SZPTR
        !           958: #        define ALIGNMENT (_MIPS_SZPTR/8)
        !           959: #        if CPP_WORDSZ != 64
        !           960: #          define ALIGN_DOUBLE
        !           961: #        endif
        !           962: #      else
        !           963: #         define ALIGNMENT 4
        !           964: #        define ALIGN_DOUBLE
        !           965: #      endif
        !           966: #      define DYNAMIC_LOADING
        !           967: #   endif
        !           968: # endif
        !           969:
        !           970: # ifdef RS6000
        !           971: #   define MACH_TYPE "RS6000"
        !           972: #   define ALIGNMENT 4
        !           973: #   define DATASTART ((ptr_t)0x20000000)
        !           974:     extern int errno;
        !           975: #   define STACKBOTTOM ((ptr_t)((ulong)&errno))
        !           976: #   define DYNAMIC_LOADING
        !           977:        /* For really old versions of AIX, this may have to be removed. */
        !           978: # endif
        !           979:
        !           980: # ifdef HP_PA
        !           981:     /* OS is assumed to be HP/UX       */
        !           982: #   define MACH_TYPE "HP_PA"
        !           983: #   define OS_TYPE "HPUX"
        !           984: #   ifdef __LP64__
        !           985: #     define CPP_WORDSZ 64
        !           986: #     define ALIGNMENT 8
        !           987: #   else
        !           988: #     define CPP_WORDSZ 32
        !           989: #     define ALIGNMENT 4
        !           990: #     define ALIGN_DOUBLE
        !           991: #   endif
        !           992:     extern int __data_start;
        !           993: #   define DATASTART ((ptr_t)(&__data_start))
        !           994: #   if 0
        !           995:        /* The following appears to work for 7xx systems running HP/UX  */
        !           996:        /* 9.xx Furthermore, it might result in much faster             */
        !           997:        /* collections than HEURISTIC2, which may involve scanning      */
        !           998:        /* segments that directly precede the stack.  It is not the     */
        !           999:        /* default, since it may not work on older machine/OS           */
        !          1000:        /* combinations. (Thanks to Raymond X.T. Nijssen for uncovering */
        !          1001:        /* this.)                                                       */
        !          1002: #       define STACKBOTTOM ((ptr_t) 0x7b033000)  /* from /etc/conf/h/param.h */
        !          1003: #   else
        !          1004:        /* Gustavo Rodriguez-Rivera suggested changing HEURISTIC2       */
        !          1005:        /* to this.  We'll probably do this on other platforms, too.    */
        !          1006:        /* For now I'll use it where I can test it.                     */
        !          1007:        extern char ** environ;
        !          1008: #       define STACKBOTTOM ((ptr_t)environ)
        !          1009: #   endif
        !          1010: #   define STACK_GROWS_UP
        !          1011: #   define DYNAMIC_LOADING
        !          1012: #   ifndef HPUX_THREADS
        !          1013: #     define MPROTECT_VDB
        !          1014: #   endif
        !          1015: #   include <unistd.h>
        !          1016: #   define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
        !          1017: # endif
        !          1018:
        !          1019: # ifdef ALPHA
        !          1020: #   define MACH_TYPE "ALPHA"
        !          1021: #   define ALIGNMENT 8
        !          1022: #   define USE_GENERIC_PUSH_REGS
        !          1023:        /* Gcc and probably the DEC/Compaq compiler spill pointers to preserved */
        !          1024:        /* fp registers in some cases when the target is a 21264.  The assembly */
        !          1025:        /* code doesn't handle that yet, and version dependencies make that a   */
        !          1026:        /* bit tricky.  Do the easy thing for now.                              */
        !          1027: #   ifdef OSF1
        !          1028: #      define OS_TYPE "OSF1"
        !          1029: #      define DATASTART ((ptr_t) 0x140000000)
        !          1030:        extern int _end;
        !          1031: #      define DATAEND ((ptr_t) &_end)
        !          1032: #      define HEURISTIC2
        !          1033:        /* Normally HEURISTIC2 is too conervative, since                */
        !          1034:        /* the text segment immediately follows the stack.              */
        !          1035:        /* Hence we give an upper pound.                                */
        !          1036:        extern int __start;
        !          1037: #      define HEURISTIC2_LIMIT ((ptr_t)((word)(&__start) & ~(getpagesize()-1)))
        !          1038: #      define CPP_WORDSZ 64
        !          1039: #      define MPROTECT_VDB
        !          1040: #      define DYNAMIC_LOADING
        !          1041: #   endif
        !          1042: #   ifdef LINUX
        !          1043: #       define OS_TYPE "LINUX"
        !          1044: #       define CPP_WORDSZ 64
        !          1045: #       define STACKBOTTOM ((ptr_t) 0x120000000)
        !          1046: #       ifdef __ELF__
        !          1047: #        define LINUX_DATA_START
        !          1048: #         define DYNAMIC_LOADING
        !          1049:          /* This doesn't work if the collector is in a dynamic library. */
        !          1050: #       else
        !          1051: #           define DATASTART ((ptr_t) 0x140000000)
        !          1052: #       endif
        !          1053:        extern int _end;
        !          1054: #      define DATAEND (&_end)
        !          1055: #      define MPROTECT_VDB
        !          1056:                /* Has only been superficially tested.  May not */
        !          1057:                /* work on all versions.                        */
        !          1058: #   endif
        !          1059: # endif
        !          1060:
        !          1061: # ifdef IA64
        !          1062: #   define MACH_TYPE "IA64"
        !          1063: #   define ALIGN_DOUBLE
        !          1064:        /* Requires 16 byte alignment for malloc */
        !          1065: #   define ALIGNMENT 8
        !          1066: #   define USE_GENERIC_PUSH_REGS
        !          1067:        /* We need to get preserved registers in addition to register windows.  */
        !          1068:        /* That's easiest to do with setjmp.                                    */
        !          1069: #   ifdef HPUX
        !          1070:        --> needs work
        !          1071: #   endif
        !          1072: #   ifdef LINUX
        !          1073: #       define OS_TYPE "LINUX"
        !          1074: #       define CPP_WORDSZ 64
        !          1075:        /* This should really be done through /proc, but that   */
        !          1076:        /* requires we run on an IA64 kernel.                   */
        !          1077: #       define STACKBOTTOM ((ptr_t) 0xa000000000000000l)
        !          1078:        /* We also need the base address of the register stack  */
        !          1079:        /* backing store.  There is probably a better way to    */
        !          1080:        /* get that, too ...                                    */
        !          1081: #      define BACKING_STORE_BASE ((ptr_t) 0x9fffffff80000000l)
        !          1082: #      if 1
        !          1083: #          define SEARCH_FOR_DATA_START
        !          1084: #          define DATASTART GC_data_start
        !          1085: #      else
        !          1086:            extern int data_start;
        !          1087: #          define DATASTART ((ptr_t)(&data_start))
        !          1088: #      endif
        !          1089: #       define DYNAMIC_LOADING
        !          1090: #      define MPROTECT_VDB
        !          1091:                /* Requires Linux 2.3.47 or later.      */
        !          1092:        extern int _end;
        !          1093: #      define DATAEND (&_end)
        !          1094: #      define PREFETCH(x) \
        !          1095:          __asm__ ("    lfetch  [%0]": : "r"((void *)(x)))
        !          1096: #      define PREFETCH_FOR_WRITE(x) \
        !          1097:          __asm__ ("    lfetch.excl     [%0]": : "r"((void *)(x)))
        !          1098: #      define CLEAR_DOUBLE(x) \
        !          1099:          __asm__ ("    stf.spill       [%0]=f0": : "r"((void *)(x)))
        !          1100: #   endif
        !          1101: # endif
        !          1102:
        !          1103: # ifdef M88K
        !          1104: #   define MACH_TYPE "M88K"
        !          1105: #   define ALIGNMENT 4
        !          1106: #   define ALIGN_DOUBLE
        !          1107:     extern int etext;
        !          1108: #   ifdef CX_UX
        !          1109: #      define OS_TYPE "CX_UX"
        !          1110: #       define DATASTART ((((word)&etext + 0x3fffff) & ~0x3fffff) + 0x10000)
        !          1111: #   endif
        !          1112: #   ifdef  DGUX
        !          1113: #      define OS_TYPE "DGUX"
        !          1114:        extern char * GC_SysVGetDataStart();
        !          1115: #       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &etext)
        !          1116: #   endif
        !          1117: #   define STACKBOTTOM ((char*)0xf0000000) /* determined empirically */
        !          1118: # endif
        !          1119:
        !          1120: # ifdef S370
        !          1121: #   define MACH_TYPE "S370"
        !          1122: #   define OS_TYPE "UTS4"
        !          1123: #   define ALIGNMENT 4 /* Required by hardware */
        !          1124:     extern int etext;
        !          1125:        extern int _etext;
        !          1126:        extern int _end;
        !          1127:        extern char * GC_SysVGetDataStart();
        !          1128: #       define DATASTART (ptr_t)GC_SysVGetDataStart(0x10000, &_etext)
        !          1129: #      define DATAEND (&_end)
        !          1130: #      define HEURISTIC2
        !          1131: # endif
        !          1132:
        !          1133: # if defined(PJ)
        !          1134: #   define ALIGNMENT 4
        !          1135:     extern int _etext;
        !          1136: #   define DATASTART ((ptr_t)(&_etext))
        !          1137: #   define HEURISTIC1
        !          1138: # endif
        !          1139:
        !          1140: # ifdef ARM32
        !          1141: #   define CPP_WORDSZ 32
        !          1142: #   define MACH_TYPE "ARM32"
        !          1143: #   define ALIGNMENT 4
        !          1144: #   ifdef NETBSD
        !          1145: #       define OS_TYPE "NETBSD"
        !          1146: #       define HEURISTIC2
        !          1147:         extern char etext;
        !          1148: #       define DATASTART ((ptr_t)(&etext))
        !          1149: #       define USE_GENERIC_PUSH_REGS
        !          1150: #   endif
        !          1151: #   ifdef LINUX
        !          1152: #       define OS_TYPE "LINUX"
        !          1153: #       define HEURISTIC1
        !          1154: #       undef STACK_GRAN
        !          1155: #       define STACK_GRAN 0x10000000
        !          1156: #       define USE_GENERIC_PUSH_REGS
        !          1157: #       ifdef __ELF__
        !          1158: #            define DYNAMIC_LOADING
        !          1159: #           include <features.h>
        !          1160: #           if defined(__GLIBC__) && __GLIBC__ >= 2
        !          1161: #               define LINUX_DATA_START
        !          1162: #           else
        !          1163:                 extern char **__environ;
        !          1164: #                define DATASTART ((ptr_t)(&__environ))
        !          1165:                              /* hideous kludge: __environ is the first */
        !          1166:                              /* word in crt0.o, and delimits the start */
        !          1167:                              /* of the data segment, no matter which   */
        !          1168:                              /* ld options were passed through.        */
        !          1169:                              /* We could use _etext instead, but that  */
        !          1170:                              /* would include .rodata, which may       */
        !          1171:                              /* contain large read-only data tables    */
        !          1172:                              /* that we'd rather not scan.             */
        !          1173: #           endif
        !          1174:             extern int _end;
        !          1175: #           define DATAEND (&_end)
        !          1176: #      else
        !          1177:             extern int etext;
        !          1178: #            define DATASTART ((ptr_t)((((word) (&etext)) + 0xfff) & ~0xfff))
        !          1179: #       endif
        !          1180: #   endif
        !          1181: #endif
        !          1182:
        !          1183: #ifdef LINUX_DATA_START
        !          1184:     /* Some Linux distributions arrange to define __data_start.  Some  */
        !          1185:     /* define data_start as a weak symbol.  The latter is technically  */
        !          1186:     /* broken, since the user program may define data_start, in which  */
        !          1187:     /* case we lose.  Nonetheless, we try both, prefering __data_start.        */
        !          1188:     /* We assume gcc.  */
        !          1189: #   pragma weak __data_start
        !          1190:     extern int __data_start;
        !          1191: #   pragma weak data_start
        !          1192:     extern int data_start;
        !          1193: #   define DATASTART ((ptr_t)(&__data_start != 0? &__data_start : &data_start))
        !          1194: #endif
        !          1195:
        !          1196: # ifndef STACK_GROWS_UP
        !          1197: #   define STACK_GROWS_DOWN
        !          1198: # endif
        !          1199:
        !          1200: # ifndef CPP_WORDSZ
        !          1201: #   define CPP_WORDSZ 32
        !          1202: # endif
        !          1203:
        !          1204: # ifndef OS_TYPE
        !          1205: #   define OS_TYPE ""
        !          1206: # endif
        !          1207:
        !          1208: # ifndef DATAEND
        !          1209:     extern int end;
        !          1210: #   define DATAEND (&end)
        !          1211: # endif
        !          1212:
        !          1213: # if defined(SVR4) && !defined(GETPAGESIZE)
        !          1214: #    include <unistd.h>
        !          1215: #    define GETPAGESIZE()  sysconf(_SC_PAGESIZE)
        !          1216: # endif
        !          1217:
        !          1218: # ifndef GETPAGESIZE
        !          1219: #   if defined(SUNOS5) || defined(IRIX5)
        !          1220: #      include <unistd.h>
        !          1221: #   endif
        !          1222: #   define GETPAGESIZE() getpagesize()
        !          1223: # endif
        !          1224:
        !          1225: # if defined(SUNOS5) || defined(DRSNX) || defined(UTS4)
        !          1226:     /* OS has SVR4 generic features.  Probably others also qualify.    */
        !          1227: #   define SVR4
        !          1228: # endif
        !          1229:
        !          1230: # if defined(SUNOS5) || defined(DRSNX)
        !          1231:     /* OS has SUNOS5 style semi-undocumented interface to dynamic      */
        !          1232:     /* loader.                                                         */
        !          1233: #   define SUNOS5DL
        !          1234:     /* OS has SUNOS5 style signal handlers.                            */
        !          1235: #   define SUNOS5SIGS
        !          1236: # endif
        !          1237:
        !          1238: # if defined(HPUX)
        !          1239: #   define SUNOS5SIGS
        !          1240: # endif
        !          1241:
        !          1242: # if CPP_WORDSZ != 32 && CPP_WORDSZ != 64
        !          1243:    -> bad word size
        !          1244: # endif
        !          1245:
        !          1246: # ifdef PCR
        !          1247: #   undef DYNAMIC_LOADING
        !          1248: #   undef STACKBOTTOM
        !          1249: #   undef HEURISTIC1
        !          1250: #   undef HEURISTIC2
        !          1251: #   undef PROC_VDB
        !          1252: #   undef MPROTECT_VDB
        !          1253: #   define PCR_VDB
        !          1254: # endif
        !          1255:
        !          1256: # ifdef SRC_M3
        !          1257: /* Postponed for now. */
        !          1258: #   undef PROC_VDB
        !          1259: #   undef MPROTECT_VDB
        !          1260: # endif
        !          1261:
        !          1262: # ifdef SMALL_CONFIG
        !          1263: /* Presumably not worth the space it takes. */
        !          1264: #   undef PROC_VDB
        !          1265: #   undef MPROTECT_VDB
        !          1266: # endif
        !          1267:
        !          1268: # ifdef USE_MUNMAP
        !          1269: #   undef MPROTECT_VDB  /* Can't deal with address space holes. */
        !          1270: # endif
        !          1271:
        !          1272: # if !defined(PCR_VDB) && !defined(PROC_VDB) && !defined(MPROTECT_VDB)
        !          1273: #   define DEFAULT_VDB
        !          1274: # endif
        !          1275:
        !          1276: # ifndef PREFETCH
        !          1277: #   define PREFETCH(x)
        !          1278: #   define NO_PREFETCH
        !          1279: # endif
        !          1280:
        !          1281: # ifndef PREFETCH_FOR_WRITE
        !          1282: #   define PREFETCH_FOR_WRITE(x)
        !          1283: #   define NO_PREFETCH_FOR_WRITE
        !          1284: # endif
        !          1285:
        !          1286: # ifndef CACHE_LINE_SIZE
        !          1287: #   define CACHE_LINE_SIZE 32  /* Wild guess   */
        !          1288: # endif
        !          1289:
        !          1290: # ifndef CLEAR_DOUBLE
        !          1291: #   define CLEAR_DOUBLE(x) \
        !          1292:        ((word*)x)[0] = 0; \
        !          1293:        ((word*)x)[1] = 0;
        !          1294: # endif /* CLEAR_DOUBLE */
        !          1295:
        !          1296: # if defined(_SOLARIS_PTHREADS) && !defined(SOLARIS_THREADS)
        !          1297: #   define SOLARIS_THREADS
        !          1298: # endif
        !          1299: # if defined(IRIX_THREADS) && !defined(IRIX5)
        !          1300: --> inconsistent configuration
        !          1301: # endif
        !          1302: # if defined(IRIX_JDK_THREADS) && !defined(IRIX5)
        !          1303: --> inconsistent configuration
        !          1304: # endif
        !          1305: # if defined(LINUX_THREADS) && !defined(LINUX)
        !          1306: --> inconsistent configuration
        !          1307: # endif
        !          1308: # if defined(SOLARIS_THREADS) && !defined(SUNOS5)
        !          1309: --> inconsistent configuration
        !          1310: # endif
        !          1311: # if defined(HPUX_THREADS) && !defined(HPUX)
        !          1312: --> inconsistent configuration
        !          1313: # endif
        !          1314: # if defined(PCR) || defined(SRC_M3) || \
        !          1315:        defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
        !          1316:        defined(IRIX_THREADS) || defined(LINUX_THREADS) || \
        !          1317:        defined(IRIX_JDK_THREADS) || defined(HPUX_THREADS)
        !          1318: #   define THREADS
        !          1319: # endif
        !          1320:
        !          1321: # if defined(HP_PA) || defined(M88K) || defined(POWERPC) \
        !          1322:      || (defined(I386) && defined(OS2)) || defined(UTS4) || defined(LINT)
        !          1323:        /* Use setjmp based hack to mark from callee-save registers. */
        !          1324: #      define USE_GENERIC_PUSH_REGS
        !          1325: # endif
        !          1326: # if defined(SPARC) && !defined(LINUX)
        !          1327: #   define SAVE_CALL_CHAIN
        !          1328: #   define ASM_CLEAR_CODE      /* Stack clearing is crucial, and we    */
        !          1329:                                /* include assembly code to do it well. */
        !          1330: # endif
        !          1331:
        !          1332: # endif /* GCCONFIG_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>