-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC: https://wiki.php.net/rfc/fibers Closes GH-6875.
- Loading branch information
Showing
112 changed files
with
7,048 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Boost Software License - Version 1.0 - August 17th, 2003 | ||
|
||
Permission is hereby granted, free of charge, to any person or organization | ||
obtaining a copy of the software and accompanying documentation covered by | ||
this license (the "Software") to use, reproduce, display, distribute, | ||
execute, and transmit the Software, and to prepare derivative works of the | ||
Software, and to permit third-parties to whom the Software is furnished to | ||
do so, all subject to the following: | ||
|
||
The copyright notices in the Software and this entire statement, including | ||
the above license grant, this restriction and the following disclaimer, | ||
must be included in all copies of the Software, in whole or in part, and | ||
all derivative works of the Software, unless such copies or derivative | ||
works are solely in the form of machine-executable object code generated by | ||
a source language processor. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | ||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | ||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/* | ||
Copyright Edward Nevill + Oliver Kowalke 2015 | ||
Distributed under the Boost Software License, Version 1.0. | ||
(See accompanying file LICENSE_1_0.txt or copy at | ||
http://www.boost.org/LICENSE_1_0.txt) | ||
*/ | ||
/******************************************************* | ||
* * | ||
* ------------------------------------------------- * | ||
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | ||
* ------------------------------------------------- * | ||
* | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| * | ||
* ------------------------------------------------- * | ||
* | d8 | d9 | d10 | d11 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * | ||
* ------------------------------------------------- * | ||
* | 0x20| 0x24| 0x28| 0x2c| 0x30| 0x34| 0x38| 0x3c| * | ||
* ------------------------------------------------- * | ||
* | d12 | d13 | d14 | d15 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * | ||
* ------------------------------------------------- * | ||
* | 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58| 0x5c| * | ||
* ------------------------------------------------- * | ||
* | x19 | x20 | x21 | x22 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * | ||
* ------------------------------------------------- * | ||
* | 0x60| 0x64| 0x68| 0x6c| 0x70| 0x74| 0x78| 0x7c| * | ||
* ------------------------------------------------- * | ||
* | x23 | x24 | x25 | x26 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * | ||
* ------------------------------------------------- * | ||
* | 0x80| 0x84| 0x88| 0x8c| 0x90| 0x94| 0x98| 0x9c| * | ||
* ------------------------------------------------- * | ||
* | x27 | x28 | FP | LR | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 40 | 41 | 42 | 43 | | | * | ||
* ------------------------------------------------- * | ||
* | 0xa0| 0xa4| 0xa8| 0xac| | | * | ||
* ------------------------------------------------- * | ||
* | PC | align | | | * | ||
* ------------------------------------------------- * | ||
* * | ||
*******************************************************/ | ||
|
||
.file "jump_arm64_aapcs_elf_gas.S" | ||
.text | ||
.align 2 | ||
.global jump_fcontext | ||
.type jump_fcontext, %function | ||
jump_fcontext: | ||
# prepare stack for GP + FPU | ||
sub sp, sp, #0xb0 | ||
|
||
# save d8 - d15 | ||
stp d8, d9, [sp, #0x00] | ||
stp d10, d11, [sp, #0x10] | ||
stp d12, d13, [sp, #0x20] | ||
stp d14, d15, [sp, #0x30] | ||
|
||
# save x19-x30 | ||
stp x19, x20, [sp, #0x40] | ||
stp x21, x22, [sp, #0x50] | ||
stp x23, x24, [sp, #0x60] | ||
stp x25, x26, [sp, #0x70] | ||
stp x27, x28, [sp, #0x80] | ||
stp x29, x30, [sp, #0x90] | ||
|
||
# save LR as PC | ||
str x30, [sp, #0xa0] | ||
|
||
# store RSP (pointing to context-data) in X0 | ||
mov x4, sp | ||
|
||
# restore RSP (pointing to context-data) from X1 | ||
mov sp, x0 | ||
|
||
# load d8 - d15 | ||
ldp d8, d9, [sp, #0x00] | ||
ldp d10, d11, [sp, #0x10] | ||
ldp d12, d13, [sp, #0x20] | ||
ldp d14, d15, [sp, #0x30] | ||
|
||
# load x19-x30 | ||
ldp x19, x20, [sp, #0x40] | ||
ldp x21, x22, [sp, #0x50] | ||
ldp x23, x24, [sp, #0x60] | ||
ldp x25, x26, [sp, #0x70] | ||
ldp x27, x28, [sp, #0x80] | ||
ldp x29, x30, [sp, #0x90] | ||
|
||
# return transfer_t from jump | ||
# pass transfer_t as first arg in context function | ||
# X0 == FCTX, X1 == DATA | ||
mov x0, x4 | ||
|
||
# load pc | ||
ldr x4, [sp, #0xa0] | ||
|
||
# restore stack from GP + FPU | ||
add sp, sp, #0xb0 | ||
|
||
ret x4 | ||
.size jump_fcontext,.-jump_fcontext | ||
# Mark that we don't need executable stack. | ||
.section .note.GNU-stack,"",%progbits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/* | ||
Copyright Edward Nevill + Oliver Kowalke 2015 | ||
Distributed under the Boost Software License, Version 1.0. | ||
(See accompanying file LICENSE_1_0.txt or copy at | ||
http://www.boost.org/LICENSE_1_0.txt) | ||
*/ | ||
/******************************************************* | ||
* * | ||
* ------------------------------------------------- * | ||
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | ||
* ------------------------------------------------- * | ||
* | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| * | ||
* ------------------------------------------------- * | ||
* | d8 | d9 | d10 | d11 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * | ||
* ------------------------------------------------- * | ||
* | 0x20| 0x24| 0x28| 0x2c| 0x30| 0x34| 0x38| 0x3c| * | ||
* ------------------------------------------------- * | ||
* | d12 | d13 | d14 | d15 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * | ||
* ------------------------------------------------- * | ||
* | 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58| 0x5c| * | ||
* ------------------------------------------------- * | ||
* | x19 | x20 | x21 | x22 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * | ||
* ------------------------------------------------- * | ||
* | 0x60| 0x64| 0x68| 0x6c| 0x70| 0x74| 0x78| 0x7c| * | ||
* ------------------------------------------------- * | ||
* | x23 | x24 | x25 | x26 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | * | ||
* ------------------------------------------------- * | ||
* | 0x80| 0x84| 0x88| 0x8c| 0x90| 0x94| 0x98| 0x9c| * | ||
* ------------------------------------------------- * | ||
* | x27 | x28 | FP | LR | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 40 | 41 | 42 | 43 | | | * | ||
* ------------------------------------------------- * | ||
* | 0xa0| 0xa4| 0xa8| 0xac| | | * | ||
* ------------------------------------------------- * | ||
* | PC | align | | | * | ||
* ------------------------------------------------- * | ||
* * | ||
*******************************************************/ | ||
|
||
.text | ||
.globl _jump_fcontext | ||
.balign 16 | ||
_jump_fcontext: | ||
; prepare stack for GP + FPU | ||
sub sp, sp, #0xb0 | ||
|
||
; save d8 - d15 | ||
stp d8, d9, [sp, #0x00] | ||
stp d10, d11, [sp, #0x10] | ||
stp d12, d13, [sp, #0x20] | ||
stp d14, d15, [sp, #0x30] | ||
|
||
; save x19-x30 | ||
stp x19, x20, [sp, #0x40] | ||
stp x21, x22, [sp, #0x50] | ||
stp x23, x24, [sp, #0x60] | ||
stp x25, x26, [sp, #0x70] | ||
stp x27, x28, [sp, #0x80] | ||
stp fp, lr, [sp, #0x90] | ||
|
||
; save LR as PC | ||
str lr, [sp, #0xa0] | ||
|
||
; store RSP (pointing to context-data) in X0 | ||
mov x4, sp | ||
|
||
; restore RSP (pointing to context-data) from X1 | ||
mov sp, x0 | ||
|
||
; load d8 - d15 | ||
ldp d8, d9, [sp, #0x00] | ||
ldp d10, d11, [sp, #0x10] | ||
ldp d12, d13, [sp, #0x20] | ||
ldp d14, d15, [sp, #0x30] | ||
|
||
; load x19-x30 | ||
ldp x19, x20, [sp, #0x40] | ||
ldp x21, x22, [sp, #0x50] | ||
ldp x23, x24, [sp, #0x60] | ||
ldp x25, x26, [sp, #0x70] | ||
ldp x27, x28, [sp, #0x80] | ||
ldp fp, lr, [sp, #0x90] | ||
|
||
; return transfer_t from jump | ||
; pass transfer_t as first arg in context function | ||
; X0 == FCTX, X1 == DATA | ||
mov x0, x4 | ||
|
||
; load pc | ||
ldr x4, [sp, #0xa0] | ||
|
||
; restore stack from GP + FPU | ||
add sp, sp, #0xb0 | ||
|
||
ret x4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
Copyright Oliver Kowalke 2009. | ||
Distributed under the Boost Software License, Version 1.0. | ||
(See accompanying file LICENSE_1_0.txt or copy at | ||
http://www.boost.org/LICENSE_1_0.txt) | ||
*/ | ||
|
||
/******************************************************* | ||
* * | ||
* ------------------------------------------------- * | ||
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | ||
* ------------------------------------------------- * | ||
* | 0x0 | 0x4 | 0x8 | 0xc | 0x10| 0x14| 0x18| 0x1c| * | ||
* ------------------------------------------------- * | ||
* | s16 | s17 | s18 | s19 | s20 | s21 | s22 | s23 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | * | ||
* ------------------------------------------------- * | ||
* | 0x20| 0x24| 0x28| 0x2c| 0x30| 0x34| 0x38| 0x3c| * | ||
* ------------------------------------------------- * | ||
* | s24 | s25 | s26 | s27 | s28 | s29 | s30 | s31 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | * | ||
* ------------------------------------------------- * | ||
* | 0x40| 0x44| 0x48| 0x4c| 0x50| 0x54| 0x58| 0x5c| * | ||
* ------------------------------------------------- * | ||
* |hiddn| v1 | v2 | v3 | v4 | v5 | v6 | v7 | * | ||
* ------------------------------------------------- * | ||
* ------------------------------------------------- * | ||
* | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | * | ||
* ------------------------------------------------- * | ||
* | 0x60| 0x64| 0x68| 0x6c| 0x70| 0x74| 0x78| 0x7c| * | ||
* ------------------------------------------------- * | ||
* | v8 | lr | pc | FCTX| DATA| | * | ||
* ------------------------------------------------- * | ||
* * | ||
*******************************************************/ | ||
|
||
.file "jump_arm_aapcs_elf_gas.S" | ||
.text | ||
.globl jump_fcontext | ||
.align 2 | ||
.type jump_fcontext,%function | ||
.syntax unified | ||
jump_fcontext: | ||
@ save LR as PC | ||
push {lr} | ||
@ save hidden,V1-V8,LR | ||
push {a1,v1-v8,lr} | ||
|
||
@ prepare stack for FPU | ||
sub sp, sp, #64 | ||
#if (defined(__VFP_FP__) && !defined(__SOFTFP__)) | ||
@ save S16-S31 | ||
vstmia sp, {d8-d15} | ||
#endif | ||
|
||
@ store RSP (pointing to context-data) in A1 | ||
mov a1, sp | ||
|
||
@ restore RSP (pointing to context-data) from A2 | ||
mov sp, a2 | ||
|
||
#if (defined(__VFP_FP__) && !defined(__SOFTFP__)) | ||
@ restore S16-S31 | ||
vldmia sp, {d8-d15} | ||
#endif | ||
@ prepare stack for FPU | ||
add sp, sp, #64 | ||
|
||
@ restore hidden,V1-V8,LR | ||
pop {a4,v1-v8,lr} | ||
|
||
@ return transfer_t from jump | ||
str a1, [a4, #0] | ||
str a3, [a4, #4] | ||
@ pass transfer_t as first arg in context function | ||
@ A1 == FCTX, A2 == DATA | ||
mov a2, a3 | ||
|
||
@ restore PC | ||
pop {pc} | ||
.size jump_fcontext,.-jump_fcontext | ||
|
||
@ Mark that we don't need executable stack. | ||
.section .note.GNU-stack,"",%progbits |
Oops, something went wrong.