/[cmucl]/src/lisp/alpha-assem.S
ViewVC logotype

Contents of /src/lisp/alpha-assem.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations)
Thu Mar 6 14:13:09 2003 UTC (11 years, 1 month ago) by pmai
Branch: MAIN
CVS Tags: sparc-tramp-assem-base, double-double-array-base, post-merge-intl-branch, release-19b-pre1, release-19b-pre2, merged-unicode-utf16-extfmt-2009-06-11, double-double-init-sparc-2, unicode-utf16-extfmt-2009-03-27, double-double-base, snapshot-2007-09, snapshot-2007-08, snapshot-2008-08, snapshot-2008-09, ppc_gencgc_snap_2006-01-06, sse2-packed-2008-11-12, snapshot-2008-05, snapshot-2008-06, snapshot-2008-07, snapshot-2007-05, snapshot-2008-01, snapshot-2008-02, snapshot-2008-03, intl-branch-working-2010-02-19-1000, snapshot-2006-11, snapshot-2006-10, double-double-init-sparc, snapshot-2006-12, unicode-string-buffer-impl-base, sse2-base, release-20b-pre1, release-20b-pre2, unicode-string-buffer-base, sse2-packed-base, sparc-tramp-assem-2010-07-19, amd64-dd-start, snapshot-2003-10, snapshot-2004-10, release-18e-base, release-19f-pre1, snapshot-2008-12, snapshot-2008-11, intl-2-branch-base, snapshot-2004-08, snapshot-2004-09, remove_negative_zero_not_zero, snapshot-2007-01, snapshot-2007-02, snapshot-2004-05, snapshot-2004-06, snapshot-2004-07, release-19e, release-19d, GIT-CONVERSION, double-double-init-ppc, release-19c, dynamic-extent-base, unicode-utf16-sync-2008-12, release-19c-base, cross-sol-x86-merged, label-2009-03-16, release-19f-base, merge-sse2-packed, mod-arith-base, sparc_gencgc_merge, merge-with-19f, snapshot-2004-12, snapshot-2004-11, intl-branch-working-2010-02-11-1000, unicode-snapshot-2009-05, unicode-snapshot-2009-06, amd64-merge-start, ppc_gencgc_snap_2005-12-17, double-double-init-%make-sparc, unicode-utf16-sync-2008-07, release-18e-pre2, unicode-utf16-sync-2008-09, unicode-utf16-extfmts-sync-2008-12, prm-before-macosx-merge-tag, cold-pcl-base, RELEASE_20b, snapshot-2008-04, snapshot-2003-11, snapshot-2005-07, unicode-utf16-sync-label-2009-03-16, RELEASE_19f, snapshot-2007-03, release-20a-base, cross-sol-x86-base, unicode-utf16-char-support-2009-03-26, unicode-utf16-char-support-2009-03-25, release-19a-base, unicode-utf16-extfmts-pre-sync-2008-11, snapshot-2008-10, sparc_gencgc, snapshot-2007-04, snapshot-2010-12, snapshot-2010-11, unicode-utf16-sync-2008-11, snapshot-2007-07, snapshot-2011-09, snapshot-2011-06, snapshot-2011-07, snapshot-2011-04, snapshot-2007-06, snapshot-2011-02, snapshot-2011-03, snapshot-2011-01, snapshot-2003-12, release-19a-pre1, release-19a-pre3, release-19a-pre2, pre-merge-intl-branch, release-19a, double-double-array-checkpoint, double-double-reader-checkpoint-1, release-19d-base, release-19e-pre1, double-double-irrat-end, release-19e-pre2, snapshot-2010-05, snapshot-2010-04, snapshot-2010-07, snapshot-2010-06, snapshot-2010-01, snapshot-2010-03, snapshot-2010-02, release-19d-pre2, release-19d-pre1, snapshot-2010-08, release-18e, double-double-init-checkpoint-1, double-double-reader-base, label-2009-03-25, snapshot-2005-03, release-19b-base, cross-sol-x86-2010-12-20, double-double-init-x86, sse2-checkpoint-2008-10-01, intl-branch-2010-03-18-1300, snapshot-2005-11, double-double-sparc-checkpoint-1, snapshot-2004-04, sse2-merge-with-2008-11, sse2-merge-with-2008-10, snapshot-2005-10, RELEASE_20a, snapshot-2005-12, release-20a-pre1, snapshot-2005-01, snapshot-2009-11, snapshot-2009-12, unicode-utf16-extfmt-2009-06-11, portable-clx-import-2009-06-16, unicode-utf16-string-support, release-19c-pre1, cross-sparc-branch-base, release-19e-base, intl-branch-base, double-double-irrat-start, snapshot-2005-06, snapshot-2005-05, snapshot-2005-04, ppc_gencgc_snap_2005-05-14, snapshot-2005-02, unicode-utf16-base, portable-clx-base, snapshot-2005-09, snapshot-2005-08, lisp-executable-base, snapshot-2009-08, snapshot-2007-12, snapshot-2007-10, snapshot-2007-11, snapshot-2009-02, snapshot-2009-01, snapshot-2009-07, snapshot-2009-05, snapshot-2009-04, snapshot-2006-02, snapshot-2006-03, release-18e-pre1, snapshot-2006-01, snapshot-2006-06, snapshot-2006-07, snapshot-2006-04, snapshot-2006-05, pre-telent-clx, snapshot-2006-08, snapshot-2006-09, HEAD
Branch point for: release-19b-branch, double-double-reader-branch, double-double-array-branch, mod-arith-branch, RELEASE-19F-BRANCH, portable-clx-branch, sparc_gencgc_branch, cross-sparc-branch, RELEASE-20B-BRANCH, unicode-string-buffer-branch, sparc-tramp-assem-branch, dynamic-extent, release-19d-branch, ppc_gencgc_branch, sse2-packed-branch, lisp-executable, RELEASE-20A-BRANCH, amd64-dd-branch, double-double-branch, unicode-string-buffer-impl-branch, intl-branch, release-18e-branch, cold-pcl, unicode-utf16-branch, cross-sol-x86-branch, release-19e-branch, sse2-branch, release-19a-branch, release-19c-branch, intl-2-branch, unicode-utf16-extfmt-branch
Changes since 1.9: +5 -4 lines
Fixes by Brian Uhrain for the alpha port:
  Attached is the full patch containing the addition of the
  ISTREAM-MEMORY-BARRIER VOP, the change to GENTRAP to use the bugchk
  opcode, and also a boot file to allow the patched sources to be
  compiled with an unpatched binary.
