1 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
3 From 5e756d4d8df2949cb3b6e51532d3016cbb276fd7 Mon Sep 17 00:00:00 2001
4 From: Ivan Maidanski <ivmai@mail.ru>
5 Date: Fri, 27 Feb 2015 21:32:22 +0300
6 Subject: [PATCH 004/135] Revert "Move asm machine-dependent files to 'src'
9 Asm files moved back to base folder to avoid build issues (reported
10 for NetBSD and Solaris on Sparc). Alternative way is to adjust
11 configure.ac and Makefile.am properly but it requires more efforts
14 * Makefile.am (EXTRA_libgc_la_SOURCES): Remove "src/" prefix.
15 * Makefile.direct (SRCS, mach_dep.o): Likewise.
16 * src/ia64_save_regs_in_stack.s: Move to base folder.
17 * src/sparc_mach_dep.S: Likewise.
18 * src/sparc_netbsd_mach_dep.s: Likewise.
19 * src/sparc_sunos4_mach_dep.s: Likewise.
23 Makefile.direct | 20 +++++++-------
24 ia64_save_regs_in_stack.s | 11 ++++++++
25 sparc_mach_dep.S | 61 +++++++++++++++++++++++++++++++++++++++++
26 sparc_netbsd_mach_dep.s | 34 +++++++++++++++++++++++
27 sparc_sunos4_mach_dep.s | 32 +++++++++++++++++++++
28 src/ia64_save_regs_in_stack.s | 11 --------
29 src/sparc_mach_dep.S | 61 -----------------------------------------
30 src/sparc_netbsd_mach_dep.s | 34 -----------------------
31 src/sparc_sunos4_mach_dep.s | 32 ---------------------
32 11 files changed, 151 insertions(+), 151 deletions(-)
33 create mode 100644 ia64_save_regs_in_stack.s
34 create mode 100644 sparc_mach_dep.S
35 create mode 100644 sparc_netbsd_mach_dep.s
36 create mode 100644 sparc_sunos4_mach_dep.s
37 delete mode 100644 src/ia64_save_regs_in_stack.s
38 delete mode 100644 src/sparc_mach_dep.S
39 delete mode 100644 src/sparc_netbsd_mach_dep.s
40 delete mode 100644 src/sparc_sunos4_mach_dep.s
42 diff --git a/Makefile.am b/Makefile.am
43 index f8057db..1688be2 100644
46 @@ -100,8 +100,8 @@ libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) $(ATOMIC_OPS_LIBS)
47 libgc_la_DEPENDENCIES = @addobjs@
48 libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:3:0 -no-undefined
50 -EXTRA_libgc_la_SOURCES = src/ia64_save_regs_in_stack.s src/sparc_mach_dep.S \
51 - src/sparc_netbsd_mach_dep.s src/sparc_sunos4_mach_dep.s
52 +EXTRA_libgc_la_SOURCES = ia64_save_regs_in_stack.s sparc_mach_dep.S \
53 + sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s
57 diff --git a/Makefile.direct b/Makefile.direct
58 index d64598b..8ab80e8 100644
61 @@ -108,8 +108,8 @@ SRCS= $(CSRCS) \
62 include/gc_config_macros.h include/private/pthread_support.h \
63 include/private/pthread_stop_world.h include/private/darwin_semaphore.h \
64 include/private/darwin_stop_world.h include/private/thread_local_alloc.h \
65 - src/ia64_save_regs_in_stack.s src/sparc_mach_dep.S \
66 - src/sparc_netbsd_mach_dep.s src/sparc_sunos4_mach_dep.s $(CORD_SRCS)
67 + ia64_save_regs_in_stack.s sparc_mach_dep.S \
68 + sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s $(CORD_SRCS)
70 DOC_FILES= README.QUICK TODO doc/README.Mac doc/README.OS2 \
71 doc/README.amiga doc/README.cords doc/debugging.html \
72 @@ -309,17 +309,17 @@ dyn_test:
73 # gcc -shared -Wl,-soname=libgc.so.0 -o libgc.so.0 $(LIBOBJS) dyn_load.lo
76 -mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/src/sparc_mach_dep.S \
77 - $(srcdir)/src/sparc_sunos4_mach_dep.s \
78 - $(srcdir)/src/ia64_save_regs_in_stack.s \
79 - $(srcdir)/src/sparc_netbsd_mach_dep.s $(UTILS)
80 +mach_dep.o: $(srcdir)/mach_dep.c $(srcdir)/sparc_mach_dep.S \
81 + $(srcdir)/sparc_sunos4_mach_dep.s \
82 + $(srcdir)/ia64_save_regs_in_stack.s \
83 + $(srcdir)/sparc_netbsd_mach_dep.s $(UTILS)
85 - ./if_mach SPARC SOLARIS $(CC) -c -o mach_dep2.o $(srcdir)/src/sparc_mach_dep.S
86 - ./if_mach SPARC OPENBSD $(AS) -o mach_dep2.o $(srcdir)/src/sparc_sunos4_mach_dep.s
87 - ./if_mach SPARC NETBSD $(AS) -o mach_dep2.o $(srcdir)/src/sparc_netbsd_mach_dep.s
88 + ./if_mach SPARC SOLARIS $(CC) -c -o mach_dep2.o $(srcdir)/sparc_mach_dep.S
89 + ./if_mach SPARC OPENBSD $(AS) -o mach_dep2.o $(srcdir)/sparc_sunos4_mach_dep.s
90 + ./if_mach SPARC NETBSD $(AS) -o mach_dep2.o $(srcdir)/sparc_netbsd_mach_dep.s
91 ./if_mach SPARC "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
92 ./if_mach SPARC "" ld -r -o mach_dep.o mach_dep1.o mach_dep2.o
93 - ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.o $(srcdir)/src/ia64_save_regs_in_stack.s
94 + ./if_mach IA64 "" as $(AS_ABI_FLAG) -o ia64_save_regs_in_stack.o $(srcdir)/ia64_save_regs_in_stack.s
95 ./if_mach IA64 "" $(CC) -c -o mach_dep1.o $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
96 ./if_mach IA64 "" ld -r -o mach_dep.o mach_dep1.o ia64_save_regs_in_stack.o
97 ./if_not_there mach_dep.o $(CC) -c $(SPECIALCFLAGS) $(srcdir)/mach_dep.c
98 diff --git a/ia64_save_regs_in_stack.s b/ia64_save_regs_in_stack.s
100 index 0000000..2b81edf
102 +++ b/ia64_save_regs_in_stack.s
106 + .global GC_save_regs_in_stack
107 + .proc GC_save_regs_in_stack
108 +GC_save_regs_in_stack:
114 + .endp GC_save_regs_in_stack
115 diff --git a/sparc_mach_dep.S b/sparc_mach_dep.S
117 index 0000000..d204dc4
119 +++ b/sparc_mach_dep.S
121 +! SPARCompiler 3.0 and later apparently no longer handles
122 +! asm outside functions. So we need a separate .s file
123 +! This is only set up for SunOS 5, not SunOS 4.
124 +! Assumes this is called before the stack contents are
128 + .globl GC_save_regs_in_stack
129 +GC_save_regs_in_stack:
130 +#if defined(__arch64__) || defined(__sparcv9)
134 + restore %sp,2047+128,%o0
135 +#else /* 32 bit SPARC */
136 + ta 0x3 ! ST_FLUSH_WINDOWS
140 +#endif /* 32 bit SPARC */
141 +.GC_save_regs_in_stack_end:
142 + .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
144 +! GC_clear_stack_inner(arg, limit) clears stack area up to limit and
145 +! returns arg. Stack clearing is crucial on SPARC, so we supply
146 +! an assembly version that s more careful. Assumes limit is hotter
147 +! than sp, and limit is 8 byte aligned.
148 + .globl GC_clear_stack_inner
149 +GC_clear_stack_inner:
150 +#if defined(__arch64__) || defined(__sparcv9)
151 + mov %sp,%o2 ! Save sp
152 + add %sp,2047-8,%o3 ! p = sp+bias-8
153 + add %o1,-2047-192,%sp ! Move sp out of the way,
154 + ! so that traps still work.
155 + ! Includes some extra words
156 + ! so we can be sloppy below.
158 + stx %g0,[%o3] ! *(long *)p = 0
160 + bgu,pt %xcc, loop ! if (p > limit) goto loop
161 + add %o3,-8,%o3 ! p -= 8 (delay slot)
163 + mov %o2,%sp ! Restore sp., delay slot
164 +#else /* 32 bit SPARC */
165 + mov %sp,%o2 ! Save sp
166 + add %sp,-8,%o3 ! p = sp-8
167 + clr %g1 ! [g0,g1] = 0
168 + add %o1,-0x60,%sp ! Move sp out of the way,
169 + ! so that traps still work.
170 + ! Includes some extra words
171 + ! so we can be sloppy below.
173 + std %g0,[%o3] ! *(long long *)p = 0
175 + bgu loop ! if (p > limit) goto loop
176 + add %o3,-8,%o3 ! p -= 8 (delay slot)
178 + mov %o2,%sp ! Restore sp., delay slot
179 +#endif /* 32 bit SPARC */
180 +.GC_clear_stack_inner_end:
181 + .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner
182 diff --git a/sparc_netbsd_mach_dep.s b/sparc_netbsd_mach_dep.s
184 index 0000000..14feb15
186 +++ b/sparc_netbsd_mach_dep.s
188 +! SPARCompiler 3.0 and later apparently no longer handles
189 +! asm outside functions. So we need a separate .s file
190 +! This is only set up for SunOS 4.
191 +! Assumes this is called before the stack contents are
194 +#include "machine/asm.h"
197 + .globl _C_LABEL(GC_save_regs_in_stack)
198 + .globl _C_LABEL(GC_push_regs)
199 +_C_LABEL(GC_save_regs_in_stack):
200 +_C_LABEL(GC_push_regs):
201 + ta 0x3 ! ST_FLUSH_WINDOWS
206 + .globl _C_LABEL(GC_clear_stack_inner)
207 +_C_LABEL(GC_clear_stack_inner):
208 + mov %sp,%o2 ! Save sp
209 + add %sp,-8,%o3 ! p = sp-8
210 + clr %g1 ! [g0,g1] = 0
211 + add %o1,-0x60,%sp ! Move sp out of the way,
212 + ! so that traps still work.
213 + ! Includes some extra words
214 + ! so we can be sloppy below.
216 + std %g0,[%o3] ! *(long long *)p = 0
218 + bgu loop ! if (p > limit) goto loop
219 + add %o3,-8,%o3 ! p -= 8 (delay slot)
221 + mov %o2,%sp ! Restore sp., delay slot
222 diff --git a/sparc_sunos4_mach_dep.s b/sparc_sunos4_mach_dep.s
224 index 0000000..923f5ea
226 +++ b/sparc_sunos4_mach_dep.s
228 +! SPARCompiler 3.0 and later apparently no longer handles
229 +! asm outside functions. So we need a separate .s file
230 +! This is only set up for SunOS 4.
231 +! Assumes this is called before the stack contents are
235 + .globl _GC_save_regs_in_stack
236 + .globl _GC_push_regs
237 +_GC_save_regs_in_stack:
239 + ta 0x3 ! ST_FLUSH_WINDOWS
244 + .globl _GC_clear_stack_inner
245 +_GC_clear_stack_inner:
246 + mov %sp,%o2 ! Save sp
247 + add %sp,-8,%o3 ! p = sp-8
248 + clr %g1 ! [g0,g1] = 0
249 + add %o1,-0x60,%sp ! Move sp out of the way,
250 + ! so that traps still work.
251 + ! Includes some extra words
252 + ! so we can be sloppy below.
254 + std %g0,[%o3] ! *(long long *)p = 0
256 + bgu loop ! if (p > limit) goto loop
257 + add %o3,-8,%o3 ! p -= 8 (delay slot)
259 + mov %o2,%sp ! Restore sp., delay slot
260 diff --git a/src/ia64_save_regs_in_stack.s b/src/ia64_save_regs_in_stack.s
261 deleted file mode 100644
262 index 2b81edf..0000000
263 --- a/src/ia64_save_regs_in_stack.s
268 - .global GC_save_regs_in_stack
269 - .proc GC_save_regs_in_stack
270 -GC_save_regs_in_stack:
276 - .endp GC_save_regs_in_stack
277 diff --git a/src/sparc_mach_dep.S b/src/sparc_mach_dep.S
278 deleted file mode 100644
279 index d204dc4..0000000
280 --- a/src/sparc_mach_dep.S
283 -! SPARCompiler 3.0 and later apparently no longer handles
284 -! asm outside functions. So we need a separate .s file
285 -! This is only set up for SunOS 5, not SunOS 4.
286 -! Assumes this is called before the stack contents are
290 - .globl GC_save_regs_in_stack
291 -GC_save_regs_in_stack:
292 -#if defined(__arch64__) || defined(__sparcv9)
296 - restore %sp,2047+128,%o0
297 -#else /* 32 bit SPARC */
298 - ta 0x3 ! ST_FLUSH_WINDOWS
302 -#endif /* 32 bit SPARC */
303 -.GC_save_regs_in_stack_end:
304 - .size GC_save_regs_in_stack,.GC_save_regs_in_stack_end-GC_save_regs_in_stack
306 -! GC_clear_stack_inner(arg, limit) clears stack area up to limit and
307 -! returns arg. Stack clearing is crucial on SPARC, so we supply
308 -! an assembly version that s more careful. Assumes limit is hotter
309 -! than sp, and limit is 8 byte aligned.
310 - .globl GC_clear_stack_inner
311 -GC_clear_stack_inner:
312 -#if defined(__arch64__) || defined(__sparcv9)
313 - mov %sp,%o2 ! Save sp
314 - add %sp,2047-8,%o3 ! p = sp+bias-8
315 - add %o1,-2047-192,%sp ! Move sp out of the way,
316 - ! so that traps still work.
317 - ! Includes some extra words
318 - ! so we can be sloppy below.
320 - stx %g0,[%o3] ! *(long *)p = 0
322 - bgu,pt %xcc, loop ! if (p > limit) goto loop
323 - add %o3,-8,%o3 ! p -= 8 (delay slot)
325 - mov %o2,%sp ! Restore sp., delay slot
326 -#else /* 32 bit SPARC */
327 - mov %sp,%o2 ! Save sp
328 - add %sp,-8,%o3 ! p = sp-8
329 - clr %g1 ! [g0,g1] = 0
330 - add %o1,-0x60,%sp ! Move sp out of the way,
331 - ! so that traps still work.
332 - ! Includes some extra words
333 - ! so we can be sloppy below.
335 - std %g0,[%o3] ! *(long long *)p = 0
337 - bgu loop ! if (p > limit) goto loop
338 - add %o3,-8,%o3 ! p -= 8 (delay slot)
340 - mov %o2,%sp ! Restore sp., delay slot
341 -#endif /* 32 bit SPARC */
342 -.GC_clear_stack_inner_end:
343 - .size GC_clear_stack_inner,.GC_clear_stack_inner_end-GC_clear_stack_inner
344 diff --git a/src/sparc_netbsd_mach_dep.s b/src/sparc_netbsd_mach_dep.s
345 deleted file mode 100644
346 index 14feb15..0000000
347 --- a/src/sparc_netbsd_mach_dep.s
350 -! SPARCompiler 3.0 and later apparently no longer handles
351 -! asm outside functions. So we need a separate .s file
352 -! This is only set up for SunOS 4.
353 -! Assumes this is called before the stack contents are
356 -#include "machine/asm.h"
359 - .globl _C_LABEL(GC_save_regs_in_stack)
360 - .globl _C_LABEL(GC_push_regs)
361 -_C_LABEL(GC_save_regs_in_stack):
362 -_C_LABEL(GC_push_regs):
363 - ta 0x3 ! ST_FLUSH_WINDOWS
368 - .globl _C_LABEL(GC_clear_stack_inner)
369 -_C_LABEL(GC_clear_stack_inner):
370 - mov %sp,%o2 ! Save sp
371 - add %sp,-8,%o3 ! p = sp-8
372 - clr %g1 ! [g0,g1] = 0
373 - add %o1,-0x60,%sp ! Move sp out of the way,
374 - ! so that traps still work.
375 - ! Includes some extra words
376 - ! so we can be sloppy below.
378 - std %g0,[%o3] ! *(long long *)p = 0
380 - bgu loop ! if (p > limit) goto loop
381 - add %o3,-8,%o3 ! p -= 8 (delay slot)
383 - mov %o2,%sp ! Restore sp., delay slot
384 diff --git a/src/sparc_sunos4_mach_dep.s b/src/sparc_sunos4_mach_dep.s
385 deleted file mode 100644
386 index 923f5ea..0000000
387 --- a/src/sparc_sunos4_mach_dep.s
390 -! SPARCompiler 3.0 and later apparently no longer handles
391 -! asm outside functions. So we need a separate .s file
392 -! This is only set up for SunOS 4.
393 -! Assumes this is called before the stack contents are
397 - .globl _GC_save_regs_in_stack
398 - .globl _GC_push_regs
399 -_GC_save_regs_in_stack:
401 - ta 0x3 ! ST_FLUSH_WINDOWS
406 - .globl _GC_clear_stack_inner
407 -_GC_clear_stack_inner:
408 - mov %sp,%o2 ! Save sp
409 - add %sp,-8,%o3 ! p = sp-8
410 - clr %g1 ! [g0,g1] = 0
411 - add %o1,-0x60,%sp ! Move sp out of the way,
412 - ! so that traps still work.
413 - ! Includes some extra words
414 - ! so we can be sloppy below.
416 - std %g0,[%o3] ! *(long long *)p = 0
418 - bgu loop ! if (p > limit) goto loop
419 - add %o3,-8,%o3 ! p -= 8 (delay slot)
421 - mov %o2,%sp ! Restore sp., delay slot