/* -----------------------------------------------------------------------------
- * $Id: StgCRun.c,v 1.41 2003/12/10 11:35:26 wolfgang Exp $
+ * $Id: StgCRun.c,v 1.42 2004/08/13 13:10:46 simonmar Exp $
*
* (c) The GHC Team, 1998-2003
*
* that we don't use but which are callee-save registers. The __divq() routine
* in libc.a clobbers $s6.
*/
-#include "config.h"
+#include "ghcconfig.h"
#ifdef alpha_TARGET_ARCH
#define alpha_EXTRA_CAREFUL
register long fake_ra __asm__("$26");
#include "Stg.h"
#include "Rts.h"
#include "StgRun.h"
+#include "RtsFlags.h"
+#include "Capability.h"
#ifdef DEBUG
-#include "RtsFlags.h"
#include "RtsUtils.h"
#include "Printer.h"
#endif
any architecture (using miniinterpreter)
-------------------------------------------------------------------------- */
-extern StgThreadReturnCode StgRun(StgFunPtr f, StgRegTable *basereg STG_UNUSED)
+StgThreadReturnCode StgRun(StgFunPtr f, StgRegTable *basereg STG_UNUSED)
{
- while (f) {
- IF_DEBUG(interpreter,
- fprintf(stderr,"Jumping to ");
- printPtr((P_)f); fflush(stdout);
- fprintf(stderr,"\n");
- );
- f = (StgFunPtr) (f)();
- }
- return (StgThreadReturnCode)R1.i;
+ while (f) {
+ if (RtsFlags[0].DebugFlags.interpreter) {
+ fprintf(stderr,"Jumping to ");
+ printPtr((P_)f); fflush(stdout);
+ fprintf(stderr,"\n");
+ }
+ f = (StgFunPtr) (f)();
+ }
+ return (StgThreadReturnCode)R1.i;
}
-EXTFUN(StgReturn)
+StgFunPtr StgReturn(void)
{
- return 0;
+ return 0;
}
#else /* !USE_MINIINTERPRETER */
"\tbl saveFP # f14\n"
"\tstmw r13,-220(r1)\n"
"\tstwu r1,-%0(r1)\n"
+ "\tmr r27,r4\n" // BaseReg == r27
"\tmtctr r3\n"
"\tmr r12,r3\n"
"\tbctr\n"
"\tstfd 29,-24(5)\n"
"\tstfd 30,-16(5)\n"
"\tstfd 31,-8(5)\n"
+ "\tmr 27,4\n" // BaseReg == r27
"\tmtctr 3\n"
"\tmr 12,3\n"
"\tbctr\n"