/[cmucl]/src/lisp/sparc-lispregs.h
ViewVC logotype

Contents of /src/lisp/sparc-lispregs.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations)
Fri Jul 30 00:53:41 2004 UTC (9 years, 8 months ago) by rtoy
Branch: MAIN
CVS Tags: snapshot-2004-10, snapshot-2004-09, snapshot-2004-12, snapshot-2004-11, snapshot-2005-01
Changes since 1.6: +1 -8 lines
File MIME type: text/plain
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.
1 rtoy 1.7 /* $Header: /tiger/var/lib/cvsroots/cmucl/src/lisp/sparc-lispregs.h,v 1.7 2004/07/30 00:53:41 rtoy Exp $ */
2 ram 1.3
3    
4 wlott 1.1
5     #ifdef LANGUAGE_ASSEMBLY
6    
7 ram 1.3 #ifdef __STDC__
8     /* Standard C token concatenation */
9     #define CAT(a,b) a ## b
10    
11     #else
12     /* Reisser CPP token concatenation */
13     #define CAT(a,b) a/**/b
14    
15     #endif
16    
17     /*
18     * Note: concatenation to non preprocessor symbols is not defined,
19     * SunPRO C 2.0.1 yields % g0, perfectly valid according to ANSI
20     */
21     #define GREG(num) CAT(%g,num)
22     #define OREG(num) CAT(%o,num)
23     #define LREG(num) CAT(%l,num)
24     #define IREG(num) CAT(%i,num)
25 wlott 1.1
26     #else
27    
28     #define GREG(num) (num)
29     #define OREG(num) ((num)+8)
30     #define LREG(num) ((num)+16)
31     #define IREG(num) ((num)+24)
32    
33     #endif
34    
35 toy 1.6 #define GREG_NUM(num) (num)
36     #define OREG_NUM(num) ((num)+8)
37     #define LREG_NUM(num) ((num)+16)
38     #define IREG_NUM(num) ((num)+24)
39    
40 wlott 1.1 #define NREGS (32)
41    
42 toy 1.6 /*
43     * Define all the Lisp registers appropriately for assembly and C.
44     * The registers ending with NUM are meant for use in assembly
45     * routines where we need the register number for getting SC_OFFSET
46     */
47 wlott 1.1 #define reg_ZERO GREG(0)
48 toy 1.6 #define reg_ZERO_NUM GREG_NUM(0)
49 wlott 1.1 #define reg_ALLOC GREG(1)
50 toy 1.6 #define reg_ALLOC_NUM GREG_NUM(1)
51 wlott 1.1 #define reg_NIL GREG(2)
52 toy 1.6 #define reg_NIL_NUM GREG_NUM(2)
53 wlott 1.1 #define reg_CSP GREG(3)
54 toy 1.6 #define reg_CSP_NUM GREG_NUM(3)
55 wlott 1.1 #define reg_CFP GREG(4)
56 toy 1.6 #define reg_CFP_NUM GREG_NUM(4)
57 wlott 1.1 #define reg_BSP GREG(5)
58 toy 1.6 #define reg_BSP_NUM GREG_NUM(5)
59 dtc 1.5 /* %g6 and %g7 are supposed to be reserved for the system */
60 wlott 1.1
61     #define reg_NL0 OREG(0)
62 toy 1.6 #define reg_NL0_NUM OREG_NUM(0)
63 wlott 1.1 #define reg_NL1 OREG(1)
64 toy 1.6 #define reg_NL1_NUM OREG_NUM(1)
65 wlott 1.1 #define reg_NL2 OREG(2)
66 toy 1.6 #define reg_NL2_NUM OREG_NUM(2)
67 wlott 1.1 #define reg_NL3 OREG(3)
68 toy 1.6 #define reg_NL3_NUM OREG_NUM(3)
69 wlott 1.1 #define reg_NL4 OREG(4)
70 toy 1.6 #define reg_NL4_NUM OREG_NUM(4)
71 wlott 1.1 #define reg_NL5 OREG(5)
72 toy 1.6 #define reg_NL5_NUM OREG_NUM(5)
73 wlott 1.1 #define reg_NSP OREG(6)
74 toy 1.6 #define reg_NSP_NUM OREG_NUM(6)
75 wlott 1.1 #define reg_NARGS OREG(7)
76 toy 1.6 #define reg_NARGS_NUM OREG_NUM(7)
77 wlott 1.1
78     #define reg_A0 LREG(0)
79 toy 1.6 #define reg_A0_NUM LREG_NUM(0)
80 wlott 1.1 #define reg_A1 LREG(1)
81 toy 1.6 #define reg_A1_NUM LREG_NUM(1)
82 wlott 1.1 #define reg_A2 LREG(2)
83 toy 1.6 #define reg_A2_NUM LREG_NUM(2)
84 wlott 1.1 #define reg_A3 LREG(3)
85 toy 1.6 #define reg_A3_NUM LREG_NUM(3)
86 wlott 1.1 #define reg_A4 LREG(4)
87 toy 1.6 #define reg_A4_NUM LREG_NUM(4)
88 wlott 1.1 #define reg_A5 LREG(5)
89 toy 1.6 #define reg_A5_NUM LREG_NUM(5)
90 wlott 1.1 #define reg_OCFP LREG(6)
91 toy 1.6 #define reg_OCFP_NUM LREG_NUM(6)
92 wlott 1.1 #define reg_LRA LREG(7)
93 toy 1.6 #define reg_LRA_NUM LREG_NUM(7)
94 wlott 1.1
95     #define reg_FDEFN IREG(0)
96 toy 1.6 #define reg_FDEFN_NUM IREG_NUM(0)
97 wlott 1.1 #define reg_LEXENV IREG(1)
98 toy 1.6 #define reg_LEXENV_NUM IREG_NUM(1)
99 wlott 1.1 #define reg_L0 IREG(2)
100 toy 1.6 #define reg_L0_NUM IREG_NUM(2)
101 dtc 1.5 #define reg_NFP IREG(3)
102 toy 1.6 #define reg_NFP_NUM IREG_NUM(3)
103 dtc 1.5 #define reg_CFUNC IREG(4)
104 toy 1.6 #define reg_CFUNC_NUM IREG_NUM(4)
105 wlott 1.1 #define reg_CODE IREG(5)
106 toy 1.6 #define reg_CODE_NUM IREG_NUM(5)
107 wlott 1.1 #define reg_LIP IREG(7)
108 toy 1.6 #define reg_LIP_NUM IREG_NUM(7)
109 wlott 1.1
110     #define REGNAMES \
111     "ZERO", "ALLOC", "NULL", "CSP", \
112 dtc 1.5 "CFP", "BSP", "%g6", "%g7", \
113 wlott 1.1 "NL0", "NL1", "NL2", "NL3", \
114     "NL4", "NL5", "NSP", "NARGS", \
115     "A0", "A1", "A2", "A3", \
116     "A4", "A5", "OCFP", "LRA", \
117 dtc 1.5 "FDEFN", "LEXENV", "L0", "NFP", \
118     "CFUNC", "CODE", "???", "LIP"
119 wlott 1.1
120     #define BOXED_REGISTERS { \
121     reg_A0, reg_A1, reg_A2, reg_A3, reg_A4, reg_A5, reg_FDEFN, reg_LEXENV, \
122 dtc 1.5 reg_OCFP, reg_LRA, reg_L0, reg_CODE \
123 wlott 1.1 }
124    
125     #ifndef LANGUAGE_ASSEMBLY
126    
127 ram 1.3 #ifdef SOLARIS
128    
129     #include <ucontext.h>
130    
131     extern int * solaris_register_address(struct ucontext *, int);
132    
133     #define SC_REG(sc, reg) (*solaris_register_address(sc,reg))
134    
135     /* short cuts */
136    
137     #define SC_PC(sc) ((sc)->uc_mcontext.gregs[REG_PC])
138     #define SC_NPC(sc) ((sc)->uc_mcontext.gregs[REG_nPC])
139    
140     #else
141    
142 wlott 1.1 #define SC_REG(sc, n) (((int *)((sc)->sc_g1))[n])
143     #define SC_PC(sc) ((sc)->sc_pc)
144     #define SC_NPC(sc) ((sc)->sc_npc)
145 ram 1.3
146     #endif /* SOLARIS */
147 wlott 1.1
148     #endif

  ViewVC Help
Powered by ViewVC 1.1.5