1 /* $Header: /tiger/var/lib/cvsroots/cmucl/src/lisp/alpha-assem.S,v 1.10 2003/03/06 14:13:09 pmai Rel $ */
2 #ifndef __linux__
3 #include <machine/regdef.h>
4 #include <machine/pal.h>
5 #else
6 #include <asm/reg.h>
7 #include <asm/pal.h>
8 #include <alpha/regdef.h>
9 #endif
10
11 #include "internals.h"
12 #include "lispregs.h"
13
14 /*
15 * Function to transfer control into lisp.
16 */
17 .text
18 .align 4
19 .globl call_into_lisp
20 .ent call_into_lisp
21 call_into_lisp:
22 #define framesize 8*8
23 ldgp gp, 0($27) /* ### */
24 /* Save all the C regs. */
25 lda sp,-framesize(sp)
26 stq ra, framesize-8*8(sp)
27 stq s0, framesize-8*7(sp)
28 stq s1, framesize-8*6(sp)
29 stq s2, framesize-8*5(sp)
30 stq s3, framesize-8*4(sp)
31 stq s4, framesize-8*3(sp)
32 stq s5, framesize-8*2(sp)
33 stq s6, framesize-8*1(sp)
34 .mask 0x0fc001fe, -framesize
35 .frame sp,framesize,ra
36
37 /* Clear descriptor regs */
38 ldil reg_CODE,0
39 ldil reg_FDEFN,0
40 mov a0,reg_LEXENV
41 sll a2,2,reg_NARGS
42 ldil reg_OCFP,0
43 ldil reg_LRA,0
44 ldil reg_L0,0
45 ldil reg_L1,0
46
47
48 /* Establish NIL. */
49 ldil reg_NULL,NIL
50
51 /* Start pseudo-atomic. */
52
53 /* No longer in foreign call. */
54 stl zero,foreign_function_call_active
55
56 /* Load lisp state. */
57 ldl reg_ALLOC,current_dynamic_space_free_pointer
58 ldl reg_BSP,current_binding_stack_pointer
59 ldl reg_CSP,current_control_stack_pointer
60 ldl reg_OCFP,current_control_frame_pointer
61 mov a1,reg_CFP
62
63 .set noat
64 ldil reg_L2,0
65 .set at
66 /* End of pseudo-atomic. */
67
68 /* Establish lisp arguments. */
69 ldl reg_A0,0(reg_CFP)
70 ldl reg_A1,4(reg_CFP)
71 ldl reg_A2,8(reg_CFP)
72 ldl reg_A3,12(reg_CFP)
73 ldl reg_A4,16(reg_CFP)
74 ldl reg_A5,20(reg_CFP)
75
76 /* Calculate the LRA. */
77 lda reg_LRA,call_into_lisp_LRA_page+type_OtherPointer
78
79 /* Indirect the closure */
80 ldl reg_CODE,CLOSURE_FUNCTION_OFFSET(reg_LEXENV)
81 addl reg_CODE,6*4-type_FunctionPointer,reg_LIP
82
83 /* And into lisp we go. */
84 jsr reg_ZERO,(reg_LIP)
85
86 .set noreorder
87 .align 3
88 .globl call_into_lisp_LRA
89 call_into_lisp_LRA:
90
91 .long type_ReturnPcHeader
92
93 mov reg_OCFP,reg_CSP
94 nop
95
96 /* return value already there */
97 mov reg_A0,v0
98
99 /* Turn on pseudo-atomic. */
100
101 /* Save LISP registers */
102 stl reg_ALLOC,current_dynamic_space_free_pointer
103 stl reg_BSP,current_binding_stack_pointer
104 stl reg_CSP,current_control_stack_pointer
105 stl reg_CFP,current_control_frame_pointer
106
107 /* Back in C land. [CSP is just a handy non-zero value.] */
108 stl reg_CSP,foreign_function_call_active
109
110 /* Turn off pseudo-atomic and check for traps. */
111
112 /* Restore C regs */
113 ldq ra, framesize-8*8(sp)
114 ldq s0, framesize-8*7(sp)
115 ldq s1, framesize-8*6(sp)
116 ldq s2, framesize-8*5(sp)
117 ldq s3, framesize-8*4(sp)
118 ldq s4, framesize-8*3(sp)
119 ldq s5, framesize-8*2(sp)
120 ldq s6, framesize-8*1(sp)
121
122 /* Restore the C stack! */
123 lda sp, framesize(sp)
124
125 ret zero,(ra),1
126 .globl call_into_lisp_end
127 call_into_lisp_end:
128 .end call_into_lisp
129
130 /*
131 * Transfering control from Lisp into C
132 */
133 .set noreorder
134 .text
135 .align 4
136 .globl call_into_c
137 .ent call_into_c
138 call_into_c:
139 .mask 0x0fc001fe, -12
140 .frame sp,12,ra
141 mov reg_CFP, reg_OCFP
142 mov reg_CSP, reg_CFP
143 addq reg_CFP, 32, reg_CSP
144 stl reg_OCFP, 0(reg_CFP)
145 subl reg_LIP, reg_CODE, reg_L1
146 addl reg_L1, type_OtherPointer, reg_L1
147 stl reg_L1, 4(reg_CFP)
148 stl reg_CODE, 8(reg_CFP)
149 stl reg_NULL, 12(reg_CFP)
150
151 /* Set the pseudo-atomic flag. */
152 addq reg_ALLOC,1,reg_ALLOC
153
154 /* Get the top two register args and fix the NSP to point to arg 7 */
155 ldq reg_NL4,0(reg_NSP)
156 ldq reg_NL5,8(reg_NSP)
157 addq reg_NSP,16,reg_NSP
158
159 /* Save lisp state. */
160 subq reg_ALLOC,1,reg_L1
161 stl reg_L1, current_dynamic_space_free_pointer
162 stl reg_BSP, current_binding_stack_pointer
163 stl reg_CSP, current_control_stack_pointer
164 stl reg_CFP, current_control_frame_pointer
165
166 /* Mark us as in C land. */
167 stl reg_CSP, foreign_function_call_active
168
169 /* Were we interrupted? */
170 subq reg_ALLOC,1,reg_ALLOC
171 stl reg_ZERO,0(reg_ALLOC)
172
173 /* Into C land we go. */
174 mov reg_CFUNC, reg_L1 /* ### This line is a mystery */
175 jsr ra, (reg_CFUNC)
176 ldgp $29,0(ra)
177
178 /* restore NSP */
179 subq reg_NSP,16,reg_NSP
180
181 /* Clear unsaved descriptor regs */
182 mov reg_ZERO, reg_NARGS
183 mov reg_ZERO, reg_A0
184 mov reg_ZERO, reg_A1
185 mov reg_ZERO, reg_A2
186 mov reg_ZERO, reg_A3
187 mov reg_ZERO, reg_A4
188 mov reg_ZERO, reg_A5
189 mov reg_ZERO, reg_L0
190 .set noat
191 mov reg_ZERO, reg_L2
192 .set at
193
194 /* Turn on pseudo-atomic. */
195 lda reg_ALLOC,1(reg_ZERO)
196
197 /* Mark us at in Lisp land. */
198 stl reg_ZERO, foreign_function_call_active
199
200 /* Restore ALLOC, preserving pseudo-atomic-atomic */
201 ldl reg_NL0,current_dynamic_space_free_pointer
202 addq reg_ALLOC,reg_NL0,reg_ALLOC
203
204 /* Check for interrupt */
205 subq reg_ALLOC,1,reg_ALLOC
206 stl reg_ZERO,0(reg_ALLOC)
207
208 ldl reg_NULL, 12(reg_CFP)
209
210 /* Restore LRA & CODE (they may have been GC'ed) */
211 ldl reg_CODE, 8(reg_CFP)
212 ldl reg_NL0, 4(reg_CFP)
213 subq reg_NL0, type_OtherPointer, reg_NL0
214 addq reg_CODE, reg_NL0, reg_NL0
215
216 mov reg_CFP, reg_CSP
217 mov reg_OCFP, reg_CFP
218
219 ret zero, (reg_NL0), 1
220
221 .end call_into_c
222
223 .text
224 .globl start_of_tramps
225 start_of_tramps:
226
227 /*
228 * The undefined-function trampoline.
229 */
230 .text
231 .globl undefined_tramp
232 .ent undefined_tramp_offset
233 undefined_tramp = /* ### undefined_tramp_offset-call_into_lisp_LRA*/ 0x140+call_into_lisp_LRA_page
234 undefined_tramp_offset:
235 call_pal PAL_gentrap
236 .long trap_Error
237 /* Number of argument bytes */
238 .byte 4
239 .byte UNDEFINED_SYMBOL_ERROR
240 /* Escape to create 16bit BE number from following two values */
241 .byte 254
242 /* SC_OFFSET(sc_DescriptorReg,reg_FDEFN) */
243 .byte (0xe0 + sc_DescriptorReg)
244 .byte 2
245 .align 2
246 .end undefined_tramp
247
248
249 /*
250 * The closure trampoline.
251 */
252 .text
253 .globl closure_tramp
254 .ent closure_tramp_offset
255 closure_tramp = /* ### */ 0x150 + call_into_lisp_LRA_page
256 closure_tramp_offset:
257 ldl reg_LEXENV, FDEFN_FUNCTION_OFFSET(reg_FDEFN)
258 ldl reg_L0, CLOSURE_FUNCTION_OFFSET(reg_LEXENV)
259 addl reg_L0, FUNCTION_CODE_OFFSET, reg_LIP
260 jmp reg_ZERO,(reg_LIP)
261 .end closure_tramp
262
263 .text
264 .globl end_of_tramps
265 end_of_tramps:
266
267
268 /*
269 * Function-end breakpoint magic.
270 */
271
272 .text
273 .align 2
274 .set noreorder
275 .globl function_end_breakpoint_guts
276 function_end_breakpoint_guts:
277 .long type_ReturnPcHeader
278 br zero, function_end_breakpoint_trap
279 nop
280 mov reg_CSP, reg_OCFP
281 addl reg_CSP, 4, reg_CSP
282 addl zero, 4, reg_NARGS
283 mov reg_NULL, reg_A1
284 mov reg_NULL, reg_A2
285 mov reg_NULL, reg_A3
286 mov reg_NULL, reg_A4
287 mov reg_NULL, reg_A5
288 1:
289
290 .globl function_end_breakpoint_trap
291 function_end_breakpoint_trap:
292 call_pal PAL_gentrap
293 .long trap_FunctionEndBreakpoint
294 br zero, function_end_breakpoint_trap
295
296 .globl function_end_breakpoint_end
297 function_end_breakpoint_end:
298
299

  ViewVC Help
Powered by ViewVC 1.1.5