Skip to content
Snippets Groups Projects
Commit fee107e6 authored by rtoy's avatar rtoy
Browse files

lispregs.h, sparc-lispregs.h:

  o Move the SC_OFFSET_{HI,LO} macros from sparc-lispregs to
    lispregs.h, so they can be used elsewhere.

ppc-lispregs.h:
  o Define the register numbers so they can be used in the SC_OFFSET
    macros.

ppc-assem.S:
  o Document what the byte 18<<2, 0, 0, 24 is supposed to do.
  o Use the SC_OFFSET macros in undefined_tramp instead of hard-wiring
    the register number.
parent 1d393259
No related branches found
No related tags found
No related merge requests found
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lispregs.h,v 1.6 2004/07/13 00:26:22 pmai Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lispregs.h,v 1.7 2004/07/30 00:53:41 rtoy Exp $ */
#if defined(mips) || defined(irix) #if defined(mips) || defined(irix)
#include "mips-lispregs.h" #include "mips-lispregs.h"
...@@ -35,6 +35,15 @@ ...@@ -35,6 +35,15 @@
/* This matches the definition of sc-offset in code/debug-info.lisp */ /* This matches the definition of sc-offset in code/debug-info.lisp */
#define SC_OFFSET(sc,offset) (((offset) << 5) | (sc)) #define SC_OFFSET(sc,offset) (((offset) << 5) | (sc))
/*
* Macros to compute the SC_OFFSET value. See read-var-integer and
* sc-offset and friends in debug-info.lisp
*/
#define SC_OFFSET_HI(sc, regnum) ((SC_OFFSET(sc,regnum)) >> 8)
#define SC_OFFSET_LO(sc, regnum) ((SC_OFFSET(sc,regnum)) & 0xff)
#ifndef LANGUAGE_ASSEMBLY #ifndef LANGUAGE_ASSEMBLY
extern char *lisp_register_names[]; extern char *lisp_register_names[];
#endif #endif
...@@ -397,6 +397,10 @@ lra: ...@@ -397,6 +397,10 @@ lra:
.globl _undefined_tramp .globl _undefined_tramp
.byte 0,0,0,type_FunctionHeader .byte 0,0,0,type_FunctionHeader
/*
* The next 4 bytes are the encoding for a PPC jump instruction.
* The jump should go to the twllei instruction below.
*/
.byte 18<<2 .byte 18<<2
_undefined_tramp: _undefined_tramp:
.byte 0,0,24 .byte 0,0,24
...@@ -406,11 +410,18 @@ _undefined_tramp: ...@@ -406,11 +410,18 @@ _undefined_tramp:
.long NIL .long NIL
.long NIL .long NIL
twllei reg_ZERO,trap_Cerror twllei reg_ZERO,trap_Cerror
/* Number of argument bytes */
.byte 4 .byte 4
.byte UNDEFINED_SYMBOL_ERROR .byte UNDEFINED_SYMBOL_ERROR
/* Escape to create 16bit number from following two bytes,
in little-endian order */
.byte 254 .byte 254
.byte SC_OFFSET_LO(sc_DescriptorReg, reg_FDEFN_NUM)
.byte SC_OFFSET_HI(sc_DescriptorReg, reg_FDEFN_NUM)
/*
.byte sc_DescriptorReg+0x40 .byte sc_DescriptorReg+0x40
.byte 1 .byte 1
*/
.align 2 .align 2
#ifdef PPC_FUN_HACK_MAYBE #ifdef PPC_FUN_HACK_MAYBE
1: lwz reg_CODE,FDEFN_RAW_ADDR_OFFSET(reg_CNAME) 1: lwz reg_CODE,FDEFN_RAW_ADDR_OFFSET(reg_CNAME)
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#define REG(num) num #define REG(num) num
#endif #endif
#define REG_NUM(num) num
#define NREGS 32 #define NREGS 32
#define reg_ZERO REG(0) /* Should alwasy contain 0 in lisp */ #define reg_ZERO REG(0) /* Should alwasy contain 0 in lisp */
...@@ -43,6 +45,44 @@ ...@@ -43,6 +45,44 @@
#define reg_L2 REG(30) /* Last lisp temp reg */ #define reg_L2 REG(30) /* Last lisp temp reg */
#define reg_LIP REG(31) /* Lisp Interior Pointer, e.g., locative */ #define reg_LIP REG(31) /* Lisp Interior Pointer, e.g., locative */
/*
* Same as above, but we just want the register number, not the
* register name
*/
#define reg_ZERO_NUM 0 /* Should alwasy contain 0 in lisp */
#define reg_NSP_NUM 1 /* The number/C stack pointer */
#define reg_POLL_NUM 2 /* Lisp preemption/Mystery SVR4 ABI reg */
#define reg_NL0_NUM 3 /* FF param/result 1 */
#define reg_NL1_NUM 4 /* FF param/result 2 */
#define reg_NL2_NUM 5 /* FF param 3 */
#define reg_NL3_NUM 6
#define reg_NL4_NUM 7
#define reg_NL5_NUM 8
#define reg_NL6_NUM 9
#define reg_FDEFN_NUM 10 /* Last (8th) FF param */
#define reg_NARGS_NUM 11
#define reg_CFUNC_NUM 12 /* Silly to blow a reg on FF-name */
#define reg_NFP_NUM 13 /* Lisp may save around FF-call */
#define reg_BSP_NUM 14 /* Binding stack pointer */
#define reg_CFP_NUM 15 /* Control/value stack frame pointer */
#define reg_CSP_NUM 16 /* Control/value stack top */
#define reg_ALLOC_NUM 17 /* (Global) dynamic free pointer */
#define reg_NULL_NUM 18 /* NIL and globals nearby */
#define reg_CODE_NUM 19 /* Current function object */
#define reg_CNAME_NUM 20 /* Current function name */
#define reg_LEXENV_NUM 21 /* And why burn a register for this ? */
#define reg_OCFP_NUM 22 /* The caller's reg_CFP_NUM */
#define reg_LRA_NUM 23 /* Tagged lisp return address */
#define reg_A0_NUM 24 /* First function arg/return value */
#define reg_A1_NUM 25 /* Second. */
#define reg_A2_NUM 26 /* */
#define reg_A3_NUM 27 /* Last of (only) 4 arg regs */
#define reg_L0_NUM 28 /* Tagged temp regs */
#define reg_L1_NUM 29
#define reg_L2_NUM 30 /* Last lisp temp reg */
#define reg_LIP_NUM 31 /* Lisp Interior Pointer, e.g., locative */
#define REGNAMES \ #define REGNAMES \
"ZERO", "NSP", "POLL", "NL0", \ "ZERO", "NSP", "POLL", "NL0", \
"NL1", "NL2", "NL3P", "NL4", \ "NL1", "NL2", "NL3P", "NL4", \
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sparc-lispregs.h,v 1.6 2002/11/13 17:14:18 toy Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sparc-lispregs.h,v 1.7 2004/07/30 00:53:41 rtoy Exp $ */
...@@ -107,13 +107,6 @@ ...@@ -107,13 +107,6 @@
#define reg_LIP IREG(7) #define reg_LIP IREG(7)
#define reg_LIP_NUM IREG_NUM(7) #define reg_LIP_NUM IREG_NUM(7)
/*
* Macros to compute the SC_OFFSET value. See read-var-integer and
* sc-offset and friends in debug-info.lisp
*/
#define SC_OFFSET_HI(sc, reg) ((SC_OFFSET(sc,reg)) >> 8)
#define SC_OFFSET_LO(sc, reg) ((SC_OFFSET(sc,reg)) & 0xff)
#define REGNAMES \ #define REGNAMES \
"ZERO", "ALLOC", "NULL", "CSP", \ "ZERO", "ALLOC", "NULL", "CSP", \
"CFP", "BSP", "%g6", "%g7", \ "CFP", "BSP", "%g6", "%g7", \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment