FIX validate for PPC Mac OS X - Evac.h
[ghc-hetmet.git] / rts / sm / Evac.h
1 /* -----------------------------------------------------------------------------
2  *
3  * (c) The GHC Team 1998-2006
4  *
5  * Generational garbage collector: evacuation functions
6  *
7  * Documentation on the architecture of the Garbage Collector can be
8  * found in the online commentary:
9  * 
10  *   http://hackage.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC
11  *
12  * ---------------------------------------------------------------------------*/
13
14 // Use a register argument for evacuate, if available.
15 // Earlier, the regparm attribute was used whenever __GNUC__ >= 2, but this
16 // generated warnings on PPC. So the use is restricted further.
17 // See http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html that says
18 //     regparm (number)
19 //         On the Intel 386, the regparm attribute causes the compiler to pass
20 //         arguments number one to number if they are of integral type in
21 //         registers EAX, EDX, and ECX instead of on the stack. Functions that
22 //         take a variable number of arguments will continue to be passed all of
23 //         their arguments on the stack.
24 #if __GNUC__ >= 2 && (defined(x86_64_TARGET_ARCH) || defined(i386_TARGET_ARCH))
25 #define REGPARM1 __attribute__((regparm(1)))
26 #else
27 #define REGPARM1
28 #endif
29
30 REGPARM1 StgClosure * evacuate (StgClosure *q);
31
32 extern lnat thunk_selector_depth;