diff --git a/Zend/asm/jump_ppc32_sysv_xcoff_gas.S b/Zend/asm/jump_ppc32_sysv_xcoff_gas.S index 5a967726add87..1854613d761c0 100644 --- a/Zend/asm/jump_ppc32_sysv_xcoff_gas.S +++ b/Zend/asm/jump_ppc32_sysv_xcoff_gas.S @@ -5,199 +5,212 @@ http://www.boost.org/LICENSE_1_0.txt) */ -/****************************************************** +/******************************************************* * * * ------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * - * ------------------------------------------------- * * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | * * ------------------------------------------------- * - * | F14 | F15 | F16 | F17 | * - * ------------------------------------------------- * + * |bchai| CR | LR |compl| link| TOC | R14 | R15 | * * ------------------------------------------------- * - * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * * ------------------------------------------------- * * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | * * ------------------------------------------------- * - * | F18 | F19 | F20 | F21 | * - * ------------------------------------------------- * + * | R16 | R17 | R18 | R19 | R20 | R21 | R22 | R23 | * * ------------------------------------------------- * - * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * * ------------------------------------------------- * * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | * * ------------------------------------------------- * - * | F22 | F23 | F24 | F25 | * - * ------------------------------------------------- * + * | R24 | R25 | R26 | R27 | R28 | R29 | R30 | R31 | * * ------------------------------------------------- * - * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * * ------------------------------------------------- * * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * * ------------------------------------------------- * - * | F26 | F27 | F28 | F29 | * - * ------------------------------------------------- * + * | F14 | F15 | F16 | F17 | * * ------------------------------------------------- * - * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * * ------------------------------------------------- * * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * * ------------------------------------------------- * - * | F30 | F31 | fpscr | R13 | R14 | * - * ------------------------------------------------- * + * | F18 | F19 | F20 | F21 | * * ------------------------------------------------- * - * | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | * * ------------------------------------------------- * * | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | * * ------------------------------------------------- * - * | R15 | R16 | R17 | R18 | R19 | R20 | R21 | R22 | * - * ------------------------------------------------- * + * | F22 | F23 | F24 | F25 | * * ------------------------------------------------- * - * | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | * * ------------------------------------------------- * * | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | * * ------------------------------------------------- * - * | R23 | R24 | R25 | R26 | R27 | R28 | R29 | R30 | * - * ------------------------------------------------- * + * | F26 | F27 | F28 | F29 | * * ------------------------------------------------- * - * | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | * * ------------------------------------------------- * * | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | * * ------------------------------------------------- * - * | R31 |hiddn| CR | LR | PC |bchai|linkr| FCTX| * - * ------------------------------------------------- * + * | F30 | F31 | PC |hiddn| fpscr | * * ------------------------------------------------- * - * | 64 | | * * ------------------------------------------------- * - * | 256 | | * + * | 256 | 260 | 264 | 268 | 272 | 276 | 280 | 284 | * * ------------------------------------------------- * - * | DATA| | * + * |bchai|savCR|savLR|compl| link|svTOC| FCTX| DATA| * * ------------------------------------------------- * * * *******************************************************/ -.globl .jump_fcontext -.globl jump_fcontext[DS] -.align 2 -.csect jump_fcontext[DS] + + .file "jump_ppc32_sysv_xcoff_gas.S" + .toc + .csect .text[PR], 5 + .globl jump_fcontext[DS] + .globl .jump_fcontext + .csect jump_fcontext[DS] jump_fcontext: - .long .jump_fcontext + .long .jump_fcontext[PR], TOC[tc0], 0 + .csect .text[PR], 5 .jump_fcontext: # reserve space on stack - subi r1, r1, 244 - - stfd f14, 0(r1) # save F14 - stfd f15, 8(r1) # save F15 - stfd f16, 16(r1) # save F16 - stfd f17, 24(r1) # save F17 - stfd f18, 32(r1) # save F18 - stfd f19, 40(r1) # save F19 - stfd f20, 48(r1) # save F20 - stfd f21, 56(r1) # save F21 - stfd f22, 64(r1) # save F22 - stfd f23, 72(r1) # save F23 - stfd f24, 80(r1) # save F24 - stfd f25, 88(r1) # save F25 - stfd f26, 96(r1) # save F26 - stfd f27, 104(r1) # save F27 - stfd f28, 112(r1) # save F28 - stfd f29, 120(r1) # save F29 - stfd f30, 128(r1) # save F30 - stfd f31, 136(r1) # save F31 - mffs f0 # load FPSCR - stfd f0, 144(r1) # save FPSCR - - stw r13, 152(r1) # save R13 - stw r14, 156(r1) # save R14 - stw r15, 160(r1) # save R15 - stw r16, 164(r1) # save R16 - stw r17, 168(r1) # save R17 - stw r18, 172(r1) # save R18 - stw r19, 176(r1) # save R19 - stw r20, 180(r1) # save R20 - stw r21, 184(r1) # save R21 - stw r22, 188(r1) # save R22 - stw r23, 192(r1) # save R23 - stw r24, 196(r1) # save R24 - stw r25, 200(r1) # save R25 - stw r26, 204(r1) # save R26 - stw r27, 208(r1) # save R27 - stw r28, 212(r1) # save R28 - stw r29, 216(r1) # save R29 - stw r30, 220(r1) # save R30 - stw r31, 224(r1) # save R31 - stw r3, 228(r1) # save hidden + subi 1, 1, 256 # save CR - mfcr r0 - stw r0, 232(r1) + mfcr 0 + stw 0, 4(1) # save LR - mflr r0 - stw r0, 236(r1) + mflr 0 + stw 0, 8(1) # save LR as PC - stw r0, 240(r1) + stw 0, 240(1) + # save TOC + stw 2, 20(1) + + # Save registers R14 to R31. + stw 14, 24(1) + stw 15, 28(1) + stw 16, 32(1) + stw 17, 36(1) + stw 18, 40(1) + stw 19, 44(1) + stw 20, 48(1) + stw 21, 52(1) + stw 22, 56(1) + stw 23, 60(1) + stw 24, 64(1) + stw 25, 68(1) + stw 26, 72(1) + stw 27, 76(1) + stw 28, 80(1) + stw 29, 84(1) + stw 30, 88(1) + stw 31, 92(1) + + # Save registers F14 to F31 in slots with 8-byte alignment. + # 4-byte alignment may stall the pipeline of some processors. + # Less than 4 may cause alignment traps. + stfd 14, 96(1) + stfd 15, 104(1) + stfd 16, 112(1) + stfd 17, 120(1) + stfd 18, 128(1) + stfd 19, 136(1) + stfd 20, 144(1) + stfd 21, 152(1) + stfd 22, 160(1) + stfd 23, 168(1) + stfd 24, 176(1) + stfd 25, 184(1) + stfd 26, 192(1) + stfd 27, 200(1) + stfd 28, 208(1) + stfd 29, 216(1) + stfd 30, 224(1) + stfd 31, 232(1) + + # hidden pointer + stw 3, 244(1) + + mffs 0 # load FPSCR + stfd 0, 248(1) # save FPSCR + # store RSP (pointing to context-data) in R6 - mr r6, r1 + mr 6, 1 # restore RSP (pointing to context-data) from R4 - mr r1, r4 - - lfd f14, 0(r1) # restore F14 - lfd f15, 8(r1) # restore F15 - lfd f16, 16(r1) # restore F16 - lfd f17, 24(r1) # restore F17 - lfd f18, 32(r1) # restore F18 - lfd f19, 40(r1) # restore F19 - lfd f20, 48(r1) # restore F20 - lfd f21, 56(r1) # restore F21 - lfd f22, 64(r1) # restore F22 - lfd f23, 72(r1) # restore F23 - lfd f24, 80(r1) # restore F24 - lfd f25, 88(r1) # restore F25 - lfd f26, 96(r1) # restore F26 - lfd f27, 104(r1) # restore F27 - lfd f28, 112(r1) # restore F28 - lfd f29, 120(r1) # restore F29 - lfd f30, 128(r1) # restore F30 - lfd f31, 136(r1) # restore F31 - lfd f0, 144(r1) # load FPSCR - mtfsf 0xff, f0 # restore FPSCR - - lwz r13, 152(r1) # restore R13 - lwz r14, 156(r1) # restore R14 - lwz r15, 160(r1) # restore R15 - lwz r16, 164(r1) # restore R16 - lwz r17, 168(r1) # restore R17 - lwz r18, 172(r1) # restore R18 - lwz r19, 176(r1) # restore R19 - lwz r20, 180(r1) # restore R20 - lwz r21, 184(r1) # restore R21 - lwz r22, 188(r1) # restore R22 - lwz r23, 192(r1) # restore R23 - lwz r24, 196(r1) # restore R24 - lwz r25, 200(r1) # restore R25 - lwz r26, 204(r1) # restore R26 - lwz r27, 208(r1) # restore R27 - lwz r28, 212(r1) # restore R28 - lwz r29, 216(r1) # restore R29 - lwz r30, 220(r1) # restore R30 - lwz r31, 224(r1) # restore R31 - lwz r3, 228(r1) # restore hidden + mr 1, 4 # restore CR - lwz r0, 232(r1) - mtcr r0 + lwz 0, 4(1) + mtcr 0 # restore LR - lwz r0, 236(r1) - mtlr r0 + lwz 0, 8(1) + mtlr 0 # load PC - lwz r0, 240(r1) - # restore CTR - mtctr r0 + lwz 0, 240(1) + mtctr 0 + + # restore TOC + lwz 2, 20(1) + + # restore R14 to R31 + lwz 14, 24(1) + lwz 15, 28(1) + lwz 16, 32(1) + lwz 17, 36(1) + lwz 18, 40(1) + lwz 19, 44(1) + lwz 20, 48(1) + lwz 21, 52(1) + lwz 22, 56(1) + lwz 23, 60(1) + lwz 24, 64(1) + lwz 25, 68(1) + lwz 26, 72(1) + lwz 27, 76(1) + lwz 28, 80(1) + lwz 29, 84(1) + lwz 30, 88(1) + lwz 31, 92(1) + + # restore F14 to F31 + lfd 14, 96(1) + lfd 15, 104(1) + lfd 16, 112(1) + lfd 17, 120(1) + lfd 18, 128(1) + lfd 19, 136(1) + lfd 20, 144(1) + lfd 21, 152(1) + lfd 22, 160(1) + lfd 23, 168(1) + lfd 24, 176(1) + lfd 25, 184(1) + lfd 26, 192(1) + lfd 27, 200(1) + lfd 28, 208(1) + lfd 29, 216(1) + lfd 30, 224(1) + lfd 31, 232(1) + + # hidden pointer + lwz 3, 244(1) + + lfd 0, 248(1) # load FPSCR + mtfsf 0xff, 0 # restore FPSCR # adjust stack - addi r1, r1, 244 + addi 1, 1, 256 + + # zero in r3 indicates first jump to context-function + cmpdi 3, 0 + beq use_entry_arg + + # return transfer_t + stw 6, 0(3) + stw 5, 4(3) + + # jump to context + bctr - # return transfer_t - stw r6, 0(r3) - stw r5, 4(r3) +use_entry_arg: + # copy transfer_t into transfer_fn arg registers + mr 3, 6 + mr 4, 5 # jump to context bctr diff --git a/Zend/asm/jump_ppc64_sysv_xcoff_gas.S b/Zend/asm/jump_ppc64_sysv_xcoff_gas.S index 6605949a35eae..f835d2a76a6cd 100644 --- a/Zend/asm/jump_ppc64_sysv_xcoff_gas.S +++ b/Zend/asm/jump_ppc64_sysv_xcoff_gas.S @@ -6,8 +6,77 @@ http://www.boost.org/LICENSE_1_0.txt) */ -.align 2 -.globl .jump_fcontext +/******************************************************* + * * + * ------------------------------------------------- * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * + * ------------------------------------------------- * + * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | * + * ------------------------------------------------- * + * | TOC | R14 | R15 | R16 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * + * ------------------------------------------------- * + * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | * + * ------------------------------------------------- * + * | R17 | R18 | R19 | R20 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * + * ------------------------------------------------- * + * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | * + * ------------------------------------------------- * + * | R21 | R22 | R23 | R24 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * + * ------------------------------------------------- * + * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * + * ------------------------------------------------- * + * | R25 | R26 | R27 | R28 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * + * ------------------------------------------------- * + * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * + * ------------------------------------------------- * + * | R29 | R30 | R31 | hidden | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | * + * ------------------------------------------------- * + * | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | * + * ------------------------------------------------- * + * | CR | LR | PC | back-chain| * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | * + * ------------------------------------------------- * + * | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | * + * ------------------------------------------------- * + * | cr saved | lr saved | compiler | linker | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | * + * ------------------------------------------------- * + * | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | * + * ------------------------------------------------- * + * | TOC saved | FCTX | DATA | | * + * ------------------------------------------------- * + * * + *******************************************************/ + + .file "jump_ppc64_sysv_xcoff_gas.S" + .toc + .csect .text[PR], 5 + .align 2 + .globl jump_fcontext[DS] + .globl .jump_fcontext + .csect jump_fcontext[DS], 3 +jump_fcontext: + .llong .jump_fcontext[PR], TOC[tc0], 0 + .csect .text[PR], 5 .jump_fcontext: # reserve space on stack subi 1, 1, 184 @@ -27,7 +96,7 @@ std 25, 96(1) # save R25 std 26, 104(1) # save R26 std 27, 112(1) # save R27 - std 29, 120(1) # save R28 + std 28, 120(1) # save R28 std 29, 128(1) # save R29 std 30, 136(1) # save R30 std 31, 144(1) # save R31 diff --git a/Zend/asm/make_ppc32_sysv_xcoff_gas.S b/Zend/asm/make_ppc32_sysv_xcoff_gas.S index f2572580609c5..e803757fa352d 100644 --- a/Zend/asm/make_ppc32_sysv_xcoff_gas.S +++ b/Zend/asm/make_ppc32_sysv_xcoff_gas.S @@ -5,81 +5,66 @@ http://www.boost.org/LICENSE_1_0.txt) */ -/****************************************************** +/******************************************************* * * * ------------------------------------------------- * - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * - * ------------------------------------------------- * * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | * * ------------------------------------------------- * - * | F14 | F15 | F16 | F17 | * - * ------------------------------------------------- * + * |bchai| CR | LR |compl| link| TOC | R14 | R15 | * * ------------------------------------------------- * - * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * * ------------------------------------------------- * * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | * * ------------------------------------------------- * - * | F18 | F19 | F20 | F21 | * - * ------------------------------------------------- * + * | R16 | R17 | R18 | R19 | R20 | R21 | R22 | R23 | * * ------------------------------------------------- * - * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * * ------------------------------------------------- * * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | * * ------------------------------------------------- * - * | F22 | F23 | F24 | F25 | * - * ------------------------------------------------- * + * | R24 | R25 | R26 | R27 | R28 | R29 | R30 | R31 | * * ------------------------------------------------- * - * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * * ------------------------------------------------- * * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * * ------------------------------------------------- * - * | F26 | F27 | F28 | F29 | * - * ------------------------------------------------- * + * | F14 | F15 | F16 | F17 | * * ------------------------------------------------- * - * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * * ------------------------------------------------- * * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * * ------------------------------------------------- * - * | F30 | F31 | fpscr | R13 | R14 | * - * ------------------------------------------------- * + * | F18 | F19 | F20 | F21 | * * ------------------------------------------------- * - * | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | * * ------------------------------------------------- * * | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | * * ------------------------------------------------- * - * | R15 | R16 | R17 | R18 | R19 | R20 | R21 | R22 | * - * ------------------------------------------------- * + * | F22 | F23 | F24 | F25 | * * ------------------------------------------------- * - * | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | * * ------------------------------------------------- * * | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | * * ------------------------------------------------- * - * | R23 | R24 | R25 | R26 | R27 | R28 | R29 | R30 | * - * ------------------------------------------------- * + * | F26 | F27 | F28 | F29 | * * ------------------------------------------------- * - * | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | * * ------------------------------------------------- * * | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | * * ------------------------------------------------- * - * | R31 |hiddn| CR | LR | PC |bchai|linkr| FCTX| * - * ------------------------------------------------- * + * | F30 | F31 | PC |hiddn| fpscr | * * ------------------------------------------------- * - * | 64 | | * * ------------------------------------------------- * - * | 256 | | * + * | 256 | 260 | 264 | 268 | 272 | 276 | 280 | 284 | * * ------------------------------------------------- * - * | DATA| | * + * |bchai|savLR|savLR|compl| link|svTOC| FCTX| DATA| * * ------------------------------------------------- * * * *******************************************************/ - .globl make_fcontext[DS] - .globl .make_fcontext[PR] - .align 2 - .csect make_fcontext[DS] + .file "make_ppc32_sysv_xcoff_xas.S" + .toc + .csect .text[PR] + .align 2 + .globl make_fcontext[DS] + .globl .make_fcontext + .csect make_fcontext[DS] make_fcontext: - .long .make_fcontext[PR] - .csect .make_fcontext[PR], 3 -#.make_fcontext: + .long .make_fcontext[PR], TOC[tc0], 0 + .csect .text[PR], 5 +.make_fcontext: # save return address into R6 mflr 6 @@ -88,20 +73,22 @@ make_fcontext: clrrwi 3, 3, 4 # reserve space for context-data on context-stack - # including 64 byte of linkage + parameter area (R1 % 16 == 0) - subi 3, 3, 336 + # including 32 byte of linkage + parameter area (R1 % 16 == 0) + subi 3, 3, 288 - # third arg of make_fcontext() == address of context-function - stw 5, 240(3) + # third arg of make_fcontext() == address of context-function descriptor + lwz 4, 0(5) + stw 4, 240(3) + # save TOC of context-function + lwz 4, 4(5) + stw 4, 20(3) # set back-chain to zero li 0, 0 - stw 0, 244(3) + stw 0, 256(3) - # compute address of returned transfer_t - addi 0, 3, 252 - mr 4, 0 - stw 4, 228(3) + # zero in r3 indicates first jump to context-function + std 0, 244(3) # load LR mflr 0 @@ -111,12 +98,12 @@ make_fcontext: # load LR into R4 mflr 4 # compute abs address of label .L_finish - addi 4, 4, .L_finish - .Label + addi 4, 4, .L_finish - .Label # restore LR mtlr 0 # save address of finish as return-address for context-function # will be entered after context-function returns - stw 4, 236(3) + stw 4, 8(3) # restore return address from R6 mtlr 6 diff --git a/Zend/asm/make_ppc64_sysv_xcoff_gas.S b/Zend/asm/make_ppc64_sysv_xcoff_gas.S index 40831299ddde9..2374b50ee63d2 100644 --- a/Zend/asm/make_ppc64_sysv_xcoff_gas.S +++ b/Zend/asm/make_ppc64_sysv_xcoff_gas.S @@ -4,12 +4,79 @@ (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ - .globl make_fcontext[DS] - .globl .make_fcontext[PR] - .align 2 - .csect .make_fcontext[PR], 3 - .globl _make_fcontext -#._make_fcontext: + +/******************************************************* + * * + * ------------------------------------------------- * + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * + * ------------------------------------------------- * + * | 0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | * + * ------------------------------------------------- * + * | TOC | R14 | R15 | R16 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * + * ------------------------------------------------- * + * | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | * + * ------------------------------------------------- * + * | R17 | R18 | R19 | R20 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * + * ------------------------------------------------- * + * | 64 | 68 | 72 | 76 | 80 | 84 | 88 | 92 | * + * ------------------------------------------------- * + * | R21 | R22 | R23 | R24 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * + * ------------------------------------------------- * + * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | * + * ------------------------------------------------- * + * | R25 | R26 | R27 | R28 | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * + * ------------------------------------------------- * + * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | * + * ------------------------------------------------- * + * | R29 | R30 | R31 | hidden | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | * + * ------------------------------------------------- * + * | 160 | 164 | 168 | 172 | 176 | 180 | 184 | 188 | * + * ------------------------------------------------- * + * | CR | LR | PC | back-chain| * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | * + * ------------------------------------------------- * + * | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | * + * ------------------------------------------------- * + * | cr saved | lr saved | compiler | linker | * + * ------------------------------------------------- * + * ------------------------------------------------- * + * | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | * + * ------------------------------------------------- * + * | 224 | 228 | 232 | 236 | 240 | 244 | 248 | 252 | * + * ------------------------------------------------- * + * | TOC saved | FCTX | DATA | | * + * ------------------------------------------------- * + * * + *******************************************************/ + + .file "make_ppc64_sysv_xcoff_gas.S" + .toc + .csect .text[PR], 5 + .align 2 + .globl make_fcontext[DS] + .globl .make_fcontext + .csect make_fcontext[DS], 3 +make_fcontext: + .llong .make_fcontext[PR], TOC[tc0], 0 + .csect .text[PR], 5 +.make_fcontext: # save return address into R6 mflr 6 @@ -21,8 +88,7 @@ # including 64 byte of linkage + parameter area (R1 % 16 == 0) subi 3, 3, 248 - # third arg of make_fcontext() == address of context-function - # (upstream boost ignored the fact this is a function descriptor) + # third arg of make_fcontext() == address of context-function descriptor ld 4, 0(5) std 4, 176(3) # save TOC of context-function