2001-06-20 Alexandre Petit-Bianco <apbianco@redhat.com>
[official-gcc.git] / boehm-gc / powerpc_macosx_mach_dep.s
blobfad41d1c661266d64ef3f51a67eedec9054c40e3
1 .text
3 .set linkageArea,24
4 .set params,4
5 .set alignment,4
7 .set spaceToSave,linkageArea+params+alignment
8 .set spaceToSave8,spaceToSave+8
10 ; Mark from machine registers that are saved by C compiler
11 .globl _GC_push_regs
12 _GC_push_regs:
13 ; PROLOG
14 mflr r0 ; get return address
15 stw r0,8(r1) ; save return address
16 stwu r1,-spaceToSave(r1) ; skip over caller save area
18 mr r3,r2 ; mark from r2. Well I'm not really sure
19 ; that this is necessary or even the right
20 ; thing to do - at least it doesn't harm...
21 ; According to Apple's docs it points to
22 ; the direct data area, whatever that is...
23 bl _GC_push_one
24 mr r3,r13 ; mark from r13-r31
25 bl _GC_push_one
26 mr r3,r14
27 bl _GC_push_one
28 mr r3,r15
29 bl _GC_push_one
30 mr r3,r16
31 bl _GC_push_one
32 mr r3,r17
33 bl _GC_push_one
34 mr r3,r18
35 bl _GC_push_one
36 mr r3,r19
37 bl _GC_push_one
38 mr r3,r20
39 bl _GC_push_one
40 mr r3,r21
41 bl _GC_push_one
42 mr r3,r22
43 bl _GC_push_one
44 mr r3,r23
45 bl _GC_push_one
46 mr r3,r24
47 bl _GC_push_one
48 mr r3,r25
49 bl _GC_push_one
50 mr r3,r26
51 bl _GC_push_one
52 mr r3,r27
53 bl _GC_push_one
54 mr r3,r28
55 bl _GC_push_one
56 mr r3,r29
57 bl _GC_push_one
58 mr r3,r30
59 bl _GC_push_one
60 mr r3,r31
61 bl _GC_push_one
62 ; EPILOG
63 lwz r0,spaceToSave8(r1) ; get return address back
64 mtlr r0 ; reset link register
65 addic r1,r1,spaceToSave ; restore stack pointer
66 blr