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

  ViewVC Help
Powered by ViewVC 1.1.5