board/csky: fixup gdb instructions in readme.txt
[buildroot-gz.git] / package / bdwgc / 0003-Revert-Move-asm-machine-dependent-files-to-src-folde.patch
blob03af6a39908ca2efca84e1fa938cbd605997076e
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'
7 folder" (partly)
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
12 (including testing).
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.
21 ---
22 Makefile.am | 4 +--
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
44 --- a/Makefile.am
45 +++ b/Makefile.am
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
56 # C++ Interface
57 diff --git a/Makefile.direct b/Makefile.direct
58 index d64598b..8ab80e8 100644
59 --- a/Makefile.direct
60 +++ b/Makefile.direct
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
74 # touch liblinuxgc.so
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)
84 rm -f mach_dep.o
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
99 new file mode 100644
100 index 0000000..2b81edf
101 --- /dev/null
102 +++ b/ia64_save_regs_in_stack.s
103 @@ -0,0 +1,11 @@
104 + .text
105 + .align 16
106 + .global GC_save_regs_in_stack
107 + .proc GC_save_regs_in_stack
108 +GC_save_regs_in_stack:
109 + .body
110 + flushrs
111 + ;;
112 + mov r8=ar.bsp
113 + br.ret.sptk.few rp
114 + .endp GC_save_regs_in_stack
115 diff --git a/sparc_mach_dep.S b/sparc_mach_dep.S
116 new file mode 100644
117 index 0000000..d204dc4
118 --- /dev/null
119 +++ b/sparc_mach_dep.S
120 @@ -0,0 +1,61 @@
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
125 +! examined.
127 + .seg "text"
128 + .globl GC_save_regs_in_stack
129 +GC_save_regs_in_stack:
130 +#if defined(__arch64__) || defined(__sparcv9)
131 + save %sp,-128,%sp
132 + flushw
133 + ret
134 + restore %sp,2047+128,%o0
135 +#else /* 32 bit SPARC */
136 + ta 0x3 ! ST_FLUSH_WINDOWS
137 + mov %sp,%o0
138 + retl
139 + nop
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.
157 +loop:
158 + stx %g0,[%o3] ! *(long *)p = 0
159 + cmp %o3,%o1
160 + bgu,pt %xcc, loop ! if (p > limit) goto loop
161 + add %o3,-8,%o3 ! p -= 8 (delay slot)
162 + retl
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.
172 +loop:
173 + std %g0,[%o3] ! *(long long *)p = 0
174 + cmp %o3,%o1
175 + bgu loop ! if (p > limit) goto loop
176 + add %o3,-8,%o3 ! p -= 8 (delay slot)
177 + retl
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
183 new file mode 100644
184 index 0000000..14feb15
185 --- /dev/null
186 +++ b/sparc_netbsd_mach_dep.s
187 @@ -0,0 +1,34 @@
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
192 +! examined.
194 +#include "machine/asm.h"
196 + .seg "text"
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
202 + mov %sp,%o0
203 + retl
204 + nop
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.
215 +loop:
216 + std %g0,[%o3] ! *(long long *)p = 0
217 + cmp %o3,%o1
218 + bgu loop ! if (p > limit) goto loop
219 + add %o3,-8,%o3 ! p -= 8 (delay slot)
220 + retl
221 + mov %o2,%sp ! Restore sp., delay slot
222 diff --git a/sparc_sunos4_mach_dep.s b/sparc_sunos4_mach_dep.s
223 new file mode 100644
224 index 0000000..923f5ea
225 --- /dev/null
226 +++ b/sparc_sunos4_mach_dep.s
227 @@ -0,0 +1,32 @@
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
232 +! examined.
234 + .seg "text"
235 + .globl _GC_save_regs_in_stack
236 + .globl _GC_push_regs
237 +_GC_save_regs_in_stack:
238 +_GC_push_regs:
239 + ta 0x3 ! ST_FLUSH_WINDOWS
240 + mov %sp,%o0
241 + retl
242 + nop
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.
253 +loop:
254 + std %g0,[%o3] ! *(long long *)p = 0
255 + cmp %o3,%o1
256 + bgu loop ! if (p > limit) goto loop
257 + add %o3,-8,%o3 ! p -= 8 (delay slot)
258 + retl
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
264 +++ /dev/null
265 @@ -1,11 +0,0 @@
266 - .text
267 - .align 16
268 - .global GC_save_regs_in_stack
269 - .proc GC_save_regs_in_stack
270 -GC_save_regs_in_stack:
271 - .body
272 - flushrs
273 - ;;
274 - mov r8=ar.bsp
275 - br.ret.sptk.few rp
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
281 +++ /dev/null
282 @@ -1,61 +0,0 @@
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
287 -! examined.
289 - .seg "text"
290 - .globl GC_save_regs_in_stack
291 -GC_save_regs_in_stack:
292 -#if defined(__arch64__) || defined(__sparcv9)
293 - save %sp,-128,%sp
294 - flushw
295 - ret
296 - restore %sp,2047+128,%o0
297 -#else /* 32 bit SPARC */
298 - ta 0x3 ! ST_FLUSH_WINDOWS
299 - mov %sp,%o0
300 - retl
301 - nop
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.
319 -loop:
320 - stx %g0,[%o3] ! *(long *)p = 0
321 - cmp %o3,%o1
322 - bgu,pt %xcc, loop ! if (p > limit) goto loop
323 - add %o3,-8,%o3 ! p -= 8 (delay slot)
324 - retl
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.
334 -loop:
335 - std %g0,[%o3] ! *(long long *)p = 0
336 - cmp %o3,%o1
337 - bgu loop ! if (p > limit) goto loop
338 - add %o3,-8,%o3 ! p -= 8 (delay slot)
339 - retl
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
348 +++ /dev/null
349 @@ -1,34 +0,0 @@
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
354 -! examined.
356 -#include "machine/asm.h"
358 - .seg "text"
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
364 - mov %sp,%o0
365 - retl
366 - nop
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.
377 -loop:
378 - std %g0,[%o3] ! *(long long *)p = 0
379 - cmp %o3,%o1
380 - bgu loop ! if (p > limit) goto loop
381 - add %o3,-8,%o3 ! p -= 8 (delay slot)
382 - retl
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
388 +++ /dev/null
389 @@ -1,32 +0,0 @@
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
394 -! examined.
396 - .seg "text"
397 - .globl _GC_save_regs_in_stack
398 - .globl _GC_push_regs
399 -_GC_save_regs_in_stack:
400 -_GC_push_regs:
401 - ta 0x3 ! ST_FLUSH_WINDOWS
402 - mov %sp,%o0
403 - retl
404 - nop
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.
415 -loop:
416 - std %g0,[%o3] ! *(long long *)p = 0
417 - cmp %o3,%o1
418 - bgu loop ! if (p > limit) goto loop
419 - add %o3,-8,%o3 ! p -= 8 (delay slot)
420 - retl
421 - mov %o2,%sp ! Restore sp., delay slot
423 1.7.10.4