Global state (R for register, G for globals/constants area) R csp R cfp R code R globals G flags G heap R nsp G rt::*binding-stack-pointer* G eval::*top-of-stack* G lisp::*current-catch-block* G lisp::*current-unwind-protect* G rt::*allocation-pointer* Need lisp-interior pointer register. This is a register that holds a calculated address for indexing structures, arrays, etc. It is special since it may have any low-bit pattern, so it may look like any kind of immediate or pointer. GC needs to know this is an address and to fix the it after GC moves the containing object. Five non-descriptor registers. Mostly determined by some bignum VOP, but probably good for general performance anyway. ;;; We only needed five for the %FLOOR VOP, but on the RT we don't need this. We can use the RT's instruction that does this, or we can use the Lisp level 64x32-divide. On other machines without the RT instruction, there will be 32 registers (almost certainly), or we can just use the Lisp level code. ;;; We want one less non-descriptor register to avoid a lot of C and assembly hair to make special signal stacks for handling interrupts. This also involves dummying up unwind-protect frames on the Lisp control stack which gets pretty tricky. All this seems to be way hairy and bug prone like the old RT interrupt solution. RT constraints 0 cannot hold pointers since you cannot indirect/index off it. 15 might be locked down for a particular call instruction that stashes the return pc. We might like this instruction. ;;;; Registers. Dedicated Lisp registers: NSP - Number stack pointer. CSP - Control stack pointer. CFP - Control frame pointer. CODE - Current code object. NULL - Wired NIL register. Acess to globals area. LIP - Lisp-interior pointer. Temporarily dedicated: NFP - Number frame pointer. Linkage Registers: NARGS - Number of arguments or values. LEXENV - Lexical Environment being called. OCFP - Old control frame pointer. CNAME - Name of called function. A0-A2 - First three arguments. LRA - Lisp Return Address. Reg CN PR C Usage LN Lisp Usage GC ------------------------------------------------------------------------ R0 NARGS Non-descriptor Reg N R1 Stack Pointer NSP (D) Number Stack Pointer N R2 Arg 0/ret val NL0 Non-descriptor Reg N R3 Arg 1 OCFP Non-descriptor Reg N R4 Arg 2 NFP Non-descriptor Reg N R5 Arg 3 CSP (D) Control Stack Pointer Special R6 CFP (D) Current Frame Pointer N R7 CODE (D)Code Pointer Y R8 NULL (D)Null / Nil Constant Y R9 CNAME Call Name Y R10 LEXENV Lexical Env Y R11 LRA Lisp Return Address Y R12 A0 Argument Y R13 A1 Argument Y R14 A2 Argument Y R15 RetPC (spec in) LIP (D) Lisp-interior Ptr Special Key: CN == C/UNIX name LN == Lisp name PR == Preserved on C function call (callee saves) GC == Considered as a root for GC