1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2004
5 * Registers in the STG machine.
7 * The STG machine has a collection of "registers", each one of which
8 * may or may not correspond to an actual machine register when
11 * The register set is backed by a table in memory (struct
12 * StgRegTable). If a particular STG register is not mapped to a
13 * machine register, then the apprpriate slot in this table is used
16 * This table is itself pointed to by another register, BaseReg. If
17 * BaseReg is not in a machine register, then the register table is
18 * used from an absolute location (MainCapability).
20 * ---------------------------------------------------------------------------*/
25 #include "gmp.h" // Needs MP_INT definition
28 * Spark pools: used to store pending sparks (SMP & PARALLEL_HASKELL only)
29 * This is a circular buffer. Invariants:
32 * - if hd==tl, then the pool is empty.
33 * - if hd == tl+1, then the pool is full.
34 * Adding to the pool is done by assigning to *tl++ (wrapping round as
35 * necessary). When adding to a full pool, we have the option of
36 * throwing away either the oldest (hd++) or the most recent (tl--) entry.
38 typedef struct StgSparkPool_ {
45 #define ASSERT_SPARK_POOL_INVARIANTS(p) \
46 ASSERT((p)->base <= (p)->hd); \
47 ASSERT((p)->hd < (p)->lim); \
48 ASSERT((p)->base <= (p)->tl); \
49 ASSERT((p)->tl < (p)->lim);
52 StgFunPtr stgGCEnter1;
57 * Vanilla registers are given this union type, which is purely so
58 * that we can cast the vanilla reg to a variety of types with the
59 * minimum of syntax. eg. R1.w instead of (StgWord)R1.
70 StgStackOffset offset; /* unused? */
76 * This is the table that holds shadow-locations for all the STG
77 * registers. The shadow locations are used when:
79 * 1) the particular register isn't mapped to a real machine
80 * register, probably because there's a shortage of real registers.
81 * 2) caller-saves registers are saved across a CCall
83 typedef struct StgRegTable_ {
92 StgUnion rR9; /* used occasionally by heap/stack checks */
93 StgUnion rR10; /* used occasionally by heap/stack checks */
105 struct StgTSO_ *rCurrentTSO;
106 struct step_ *rNursery;
107 struct bdescr_ *rCurrentNursery; /* Hp/HpLim point into this block */
108 struct bdescr_ *rCurrentAlloc; /* for allocation using allocate() */
109 StgWord rHpAlloc; /* number of *bytes* being allocated in heap */
110 // rmp_tmp1..rmp_result2 are only used in SMP builds to avoid per-thread temps
111 // in bss, but currently always incldue here so we just run mkDerivedConstants once
117 StgWord rRet; // holds the return code of the thread
118 #if defined(SMP) || defined(PAR)
119 StgSparkPool rSparks; /* per-task spark pool */
126 * Registers Hp and HpLim are global across the entire system, and are
127 * copied into the RegTable before executing a thread.
129 * Registers Sp and SpLim are saved in the TSO for the
130 * thread, but are copied into the RegTable before executing a thread.
132 * All other registers are "general purpose", and are used for passing
133 * arguments to functions, and returning values. The code generator
134 * knows how many of these are in real registers, and avoids
135 * generating code that uses non-real registers. General purpose
136 * registers are never saved when returning to the scheduler, instead
137 * we save whatever is live at the time on the stack, and restore it
138 * later. This should reduce the context switch time, amongst other
141 * For argument passing, the stack will be used in preference to
142 * pseudo-registers if the architecture has too few general purpose
145 * Some special RTS functions like newArray and the Integer primitives
146 * expect their arguments to be in registers R1-Rn, so we use these
147 * (pseudo-)registers in those cases.
151 * Locations for saving per-thread registers.
154 #define SAVE_Sp (CurrentTSO->sp)
155 #define SAVE_SpLim (CurrentTSO->splim)
157 #define SAVE_Hp (BaseReg->rHp)
158 #define SAVE_HpLim (BaseReg->rHpLim)
160 #define SAVE_CurrentTSO (BaseReg->rCurrentTSO)
161 #define SAVE_CurrentNursery (BaseReg->rCurrentNursery)
162 #define SAVE_HpAlloc (BaseReg->rHpAlloc)
163 #define SAVE_SparkHd (BaseReg->rSparks.hd)
164 #define SAVE_SparkTl (BaseReg->rSparks.tl)
165 #define SAVE_SparkBase (BaseReg->rSparks.base)
166 #define SAVE_SparkLim (BaseReg->rSparks.lim)
168 /* We sometimes need to save registers across a C-call, eg. if they
169 * are clobbered in the standard calling convention. We define the
170 * save locations for all registers in the register table.
173 #define SAVE_R1 (BaseReg->rR1)
174 #define SAVE_R2 (BaseReg->rR2)
175 #define SAVE_R3 (BaseReg->rR3)
176 #define SAVE_R4 (BaseReg->rR4)
177 #define SAVE_R5 (BaseReg->rR5)
178 #define SAVE_R6 (BaseReg->rR6)
179 #define SAVE_R7 (BaseReg->rR7)
180 #define SAVE_R8 (BaseReg->rR8)
182 #define SAVE_F1 (BaseReg->rF1)
183 #define SAVE_F2 (BaseReg->rF2)
184 #define SAVE_F3 (BaseReg->rF3)
185 #define SAVE_F4 (BaseReg->rF4)
187 #define SAVE_D1 (BaseReg->rD1)
188 #define SAVE_D2 (BaseReg->rD2)
190 #define SAVE_L1 (BaseReg->rL1)
192 /* -----------------------------------------------------------------------------
193 * Emit the GCC-specific register declarations for each machine
194 * register being used. If any STG register isn't mapped to a machine
195 * register, then map it to an offset from BaseReg.
197 * First, the general purpose registers. The idea is, if a particular
198 * general-purpose STG register can't be mapped to a real machine
199 * register, it won't be used at all. Instead, we'll use the stack.
201 * This is an improvement on the way things used to be done, when all
202 * registers were mapped to locations in the register table, and stuff
203 * was being shifted from the stack to the register table and back
204 * again for no good reason (on register-poor architectures).
207 /* define NO_REGS to omit register declarations - used in RTS C code
208 * that needs all the STG definitions but not the global register
211 #define GLOBAL_REG_DECL(type,name,reg) register type name REG(reg);
213 #if defined(REG_R1) && !defined(NO_GLOBAL_REG_DECLS)
214 GLOBAL_REG_DECL(StgUnion,R1,REG_R1)
216 # define R1 (BaseReg->rR1)
219 #if defined(REG_R2) && !defined(NO_GLOBAL_REG_DECLS)
220 GLOBAL_REG_DECL(StgUnion,R2,REG_R2)
222 # define R2 (BaseReg->rR2)
225 #if defined(REG_R3) && !defined(NO_GLOBAL_REG_DECLS)
226 GLOBAL_REG_DECL(StgUnion,R3,REG_R3)
228 # define R3 (BaseReg->rR3)
231 #if defined(REG_R4) && !defined(NO_GLOBAL_REG_DECLS)
232 GLOBAL_REG_DECL(StgUnion,R4,REG_R4)
234 # define R4 (BaseReg->rR4)
237 #if defined(REG_R5) && !defined(NO_GLOBAL_REG_DECLS)
238 GLOBAL_REG_DECL(StgUnion,R5,REG_R5)
240 # define R5 (BaseReg->rR5)
243 #if defined(REG_R6) && !defined(NO_GLOBAL_REG_DECLS)
244 GLOBAL_REG_DECL(StgUnion,R6,REG_R6)
246 # define R6 (BaseReg->rR6)
249 #if defined(REG_R7) && !defined(NO_GLOBAL_REG_DECLS)
250 GLOBAL_REG_DECL(StgUnion,R7,REG_R7)
252 # define R7 (BaseReg->rR7)
255 #if defined(REG_R8) && !defined(NO_GLOBAL_REG_DECLS)
256 GLOBAL_REG_DECL(StgUnion,R8,REG_R8)
258 # define R8 (BaseReg->rR8)
261 #if defined(REG_R9) && !defined(NO_GLOBAL_REG_DECLS)
262 GLOBAL_REG_DECL(StgUnion,R9,REG_R9)
264 # define R9 (BaseReg->rR9)
267 #if defined(REG_R10) && !defined(NO_GLOBAL_REG_DECLS)
268 GLOBAL_REG_DECL(StgUnion,R10,REG_R10)
270 # define R10 (BaseReg->rR10)
273 #if defined(REG_F1) && !defined(NO_GLOBAL_REG_DECLS)
274 GLOBAL_REG_DECL(StgFloat,F1,REG_F1)
276 #define F1 (BaseReg->rF1)
279 #if defined(REG_F2) && !defined(NO_GLOBAL_REG_DECLS)
280 GLOBAL_REG_DECL(StgFloat,F2,REG_F2)
282 #define F2 (BaseReg->rF2)
285 #if defined(REG_F3) && !defined(NO_GLOBAL_REG_DECLS)
286 GLOBAL_REG_DECL(StgFloat,F3,REG_F3)
288 #define F3 (BaseReg->rF3)
291 #if defined(REG_F4) && !defined(NO_GLOBAL_REG_DECLS)
292 GLOBAL_REG_DECL(StgFloat,F4,REG_F4)
294 #define F4 (BaseReg->rF4)
297 #if defined(REG_D1) && !defined(NO_GLOBAL_REG_DECLS)
298 GLOBAL_REG_DECL(StgDouble,D1,REG_D1)
300 #define D1 (BaseReg->rD1)
303 #if defined(REG_D2) && !defined(NO_GLOBAL_REG_DECLS)
304 GLOBAL_REG_DECL(StgDouble,D2,REG_D2)
306 #define D2 (BaseReg->rD2)
309 #if defined(REG_L1) && !defined(NO_GLOBAL_REG_DECLS)
310 GLOBAL_REG_DECL(StgWord64,L1,REG_L1)
312 #define L1 (BaseReg->rL1)
316 * If BaseReg isn't mapped to a machine register, just use the global
317 * address of the current register table (CurrentRegTable in
318 * concurrent Haskell, MainRegTable otherwise).
321 /* A capability is a combination of a FunTable and a RegTable. In STG
322 * code, BaseReg normally points to the RegTable portion of this
323 * structure, so that we can index both forwards and backwards to take
324 * advantage of shorter instruction forms on some archs (eg. x86).
325 * This is a cut-down version of the Capability structure; the full
326 * version is defined in Capability.h.
328 struct PartCapability_ {
333 /* No such thing as a MainCapability under SMP - each thread must have
334 * its own Capability.
336 #if IN_STG_CODE && !defined(SMP)
337 extern W_ MainCapability[];
340 #if defined(REG_Base) && !defined(NO_GLOBAL_REG_DECLS)
341 GLOBAL_REG_DECL(StgRegTable *,BaseReg,REG_Base)
344 #error BaseReg must be in a register for SMP
346 #define BaseReg (&((struct PartCapability_ *)MainCapability)->r)
349 #if defined(REG_Sp) && !defined(NO_GLOBAL_REG_DECLS)
350 GLOBAL_REG_DECL(P_,Sp,REG_Sp)
352 #define Sp (BaseReg->rSp)
355 #if defined(REG_SpLim) && !defined(NO_GLOBAL_REG_DECLS)
356 GLOBAL_REG_DECL(P_,SpLim,REG_SpLim)
358 #define SpLim (BaseReg->rSpLim)
361 #if defined(REG_Hp) && !defined(NO_GLOBAL_REG_DECLS)
362 GLOBAL_REG_DECL(P_,Hp,REG_Hp)
364 #define Hp (BaseReg->rHp)
367 #if defined(REG_HpLim) && !defined(NO_GLOBAL_REG_DECLS)
368 GLOBAL_REG_DECL(P_,HpLim,REG_HpLim)
370 #define HpLim (BaseReg->rHpLim)
373 #if defined(REG_CurrentTSO) && !defined(NO_GLOBAL_REG_DECLS)
374 GLOBAL_REG_DECL(struct _StgTSO *,CurrentTSO,REG_CurrentTSO)
376 #define CurrentTSO (BaseReg->rCurrentTSO)
379 #if defined(REG_CurrentNursery) && !defined(NO_GLOBAL_REG_DECLS)
380 GLOBAL_REG_DECL(bdescr *,CurrentNursery,REG_CurrentNursery)
382 #define CurrentNursery (BaseReg->rCurrentNursery)
385 #if defined(REG_HpAlloc) && !defined(NO_GLOBAL_REG_DECLS)
386 GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc)
388 #define HpAlloc (BaseReg->rHpAlloc)
391 #if defined(REG_SparkHd) && !defined(NO_GLOBAL_REG_DECLS)
392 GLOBAL_REG_DECL(bdescr *,SparkHd,REG_SparkHd)
394 #define SparkHd (BaseReg->rSparks.hd)
397 #if defined(REG_SparkTl) && !defined(NO_GLOBAL_REG_DECLS)
398 GLOBAL_REG_DECL(bdescr *,SparkTl,REG_SparkTl)
400 #define SparkTl (BaseReg->rSparks.tl)
403 #if defined(REG_SparkBase) && !defined(NO_GLOBAL_REG_DECLS)
404 GLOBAL_REG_DECL(bdescr *,SparkBase,REG_SparkBase)
406 #define SparkBase (BaseReg->rSparks.base)
409 #if defined(REG_SparkLim) && !defined(NO_GLOBAL_REG_DECLS)
410 GLOBAL_REG_DECL(bdescr *,SparkLim,REG_SparkLim)
412 #define SparkLim (BaseReg->rSparks.lim)
415 /* -----------------------------------------------------------------------------
416 Get absolute function pointers from the register table, to save
425 as long as the offset is within the range of a signed byte
426 (-128..+127). So we pick some common absolute_addresses and put
427 them in the register table. As a bonus, linking time should also
430 Other possible candidates in order of importance:
433 stg_CAF_BLACKHOLE_info
436 anything else probably isn't worth the effort.
438 -------------------------------------------------------------------------- */
441 #define FunReg ((StgFunTable *)((void *)BaseReg - sizeof(StgFunTable)))
443 #define stg_gc_enter_1 (FunReg->stgGCEnter1)
444 #define stg_gc_fun (FunReg->stgGCFun)
446 /* -----------------------------------------------------------------------------
447 For any registers which are denoted "caller-saves" by the C calling
448 convention, we have to emit code to save and restore them across C
450 -------------------------------------------------------------------------- */
452 #ifdef CALLER_SAVES_R1
453 #define CALLER_SAVE_R1 SAVE_R1 = R1;
454 #define CALLER_RESTORE_R1 R1 = SAVE_R1;
456 #define CALLER_SAVE_R1 /* nothing */
457 #define CALLER_RESTORE_R1 /* nothing */
460 #ifdef CALLER_SAVES_R2
461 #define CALLER_SAVE_R2 SAVE_R2 = R2;
462 #define CALLER_RESTORE_R2 R2 = SAVE_R2;
464 #define CALLER_SAVE_R2 /* nothing */
465 #define CALLER_RESTORE_R2 /* nothing */
468 #ifdef CALLER_SAVES_R3
469 #define CALLER_SAVE_R3 SAVE_R3 = R3;
470 #define CALLER_RESTORE_R3 R3 = SAVE_R3;
472 #define CALLER_SAVE_R3 /* nothing */
473 #define CALLER_RESTORE_R3 /* nothing */
476 #ifdef CALLER_SAVES_R4
477 #define CALLER_SAVE_R4 SAVE_R4 = R4;
478 #define CALLER_RESTORE_R4 R4 = SAVE_R4;
480 #define CALLER_SAVE_R4 /* nothing */
481 #define CALLER_RESTORE_R4 /* nothing */
484 #ifdef CALLER_SAVES_R5
485 #define CALLER_SAVE_R5 SAVE_R5 = R5;
486 #define CALLER_RESTORE_R5 R5 = SAVE_R5;
488 #define CALLER_SAVE_R5 /* nothing */
489 #define CALLER_RESTORE_R5 /* nothing */
492 #ifdef CALLER_SAVES_R6
493 #define CALLER_SAVE_R6 SAVE_R6 = R6;
494 #define CALLER_RESTORE_R6 R6 = SAVE_R6;
496 #define CALLER_SAVE_R6 /* nothing */
497 #define CALLER_RESTORE_R6 /* nothing */
500 #ifdef CALLER_SAVES_R7
501 #define CALLER_SAVE_R7 SAVE_R7 = R7;
502 #define CALLER_RESTORE_R7 R7 = SAVE_R7;
504 #define CALLER_SAVE_R7 /* nothing */
505 #define CALLER_RESTORE_R7 /* nothing */
508 #ifdef CALLER_SAVES_R8
509 #define CALLER_SAVE_R8 SAVE_R8 = R8;
510 #define CALLER_RESTORE_R8 R8 = SAVE_R8;
512 #define CALLER_SAVE_R8 /* nothing */
513 #define CALLER_RESTORE_R8 /* nothing */
516 #ifdef CALLER_SAVES_R9
517 #define CALLER_SAVE_R9 SAVE_R9 = R9;
518 #define CALLER_RESTORE_R9 R9 = SAVE_R9;
520 #define CALLER_SAVE_R9 /* nothing */
521 #define CALLER_RESTORE_R9 /* nothing */
524 #ifdef CALLER_SAVES_R10
525 #define CALLER_SAVE_R10 SAVE_R10 = R10;
526 #define CALLER_RESTORE_R10 R10 = SAVE_R10;
528 #define CALLER_SAVE_R10 /* nothing */
529 #define CALLER_RESTORE_R10 /* nothing */
532 #ifdef CALLER_SAVES_F1
533 #define CALLER_SAVE_F1 SAVE_F1 = F1;
534 #define CALLER_RESTORE_F1 F1 = SAVE_F1;
536 #define CALLER_SAVE_F1 /* nothing */
537 #define CALLER_RESTORE_F1 /* nothing */
540 #ifdef CALLER_SAVES_F2
541 #define CALLER_SAVE_F2 SAVE_F2 = F2;
542 #define CALLER_RESTORE_F2 F2 = SAVE_F2;
544 #define CALLER_SAVE_F2 /* nothing */
545 #define CALLER_RESTORE_F2 /* nothing */
548 #ifdef CALLER_SAVES_F3
549 #define CALLER_SAVE_F3 SAVE_F3 = F3;
550 #define CALLER_RESTORE_F3 F3 = SAVE_F3;
552 #define CALLER_SAVE_F3 /* nothing */
553 #define CALLER_RESTORE_F3 /* nothing */
556 #ifdef CALLER_SAVES_F4
557 #define CALLER_SAVE_F4 SAVE_F4 = F4;
558 #define CALLER_RESTORE_F4 F4 = SAVE_F4;
560 #define CALLER_SAVE_F4 /* nothing */
561 #define CALLER_RESTORE_F4 /* nothing */
564 #ifdef CALLER_SAVES_D1
565 #define CALLER_SAVE_D1 SAVE_D1 = D1;
566 #define CALLER_RESTORE_D1 D1 = SAVE_D1;
568 #define CALLER_SAVE_D1 /* nothing */
569 #define CALLER_RESTORE_D1 /* nothing */
572 #ifdef CALLER_SAVES_D2
573 #define CALLER_SAVE_D2 SAVE_D2 = D2;
574 #define CALLER_RESTORE_D2 D2 = SAVE_D2;
576 #define CALLER_SAVE_D2 /* nothing */
577 #define CALLER_RESTORE_D2 /* nothing */
580 #ifdef CALLER_SAVES_L1
581 #define CALLER_SAVE_L1 SAVE_L1 = L1;
582 #define CALLER_RESTORE_L1 L1 = SAVE_L1;
584 #define CALLER_SAVE_L1 /* nothing */
585 #define CALLER_RESTORE_L1 /* nothing */
588 #ifdef CALLER_SAVES_Sp
589 #define CALLER_SAVE_Sp SAVE_Sp = Sp;
590 #define CALLER_RESTORE_Sp Sp = SAVE_Sp;
592 #define CALLER_SAVE_Sp /* nothing */
593 #define CALLER_RESTORE_Sp /* nothing */
596 #ifdef CALLER_SAVES_SpLim
597 #define CALLER_SAVE_SpLim SAVE_SpLim = SpLim;
598 #define CALLER_RESTORE_SpLim SpLim = SAVE_SpLim;
600 #define CALLER_SAVE_SpLim /* nothing */
601 #define CALLER_RESTORE_SpLim /* nothing */
604 #ifdef CALLER_SAVES_Hp
605 #define CALLER_SAVE_Hp SAVE_Hp = Hp;
606 #define CALLER_RESTORE_Hp Hp = SAVE_Hp;
608 #define CALLER_SAVE_Hp /* nothing */
609 #define CALLER_RESTORE_Hp /* nothing */
612 #ifdef CALLER_SAVES_HpLim
613 #define CALLER_SAVE_HpLim SAVE_HpLim = HpLim;
614 #define CALLER_RESTORE_HpLim HpLim = SAVE_HpLim;
616 #define CALLER_SAVE_HpLim /* nothing */
617 #define CALLER_RESTORE_HpLim /* nothing */
620 #ifdef CALLER_SAVES_Base
622 #error "Can't have caller-saved BaseReg with SMP"
624 #define CALLER_SAVE_Base /* nothing */
625 #define CALLER_RESTORE_Base BaseReg = &MainRegTable;
627 #define CALLER_SAVE_Base /* nothing */
628 #define CALLER_RESTORE_Base /* nothing */
631 #ifdef CALLER_SAVES_CurrentTSO
632 #define CALLER_SAVE_CurrentTSO SAVE_CurrentTSO = CurrentTSO;
633 #define CALLER_RESTORE_CurrentTSO CurrentTSO = SAVE_CurrentTSO;
635 #define CALLER_SAVE_CurrentTSO /* nothing */
636 #define CALLER_RESTORE_CurrentTSO /* nothing */
639 #ifdef CALLER_SAVES_CurrentNursery
640 #define CALLER_SAVE_CurrentNursery SAVE_CurrentNursery = CurrentNursery;
641 #define CALLER_RESTORE_CurrentNursery CurrentNursery = SAVE_CurrentNursery;
643 #define CALLER_SAVE_CurrentNursery /* nothing */
644 #define CALLER_RESTORE_CurrentNursery /* nothing */
647 #ifdef CALLER_SAVES_HpAlloc
648 #define CALLER_SAVE_HpAlloc SAVE_HpAlloc = HpAlloc;
649 #define CALLER_RESTORE_HpAlloc HpAlloc = SAVE_HpAlloc;
651 #define CALLER_SAVE_HpAlloc /* nothing */
652 #define CALLER_RESTORE_HpAlloc /* nothing */
655 #ifdef CALLER_SAVES_SparkHd
656 #define CALLER_SAVE_SparkHd SAVE_SparkHd = SparkHd;
657 #define CALLER_RESTORE_SparkHd SparkHd = SAVE_SparkHd;
659 #define CALLER_SAVE_SparkHd /* nothing */
660 #define CALLER_RESTORE_SparkHd /* nothing */
663 #ifdef CALLER_SAVES_SparkTl
664 #define CALLER_SAVE_SparkTl SAVE_SparkTl = SparkTl;
665 #define CALLER_RESTORE_SparkTl SparkTl = SAVE_SparkTl;
667 #define CALLER_SAVE_SparkTl /* nothing */
668 #define CALLER_RESTORE_SparkTl /* nothing */
671 #ifdef CALLER_SAVES_SparkBase
672 #define CALLER_SAVE_SparkBase SAVE_SparkBase = SparkBase;
673 #define CALLER_RESTORE_SparkBase SparkBase = SAVE_SparkBase;
675 #define CALLER_SAVE_SparkBase /* nothing */
676 #define CALLER_RESTORE_SparkBase /* nothing */
679 #ifdef CALLER_SAVES_SparkLim
680 #define CALLER_SAVE_SparkLim SAVE_SparkLim = SparkLim;
681 #define CALLER_RESTORE_SparkLim SparkLim = SAVE_SparkLim;
683 #define CALLER_SAVE_SparkLim /* nothing */
684 #define CALLER_RESTORE_SparkLim /* nothing */
687 #endif /* IN_STG_CODE */
689 /* ----------------------------------------------------------------------------
690 Handy bunches of saves/restores
691 ------------------------------------------------------------------------ */
695 #define CALLER_SAVE_USER \
712 /* Save Base last, since the others may
713 be addressed relative to it */
714 #define CALLER_SAVE_SYSTEM \
719 CALLER_SAVE_CurrentTSO \
720 CALLER_SAVE_CurrentNursery \
721 CALLER_SAVE_SparkHd \
722 CALLER_SAVE_SparkTl \
723 CALLER_SAVE_SparkBase \
724 CALLER_SAVE_SparkLim \
727 #define CALLER_RESTORE_USER \
744 /* Restore Base first, since the others may
745 be addressed relative to it */
746 #define CALLER_RESTORE_SYSTEM \
747 CALLER_RESTORE_Base \
749 CALLER_RESTORE_SpLim \
751 CALLER_RESTORE_HpLim \
752 CALLER_RESTORE_CurrentTSO \
753 CALLER_RESTORE_CurrentNursery \
754 CALLER_RESTORE_SparkHd \
755 CALLER_RESTORE_SparkTl \
756 CALLER_RESTORE_SparkBase \
757 CALLER_RESTORE_SparkLim
759 #else /* not IN_STG_CODE */
761 #define CALLER_SAVE_USER /* nothing */
762 #define CALLER_SAVE_SYSTEM /* nothing */
763 #define CALLER_RESTORE_USER /* nothing */
764 #define CALLER_RESTORE_SYSTEM /* nothing */
766 #endif /* IN_STG_CODE */
767 #define CALLER_SAVE_ALL \
771 #define CALLER_RESTORE_ALL \
772 CALLER_RESTORE_SYSTEM \