Simon Marlow wrote:
Joe Buehler wrote:
What is the purpose of RESERVED_C_STACK_BYTES?  Are stg routines
expecting a free area of that size at *top* of stack? I need to make sure that I have saved the registers at the correct end of the stack frame created in StgRun. It is difficult to tell from the existing hppa code what exactly
was intended.

I had the same problem. I think you can define USE_MINIINTERPRETER (in rts/Makefile:STANDARD_OPTS or as build.mk:SRC_CC_OPTS) and that will get around StgCRun/Return. The problem I had was finding out where everything was supposed to go: I needed to see the actual C compiler output to make sure things were safe. In the end I gave up-- Windows-native RTS is unregisterised for now because CL cannot create Explicit Register Variables or use the 'register' storage class for global variables (both are used in includes/Regs.h).

The reserved area is used for spilling in STG code. Typically the area above the C stack pointer is assumed to be available for scratch space during any basic block. I'm not familiar with HPPA though, it may have different conventions.

Maybe I have this reversed--I asked about this before now: StgCRun.c:StgRun:

        "movl %%esp, %%eax\n\t"
        "addl %4, %%eax\n\t"

that %4 there is the argument RESERVED_C_STACK_BYTES--i.e., instead of moving the saved-stack-pointer _down_ the stack (subl to where the stack would grow) it moves up the stack (addl back up into the stack). This would save memory (RESERVED_C_STACK_BYTES is defined in Constants.h as (2048 * SIZEOF_LONG)) but only if it is already known that the stack space above was used by the GHC program. The point being that knowing what is controlling the stack you are using--GHC or the C compiler--would help. Am I way off here?

Thanks,
Pete

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to