/[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 - (show 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 /* $Header: /tiger/var/lib/cvsroots/cmucl/src/lisp/sparc-lispregs.h,v 1.7 2004/07/30 00:53:41 rtoy Exp $ */
2
3
4
5 #ifdef LANGUAGE_ASSEMBLY
6
7 #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
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 #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 #define NREGS (32)
41
42 /*
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 #define reg_ZERO GREG(0)
48 #define reg_ZERO_NUM GREG_NUM(0)
49 #define reg_ALLOC GREG(1)
50 #define reg_ALLOC_NUM GREG_NUM(1)
51 #define reg_NIL GREG(2)
52 #define reg_NIL_NUM GREG_NUM(2)
53 #define reg_CSP GREG(3)
54 #define reg_CSP_NUM GREG_NUM(3)
55 #define reg_CFP GREG(4)
56 #define reg_CFP_NUM GREG_NUM(4)
57 #define reg_BSP GREG(5)
58 #define reg_BSP_NUM GREG_NUM(5)
59 /* %g6 and %g7 are supposed to be reserved for the system */
60
61 #define reg_NL0 OREG(0)
62 #define reg_NL0_NUM OREG_NUM(0)
63 #define reg_NL1 OREG(1)
64 #define reg_NL1_NUM OREG_NUM(1)
65 #define reg_NL2 OREG(2)
66 #define reg_NL2_NUM OREG_NUM(2)
67 #define reg_NL3 OREG(3)
68 #define reg_NL3_NUM OREG_NUM(3)
69 #define reg_NL4 OREG(4)
70 #define reg_NL4_NUM OREG_NUM(4)
71 #define reg_NL5 OREG(5)
72 #define reg_NL5_NUM OREG_NUM(5)
73 #define reg_NSP OREG(6)
74 #define reg_NSP_NUM OREG_NUM(6)
75 #define reg_NARGS OREG(7)
76 #define reg_NARGS_NUM OREG_NUM(7)
77
78 #define reg_A0 LREG(0)
79 #define reg_A0_NUM LREG_NUM(0)
80 #define reg_A1 LREG(1)
81 #define reg_A1_NUM LREG_NUM(1)
82 #define reg_A2 LREG(2)
83 #define reg_A2_NUM LREG_NUM(2)
84 #define reg_A3 LREG(3)
85 #define reg_A3_NUM LREG_NUM(3)
86 #define reg_A4 LREG(4)
87 #define reg_A4_NUM LREG_NUM(4)
88 #define reg_A5 LREG(5)
89 #define reg_A5_NUM LREG_NUM(5)
90 #define reg_OCFP LREG(6)
91 #define reg_OCFP_NUM LREG_NUM(6)
92 #define reg_LRA LREG(7)
93 #define reg_LRA_NUM LREG_NUM(7)
94
95 #define reg_FDEFN IREG(0)
96 #define reg_FDEFN_NUM IREG_NUM(0)
97 #define reg_LEXENV IREG(1)
98 #define reg_LEXENV_NUM IREG_NUM(1)
99 #define reg_L0 IREG(2)
100 #define reg_L0_NUM IREG_NUM(2)
101 #define reg_NFP IREG(3)
102 #define reg_NFP_NUM IREG_NUM(3)
103 #define reg_CFUNC IREG(4)
104 #define reg_CFUNC_NUM IREG_NUM(4)
105 #define reg_CODE IREG(5)
106 #define reg_CODE_NUM IREG_NUM(5)
107 #define reg_LIP IREG(7)
108 #define reg_LIP_NUM IREG_NUM(7)
109
110 #define REGNAMES \
111 "ZERO", "ALLOC", "NULL", "CSP", \
112 "CFP", "BSP", "%g6", "%g7", \
113 "NL0", "NL1", "NL2", "NL3", \
114 "NL4", "NL5", "NSP", "NARGS", \
115 "A0", "A1", "A2", "A3", \
116 "A4", "A5", "OCFP", "LRA", \
117 "FDEFN", "LEXENV", "L0", "NFP", \
118 "CFUNC", "CODE", "???", "LIP"
119
120 #define BOXED_REGISTERS { \
121 reg_A0, reg_A1, reg_A2, reg_A3, reg_A4, reg_A5, reg_FDEFN, reg_LEXENV, \
122 reg_OCFP, reg_LRA, reg_L0, reg_CODE \
123 }
124
125 #ifndef LANGUAGE_ASSEMBLY
126
127 #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 #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
146 #endif /* SOLARIS */
147
148 #endif

  ViewVC Help
Powered by ViewVC 1.1.5