diff --git a/Zend/asm/jump_arm64_aapcs_elf_gas.S b/Zend/asm/jump_arm64_aapcs_elf_gas.S index cefd1830d718..32cbf117e88b 100644 --- a/Zend/asm/jump_arm64_aapcs_elf_gas.S +++ b/Zend/asm/jump_arm64_aapcs_elf_gas.S @@ -54,9 +54,9 @@ .file "jump_arm64_aapcs_elf_gas.S" .text .align 2 -.global jump_fcontext -.type jump_fcontext, %function -jump_fcontext: +.global zend_jump_fcontext +.type zend_jump_fcontext, %function +zend_jump_fcontext: # prepare stack for GP + FPU sub sp, sp, #0xb0 @@ -109,6 +109,6 @@ jump_fcontext: add sp, sp, #0xb0 ret x4 -.size jump_fcontext,.-jump_fcontext +.size zend_jump_fcontext,.-zend_jump_fcontext # Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_arm64_aapcs_macho_gas.S b/Zend/asm/jump_arm64_aapcs_macho_gas.S index 31738f745314..3cbb5eafb501 100644 --- a/Zend/asm/jump_arm64_aapcs_macho_gas.S +++ b/Zend/asm/jump_arm64_aapcs_macho_gas.S @@ -52,9 +52,9 @@ *******************************************************/ .text -.globl _jump_fcontext +.globl _zend_jump_fcontext .balign 16 -_jump_fcontext: +_zend_jump_fcontext: ; prepare stack for GP + FPU sub sp, sp, #0xb0 diff --git a/Zend/asm/jump_arm_aapcs_elf_gas.S b/Zend/asm/jump_arm_aapcs_elf_gas.S index 86efe9d82146..c80b9b90cf26 100644 --- a/Zend/asm/jump_arm_aapcs_elf_gas.S +++ b/Zend/asm/jump_arm_aapcs_elf_gas.S @@ -40,11 +40,11 @@ .file "jump_arm_aapcs_elf_gas.S" .text -.globl jump_fcontext +.globl zend_jump_fcontext .align 2 -.type jump_fcontext,%function +.type zend_jump_fcontext,%function .syntax unified -jump_fcontext: +zend_jump_fcontext: @ save LR as PC push {lr} @ save hidden,V1-V8,LR @@ -82,7 +82,7 @@ jump_fcontext: @ restore PC pop {pc} -.size jump_fcontext,.-jump_fcontext +.size zend_jump_fcontext,.-zend_jump_fcontext @ Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_arm_aapcs_macho_gas.S b/Zend/asm/jump_arm_aapcs_macho_gas.S index 077c36409e83..aa63a9c97447 100644 --- a/Zend/asm/jump_arm_aapcs_macho_gas.S +++ b/Zend/asm/jump_arm_aapcs_macho_gas.S @@ -39,9 +39,9 @@ *******************************************************/ .text -.globl _jump_fcontext +.globl _zend_jump_fcontext .align 2 -_jump_fcontext: +_zend_jump_fcontext: @ save LR as PC push {lr} @ save hidden,V1-V8,LR diff --git a/Zend/asm/jump_i386_ms_pe_masm.asm b/Zend/asm/jump_i386_ms_pe_masm.asm index 7a9e848f1c3f..3aa7ae51b83a 100644 --- a/Zend/asm/jump_i386_ms_pe_masm.asm +++ b/Zend/asm/jump_i386_ms_pe_masm.asm @@ -24,7 +24,7 @@ .model flat, c .code -jump_fcontext PROC BOOST_CONTEXT_EXPORT +zend_jump_fcontext PROC BOOST_CONTEXT_EXPORT ; prepare stack lea esp, [esp-02ch] @@ -63,7 +63,7 @@ ENDIF ; store ESP (pointing to context-data) in EAX mov eax, esp - ; firstarg of jump_fcontext() == fcontext to jump to + ; firstarg of zend_jump_fcontext() == fcontext to jump to mov ecx, [esp+030h] ; restore ESP (pointing to context-data) from ECX @@ -112,5 +112,5 @@ ENDIF ; jump to context jmp ecx -jump_fcontext ENDP +zend_jump_fcontext ENDP END diff --git a/Zend/asm/jump_i386_sysv_elf_gas.S b/Zend/asm/jump_i386_sysv_elf_gas.S index b96d4b5c0e70..7676bbe07507 100644 --- a/Zend/asm/jump_i386_sysv_elf_gas.S +++ b/Zend/asm/jump_i386_sysv_elf_gas.S @@ -26,10 +26,10 @@ .file "jump_i386_sysv_elf_gas.S" .text -.globl jump_fcontext +.globl zend_jump_fcontext .align 2 -.type jump_fcontext,@function -jump_fcontext: +.type zend_jump_fcontext,@function +zend_jump_fcontext: leal -0x18(%esp), %esp /* prepare stack */ #if !defined(BOOST_USE_TSX) @@ -45,10 +45,10 @@ jump_fcontext: /* store ESP (pointing to context-data) in ECX */ movl %esp, %ecx - /* first arg of jump_fcontext() == fcontext to jump to */ + /* first arg of zend_jump_fcontext() == fcontext to jump to */ movl 0x20(%esp), %eax - /* second arg of jump_fcontext() == data to be transferred */ + /* second arg of zend_jump_fcontext() == data to be transferred */ movl 0x24(%esp), %edx /* restore ESP (pointing to context-data) from EAX */ @@ -77,7 +77,7 @@ jump_fcontext: /* jump to context */ jmp *%ecx -.size jump_fcontext,.-jump_fcontext +.size zend_jump_fcontext,.-zend_jump_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_i386_sysv_macho_gas.S b/Zend/asm/jump_i386_sysv_macho_gas.S index 8ab7c6f29c66..1e44b23982ee 100644 --- a/Zend/asm/jump_i386_sysv_macho_gas.S +++ b/Zend/asm/jump_i386_sysv_macho_gas.S @@ -25,9 +25,9 @@ ****************************************************************************************/ .text -.globl _jump_fcontext +.globl _zend_jump_fcontext .align 2 -_jump_fcontext: +_zend_jump_fcontext: leal -0x18(%esp), %esp /* prepare stack */ #if !defined(BOOST_USE_TSX) @@ -43,10 +43,10 @@ _jump_fcontext: /* store ESP (pointing to context-data) in ECX */ movl %esp, %ecx - /* first arg of jump_fcontext() == fcontext to jump to */ + /* first arg of zend_jump_fcontext() == fcontext to jump to */ movl 0x1c(%esp), %eax - /* second arg of jump_fcontext() == data to be transferred */ + /* second arg of zend_jump_fcontext() == data to be transferred */ movl 0x20(%esp), %edx /* restore ESP (pointing to context-data) from EAX */ diff --git a/Zend/asm/jump_mips32_o32_elf_gas.S b/Zend/asm/jump_mips32_o32_elf_gas.S index f2b8034d8c5b..dec161d0a757 100644 --- a/Zend/asm/jump_mips32_o32_elf_gas.S +++ b/Zend/asm/jump_mips32_o32_elf_gas.S @@ -40,11 +40,11 @@ .file "jump_mips32_o32_elf_gas.S" .text -.globl jump_fcontext +.globl zend_jump_fcontext .align 2 -.type jump_fcontext,@function -.ent jump_fcontext -jump_fcontext: +.type zend_jump_fcontext,@function +.ent zend_jump_fcontext +zend_jump_fcontext: # reserve space on stack addiu $sp, $sp, -96 @@ -112,8 +112,8 @@ jump_fcontext: # jump to context jr $t9 -.end jump_fcontext -.size jump_fcontext, .-jump_fcontext +.end zend_jump_fcontext +.size zend_jump_fcontext, .-zend_jump_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_mips64_n64_elf_gas.S b/Zend/asm/jump_mips64_n64_elf_gas.S index e338912bb6e8..1f6836a646eb 100644 --- a/Zend/asm/jump_mips64_n64_elf_gas.S +++ b/Zend/asm/jump_mips64_n64_elf_gas.S @@ -47,11 +47,11 @@ .file "jump_mips64_n64_elf_gas.S" .text -.globl jump_fcontext +.globl zend_jump_fcontext .align 3 -.type jump_fcontext,@function -.ent jump_fcontext -jump_fcontext: +.type zend_jump_fcontext,@function +.ent zend_jump_fcontext +zend_jump_fcontext: # reserve space on stack daddiu $sp, $sp, -160 @@ -117,8 +117,8 @@ jump_fcontext: # jump to context jr $t9 -.end jump_fcontext -.size jump_fcontext, .-jump_fcontext +.end zend_jump_fcontext +.size zend_jump_fcontext, .-zend_jump_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_ppc32_sysv_elf_gas.S b/Zend/asm/jump_ppc32_sysv_elf_gas.S index 48e09c935e09..e18ed6059cec 100644 --- a/Zend/asm/jump_ppc32_sysv_elf_gas.S +++ b/Zend/asm/jump_ppc32_sysv_elf_gas.S @@ -52,12 +52,12 @@ .file "jump_ppc32_sysv_elf_gas.S" .text -.globl jump_fcontext +.globl zend_jump_fcontext .align 2 -.type jump_fcontext,@function -jump_fcontext: - # Linux: jump_fcontext( hidden transfer_t * R3, R4, R5) - # Other: transfer_t R3:R4 = jump_fcontext( R3, R4) +.type zend_jump_fcontext,@function +zend_jump_fcontext: + # Linux: zend_jump_fcontext( hidden transfer_t * R3, R4, R5) + # Other: transfer_t R3:R4 = zend_jump_fcontext( R3, R4) mflr %r0 # return address from LR mffs %f0 # FPSCR @@ -195,7 +195,7 @@ jump_fcontext: # jump to context bctr -.size jump_fcontext, .-jump_fcontext +.size zend_jump_fcontext, .-zend_jump_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_ppc32_sysv_macho_gas.S b/Zend/asm/jump_ppc32_sysv_macho_gas.S index c555237afa2e..f7e65e653115 100644 --- a/Zend/asm/jump_ppc32_sysv_macho_gas.S +++ b/Zend/asm/jump_ppc32_sysv_macho_gas.S @@ -74,9 +74,9 @@ *******************************************************/ .text -.globl _jump_fcontext +.globl _zend_jump_fcontext .align 2 -_jump_fcontext: +_zend_jump_fcontext: ; reserve space on stack subi r1, r1, 244 diff --git a/Zend/asm/jump_ppc32_sysv_xcoff_gas.S b/Zend/asm/jump_ppc32_sysv_xcoff_gas.S index 1854613d761c..295a919bc962 100644 --- a/Zend/asm/jump_ppc32_sysv_xcoff_gas.S +++ b/Zend/asm/jump_ppc32_sysv_xcoff_gas.S @@ -58,13 +58,13 @@ .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[PR], TOC[tc0], 0 + .globl zend_jump_fcontext[DS] + .globl .zend_jump_fcontext + .csect zend_jump_fcontext[DS] +zend_jump_fcontext: + .long .zend_jump_fcontext[PR], TOC[tc0], 0 .csect .text[PR], 5 -.jump_fcontext: +.zend_jump_fcontext: # reserve space on stack subi 1, 1, 256 diff --git a/Zend/asm/jump_ppc64_sysv_elf_gas.S b/Zend/asm/jump_ppc64_sysv_elf_gas.S index 28907db32b8c..5a5e0c2cfba1 100644 --- a/Zend/asm/jump_ppc64_sysv_elf_gas.S +++ b/Zend/asm/jump_ppc64_sysv_elf_gas.S @@ -67,33 +67,33 @@ *******************************************************/ .file "jump_ppc64_sysv_elf_gas.S" -.globl jump_fcontext +.globl zend_jump_fcontext #if _CALL_ELF == 2 .text .align 2 -jump_fcontext: - addis %r2, %r12, .TOC.-jump_fcontext@ha - addi %r2, %r2, .TOC.-jump_fcontext@l - .localentry jump_fcontext, . - jump_fcontext +zend_jump_fcontext: + addis %r2, %r12, .TOC.-zend_jump_fcontext@ha + addi %r2, %r2, .TOC.-zend_jump_fcontext@l + .localentry zend_jump_fcontext, . - zend_jump_fcontext #else .section ".opd","aw" .align 3 -jump_fcontext: +zend_jump_fcontext: # ifdef _CALL_LINUX - .quad .L.jump_fcontext,.TOC.@tocbase,0 - .type jump_fcontext,@function + .quad .L.zend_jump_fcontext,.TOC.@tocbase,0 + .type zend_jump_fcontext,@function .text .align 2 -.L.jump_fcontext: +.L.zend_jump_fcontext: # else - .hidden .jump_fcontext - .globl .jump_fcontext - .quad .jump_fcontext,.TOC.@tocbase,0 - .size jump_fcontext,24 - .type .jump_fcontext,@function + .hidden .zend_jump_fcontext + .globl .zend_jump_fcontext + .quad .zend_jump_fcontext,.TOC.@tocbase,0 + .size zend_jump_fcontext,24 + .type .zend_jump_fcontext,@function .text .align 2 -.jump_fcontext: +.zend_jump_fcontext: # endif #endif # reserve space on stack @@ -189,7 +189,7 @@ jump_fcontext: # jump to context bctr - .size jump_fcontext, .-jump_fcontext + .size zend_jump_fcontext, .-zend_jump_fcontext #else # zero in r3 indicates first jump to context-function cmpdi %r3, 0 @@ -210,9 +210,9 @@ use_entry_arg: # jump to context bctr # ifdef _CALL_LINUX - .size .jump_fcontext, .-.L.jump_fcontext + .size .zend_jump_fcontext, .-.L.zend_jump_fcontext # else - .size .jump_fcontext, .-.jump_fcontext + .size .zend_jump_fcontext, .-.zend_jump_fcontext # endif #endif diff --git a/Zend/asm/jump_ppc64_sysv_macho_gas.S b/Zend/asm/jump_ppc64_sysv_macho_gas.S index 74fcb2ab3528..969f104ee803 100644 --- a/Zend/asm/jump_ppc64_sysv_macho_gas.S +++ b/Zend/asm/jump_ppc64_sysv_macho_gas.S @@ -68,9 +68,9 @@ .text .align 2 -.globl _jump_fcontext +.globl _zend_jump_fcontext -_jump_fcontext: +_zend_jump_fcontext: ; reserve space on stack subi r1, r1, 184 diff --git a/Zend/asm/jump_ppc64_sysv_xcoff_gas.S b/Zend/asm/jump_ppc64_sysv_xcoff_gas.S index f835d2a76a6c..418a1def39c0 100644 --- a/Zend/asm/jump_ppc64_sysv_xcoff_gas.S +++ b/Zend/asm/jump_ppc64_sysv_xcoff_gas.S @@ -71,13 +71,13 @@ .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 + .globl zend_jump_fcontext[DS] + .globl .zend_jump_fcontext + .csect zend_jump_fcontext[DS], 3 +zend_jump_fcontext: + .llong .zend_jump_fcontext[PR], TOC[tc0], 0 .csect .text[PR], 5 -.jump_fcontext: +.zend_jump_fcontext: # reserve space on stack subi 1, 1, 184 diff --git a/Zend/asm/jump_riscv64_sysv_elf_gas.S b/Zend/asm/jump_riscv64_sysv_elf_gas.S index 5417e5d5e349..bc33b43855ef 100644 --- a/Zend/asm/jump_riscv64_sysv_elf_gas.S +++ b/Zend/asm/jump_riscv64_sysv_elf_gas.S @@ -60,9 +60,9 @@ .file "jump_riscv64_sysv_elf_gas.S" .text .align 1 -.global jump_fcontext -.type jump_fcontext, %function -jump_fcontext: +.global zend_jump_fcontext +.type zend_jump_fcontext, %function +zend_jump_fcontext: # prepare stack for GP + FPU addi sp, sp, -0xd0 @@ -145,6 +145,6 @@ jump_fcontext: addi sp, sp, 0xd0 jr a2 -.size jump_fcontext,.-jump_fcontext +.size zend_jump_fcontext,.-zend_jump_fcontext # Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_s390x_sysv_elf_gas.S b/Zend/asm/jump_s390x_sysv_elf_gas.S index c2a578b2663e..a8cd53ef5e3a 100644 --- a/Zend/asm/jump_s390x_sysv_elf_gas.S +++ b/Zend/asm/jump_s390x_sysv_elf_gas.S @@ -45,8 +45,8 @@ .text .align 8 -.global jump_fcontext -.type jump_fcontext, @function +.global zend_jump_fcontext +.type zend_jump_fcontext, @function #define ARG_OFFSET 0 #define GR_OFFSET 16 @@ -66,7 +66,7 @@ struct transfer_t { void * data; }; -transfer_t jump_fcontext( fcontext_t const to, +transfer_t zend_jump_fcontext( fcontext_t const to, void * data); Incoming args @@ -76,7 +76,7 @@ r4 - Data pointer */ -jump_fcontext: +zend_jump_fcontext: .machine "z10" /* Reserve stack space to store the current context. */ aghi %r15,-CONTEXT_SIZE @@ -131,7 +131,7 @@ jump_fcontext: ltg %r2,GR_OFFSET(%r15) jnz use_return_slot - /* We restore a make_fcontext context. Use the function + /* We restore a zend_make_fcontext context. Use the function argument slot in the context we just saved and allocate the register save area for the target function. */ la %r2,ARG_OFFSET(%r1) @@ -139,9 +139,9 @@ jump_fcontext: use_return_slot: /* Save the two fields in transfer_t. When calling a - make_fcontext function this becomes the function argument of + zend_make_fcontext function this becomes the function argument of the target function, otherwise it will be the return value of - jump_fcontext. */ + zend_jump_fcontext. */ stg %r1,0(%r2) stg %r4,8(%r2) @@ -152,5 +152,5 @@ use_return_slot: br %r5 -.size jump_fcontext,.-jump_fcontext +.size zend_jump_fcontext,.-zend_jump_fcontext .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_x86_64_ms_pe_masm.asm b/Zend/asm/jump_x86_64_ms_pe_masm.asm index c8a28a558e8b..8f717591695b 100644 --- a/Zend/asm/jump_x86_64_ms_pe_masm.asm +++ b/Zend/asm/jump_x86_64_ms_pe_masm.asm @@ -84,7 +84,7 @@ .code -jump_fcontext PROC BOOST_CONTEXT_EXPORT FRAME +zend_jump_fcontext PROC BOOST_CONTEXT_EXPORT FRAME .endprolog ; prepare stack @@ -201,5 +201,5 @@ ENDIF ; indirect jump to context jmp r10 -jump_fcontext ENDP +zend_jump_fcontext ENDP END diff --git a/Zend/asm/jump_x86_64_sysv_elf_gas.S b/Zend/asm/jump_x86_64_sysv_elf_gas.S index 0c4a1a39eb8b..330cf8fe2d32 100644 --- a/Zend/asm/jump_x86_64_sysv_elf_gas.S +++ b/Zend/asm/jump_x86_64_sysv_elf_gas.S @@ -26,10 +26,10 @@ .file "jump_x86_64_sysv_elf_gas.S" .text -.globl jump_fcontext -.type jump_fcontext,@function +.globl zend_jump_fcontext +.type zend_jump_fcontext,@function .align 16 -jump_fcontext: +zend_jump_fcontext: leaq -0x38(%rsp), %rsp /* prepare stack */ #if !defined(BOOST_USE_TSX) @@ -85,7 +85,7 @@ jump_fcontext: /* indirect jump to context */ jmp *%r8 -.size jump_fcontext,.-jump_fcontext +.size zend_jump_fcontext,.-zend_jump_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/jump_x86_64_sysv_macho_gas.S b/Zend/asm/jump_x86_64_sysv_macho_gas.S index afc3e5c126f9..f346e94e01e9 100644 --- a/Zend/asm/jump_x86_64_sysv_macho_gas.S +++ b/Zend/asm/jump_x86_64_sysv_macho_gas.S @@ -25,9 +25,9 @@ ****************************************************************************************/ .text -.globl _jump_fcontext +.globl _zend_jump_fcontext .align 8 -_jump_fcontext: +_zend_jump_fcontext: leaq -0x38(%rsp), %rsp /* prepare stack */ #if !defined(BOOST_USE_TSX) diff --git a/Zend/asm/make_arm64_aapcs_elf_gas.S b/Zend/asm/make_arm64_aapcs_elf_gas.S index 66cfb2da17ea..eaf74ffcc6de 100644 --- a/Zend/asm/make_arm64_aapcs_elf_gas.S +++ b/Zend/asm/make_arm64_aapcs_elf_gas.S @@ -54,16 +54,16 @@ .file "make_arm64_aapcs_elf_gas.S" .text .align 2 -.global make_fcontext -.type make_fcontext, %function -make_fcontext: +.global zend_make_fcontext +.type zend_make_fcontext, %function +zend_make_fcontext: # shift address in x0 (allocated stack) to lower 16 byte boundary and x0, x0, ~0xF # reserve space for context-data on context-stack sub x0, x0, #0xb0 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function # store address as a PC to jump in str x2, [x0, #0xa0] @@ -80,6 +80,6 @@ finish: # exit application bl _exit -.size make_fcontext,.-make_fcontext +.size zend_make_fcontext,.-zend_make_fcontext # Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_arm64_aapcs_macho_gas.S b/Zend/asm/make_arm64_aapcs_macho_gas.S index b30b1e3e5bbb..926f642703ef 100644 --- a/Zend/asm/make_arm64_aapcs_macho_gas.S +++ b/Zend/asm/make_arm64_aapcs_macho_gas.S @@ -52,17 +52,17 @@ *******************************************************/ .text -.globl _make_fcontext +.globl _zend_make_fcontext .balign 16 -_make_fcontext: +_zend_make_fcontext: ; shift address in x0 (allocated stack) to lower 16 byte boundary and x0, x0, ~0xF ; reserve space for context-data on context-stack sub x0, x0, #0xb0 - ; third arg of make_fcontext() == address of context-function + ; third arg of zend_make_fcontext() == address of context-function ; store address as a PC to jump in str x2, [x0, #0xa0] diff --git a/Zend/asm/make_arm_aapcs_elf_gas.S b/Zend/asm/make_arm_aapcs_elf_gas.S index 98ae64b43f9d..686247445f73 100644 --- a/Zend/asm/make_arm_aapcs_elf_gas.S +++ b/Zend/asm/make_arm_aapcs_elf_gas.S @@ -40,18 +40,18 @@ .file "make_arm_aapcs_elf_gas.S" .text -.globl make_fcontext +.globl zend_make_fcontext .align 2 -.type make_fcontext,%function +.type zend_make_fcontext,%function .syntax unified -make_fcontext: +zend_make_fcontext: @ shift address in A1 to lower 16 byte boundary bic a1, a1, #15 @ reserve space for context-data on context-stack sub a1, a1, #124 - @ third arg of make_fcontext() == address of context-function + @ third arg of zend_make_fcontext() == address of context-function str a3, [a1, #104] @ compute address of returned transfer_t @@ -75,7 +75,7 @@ finish: mov a1, #0 @ exit application bl _exit@PLT -.size make_fcontext,.-make_fcontext +.size zend_make_fcontext,.-zend_make_fcontext @ Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_arm_aapcs_macho_gas.S b/Zend/asm/make_arm_aapcs_macho_gas.S index c909ae9d43a2..ccb86aa7e57f 100644 --- a/Zend/asm/make_arm_aapcs_macho_gas.S +++ b/Zend/asm/make_arm_aapcs_macho_gas.S @@ -39,16 +39,16 @@ *******************************************************/ .text -.globl _make_fcontext +.globl _zend_make_fcontext .align 2 -_make_fcontext: +_zend_make_fcontext: @ shift address in A1 to lower 16 byte boundary bic a1, a1, #15 @ reserve space for context-data on context-stack sub a1, a1, #124 - @ third arg of make_fcontext() == address of context-function + @ third arg of zend_make_fcontext() == address of context-function str a3, [a1, #108] @ compute address of returned transfer_t diff --git a/Zend/asm/make_i386_ms_pe_masm.asm b/Zend/asm/make_i386_ms_pe_masm.asm index 5246465cb975..107920582f26 100644 --- a/Zend/asm/make_i386_ms_pe_masm.asm +++ b/Zend/asm/make_i386_ms_pe_masm.asm @@ -26,8 +26,8 @@ _exit PROTO, value:SDWORD .code -make_fcontext PROC BOOST_CONTEXT_EXPORT - ; first arg of make_fcontext() == top of context-stack +zend_make_fcontext PROC BOOST_CONTEXT_EXPORT + ; first arg of zend_make_fcontext() == top of context-stack mov eax, [esp+04h] ; reserve space for first argument of context-function @@ -47,11 +47,11 @@ make_fcontext PROC BOOST_CONTEXT_EXPORT ; save x87 control-word fnstcw [eax+04h] - ; first arg of make_fcontext() == top of context-stack + ; first arg of zend_make_fcontext() == top of context-stack mov ecx, [esp+04h] ; save top address of context stack as 'base' mov [eax+014h], ecx - ; second arg of make_fcontext() == size of context-stack + ; second arg of zend_make_fcontext() == size of context-stack mov edx, [esp+08h] ; negate stack size for LEA instruction (== substraction) neg edx @@ -65,7 +65,7 @@ make_fcontext PROC BOOST_CONTEXT_EXPORT xor ecx, ecx mov [eax+08h], ecx - ; third arg of make_fcontext() == address of context-function + ; third arg of zend_make_fcontext() == address of context-function ; stored in EBX mov ecx, [esp+0ch] mov [eax+024h], ecx @@ -73,7 +73,7 @@ make_fcontext PROC BOOST_CONTEXT_EXPORT ; compute abs address of label trampoline mov ecx, trampoline ; save address of trampoline as return-address for context-function - ; will be entered after calling jump_fcontext() first time + ; will be entered after calling zend_jump_fcontext() first time mov [eax+02ch], ecx ; compute abs address of label finish @@ -136,5 +136,5 @@ finish: ; exit application call _exit hlt -make_fcontext ENDP +zend_make_fcontext ENDP END diff --git a/Zend/asm/make_i386_sysv_elf_gas.S b/Zend/asm/make_i386_sysv_elf_gas.S index b76de260d211..c6df705cb7c8 100644 --- a/Zend/asm/make_i386_sysv_elf_gas.S +++ b/Zend/asm/make_i386_sysv_elf_gas.S @@ -26,11 +26,11 @@ .file "make_i386_sysv_elf_gas.S" .text -.globl make_fcontext +.globl zend_make_fcontext .align 2 -.type make_fcontext,@function -make_fcontext: - /* first arg of make_fcontext() == top of context-stack */ +.type zend_make_fcontext,@function +zend_make_fcontext: + /* first arg of zend_make_fcontext() == top of context-stack */ movl 0x4(%esp), %eax /* reserve space for first argument of context-function @@ -43,7 +43,7 @@ make_fcontext: /* reserve space for context-data on context-stack */ leal -0x28(%eax), %eax - /* third arg of make_fcontext() == address of context-function */ + /* third arg of zend_make_fcontext() == address of context-function */ /* stored in EBX */ movl 0xc(%esp), %ecx movl %ecx, 0x10(%eax) @@ -65,7 +65,7 @@ make_fcontext: /* compute abs address of label trampoline */ addl $trampoline-1b, %ecx /* save address of trampoline as return address */ - /* will be entered after calling jump_fcontext() first time */ + /* will be entered after calling zend_jump_fcontext() first time */ movl %ecx, 0x18(%eax) /* compute abs address of label finish */ @@ -101,7 +101,7 @@ finish: /* exit application */ call _exit@PLT hlt -.size make_fcontext,.-make_fcontext +.size zend_make_fcontext,.-zend_make_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_i386_sysv_macho_gas.S b/Zend/asm/make_i386_sysv_macho_gas.S index fdcdb7c80fbf..55c1870ef3a9 100644 --- a/Zend/asm/make_i386_sysv_macho_gas.S +++ b/Zend/asm/make_i386_sysv_macho_gas.S @@ -25,10 +25,10 @@ ****************************************************************************************/ .text -.globl _make_fcontext +.globl _zend_make_fcontext .align 2 -_make_fcontext: - /* first arg of make_fcontext() == top of context-stack */ +_zend_make_fcontext: + /* first arg of zend_make_fcontext() == top of context-stack */ movl 0x4(%esp), %eax /* reserve space for first argument of context-function @@ -41,7 +41,7 @@ _make_fcontext: /* reserve space for context-data on context-stack */ leal -0x2c(%eax), %eax - /* third arg of make_fcontext() == address of context-function */ + /* third arg of zend_make_fcontext() == address of context-function */ /* stored in EBX */ movl 0xc(%esp), %ecx movl %ecx, 0x10(%eax) @@ -58,7 +58,7 @@ _make_fcontext: /* compute abs address of label trampoline */ addl $trampoline-1b, %ecx /* save address of trampoline as return address */ - /* will be entered after calling jump_fcontext() first time */ + /* will be entered after calling zend_jump_fcontext() first time */ movl %ecx, 0x18(%eax) /* compute abs address of label finish */ diff --git a/Zend/asm/make_mips32_o32_elf_gas.S b/Zend/asm/make_mips32_o32_elf_gas.S index 4e11e3d05825..5a90f71b66c1 100644 --- a/Zend/asm/make_mips32_o32_elf_gas.S +++ b/Zend/asm/make_mips32_o32_elf_gas.S @@ -40,11 +40,11 @@ .file "make_mips32_o32_elf_gas.S" .text -.globl make_fcontext +.globl zend_make_fcontext .align 2 -.type make_fcontext,@function -.ent make_fcontext -make_fcontext: +.type zend_make_fcontext,@function +.ent zend_make_fcontext +zend_make_fcontext: #ifdef __PIC__ .set noreorder .cpload $t9 @@ -63,7 +63,7 @@ make_fcontext: # - 4 bytes for alignment addiu $v0, $v0, -128 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function sw $a2, 92($v0) # save global pointer in context-data sw $gp, 112($v0) @@ -90,8 +90,8 @@ finish: la $t9, _exit move $a0, $zero jr $t9 -.end make_fcontext -.size make_fcontext, .-make_fcontext +.end zend_make_fcontext +.size zend_make_fcontext, .-zend_make_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_mips64_n64_elf_gas.S b/Zend/asm/make_mips64_n64_elf_gas.S index 7bb30b14dee7..2994dc9453f8 100644 --- a/Zend/asm/make_mips64_n64_elf_gas.S +++ b/Zend/asm/make_mips64_n64_elf_gas.S @@ -47,11 +47,11 @@ .file "make_mips64_n64_elf_gas.S" .text -.globl make_fcontext +.globl zend_make_fcontext .align 3 -.type make_fcontext,@function -.ent make_fcontext -make_fcontext: +.type zend_make_fcontext,@function +.ent zend_make_fcontext +zend_make_fcontext: #ifdef __PIC__ .set noreorder .cpload $t9 @@ -64,7 +64,7 @@ make_fcontext: # reserve space for context-data on context-stack daddiu $v0, $v0, -160 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function sd $a2, 152($v0) # save global pointer in context-data sd $gp, 136($v0) @@ -89,8 +89,8 @@ finish: dla $t9, _exit move $a0, $zero jr $t9 -.end make_fcontext -.size make_fcontext, .-make_fcontext +.end zend_make_fcontext +.size zend_make_fcontext, .-zend_make_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_ppc32_sysv_elf_gas.S b/Zend/asm/make_ppc32_sysv_elf_gas.S index 9616c4ca9b46..3fa61e1bcd05 100644 --- a/Zend/asm/make_ppc32_sysv_elf_gas.S +++ b/Zend/asm/make_ppc32_sysv_elf_gas.S @@ -52,14 +52,14 @@ .file "make_ppc32_sysv_elf_gas.S" .text -.globl make_fcontext +.globl zend_make_fcontext .align 2 -.type make_fcontext,@function -make_fcontext: +.type zend_make_fcontext,@function +zend_make_fcontext: # save return address into R6 mflr %r6 - # first arg of make_fcontext() == top address of context-function + # first arg of zend_make_fcontext() == top address of context-function # shift address in R3 to lower 16 byte boundary clrrwi %r3, %r3, 4 @@ -67,7 +67,7 @@ make_fcontext: # and parameter area + 240 bytes of context-data (R1 % 16 == 0) subi %r3, %r3, 16 + 240 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function #ifdef __linux__ # save context-function as PC stw %r5, 16(%r3) @@ -111,7 +111,7 @@ make_fcontext: #ifndef __linux__ trampoline: - # On systems other than Linux, jump_fcontext is returning the + # On systems other than Linux, zend_jump_fcontext is returning the # transfer_t in R3:R4, but we need to pass transfer_t * R3 to # our context-function. lwz %r0, 8(%r1) # address of context-function @@ -136,7 +136,7 @@ finish: # call _exit(0) with special addend 0x8000 for large model li %r3, 0 bl _exit + 0x8000@plt -.size make_fcontext, .-make_fcontext +.size zend_make_fcontext, .-zend_make_fcontext /* Provide the GOT pointer for secure PLT, large model. */ .section .got2,"aw" diff --git a/Zend/asm/make_ppc32_sysv_macho_gas.S b/Zend/asm/make_ppc32_sysv_macho_gas.S index 8f35eff9abbf..99a3f573e8c5 100644 --- a/Zend/asm/make_ppc32_sysv_macho_gas.S +++ b/Zend/asm/make_ppc32_sysv_macho_gas.S @@ -74,13 +74,13 @@ *******************************************************/ .text -.globl _make_fcontext +.globl _zend_make_fcontext .align 2 -_make_fcontext: +_zend_make_fcontext: # save return address into R6 mflr r6 - # first arg of make_fcontext() == top address of context-function + # first arg of zend_make_fcontext() == top address of context-function # shift address in R3 to lower 16 byte boundary clrrwi r3, r3, 4 @@ -88,7 +88,7 @@ _make_fcontext: # including 64 byte of linkage + parameter area (R1 16 == 0) subi r3, r3, 336 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function stw r5, 240(r3) # set back-chain to zero diff --git a/Zend/asm/make_ppc32_sysv_xcoff_gas.S b/Zend/asm/make_ppc32_sysv_xcoff_gas.S index e803757fa352..ab5b3321d46e 100644 --- a/Zend/asm/make_ppc32_sysv_xcoff_gas.S +++ b/Zend/asm/make_ppc32_sysv_xcoff_gas.S @@ -58,17 +58,17 @@ .toc .csect .text[PR] .align 2 - .globl make_fcontext[DS] - .globl .make_fcontext - .csect make_fcontext[DS] -make_fcontext: - .long .make_fcontext[PR], TOC[tc0], 0 + .globl zend_make_fcontext[DS] + .globl .zend_make_fcontext + .csect zend_make_fcontext[DS] +zend_make_fcontext: + .long .zend_make_fcontext[PR], TOC[tc0], 0 .csect .text[PR], 5 -.make_fcontext: +.zend_make_fcontext: # save return address into R6 mflr 6 - # first arg of make_fcontext() == top address of context-function + # first arg of zend_make_fcontext() == top address of context-function # shift address in R3 to lower 16 byte boundary clrrwi 3, 3, 4 @@ -76,7 +76,7 @@ make_fcontext: # including 32 byte of linkage + parameter area (R1 % 16 == 0) subi 3, 3, 288 - # third arg of make_fcontext() == address of context-function descriptor + # third arg of zend_make_fcontext() == address of context-function descriptor lwz 4, 0(5) stw 4, 240(3) # save TOC of context-function diff --git a/Zend/asm/make_ppc64_sysv_elf_gas.S b/Zend/asm/make_ppc64_sysv_elf_gas.S index c4d7ee59826a..81fe865eaa6b 100644 --- a/Zend/asm/make_ppc64_sysv_elf_gas.S +++ b/Zend/asm/make_ppc64_sysv_elf_gas.S @@ -67,39 +67,39 @@ *******************************************************/ .file "make_ppc64_sysv_elf_gas.S" -.globl make_fcontext +.globl zend_make_fcontext #if _CALL_ELF == 2 .text .align 2 -make_fcontext: - addis %r2, %r12, .TOC.-make_fcontext@ha - addi %r2, %r2, .TOC.-make_fcontext@l - .localentry make_fcontext, . - make_fcontext +zend_make_fcontext: + addis %r2, %r12, .TOC.-zend_make_fcontext@ha + addi %r2, %r2, .TOC.-zend_make_fcontext@l + .localentry zend_make_fcontext, . - zend_make_fcontext #else .section ".opd","aw" .align 3 -make_fcontext: +zend_make_fcontext: # ifdef _CALL_LINUX - .quad .L.make_fcontext,.TOC.@tocbase,0 - .type make_fcontext,@function + .quad .L.zend_make_fcontext,.TOC.@tocbase,0 + .type zend_make_fcontext,@function .text .align 2 -.L.make_fcontext: +.L.zend_make_fcontext: # else - .hidden .make_fcontext - .globl .make_fcontext - .quad .make_fcontext,.TOC.@tocbase,0 - .size make_fcontext,24 - .type .make_fcontext,@function + .hidden .zend_make_fcontext + .globl .zend_make_fcontext + .quad .zend_make_fcontext,.TOC.@tocbase,0 + .size zend_make_fcontext,24 + .type .zend_make_fcontext,@function .text .align 2 -.make_fcontext: +.zend_make_fcontext: # endif #endif # save return address into R6 mflr %r6 - # first arg of make_fcontext() == top address of context-stack + # first arg of zend_make_fcontext() == top address of context-stack # shift address in R3 to lower 16 byte boundary clrrdi %r3, %r3, 4 @@ -107,7 +107,7 @@ make_fcontext: # including 64 byte of linkage + parameter area (R1 % 16 == 0) subi %r3, %r3, 248 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function # entry point (ELFv2) or descriptor (ELFv1) #if _CALL_ELF == 2 # save address of context-function entry point @@ -164,12 +164,12 @@ finish: bl _exit nop #if _CALL_ELF == 2 - .size make_fcontext, .-make_fcontext + .size zend_make_fcontext, .-zend_make_fcontext #else # ifdef _CALL_LINUX - .size .make_fcontext, .-.L.make_fcontext + .size .zend_make_fcontext, .-.L.zend_make_fcontext # else - .size .make_fcontext, .-.make_fcontext + .size .zend_make_fcontext, .-.zend_make_fcontext # endif #endif diff --git a/Zend/asm/make_ppc64_sysv_macho_gas.S b/Zend/asm/make_ppc64_sysv_macho_gas.S index 7b947bb6b030..6146f481d0e3 100644 --- a/Zend/asm/make_ppc64_sysv_macho_gas.S +++ b/Zend/asm/make_ppc64_sysv_macho_gas.S @@ -66,12 +66,12 @@ * * .text -.globl _make_fcontext -_make_fcontext: +.globl _zend_make_fcontext +_zend_make_fcontext: ; save return address into R6 mflr r6 - ; first arg of make_fcontext() == top address of context-function + ; first arg of zend_make_fcontext() == top address of context-function ; shift address in R3 to lower 16 byte boundary clrrwi r3, r3, 4 @@ -79,7 +79,7 @@ _make_fcontext: ; including 64 byte of linkage + parameter area (R1 16 == 0) subi r3, r3, 248 - ; third arg of make_fcontext() == address of context-function + ; third arg of zend_make_fcontext() == address of context-function stw r5, 176(r3) ; set back-chain to zero diff --git a/Zend/asm/make_ppc64_sysv_xcoff_gas.S b/Zend/asm/make_ppc64_sysv_xcoff_gas.S index 2374b50ee63d..c4b76c69c8df 100644 --- a/Zend/asm/make_ppc64_sysv_xcoff_gas.S +++ b/Zend/asm/make_ppc64_sysv_xcoff_gas.S @@ -70,17 +70,17 @@ .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 + .globl zend_make_fcontext[DS] + .globl .zend_make_fcontext + .csect zend_make_fcontext[DS], 3 +zend_make_fcontext: + .llong .zend_make_fcontext[PR], TOC[tc0], 0 .csect .text[PR], 5 -.make_fcontext: +.zend_make_fcontext: # save return address into R6 mflr 6 - # first arg of make_fcontext() == top address of context-function + # first arg of zend_make_fcontext() == top address of context-function # shift address in R3 to lower 16 byte boundary clrrdi 3, 3, 4 @@ -88,7 +88,7 @@ make_fcontext: # including 64 byte of linkage + parameter area (R1 % 16 == 0) subi 3, 3, 248 - # third arg of make_fcontext() == address of context-function descriptor + # third arg of zend_make_fcontext() == address of context-function descriptor ld 4, 0(5) std 4, 176(3) # save TOC of context-function diff --git a/Zend/asm/make_riscv64_sysv_elf_gas.S b/Zend/asm/make_riscv64_sysv_elf_gas.S index 5322e0fdbdec..d8155d030287 100644 --- a/Zend/asm/make_riscv64_sysv_elf_gas.S +++ b/Zend/asm/make_riscv64_sysv_elf_gas.S @@ -60,16 +60,16 @@ .file "make_riscv64_sysv_elf_gas.S" .text .align 1 -.global make_fcontext -.type make_fcontext, %function -make_fcontext: +.global zend_make_fcontext +.type zend_make_fcontext, %function +zend_make_fcontext: # shift address in a0 (allocated stack) to lower 16 byte boundary andi a0, a0, ~0xF # reserve space for context-data on context-stack addi a0, a0, -0xd0 - # third arg of make_fcontext() == address of context-function + # third arg of zend_make_fcontext() == address of context-function # store address as a PC to jump in sd a2, 0xc8(a0) @@ -86,6 +86,6 @@ finish: # exit application tail _exit@plt -.size make_fcontext,.-make_fcontext +.size zend_make_fcontext,.-zend_make_fcontext # Mark that we don't need executable stack. .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_s390x_sysv_elf_gas.S b/Zend/asm/make_s390x_sysv_elf_gas.S index e7e2d5f6e0c9..2a9d6b771915 100644 --- a/Zend/asm/make_s390x_sysv_elf_gas.S +++ b/Zend/asm/make_s390x_sysv_elf_gas.S @@ -45,8 +45,8 @@ .text .align 8 -.global make_fcontext -.type make_fcontext, @function +.global zend_make_fcontext +.type zend_make_fcontext, @function #define ARG_OFFSET 0 #define GR_OFFSET 16 @@ -58,7 +58,7 @@ /* -fcontext_t make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) ); +fcontext_t zend_make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) ); Create and return a context below SP to call FN. @@ -69,7 +69,7 @@ r4 - The address of the context function */ -make_fcontext: +zend_make_fcontext: .machine "z10" /* Align the stack to an 8 byte boundary. */ nill %r2,0xfff0 @@ -77,7 +77,7 @@ make_fcontext: /* Allocate stack space for the context. */ aghi %r2,-CONTEXT_SIZE - /* Set the r2 save slot to zero. This indicates jump_fcontext + /* Set the r2 save slot to zero. This indicates zend_jump_fcontext that this is a special context. */ mvghi GR_OFFSET(%r2),0 @@ -99,10 +99,10 @@ make_fcontext: finish: /* In finish tasks, you load the exit code and exit the - make_fcontext This is called when the context-function is + zend_make_fcontext This is called when the context-function is entirely executed. */ lghi %r2,0 brasl %r14,_exit@PLT -.size make_fcontext,.-make_fcontext +.size zend_make_fcontext,.-zend_make_fcontext .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_x86_64_ms_pe_masm.asm b/Zend/asm/make_x86_64_ms_pe_masm.asm index 8f6c959a8376..5c34e4770ab6 100644 --- a/Zend/asm/make_x86_64_ms_pe_masm.asm +++ b/Zend/asm/make_x86_64_ms_pe_masm.asm @@ -87,11 +87,11 @@ EXTERN _exit:PROC .code ; generate function table entry in .pdata and unwind information in -make_fcontext PROC BOOST_CONTEXT_EXPORT FRAME +zend_make_fcontext PROC BOOST_CONTEXT_EXPORT FRAME ; .xdata for a function's structured exception handling unwind behavior .endprolog - ; first arg of make_fcontext() == top of context-stack + ; first arg of zend_make_fcontext() == top of context-stack mov rax, rcx ; shift address in RAX to lower 16 byte boundary @@ -102,14 +102,14 @@ make_fcontext PROC BOOST_CONTEXT_EXPORT FRAME ; on context-function entry: (RSP -0x8) % 16 == 0 sub rax, 0150h - ; third arg of make_fcontext() == address of context-function + ; third arg of zend_make_fcontext() == address of context-function ; stored in RBX mov [rax+0100h], r8 - ; first arg of make_fcontext() == top of context-stack + ; first arg of zend_make_fcontext() == top of context-stack ; save top address of context stack as 'base' mov [rax+0c8h], rcx - ; second arg of make_fcontext() == size of context-stack + ; second arg of zend_make_fcontext() == size of context-stack ; negate stack size for LEA instruction (== substraction) neg rdx ; compute bottom address of context stack (limit) @@ -135,7 +135,7 @@ make_fcontext PROC BOOST_CONTEXT_EXPORT FRAME ; compute abs address of label trampoline lea rcx, trampoline ; save address of trampoline as return-address for context-function - ; will be entered after calling jump_fcontext() first time + ; will be entered after calling zend_jump_fcontext() first time mov [rax+0118h], rcx ; compute abs address of label finish @@ -159,5 +159,5 @@ finish: ; exit application call _exit hlt -make_fcontext ENDP +zend_make_fcontext ENDP END diff --git a/Zend/asm/make_x86_64_sysv_elf_gas.S b/Zend/asm/make_x86_64_sysv_elf_gas.S index 0ef37569a029..f6ebb60e53ae 100644 --- a/Zend/asm/make_x86_64_sysv_elf_gas.S +++ b/Zend/asm/make_x86_64_sysv_elf_gas.S @@ -26,11 +26,11 @@ .file "make_x86_64_sysv_elf_gas.S" .text -.globl make_fcontext -.type make_fcontext,@function +.globl zend_make_fcontext +.type zend_make_fcontext,@function .align 16 -make_fcontext: - /* first arg of make_fcontext() == top of context-stack */ +zend_make_fcontext: + /* first arg of zend_make_fcontext() == top of context-stack */ movq %rdi, %rax /* shift address in RAX to lower 16 byte boundary */ @@ -40,7 +40,7 @@ make_fcontext: /* on context-function entry: (RSP -0x8) % 16 == 0 */ leaq -0x40(%rax), %rax - /* third arg of make_fcontext() == address of context-function */ + /* third arg of zend_make_fcontext() == address of context-function */ /* stored in RBX */ movq %rdx, 0x28(%rax) @@ -52,7 +52,7 @@ make_fcontext: /* compute abs address of label trampoline */ leaq trampoline(%rip), %rcx /* save address of trampoline as return-address for context-function */ - /* will be entered after calling jump_fcontext() first time */ + /* will be entered after calling zend_jump_fcontext() first time */ movq %rcx, 0x38(%rax) /* compute abs address of label finish */ @@ -76,7 +76,7 @@ finish: /* exit application */ call _exit@PLT hlt -.size make_fcontext,.-make_fcontext +.size zend_make_fcontext,.-zend_make_fcontext /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits diff --git a/Zend/asm/make_x86_64_sysv_macho_gas.S b/Zend/asm/make_x86_64_sysv_macho_gas.S index 5d6c5431c598..5e22e47592ca 100644 --- a/Zend/asm/make_x86_64_sysv_macho_gas.S +++ b/Zend/asm/make_x86_64_sysv_macho_gas.S @@ -25,10 +25,10 @@ ****************************************************************************************/ .text -.globl _make_fcontext +.globl _zend_make_fcontext .align 8 -_make_fcontext: - /* first arg of make_fcontext() == top of context-stack */ +_zend_make_fcontext: + /* first arg of zend_make_fcontext() == top of context-stack */ movq %rdi, %rax /* shift address in RAX to lower 16 byte boundary */ @@ -38,7 +38,7 @@ _make_fcontext: /* on context-function entry: (RSP -0x8) % 16 == 0 */ leaq -0x40(%rax), %rax - /* third arg of make_fcontext() == address of context-function */ + /* third arg of zend_make_fcontext() == address of context-function */ /* stored in RBX */ movq %rdx, 0x28(%rax) @@ -50,7 +50,7 @@ _make_fcontext: /* compute abs address of label trampoline */ leaq trampoline(%rip), %rcx /* save address of trampoline as return-address for context-function */ - /* will be entered after calling jump_fcontext() first time */ + /* will be entered after calling zend_jump_fcontext() first time */ movq %rcx, 0x38(%rax) /* compute abs address of label finish */ diff --git a/Zend/asm/sync.php b/Zend/asm/sync.php new file mode 100644 index 000000000000..7f41ec011359 --- /dev/null +++ b/Zend/asm/sync.php @@ -0,0 +1,137 @@ +#!/usr/bin/env php +getPathName(); + if (is_file($pathName)) { + if (realpath($pathName) === realpath(__FILE__)) { + // workaround for skipping this file + continue; + } elseif ($fileFilter && !$fileFilter($pathName)) { + unlink($pathName); + } else if ($contentFilter) { + file_put_contents($pathName, $contentFilter(file_get_contents($pathName))); + } + } + } + } + if ($license) { + download($license, "$workspace/LICENSE"); + } + } finally { + @unlink("$workspace/$tarName"); + } +} + +// get fiber_asm_file vars from configure.ac +$configureContent = file_get_contents(__DIR__ . '/../../configure.ac'); +$fiber_asm_files = []; +preg_match_all('/fiber_asm_file="([^"]+)"/', $configureContent, $fiber_asm_file_expressions); +$fiber_asm_file_expressions = $fiber_asm_file_expressions[1]; +foreach ($fiber_asm_file_expressions as $fiber_asm_file_expression) { + if (preg_match_all('/\${(\w+)}/', $fiber_asm_file_expression, $fiber_asm_file_var_names)) { + foreach ($fiber_asm_file_var_names[1] as $fiber_asm_file_var_name) { + preg_match_all("/$fiber_asm_file_var_name=\"([^\"]+)\"/", $configureContent, $fiber_asm_file_vars); + $fiber_asm_file_vars = $fiber_asm_file_vars[1]; + foreach ($fiber_asm_file_vars as $fiber_asm_file_var) { + if ($fiber_asm_file_var === 'unknown') { + continue; + } + $fiber_asm_files[] = str_replace('${' . $fiber_asm_file_var_name . '}', $fiber_asm_file_var, $fiber_asm_file_expression); + } + } + } else { + $fiber_asm_files[] = $fiber_asm_file_expression; + } +} + +sync( + name: 'context', + workspace: __DIR__, + uri: 'https://github.com/boostorg/context/archive/refs/heads/develop.tar.gz', + subPath: 'context-develop/src/asm', + fileFilter: function (string $pathName) use ($fiber_asm_files): bool { + if (!str_starts_with(basename($pathName), 'make_') && !str_starts_with(basename($pathName), 'jump_')) { + return false; + } + // configure.ac + foreach ($fiber_asm_files as $fiber_asm_file) { + if (str_ends_with($pathName, "$fiber_asm_file.S")) { + return true; + } + } + // for darwin + if (str_ends_with($pathName, "macho_gas.S") && + /* we already have combined file */ + (str_contains($pathName, '_combined_') || !str_contains(file_get_contents($pathName), 'No arch\'s'))) { + return true; + } + // win32/build/Makefile.frag.w32 + if (str_ends_with($pathName, 'ms_pe_masm.asm') || + str_ends_with($pathName, 'ms_pe_masm.asm')) { + return true; + } + return false; + }, + contentFilter: fn(string $content): string => preg_replace([ + '/\b_make_fcontext\b/', + '/\bmake_fcontext\b/', + '/\b_jump_fcontext\b/', + '/\bjump_fcontext\b/', + ], [ + '_zend_make_fcontext', + 'zend_make_fcontext', + '_zend_jump_fcontext', + 'zend_jump_fcontext', + ], $content), + license: 'https://raw.githubusercontent.com/boostorg/boost/master/LICENSE_1_0.txt' +); + +echo "Done.\n"; diff --git a/Zend/zend_fibers.c b/Zend/zend_fibers.c index dd06f86ae8da..22cd2ca5e22f 100644 --- a/Zend/zend_fibers.c +++ b/Zend/zend_fibers.c @@ -140,8 +140,8 @@ typedef struct { } boost_context_data; /* These functions are defined in assembler files provided by boost.context (located in "Zend/asm"). */ -extern void *make_fcontext(void *sp, size_t size, void (*fn)(boost_context_data)); -extern boost_context_data jump_fcontext(void *to, zend_fiber_transfer *transfer); +extern void *zend_make_fcontext(void *sp, size_t size, void (*fn)(boost_context_data)); +extern boost_context_data zend_jump_fcontext(void *to, zend_fiber_transfer *transfer); #endif ZEND_API zend_class_entry *zend_ce_fiber; @@ -335,11 +335,11 @@ ZEND_API bool zend_fiber_init_context(zend_fiber_context *context, void *kind, z context->handle = handle; #else - // Stack grows down, calculate the top of the stack. make_fcontext then shifts pointer to lower 16-byte boundary. + // Stack grows down, calculate the top of the stack. zend_make_fcontext then shifts pointer to lower 16-byte boundary. void *stack = (void *) ((uintptr_t) context->stack->pointer + context->stack->size); - context->handle = make_fcontext(stack, context->stack->size, zend_fiber_trampoline); - ZEND_ASSERT(context->handle != NULL && "make_fcontext() never returns NULL"); + context->handle = zend_make_fcontext(stack, context->stack->size, zend_fiber_trampoline); + ZEND_ASSERT(context->handle != NULL && "zend_make_fcontext() never returns NULL"); #endif context->kind = kind; @@ -411,7 +411,7 @@ ZEND_API void zend_fiber_switch_context(zend_fiber_transfer *transfer) /* Copy transfer struct because it might live on the other fiber's stack that will eventually be destroyed. */ *transfer = *transfer_data; #else - boost_context_data data = jump_fcontext(to->handle, transfer); + boost_context_data data = zend_jump_fcontext(to->handle, transfer); /* Copy transfer struct because it might live on the other fiber's stack that will eventually be destroyed. */ *transfer = *data.transfer;