Skip to content

Commit 36cbc00

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Sync all boost.context files with release 1.86.0 Sync all boost.context files with release 1.86.0
2 parents 8ea8da2 + d94c05f commit 36cbc00

File tree

6 files changed

+38
-24
lines changed

6 files changed

+38
-24
lines changed

Zend/asm/jump_s390x_sysv_elf_gas.S

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@
4949
.type jump_fcontext, @function
5050

5151
#define ARG_OFFSET 0
52-
#define GR_OFFSET 16
53-
#define FP_OFFSET 96
54-
#define FPC_OFFSET 160
55-
#define PC_OFFSET 168
56-
#define CONTEXT_SIZE 176
52+
#define GR_OFFSET 16
53+
#define R14_OFFSET 88
54+
#define FP_OFFSET 96
55+
#define FPC_OFFSET 160
56+
#define PC_OFFSET 168
57+
#define CONTEXT_SIZE 176
5758

5859
#define REG_SAVE_AREA_SIZE 160
5960

@@ -131,11 +132,14 @@ jump_fcontext:
131132
ltg %r2,GR_OFFSET(%r15)
132133
jnz use_return_slot
133134

134-
/* We restore a make_fcontext context. Use the function
135-
argument slot in the context we just saved and allocate the
136-
register save area for the target function. */
137-
la %r2,ARG_OFFSET(%r1)
138-
aghi %r15,-REG_SAVE_AREA_SIZE
135+
/* We're restoring a context created by make_fcontext.
136+
This is going to be the argument of the entry point
137+
of the fiber. We're placing it on top of the ABI
138+
defined register save area of the fiber's own stack. */
139+
la %r2,REG_SAVE_AREA_SIZE(%r15)
140+
141+
/* REG_SAVE_AREA_SIZE + sizeof(transfer_t) */
142+
aghi %r15,-(REG_SAVE_AREA_SIZE+16)
139143

140144
use_return_slot:
141145
/* Save the two fields in transfer_t. When calling a

Zend/asm/jump_sparc64_sysv_elf_gas.S

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
*/
77

88
/*
9-
* typedef struct {
10-
* void *handle;
11-
* zend_fiber_transfer *transfer;
12-
* } boost_context_data;
9+
* typedef void* fcontext_t;
1310
*
14-
* boost_context_data jump_fcontext(void *to, zend_fiber_transfer *transfer);
11+
* struct transfer_t {
12+
* fcontext_t fctx;
13+
* void * data;
14+
* };
15+
*
16+
* transfer_t jump_fcontext(fcontext_t const to, void *vp);
1517
*/
1618
#define CC64FSZ 176
1719
#define BIAS 2047

Zend/asm/jump_x86_64_ms_pe_gas.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
.file "jump_x86_64_ms_pe_gas.asm"
9090
.text
9191
.p2align 4,,15
92+
.globl jump_fcontext
9293
.def jump_fcontext; .scl 2; .type 32; .endef
9394
.seh_proc jump_fcontext
9495
jump_fcontext:
@@ -203,3 +204,6 @@ jump_fcontext:
203204
/* indirect jump to context */
204205
jmp *%r10
205206
.seh_endproc
207+
208+
.section .drectve
209+
.ascii " -export:\"jump_fcontext\""

Zend/asm/make_s390x_sysv_elf_gas.S

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
.type make_fcontext, @function
5050

5151
#define ARG_OFFSET 0
52-
#define GR_OFFSET 16
53-
#define R14_OFFSET 88
54-
#define FP_OFFSET 96
55-
#define FPC_OFFSET 160
56-
#define PC_OFFSET 168
57-
#define CONTEXT_SIZE 176
52+
#define GR_OFFSET 16
53+
#define R14_OFFSET 88
54+
#define FP_OFFSET 96
55+
#define FPC_OFFSET 160
56+
#define PC_OFFSET 168
57+
#define CONTEXT_SIZE 176
5858

5959
/*
6060
@@ -72,7 +72,7 @@ r4 - The address of the context function
7272
make_fcontext:
7373
.machine "z10"
7474
/* Align the stack to an 8 byte boundary. */
75-
nill %r2,0xfff0
75+
nill %r2,0xfff8
7676

7777
/* Allocate stack space for the context. */
7878
aghi %r2,-CONTEXT_SIZE

Zend/asm/make_sparc64_sysv_elf_gas.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
/*
9-
* void *make_fcontext(void *sp, size_t size, void (*fn)(boost_context_data));
9+
* fcontext_t *make_fcontext(void *sp, size_t size, void (*fn)(transfer_t));
1010
*/
1111
#define CC64FSZ 176
1212
#define BIAS 2047
@@ -56,7 +56,7 @@ make_fcontext:
5656
trampoline:
5757
ldx [%sp + BIAS + I7], %l0
5858

59-
# no need to setup boost_context_data, already in %o0 and %o1
59+
# no need to setup transfer_t, already in %o0 and %o1
6060
jmpl %l0, %o7
6161
nop
6262

Zend/asm/make_x86_64_ms_pe_gas.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
.file "make_x86_64_ms_pe_gas.asm"
9090
.text
9191
.p2align 4,,15
92+
.globl make_fcontext
9293
.def make_fcontext; .scl 2; .type 32; .endef
9394
.seh_proc make_fcontext
9495
make_fcontext:
@@ -168,3 +169,6 @@ finish:
168169
.seh_endproc
169170

170171
.def _exit; .scl 2; .type 32; .endef /* standard C library function */
172+
173+
.section .drectve
174+
.ascii " -export:\"make_fcontext\""

0 commit comments

Comments
 (0)