6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
|
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
From 5e756d4d8df2949cb3b6e51532d3016cbb276fd7 Mon Sep 17 00:00:00 2001
From: Ivan Maidanski <ivmai@mail.ru>
Date: Fri, 27 Feb 2015 21:32:22 +0300
Subject: [PATCH 004/135] Revert "Move asm machine-dependent files to 'src'
folder" (partly)
Asm files moved back to base folder to avoid build issues (reported
for NetBSD and Solaris on Sparc). Alternative way is to adjust
configure.ac and Makefile.am properly but it requires more efforts
(including testing).
* Makefile.am (EXTRA_libgc_la_SOURCES): Remove "src/" prefix.
* Makefile.direct (SRCS, mach_dep.o): Likewise.
* src/ia64_save_regs_in_stack.s: Move to base folder.
* src/sparc_mach_dep.S: Likewise.
* src/sparc_netbsd_mach_dep.s: Likewise.
* src/sparc_sunos4_mach_dep.s: Likewise.
---
Makefile.am | 4 +--
Makefile.direct | 20 +++++++-------
ia64_save_regs_in_stack.s | 11 ++++++++
sparc_mach_dep.S | 61 +++++++++++++++++++++++++++++++++++++++++
sparc_netbsd_mach_dep.s | 34 +++++++++++++++++++++++
sparc_sunos4_mach_dep.s | 32 +++++++++++++++++++++
src/ia64_save_regs_in_stack.s | 11 --------
src/sparc_mach_dep.S | 61 -----------------------------------------
src/sparc_netbsd_mach_dep.s | 34 -----------------------
src/sparc_sunos4_mach_dep.s | 32 ---------------------
11 files changed, 151 insertions(+), 151 deletions(-)
create mode 100644 ia64_save_regs_in_stack.s
create mode 100644 sparc_mach_dep.S
create mode 100644 sparc_netbsd_mach_dep.s
create mode 100644 sparc_sunos4_mach_dep.s
delete mode 100644 src/ia64_save_regs_in_stack.s
delete mode 100644 src/sparc_mach_dep.S
delete mode 100644 src/sparc_netbsd_mach_dep.s
delete mode 100644 src/sparc_sunos4_mach_dep.s
diff --git a/Makefile.am b/Makefile.am
index f8057db..1688be2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -100,8 +100,8 @@ libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) $(ATOMIC_OPS_LIBS)
libgc_la_DEPENDENCIES = @addobjs@
libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:3:0 -no-undefined
-EXTRA_libgc_la_SOURCES = src/ia64_save_regs_in_stack.s src/sparc_mach_dep.S \
- src/sparc_netbsd_mach_dep.s src/sparc_sunos4_mach_dep.s
+EXTRA_libgc_la_SOURCES = ia64_save_regs_in_stack.s sparc_mach_dep.S \
+ sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s
# C++ Interface
diff --git a/Makefile.direct b/Makefile.direct
index d64598b..8ab80e8 100644
--- a/Makefile.direct
+++ b/Makefile.direct
@@ -108,8 +108,8 @@ SRCS= $(CSRCS) \
include/gc_config_macros.h include/private/pthread_support.h \
include/private/pthread_stop_world.h include/private/darwin_semaphore.h \
include/private/darwin_stop_world.h include/private/thread_local_alloc.h \
- src/ia64_save_regs_in_stack.s src/sparc_mach_dep.S \
- src/sparc_netbsd_mach_dep.s src/sparc_sunos4_mach_dep.s $(CORD_SRCS)
+ ia64_save_regs_in_stack.s sparc_mach_dep.S \
+ sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s $(CORD_SRCS)
DOC_FILES= README.QUICK TODO doc/README.Mac doc/README.OS2 \
doc/README.amiga doc/README.cords doc/debugging.html \
@@ -309,17 +309,17 @@ dyn_test:
# gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo
# touch liblinuxgc.so
-mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/src/sparc_mach_dep.S \
- $(srcdir)/src/sparc_sunos4_mach_dep.s \
- $(srcdir)/src/ia64_save_regs_in_stack.s \
- $(srcdir)/src/sparc_netbsd_mach_dep.s $(UTILS)
+mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/sparc_mach_dep.S \
+ $(srcdir)/sparc_sunos4_mach_dep.s \
+ $(srcdir)/ia64_save_regs_in_stack.s \
+ $(srcdir)/sparc_netbsd_mach_dep.s $(UTILS)
rm -f mach_dep.o
- ./if_mach SPARC SOLARIS $(CC) -c -o mach_dep2.o $(srcdir)/src/sparc_mach_dep.S
- ./if_mach SPARC OPENBSD $(AS) -o mach_dep2.o $(srcdir)/src/sparc_sunos4_mach_dep.s
- ./if_mach SPARC NETBSD $(AS) -o mach_dep2.o $(srcdir)/src/sparc_netbsd_mach_dep.s
+ ./if_mach SPARC SOLARIS $(CC) -c -o mach_dep2.o $(srcdir)/sparc_mach_dep.S
+ ./if_mach SPARC OPENBSD $(AS) -o mach_dep2.o $(srcdir)/sparc_sunos4_mach_dep.s
+ ./if_mach SPARC NETBSD $(AS) -o mach_dep2.o $(srcdir)/sparc_netbsd_mach_dep.s
./if_mach SPARC "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
./if_mach SPARC "" ld -r -o mach_dep.o mach_dep1.o mach_dep2.o
- ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.o $(srcdir)/src/ia64_save_regs_in_stack.s
+ ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.o $(srcdir)/ia64_save_regs_in_stack.s
./if_mach IA64 "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
./if_mach IA64 "" ld -r -o mach_dep.o mach_dep1.o ia64_save_regs_in_stack.o
./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
diff --git a/ia64_save_regs_in_stack.s b/ia64_save_regs_in_stack.s
new file mode 100644
index 0000000..2b81edf
--- /dev/null
+++ b/ia64_save_regs_in_stack.s
@@ -0,0 +1,11 @@
+ .text
+ .align 16
+ .global GC_save_regs_in_stack
+ .proc GC_save_regs_in_stack
+GC_save_regs_in_stack:
+ .body
+ flushrs
+ ;;
+ mov r8=ar.bsp
+ br.ret.sptk.few rp
+ .endp GC_save_regs_in_stack
diff --git a/sparc_mach_dep.S b/sparc_mach_dep.S
new file mode 100644
index 0000000..d204dc4
--- /dev/null
+++ b/sparc_mach_dep.S
@@ -0,0 +1,61 @@
+! SPARCompiler 3.0 and later apparently no longer handles
+! asm outside functions. So we need a separate .s file
+! This is only set up for SunOS 5, not SunOS 4.
+! Assumes this is called before the stack contents are
+! examined.
+
+ .seg "text"
+ .globl GC_save_regs_in_stack
+GC_save_regs_in_stack:
+#if defined(__arch64__) || defined(__sparcv9)
+ save %sp,-128,%sp
+ flushw
+ ret
+ restore %sp,2047+128,%o0
+#else /* 32 bit SPARC */
+ ta 0x3 ! ST_FLUSH_WINDOWS
+ mov %sp,%o0
+ retl
+ nop
+#endif /* 32 bit SPARC */
+.GC_save_regs_in_stack_end:
+ .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
+
+! GC_clear_stack_inner(arg, limit) clears stack area up to limit and
+! returns arg. Stack clearing is crucial on SPARC, so we supply
+! an assembly version that s more careful. Assumes limit is hotter
+! than sp, and limit is 8 byte aligned.
+ .globl GC_clear_stack_inner
+GC_clear_stack_inner:
+#if defined(__arch64__) || defined(__sparcv9)
+ mov %sp,%o2 ! Save sp
+ add %sp,2047-8,%o3 ! p = sp+bias-8
+ add %o1,-2047-192,%sp ! Move sp out of the way,
+ ! so that traps still work.
+ ! Includes some extra words
+ ! so we can be sloppy below.
+loop:
+ stx %g0,[%o3] ! *(long *)p = 0
+ cmp %o3,%o1
+ bgu,pt %xcc, loop ! if (p > limit) goto loop
+ add %o3,-8,%o3 ! p -= 8 (delay slot)
+ retl
+ mov %o2,%sp ! Restore sp., delay slot
+#else /* 32 bit SPARC */
+ mov %sp,%o2 ! Save sp
+ add %sp,-8,%o3 ! p = sp-8
+ clr %g1 ! [g0,g1] = 0
+ add %o1,-0x60,%sp ! Move sp out of the way,
+ ! so that traps still work.
+ ! Includes some extra words
+ ! so we can be sloppy below.
+loop:
+ std %g0,[%o3] ! *(long long *)p = 0
+ cmp %o3,%o1
+ bgu loop ! if (p > limit) goto loop
+ add %o3,-8,%o3 ! p -= 8 (delay slot)
+ retl
+ mov %o2,%sp ! Restore sp., delay slot
+#endif /* 32 bit SPARC */
+.GC_clear_stack_inner_end:
+ .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner
diff --git a/sparc_netbsd_mach_dep.s b/sparc_netbsd_mach_dep.s
new file mode 100644
index 0000000..14feb15
--- /dev/null
+++ b/sparc_netbsd_mach_dep.s
@@ -0,0 +1,34 @@
+! SPARCompiler 3.0 and later apparently no longer handles
+! asm outside functions. So we need a separate .s file
+! This is only set up for SunOS 4.
+! Assumes this is called before the stack contents are
+! examined.
+
+#include "machine/asm.h"
+
+ .seg "text"
+ .globl _C_LABEL(GC_save_regs_in_stack)
+ .globl _C_LABEL(GC_push_regs)
+_C_LABEL(GC_save_regs_in_stack):
+_C_LABEL(GC_push_regs):
+ ta 0x3 ! ST_FLUSH_WINDOWS
+ mov %sp,%o0
+ retl
+ nop
+
+ .globl _C_LABEL(GC_clear_stack_inner)
+_C_LABEL(GC_clear_stack_inner):
+ mov %sp,%o2 ! Save sp
+ add %sp,-8,%o3 ! p = sp-8
+ clr %g1 ! [g0,g1] = 0
+ add %o1,-0x60,%sp ! Move sp out of the way,
+ ! so that traps still work.
+ ! Includes some extra words
+ ! so we can be sloppy below.
+loop:
+ std %g0,[%o3] ! *(long long *)p = 0
+ cmp %o3,%o1
+ bgu loop ! if (p > limit) goto loop
+ add %o3,-8,%o3 ! p -= 8 (delay slot)
+ retl
+ mov %o2,%sp ! Restore sp., delay slot
diff --git a/sparc_sunos4_mach_dep.s b/sparc_sunos4_mach_dep.s
new file mode 100644
index 0000000..923f5ea
--- /dev/null
+++ b/sparc_sunos4_mach_dep.s
@@ -0,0 +1,32 @@
+! SPARCompiler 3.0 and later apparently no longer handles
+! asm outside functions. So we need a separate .s file
+! This is only set up for SunOS 4.
+! Assumes this is called before the stack contents are
+! examined.
+
+ .seg "text"
+ .globl _GC_save_regs_in_stack
+ .globl _GC_push_regs
+_GC_save_regs_in_stack:
+_GC_push_regs:
+ ta 0x3 ! ST_FLUSH_WINDOWS
+ mov %sp,%o0
+ retl
+ nop
+
+ .globl _GC_clear_stack_inner
+_GC_clear_stack_inner:
+ mov %sp,%o2 ! Save sp
+ add %sp,-8,%o3 ! p = sp-8
+ clr %g1 ! [g0,g1] = 0
+ add %o1,-0x60,%sp ! Move sp out of the way,
+ ! so that traps still work.
+ ! Includes some extra words
+ ! so we can be sloppy below.
+loop:
+ std %g0,[%o3] ! *(long long *)p = 0
+ cmp %o3,%o1
+ bgu loop ! if (p > limit) goto loop
+ add %o3,-8,%o3 ! p -= 8 (delay slot)
+ retl
+ mov %o2,%sp ! Restore sp., delay slot
diff --git a/src/ia64_save_regs_in_stack.s b/src/ia64_save_regs_in_stack.s
deleted file mode 100644
index 2b81edf..0000000
--- a/src/ia64_save_regs_in_stack.s
+++ /dev/null
@@ -1,11 +0,0 @@
- .text
- .align 16
- .global GC_save_regs_in_stack
- .proc GC_save_regs_in_stack
-GC_save_regs_in_stack:
- .body
- flushrs
- ;;
- mov r8=ar.bsp
- br.ret.sptk.few rp
- .endp GC_save_regs_in_stack
diff --git a/src/sparc_mach_dep.S b/src/sparc_mach_dep.S
deleted file mode 100644
index d204dc4..0000000
--- a/src/sparc_mach_dep.S
+++ /dev/null
@@ -1,61 +0,0 @@
-! SPARCompiler 3.0 and later apparently no longer handles
-! asm outside functions. So we need a separate .s file
-! This is only set up for SunOS 5, not SunOS 4.
-! Assumes this is called before the stack contents are
-! examined.
-
- .seg "text"
- .globl GC_save_regs_in_stack
-GC_save_regs_in_stack:
-#if defined(__arch64__) || defined(__sparcv9)
- save %sp,-128,%sp
- flushw
- ret
- restore %sp,2047+128,%o0
-#else /* 32 bit SPARC */
- ta 0x3 ! ST_FLUSH_WINDOWS
- mov %sp,%o0
- retl
- nop
-#endif /* 32 bit SPARC */
-.GC_save_regs_in_stack_end:
- .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
-
-! GC_clear_stack_inner(arg, limit) clears stack area up to limit and
-! returns arg. Stack clearing is crucial on SPARC, so we supply
-! an assembly version that s more careful. Assumes limit is hotter
-! than sp, and limit is 8 byte aligned.
- .globl GC_clear_stack_inner
-GC_clear_stack_inner:
-#if defined(__arch64__) || defined(__sparcv9)
- mov %sp,%o2 ! Save sp
- add %sp,2047-8,%o3 ! p = sp+bias-8
- add %o1,-2047-192,%sp ! Move sp out of the way,
- ! so that traps still work.
- ! Includes some extra words
- ! so we can be sloppy below.
-loop:
- stx %g0,[%o3] ! *(long *)p = 0
- cmp %o3,%o1
- bgu,pt %xcc, loop ! if (p > limit) goto loop
- add %o3,-8,%o3 ! p -= 8 (delay slot)
- retl
- mov %o2,%sp ! Restore sp., delay slot
-#else /* 32 bit SPARC */
- mov %sp,%o2 ! Save sp
- add %sp,-8,%o3 ! p = sp-8
- clr %g1 ! [g0,g1] = 0
- add %o1,-0x60,%sp ! Move sp out of the way,
- ! so that traps still work.
- ! Includes some extra words
- ! so we can be sloppy below.
-loop:
- std %g0,[%o3] ! *(long long *)p = 0
- cmp %o3,%o1
- bgu loop ! if (p > limit) goto loop
- add %o3,-8,%o3 ! p -= 8 (delay slot)
- retl
- mov %o2,%sp ! Restore sp., delay slot
-#endif /* 32 bit SPARC */
-.GC_clear_stack_inner_end:
- .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner
diff --git a/src/sparc_netbsd_mach_dep.s b/src/sparc_netbsd_mach_dep.s
deleted file mode 100644
index 14feb15..0000000
--- a/src/sparc_netbsd_mach_dep.s
+++ /dev/null
@@ -1,34 +0,0 @@
-! SPARCompiler 3.0 and later apparently no longer handles
-! asm outside functions. So we need a separate .s file
-! This is only set up for SunOS 4.
-! Assumes this is called before the stack contents are
-! examined.
-
-#include "machine/asm.h"
-
- .seg "text"
- .globl _C_LABEL(GC_save_regs_in_stack)
- .globl _C_LABEL(GC_push_regs)
-_C_LABEL(GC_save_regs_in_stack):
-_C_LABEL(GC_push_regs):
- ta 0x3 ! ST_FLUSH_WINDOWS
- mov %sp,%o0
- retl
- nop
-
- .globl _C_LABEL(GC_clear_stack_inner)
-_C_LABEL(GC_clear_stack_inner):
- mov %sp,%o2 ! Save sp
- add %sp,-8,%o3 ! p = sp-8
- clr %g1 ! [g0,g1] = 0
- add %o1,-0x60,%sp ! Move sp out of the way,
- ! so that traps still work.
- ! Includes some extra words
- ! so we can be sloppy below.
-loop:
- std %g0,[%o3] ! *(long long *)p = 0
- cmp %o3,%o1
- bgu loop ! if (p > limit) goto loop
- add %o3,-8,%o3 ! p -= 8 (delay slot)
- retl
- mov %o2,%sp ! Restore sp., delay slot
diff --git a/src/sparc_sunos4_mach_dep.s b/src/sparc_sunos4_mach_dep.s
deleted file mode 100644
index 923f5ea..0000000
--- a/src/sparc_sunos4_mach_dep.s
+++ /dev/null
@@ -1,32 +0,0 @@
-! SPARCompiler 3.0 and later apparently no longer handles
-! asm outside functions. So we need a separate .s file
-! This is only set up for SunOS 4.
-! Assumes this is called before the stack contents are
-! examined.
-
- .seg "text"
- .globl _GC_save_regs_in_stack
- .globl _GC_push_regs
-_GC_save_regs_in_stack:
-_GC_push_regs:
- ta 0x3 ! ST_FLUSH_WINDOWS
- mov %sp,%o0
- retl
- nop
-
- .globl _GC_clear_stack_inner
-_GC_clear_stack_inner:
- mov %sp,%o2 ! Save sp
- add %sp,-8,%o3 ! p = sp-8
- clr %g1 ! [g0,g1] = 0
- add %o1,-0x60,%sp ! Move sp out of the way,
- ! so that traps still work.
- ! Includes some extra words
- ! so we can be sloppy below.
-loop:
- std %g0,[%o3] ! *(long long *)p = 0
- cmp %o3,%o1
- bgu loop ! if (p > limit) goto loop
- add %o3,-8,%o3 ! p -= 8 (delay slot)
- retl
- mov %o2,%sp ! Restore sp., delay slot
--
1.7.10.4
|