... |
... |
@@ -12,15 +12,18 @@ |
12
|
12
|
#else
|
13
|
13
|
#endif
|
14
|
14
|
|
|
15
|
+/* Sparcv9 ABI has a bias on the stack (including sp and fp!) */
|
|
16
|
+#define WORD_BYTES 8
|
|
17
|
+
|
15
|
18
|
#define LANGUAGE_ASSEMBLY
|
16
|
19
|
#include "lispregs.h"
|
17
|
20
|
#include "internals.h"
|
18
|
21
|
#include "globals.h"
|
19
|
22
|
|
20
|
23
|
#define load(sym, reg) \
|
21
|
|
- sethi %hi(sym), reg; ld [reg+%lo(sym)], reg
|
|
24
|
+ sethi %hi(sym), reg; ldn [reg+%lo(sym)], reg
|
22
|
25
|
#define store(reg, sym) \
|
23
|
|
- sethi %hi(sym), reg_L0; st reg, [reg_L0+%lo(sym)]
|
|
26
|
+ sethi %hi(sym), reg_L0; stn reg, [reg_L0+%lo(sym)]
|
24
|
27
|
|
25
|
28
|
/*
|
26
|
29
|
* Our frame size needs to be large enough to hold our window,
|
... |
... |
@@ -31,11 +34,7 @@ |
31
|
34
|
* Since %o0 and %o1 contain the return results, we do not have to save
|
32
|
35
|
* these.
|
33
|
36
|
*/
|
34
|
|
-#ifdef v8plus
|
35
|
|
-#define FRAMESIZE (SA(WINDOWSIZE+4 + 6*8))
|
36
|
|
-#else
|
37
|
|
-#define FRAMESIZE (SA(MINFRAME))
|
38
|
|
-#endif
|
|
37
|
+#define FRAMESIZE (SA64(MINFRAME64))
|
39
|
38
|
|
40
|
39
|
/*
|
41
|
40
|
* Tell assembler we're using %g2 and %g3 here.
|
... |
... |
@@ -53,7 +52,7 @@ call_into_lisp: |
53
|
52
|
ta ST_FLUSH_WINDOWS
|
54
|
53
|
|
55
|
54
|
/* Save the return address. */
|
56
|
|
- st %i7, [%fp-4]
|
|
55
|
+ stn %i7, [%fp + STACK_BIAS - WORD_BYTES]
|
57
|
56
|
|
58
|
57
|
/* Clear the descriptor regs. (See sparc/vm.lisp) */
|
59
|
58
|
mov reg_ZERO, reg_A0
|
... |
... |
@@ -92,18 +91,18 @@ call_into_lisp: |
92
|
91
|
sll %i2, 2, reg_NARGS
|
93
|
92
|
mov %i1, reg_CFP
|
94
|
93
|
mov %i0, reg_LEXENV
|
95
|
|
- ld [reg_CFP+0], reg_A0
|
96
|
|
- ld [reg_CFP+4], reg_A1
|
97
|
|
- ld [reg_CFP+8], reg_A2
|
98
|
|
- ld [reg_CFP+12], reg_A3
|
99
|
|
- ld [reg_CFP+16], reg_A4
|
100
|
|
- ld [reg_CFP+20], reg_A5
|
|
94
|
+ ldn [reg_CFP + 0*WORD_BYTES], reg_A0
|
|
95
|
+ ldn [reg_CFP + 1*WORD_BYTES], reg_A1
|
|
96
|
+ ldn [reg_CFP + 2*WORD_BYTES], reg_A2
|
|
97
|
+ ldn [reg_CFP + 3*WORD_BYTES], reg_A3
|
|
98
|
+ ldn [reg_CFP + 4*WORD_BYTES], reg_A4
|
|
99
|
+ ldn [reg_CFP + 5*WORD_BYTES], reg_A5
|
101
|
100
|
|
102
|
101
|
/* Calculate LRA */
|
103
|
102
|
set lra + type_OtherPointer, reg_LRA
|
104
|
103
|
|
105
|
104
|
/* Indirect closure */
|
106
|
|
- ld [reg_LEXENV+CLOSURE_FUNCTION_OFFSET], reg_CODE
|
|
105
|
+ ldn [reg_LEXENV+CLOSURE_FUNCTION_OFFSET], reg_CODE
|
107
|
106
|
|
108
|
107
|
jmp reg_CODE+FUNCTION_CODE_OFFSET
|
109
|
108
|
nop
|
... |
... |
@@ -138,7 +137,7 @@ lra: |
138
|
137
|
tne trap_PseudoAtomic
|
139
|
138
|
|
140
|
139
|
/* Back to C we go. */
|
141
|
|
- ld [%sp+FRAMESIZE-4], %i7
|
|
140
|
+ ld [%sp + STACK_BIAS +FRAMESIZE-WORD_BYTES], %i7
|
142
|
141
|
ret
|
143
|
142
|
restore %sp, FRAMESIZE, %sp
|
144
|
143
|
SET_SIZE(call_into_lisp)
|
... |
... |
@@ -149,12 +148,12 @@ lra: |
149
|
148
|
FUNCDEF(call_into_c)
|
150
|
149
|
call_into_c:
|
151
|
150
|
#ifdef v8plus
|
152
|
|
- stx %o2, [%fp - 8 - 1*8]
|
153
|
|
- stx %o3, [%fp - 8 - 2*8]
|
154
|
|
- stx %o4, [%fp - 8 - 3*8]
|
155
|
|
- stx %o5, [%fp - 8 - 4*8]
|
156
|
|
- stx %o6, [%fp - 8 - 5*8]
|
157
|
|
- stx %o7, [%fp - 8 - 6*8]
|
|
151
|
+ stx %o2, [%fp + STACK_BIAS - 8 - 1*8]
|
|
152
|
+ stx %o3, [%fp + STACK_BIAS - 8 - 2*8]
|
|
153
|
+ stx %o4, [%fp + STACK_BIAS - 8 - 3*8]
|
|
154
|
+ stx %o5, [%fp + STACK_BIAS - 8 - 4*8]
|
|
155
|
+ stx %o6, [%fp + STACK_BIAS - 8 - 5*8]
|
|
156
|
+ stx %o7, [%fp + STACK_BIAS - 8 - 6*8]
|
158
|
157
|
#endif
|
159
|
158
|
/* Build a lisp stack frame */
|
160
|
159
|
mov reg_CFP, reg_OCFP
|
... |
... |
@@ -233,12 +232,12 @@ call_into_c: |
233
|
232
|
mov reg_OCFP, reg_CFP
|
234
|
233
|
|
235
|
234
|
#ifdef v8plus
|
236
|
|
- ldx [%fp - 8 - 1*8], %o2
|
237
|
|
- ldx [%fp - 8 - 2*8], %o3
|
238
|
|
- ldx [%fp - 8 - 3*8], %o4
|
239
|
|
- ldx [%fp - 8 - 4*8], %o5
|
240
|
|
- ldx [%fp - 8 - 5*8], %o6
|
241
|
|
- ldx [%fp - 8 - 6*8], %o7
|
|
235
|
+ ldx [%fp + STACK_BIAS - 8 - 1*8], %o2
|
|
236
|
+ ldx [%fp + STACK_BIAS - 8 - 2*8], %o3
|
|
237
|
+ ldx [%fp + STACK_BIAS - 8 - 3*8], %o4
|
|
238
|
+ ldx [%fp + STACK_BIAS - 8 - 4*8], %o5
|
|
239
|
+ ldx [%fp + STACK_BIAS - 8 - 5*8], %o6
|
|
240
|
+ ldx [%fp + STACK_BIAS - 8 - 6*8], %o7
|
242
|
241
|
#endif
|
243
|
242
|
/* And back into lisp. */
|
244
|
243
|
ret
|