diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2024-12-19 12:43:41 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2024-12-19 13:48:07 +0300 |
commit | 764ba18f3853b477082f7b72ce9da3f984b98429 (patch) | |
tree | 4a4e34826e26c4b8125e2b3e2ad4d2850cda8a75 | |
parent | f68ac69e4656a200f24e5bbd153a59db43c185de (diff) | |
download | ydb-764ba18f3853b477082f7b72ce9da3f984b98429.tar.gz |
Update contrib/restricted/boost/context to 1.87.0
commit_hash:9a410907c80c2195a53579cb7946b3ffaa07d579
63 files changed, 549 insertions, 51 deletions
diff --git a/contrib/restricted/boost/context/.yandex_meta/devtools.copyrights.report b/contrib/restricted/boost/context/.yandex_meta/devtools.copyrights.report index bc3f7ce474..32f11fe362 100644 --- a/contrib/restricted/boost/context/.yandex_meta/devtools.copyrights.report +++ b/contrib/restricted/boost/context/.yandex_meta/devtools.copyrights.report @@ -47,12 +47,15 @@ BELONGS ya.make src/asm/jump_arm64_aapcs_elf_gas.S [2:4] src/asm/jump_arm64_aapcs_macho_gas.S [2:4] src/asm/jump_arm64_aapcs_pe_armasm.masm [1:3] + src/asm/jump_arm64_aapcs_pe_armclang.S [2:4] src/asm/make_arm64_aapcs_elf_gas.S [2:4] src/asm/make_arm64_aapcs_macho_gas.S [2:4] src/asm/make_arm64_aapcs_pe_armasm.masm [1:3] + src/asm/make_arm64_aapcs_pe_armclang.S [2:4] src/asm/ontop_arm64_aapcs_elf_gas.S [2:4] src/asm/ontop_arm64_aapcs_macho_gas.S [2:4] src/asm/ontop_arm64_aapcs_pe_armasm.masm [1:3] + src/asm/ontop_arm64_aapcs_pe_armclang.S [2:4] KEEP COPYRIGHT_SERVICE_LABEL 48ce97ba62fc10cee11a213ab0560d6d BELONGS ya.make @@ -144,6 +147,16 @@ BELONGS ya.make src/asm/tail_ontop_ppc32_sysv.cpp [2:4] src/untested.cpp [2:4] +KEEP COPYRIGHT_SERVICE_LABEL 9ed7b7468c684d33492a4176e9cf31b1 +BELONGS ya.make + Note: matched license text is too long. Read it in the source files. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + src/fcontext.cpp [1:3] + KEEP COPYRIGHT_SERVICE_LABEL b56e68f168b25ead2610488b3af94842 BELONGS ya.make License text: diff --git a/contrib/restricted/boost/context/.yandex_meta/devtools.licenses.report b/contrib/restricted/boost/context/.yandex_meta/devtools.licenses.report index 2f7dd7780d..92e42b3404 100644 --- a/contrib/restricted/boost/context/.yandex_meta/devtools.licenses.report +++ b/contrib/restricted/boost/context/.yandex_meta/devtools.licenses.report @@ -68,6 +68,22 @@ BELONGS ya.make src/asm/make_arm_aapcs_pe_armasm.masm [3:5] src/asm/ontop_arm_aapcs_pe_armasm.masm [3:5] +KEEP BSL-1.0 321a164a9126e96f909fc36bc3ae6dda +BELONGS ya.make + License text: + 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) + Scancode info: + Original SPDX id: BSL-1.0 + Score : 100.00 + Match type : NOTICE + Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 + Files with this license: + src/asm/jump_arm64_aapcs_pe_armclang.S [3:5] + src/asm/make_arm64_aapcs_pe_armclang.S [3:5] + src/asm/ontop_arm64_aapcs_pe_armclang.S [3:5] + KEEP BSL-1.0 45dafc5af311668ee8f059b952891651 BELONGS ya.make License text: @@ -127,6 +143,7 @@ BELONGS ya.make include/boost/context/stack_traits.hpp [3:5] include/boost/context/windows/protected_fixedsize_stack.hpp [3:5] src/continuation.cpp [3:5] + src/fcontext.cpp [2:4] src/fiber.cpp [3:5] src/posix/stack_traits.cpp [3:5] src/untested.cpp [3:5] diff --git a/contrib/restricted/boost/context/.yandex_meta/licenses.list.txt b/contrib/restricted/boost/context/.yandex_meta/licenses.list.txt index 6b4897d488..7ab7afd143 100644 --- a/contrib/restricted/boost/context/.yandex_meta/licenses.list.txt +++ b/contrib/restricted/boost/context/.yandex_meta/licenses.list.txt @@ -17,6 +17,12 @@ ====================BSL-1.0==================== + 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) + + +====================BSL-1.0==================== // 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) @@ -93,3 +99,9 @@ // Copyright Oliver Kowalke 2017. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at + + +====================COPYRIGHT==================== +// SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com> +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at diff --git a/contrib/restricted/boost/context/fcontext_impl/ya.make b/contrib/restricted/boost/context/fcontext_impl/ya.make index 830a53b844..fc4f78a0e4 100644 --- a/contrib/restricted/boost/context/fcontext_impl/ya.make +++ b/contrib/restricted/boost/context/fcontext_impl/ya.make @@ -4,9 +4,9 @@ LIBRARY() WITHOUT_LICENSE_TEXTS() -VERSION(1.86.0) +VERSION(1.87.0) -ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.86.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.87.0.tar.gz) LICENSE(BSL-1.0) @@ -70,6 +70,7 @@ SRCS( asm/jump_${BOOST_CONTEXT_ASM_SUFFIX} asm/make_${BOOST_CONTEXT_ASM_SUFFIX} asm/ontop_${BOOST_CONTEXT_ASM_SUFFIX} + fcontext.cpp ) END() diff --git a/contrib/restricted/boost/context/impl_common/ya.make b/contrib/restricted/boost/context/impl_common/ya.make index 61f7516118..3a9a118a9c 100644 --- a/contrib/restricted/boost/context/impl_common/ya.make +++ b/contrib/restricted/boost/context/impl_common/ya.make @@ -4,9 +4,9 @@ LIBRARY() WITHOUT_LICENSE_TEXTS() -VERSION(1.86.0) +VERSION(1.87.0) -ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.86.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.87.0.tar.gz) LICENSE(BSL-1.0) diff --git a/contrib/restricted/boost/context/include/boost/context/detail/fcontext.hpp b/contrib/restricted/boost/context/include/boost/context/detail/fcontext.hpp index 00cb24d941..52be6083af 100644 --- a/contrib/restricted/boost/context/include/boost/context/detail/fcontext.hpp +++ b/contrib/restricted/boost/context/include/boost/context/detail/fcontext.hpp @@ -27,14 +27,11 @@ struct transfer_t { void * data; }; -extern "C" BOOST_CONTEXT_DECL -transfer_t BOOST_CONTEXT_CALLDECL jump_fcontext( fcontext_t const to, void * vp); -extern "C" BOOST_CONTEXT_DECL -fcontext_t BOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) ); +BOOST_CONTEXT_DECL transfer_t jump_fcontext( fcontext_t const to, void * vp); +BOOST_CONTEXT_DECL fcontext_t make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) ); // based on an idea of Giovanni Derreta -extern "C" BOOST_CONTEXT_DECL -transfer_t BOOST_CONTEXT_CALLDECL ontop_fcontext( fcontext_t const to, void * vp, transfer_t (* fn)( transfer_t) ); +BOOST_CONTEXT_DECL transfer_t ontop_fcontext( fcontext_t const to, void * vp, transfer_t (* fn)( transfer_t) ); }}} diff --git a/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_elf_gas.S index cefd1830d7..7c1f075355 100644 --- a/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_elf_gas.S @@ -55,6 +55,7 @@ .text .align 2 .global jump_fcontext +.hidden jump_fcontext .type jump_fcontext, %function jump_fcontext: # prepare stack for GP + FPU diff --git a/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_macho_gas.S b/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_macho_gas.S index 31738f7453..12cc021586 100644 --- a/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_macho_gas.S @@ -52,6 +52,7 @@ *******************************************************/ .text +.private_extern _jump_fcontext .globl _jump_fcontext .balign 16 _jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_pe_armclang.S b/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_pe_armclang.S new file mode 100644 index 0000000000..0ad7ac1f8f --- /dev/null +++ b/contrib/restricted/boost/context/src/asm/jump_arm64_aapcs_pe_armclang.S @@ -0,0 +1,141 @@ +/* + 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 | 44 | 45 | 46 | 47 | * +* ------------------------------------------------- * +* | 0xa0| 0xa4| 0xa8| 0xac| 0xb0| 0xb4| 0xb8| 0xbc| * +* ------------------------------------------------- * +* | fiber data| base | limit | dealloc | * +* ------------------------------------------------- * +* ------------------------------------------------- * +* | 48 | 49 | 50 | 51 | | | * +* ------------------------------------------------- * +* | 0xc0| 0xc4| 0xc8| 0xcc| | | * +* ------------------------------------------------- * +* | PC | align | | | * +* ------------------------------------------------- * +* * +*******************************************************/ + +.file "jump_arm64_aapcs_pe_armclang.S" +.text +.balign 4 + +.def jump_fcontext; .scl 2; .type 32; .endef +.seh_proc jump_fcontext +jump_fcontext: +.seh_endprologue + // prepare stack for GP + FPU + sub sp, sp, #0xd0 + + // 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, #0xc0] + + // save current stack base and limit + ldp x5, x6, [x18, #0x08] // TeStackBase and TeStackLimit at ksarm64.h + stp x5, x6, [sp, #0xa0] + // save current fiber data and deallocation stack + ldr x5, [x18, #0x1478] // TeDeallocationStack at ksarm64.h + ldr x6, [x18, #0x20] // TeFiberData at ksarm64.h + stp x5, x6, [sp, #0xb0] + + // store RSP (pointing to context-data) in X0 + mov x4, sp + + // restore RSP (pointing to context-data) from X1 + mov sp, x0 + + // restore stack base and limit + ldp x5, x6, [sp, #0xa0] + stp x5, x6, [x18, #0x08] // TeStackBase and TeStackLimit at ksarm64.h + // restore fiber data and deallocation stack + ldp x5, x6, [sp, #0xb0] + str x5, [x18, #0x1478] // TeDeallocationStack at ksarm64.h + str x6, [x18, #0x20] // TeFiberData at ksarm64.h + + // 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, #0xc0] + + // restore stack from GP + FPU + add sp, sp, #0xd0 + + ret x4 +.seh_endproc + +.section .drectve +.ascii " -export:\"jump_fcontext\"" diff --git a/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_elf_gas.S index 86efe9d821..9934c0897c 100644 --- a/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_elf_gas.S @@ -41,6 +41,7 @@ .file "jump_arm_aapcs_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .align 2 .type jump_fcontext,%function .syntax unified diff --git a/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_macho_gas.S b/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_macho_gas.S index 077c36409e..44e7f2a422 100644 --- a/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_arm_aapcs_macho_gas.S @@ -39,6 +39,7 @@ *******************************************************/ .text +.private_extern _jump_fcontext .globl _jump_fcontext .align 2 _jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_i386_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_i386_sysv_elf_gas.S index ed83717ce2..d00ac4fffd 100644 --- a/contrib/restricted/boost/context/src/asm/jump_i386_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_i386_sysv_elf_gas.S @@ -31,6 +31,7 @@ .file "jump_i386_sysv_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .align 2 .type jump_fcontext,@function jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_i386_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/jump_i386_sysv_macho_gas.S index 8ab7c6f29c..12aa702be9 100644 --- a/contrib/restricted/boost/context/src/asm/jump_i386_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_i386_sysv_macho_gas.S @@ -25,6 +25,7 @@ ****************************************************************************************/ .text +.private_extern _jump_fcontext .globl _jump_fcontext .align 2 _jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_loongarch64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_loongarch64_sysv_elf_gas.S index 74c081e07f..6f99e719ec 100644 --- a/contrib/restricted/boost/context/src/asm/jump_loongarch64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_loongarch64_sysv_elf_gas.S @@ -41,6 +41,7 @@ .file "jump_loongarch64_sysv_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .align 2 .type jump_fcontext,@function jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_mips32_o32_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_mips32_o32_elf_gas.S index f2b8034d8c..df0676b604 100644 --- a/contrib/restricted/boost/context/src/asm/jump_mips32_o32_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_mips32_o32_elf_gas.S @@ -41,6 +41,7 @@ .file "jump_mips32_o32_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .align 2 .type jump_fcontext,@function .ent jump_fcontext diff --git a/contrib/restricted/boost/context/src/asm/jump_mips64_n64_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_mips64_n64_elf_gas.S index e338912bb6..60027fe617 100644 --- a/contrib/restricted/boost/context/src/asm/jump_mips64_n64_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_mips64_n64_elf_gas.S @@ -48,6 +48,7 @@ .file "jump_mips64_n64_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .align 3 .type jump_fcontext,@function .ent jump_fcontext diff --git a/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_elf_gas.S index 48e09c935e..e313366400 100644 --- a/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_elf_gas.S @@ -53,6 +53,7 @@ .file "jump_ppc32_sysv_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .align 2 .type jump_fcontext,@function jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_macho_gas.S index fef90c295f..10e6113639 100644 --- a/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_ppc32_sysv_macho_gas.S @@ -74,6 +74,7 @@ *******************************************************/ .text +.private_extern _jump_fcontext .globl _jump_fcontext .align 2 _jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_elf_gas.S index 28907db32b..fc3c6d63dc 100644 --- a/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_elf_gas.S @@ -68,6 +68,7 @@ .file "jump_ppc64_sysv_elf_gas.S" .globl jump_fcontext +.hidden jump_fcontext #if _CALL_ELF == 2 .text .align 2 diff --git a/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_macho_gas.S index dcc6c645db..e4d8944b56 100644 --- a/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_ppc64_sysv_macho_gas.S @@ -68,6 +68,7 @@ .text .align 2 +.private_extern _jump_fcontext .globl _jump_fcontext _jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/jump_riscv64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_riscv64_sysv_elf_gas.S index 5417e5d5e3..879eb7efee 100644 --- a/contrib/restricted/boost/context/src/asm/jump_riscv64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_riscv64_sysv_elf_gas.S @@ -61,6 +61,7 @@ .text .align 1 .global jump_fcontext +.hidden jump_fcontext .type jump_fcontext, %function jump_fcontext: # prepare stack for GP + FPU diff --git a/contrib/restricted/boost/context/src/asm/jump_s390x_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_s390x_sysv_elf_gas.S index fa71467756..59bc58bf37 100644 --- a/contrib/restricted/boost/context/src/asm/jump_s390x_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_s390x_sysv_elf_gas.S @@ -46,6 +46,7 @@ .text .align 8 .global jump_fcontext +.hidden jump_fcontext .type jump_fcontext, @function #define ARG_OFFSET 0 diff --git a/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_elf_gas.S index be264bdc2e..2eff59a380 100644 --- a/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_elf_gas.S @@ -44,6 +44,7 @@ .file "jump_x86_64_sysv_elf_gas.S" .text .globl jump_fcontext +.hidden jump_fcontext .type jump_fcontext,@function .align 16 jump_fcontext: @@ -73,14 +74,6 @@ jump_fcontext: /* read the current SSP and store it */ rdsspq %rcx movq %rcx, (%rsp) -#endif - -#if BOOST_CONTEXT_SHADOW_STACK - /* grow the stack to reserve space for shadow stack pointer(SSP) */ - leaq -0x8(%rsp), %rsp - /* read the current SSP and store it */ - rdsspq %rcx - movq %rcx, (%rsp) # endif /* store RSP (pointing to context-data) in RAX */ diff --git a/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_macho_gas.S index afc3e5c126..673daa61df 100644 --- a/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/jump_x86_64_sysv_macho_gas.S @@ -25,6 +25,7 @@ ****************************************************************************************/ .text +.private_extern _jump_fcontext .globl _jump_fcontext .align 8 _jump_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_elf_gas.S index 66cfb2da17..8ac825bf54 100644 --- a/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_elf_gas.S @@ -55,6 +55,7 @@ .text .align 2 .global make_fcontext +.hidden make_fcontext .type make_fcontext, %function make_fcontext: # shift address in x0 (allocated stack) to lower 16 byte boundary diff --git a/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_macho_gas.S b/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_macho_gas.S index b30b1e3e5b..a6a1314c0d 100644 --- a/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_macho_gas.S @@ -52,6 +52,7 @@ *******************************************************/ .text +.private_extern _make_fcontext .globl _make_fcontext .balign 16 diff --git a/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_pe_armclang.S b/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_pe_armclang.S new file mode 100644 index 0000000000..cab00e922b --- /dev/null +++ b/contrib/restricted/boost/context/src/asm/make_arm64_aapcs_pe_armclang.S @@ -0,0 +1,118 @@ +/* + 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 | 44 | 45 | 46 | 47 | * +* ------------------------------------------------- * +* | 0xa0| 0xa4| 0xa8| 0xac| 0xb0| 0xb4| 0xb8| 0xbc| * +* ------------------------------------------------- * +* | base | limit | dealloc | fiber data| * +* ------------------------------------------------- * +* ------------------------------------------------- * +* | 48 | 49 | 50 | 51 | | | * +* ------------------------------------------------- * +* | 0xc0| 0xc4| 0xc8| 0xcc| | | * +* ------------------------------------------------- * +* | PC | align | | | * +* ------------------------------------------------- * +* * +*******************************************************/ + +.file "make_arm64_aapcs_pe_armclang.S" +.text +.balign 4 + +.globl make_fcontext +.def make_fcontext; .scl 2; .type 32; .endef +.seh_proc make_fcontext +make_fcontext: +.seh_endprologue + // save stack top address to x3 + mov x3, x0 + + // 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, #0xd0 + + // save top address of context_stack as 'base' + str x3, [x0, #0xa0] + // save bottom address of context-stack as 'limit' and 'dealloction stack' + sub x3, x3, x1 + stp x3, x3, [x0, #0xa8] + // save 0 as 'fiber data' + str xzr, [x0, #0xb8] + + // third arg of make_fcontext() == address of context-function + // store address as x19 for trampoline + str x2, [x0, #0x40] + // store trampoline address as pc + adr x2, trampoline + str x2, [x0, #0xc0] + + // save address of finish as return-address for context-function + // will be entered after context-function returns (LR register) + adr x1, finish + str x1, [x0, #0x98] + + ret x30 // return pointer to context-data (x0) + +trampoline: + stp fp, lr, [sp, #-0x10]! + mov fp, sp + blr x19 + +finish: + // exit code is zero + mov x0, #0 + // exit application + bl _exit + +.seh_endproc + +.def _exit; .scl 2; .type 32; .endef /* standard C library function */ + +.section .drectve +.ascii " -export:\"make_fcontext\"" diff --git a/contrib/restricted/boost/context/src/asm/make_arm_aapcs_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_arm_aapcs_elf_gas.S index 98ae64b43f..9616e566af 100644 --- a/contrib/restricted/boost/context/src/asm/make_arm_aapcs_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_arm_aapcs_elf_gas.S @@ -41,6 +41,7 @@ .file "make_arm_aapcs_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .align 2 .type make_fcontext,%function .syntax unified diff --git a/contrib/restricted/boost/context/src/asm/make_arm_aapcs_macho_gas.S b/contrib/restricted/boost/context/src/asm/make_arm_aapcs_macho_gas.S index c909ae9d43..de934075d2 100644 --- a/contrib/restricted/boost/context/src/asm/make_arm_aapcs_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_arm_aapcs_macho_gas.S @@ -39,6 +39,7 @@ *******************************************************/ .text +.private_extern _make_fcontext .globl _make_fcontext .align 2 _make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_i386_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_i386_sysv_elf_gas.S index c6e0b36558..992bae019a 100644 --- a/contrib/restricted/boost/context/src/asm/make_i386_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_i386_sysv_elf_gas.S @@ -31,6 +31,7 @@ .file "make_i386_sysv_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .align 2 .type make_fcontext,@function make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_i386_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/make_i386_sysv_macho_gas.S index 519e406248..a5890d75f6 100644 --- a/contrib/restricted/boost/context/src/asm/make_i386_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_i386_sysv_macho_gas.S @@ -25,6 +25,7 @@ ****************************************************************************************/ .text +.private_extern _make_fcontext .globl _make_fcontext .align 2 _make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_loongarch64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_loongarch64_sysv_elf_gas.S index 55062702f1..a067baded5 100644 --- a/contrib/restricted/boost/context/src/asm/make_loongarch64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_loongarch64_sysv_elf_gas.S @@ -41,6 +41,7 @@ .file "make_loongarch64_sysv_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .align 2 .type make_fcontext,@function make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_mips32_o32_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_mips32_o32_elf_gas.S index 4e11e3d058..54742f3a8b 100644 --- a/contrib/restricted/boost/context/src/asm/make_mips32_o32_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_mips32_o32_elf_gas.S @@ -41,6 +41,7 @@ .file "make_mips32_o32_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .align 2 .type make_fcontext,@function .ent make_fcontext diff --git a/contrib/restricted/boost/context/src/asm/make_mips64_n64_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_mips64_n64_elf_gas.S index 7bb30b14de..40f29a55c2 100644 --- a/contrib/restricted/boost/context/src/asm/make_mips64_n64_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_mips64_n64_elf_gas.S @@ -48,6 +48,7 @@ .file "make_mips64_n64_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .align 3 .type make_fcontext,@function .ent make_fcontext diff --git a/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_elf_gas.S index 9616c4ca9b..0dd7771935 100644 --- a/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_elf_gas.S @@ -53,6 +53,7 @@ .file "make_ppc32_sysv_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .align 2 .type make_fcontext,@function make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_macho_gas.S index 1102ee90ef..e7b0c7a2ae 100644 --- a/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_ppc32_sysv_macho_gas.S @@ -74,6 +74,7 @@ *******************************************************/ .text +.private_extern _make_fcontext .globl _make_fcontext .align 2 _make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_elf_gas.S index c4d7ee5982..f513d3639e 100644 --- a/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_elf_gas.S @@ -68,6 +68,7 @@ .file "make_ppc64_sysv_elf_gas.S" .globl make_fcontext +.hidden make_fcontext #if _CALL_ELF == 2 .text .align 2 diff --git a/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_macho_gas.S index dd7bf2c5c0..d8cdd2d080 100644 --- a/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_ppc64_sysv_macho_gas.S @@ -67,6 +67,7 @@ *******************************************************/ .text +.private_extern _make_fcontext .globl _make_fcontext _make_fcontext: ; save return address into R6 diff --git a/contrib/restricted/boost/context/src/asm/make_riscv64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_riscv64_sysv_elf_gas.S index 5322e0fdbd..6d97c59e87 100644 --- a/contrib/restricted/boost/context/src/asm/make_riscv64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_riscv64_sysv_elf_gas.S @@ -61,6 +61,7 @@ .text .align 1 .global make_fcontext +.hidden make_fcontext .type make_fcontext, %function make_fcontext: # shift address in a0 (allocated stack) to lower 16 byte boundary diff --git a/contrib/restricted/boost/context/src/asm/make_s390x_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_s390x_sysv_elf_gas.S index 4dd423e2a4..4d6aa62c0a 100644 --- a/contrib/restricted/boost/context/src/asm/make_s390x_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_s390x_sysv_elf_gas.S @@ -46,6 +46,7 @@ .text .align 8 .global make_fcontext +.hidden make_fcontext .type make_fcontext, @function #define ARG_OFFSET 0 diff --git a/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_elf_gas.S index b0d0c0341e..7561c0896b 100644 --- a/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_elf_gas.S @@ -44,6 +44,7 @@ .file "make_x86_64_sysv_elf_gas.S" .text .globl make_fcontext +.hidden make_fcontext .type make_fcontext,@function .align 16 make_fcontext: @@ -92,35 +93,6 @@ make_fcontext: movq %rcx, 0x38(%rax) #if BOOST_CONTEXT_SHADOW_STACK - /* Populate the shadow stack and normal stack */ - /* get original SSP */ - rdsspq %r8 - /* restore new shadow stack */ - rstorssp -0x8(%r9) - /* save the restore token on the original shadow stack */ - saveprevssp - /* push the address of "jmp trampoline" to the new shadow stack */ - /* as well as the stack */ - call 1f - jmp trampoline -1: - /* save address of "jmp trampoline" as return-address */ - /* for context-function */ - pop 0x38(%rax) - /* Get the new SSP. */ - rdsspq %r9 - /* restore original shadow stack */ - rstorssp -0x8(%r8) - /* save the restore token on the new shadow stack. */ - saveprevssp - - /* reserve space for the new SSP */ - leaq -0x8(%rax), %rax - /* save the new SSP to this fcontext */ - movq %r9, (%rax) -#endif - -#if BOOST_CONTEXT_SHADOW_STACK /* Populate the shadow stack */ /* get original SSP */ diff --git a/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_macho_gas.S index 5d6c5431c5..06357f678a 100644 --- a/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/make_x86_64_sysv_macho_gas.S @@ -25,6 +25,7 @@ ****************************************************************************************/ .text +.private_extern _make_fcontext .globl _make_fcontext .align 8 _make_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_elf_gas.S index 665ca5a2c1..8e40fc7d36 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_elf_gas.S @@ -55,6 +55,7 @@ .text .align 2 .global ontop_fcontext +.hidden ontop_fcontext .type ontop_fcontext, %function ontop_fcontext: # prepare stack for GP + FPU diff --git a/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_macho_gas.S b/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_macho_gas.S index a387d06dd2..8babe47023 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_macho_gas.S @@ -52,6 +52,7 @@ *******************************************************/ .text +.private_extern _ontop_fcontext .global _ontop_fcontext .balign 16 _ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_pe_armclang.S b/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_pe_armclang.S new file mode 100644 index 0000000000..bdf097b71c --- /dev/null +++ b/contrib/restricted/boost/context/src/asm/ontop_arm64_aapcs_pe_armclang.S @@ -0,0 +1,140 @@ +/* + 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 | 44 | 45 | 46 | 47 | * +* ------------------------------------------------- * +* | 0xa0| 0xa4| 0xa8| 0xac| 0xb0| 0xb4| 0xb8| 0xbc| * +* ------------------------------------------------- * +* | fiber data| base | limit | dealloc | * +* ------------------------------------------------- * +* ------------------------------------------------- * +* | 48 | 49 | 50 | 51 | | | * +* ------------------------------------------------- * +* | 0xc0| 0xc4| 0xc8| 0xcc| | | * +* ------------------------------------------------- * +* | PC | align | | | * +* ------------------------------------------------- * +* * +*******************************************************/ + +.file "ontop_arm64_aapcs_pe_armclang.S" +.text +.balign 4 + +.def ontop_fcontext; .scl 2; .type 32; .endef +.seh_proc ontop_fcontext +ontop_fcontext: +.seh_endprologue + // prepare stack for GP + FPU + sub sp, sp, #0xd0 + + // 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, #0xc0] + + // save current stack base and limit + ldp x5, x6, [x18, #0x08] // TeStackBase and TeStackLimit at ksarm64.h + stp x5, x6, [sp, #0xa0] + // save current fiber data and deallocation stack + ldr x5, [x18, #0x1478] // TeDeallocationStack at ksarm64.h + ldr x6, [x18, #0x20] // TeFiberData at ksarm64.h + stp x5, x6, [sp, #0xb0] + + // store RSP (pointing to context-data) in X5 + mov x4, sp + + // restore RSP (pointing to context-data) from X1 + mov sp, x0 + + // restore stack base and limit + ldp x5, x6, [sp, #0xa0] + stp x5, x6, [x18, #0x08] // TeStackBase and TeStackLimit at ksarm64.h + // restore fiber data and deallocation stack + ldp x5, x6, [sp, #0xb0] + str x5, [x18, #0x1478] // TeDeallocationStack at ksarm64.h + str x6, [x18, #0x20] // TeFiberData at ksarm64.h + + // 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 + + // skip pc + // restore stack from GP + FPU + add sp, sp, #0xc0 + + // jump to ontop-function + ret x2 +.seh_endproc + +.section .drectve +.ascii " -export:\"ontop_fcontext\"" diff --git a/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_elf_gas.S index 59ad5ca9ce..8c6c9020de 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_elf_gas.S @@ -41,6 +41,7 @@ .file "ontop_arm_aapcs_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .align 2 .type ontop_fcontext,%function .syntax unified diff --git a/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_macho_gas.S b/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_macho_gas.S index 3633aca641..07e63fb24f 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_arm_aapcs_macho_gas.S @@ -39,6 +39,7 @@ *******************************************************/ .text +.private_extern _ontop_fcontext .globl _ontop_fcontext .align 2 _ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_elf_gas.S index 0cb6168fab..ea7a75b90f 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_elf_gas.S @@ -24,9 +24,14 @@ * * ****************************************************************************************/ +#ifdef __x86_64__ +#include "ontop_x86_64_sysv_elf_gas.S" +#else + .file "ontop_i386_sysv_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .align 2 .type ontop_fcontext,@function ontop_fcontext: @@ -98,3 +103,5 @@ ontop_fcontext: /* Mark that we don't need executable stack. */ .section .note.GNU-stack,"",%progbits + +#endif diff --git a/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_macho_gas.S index 3a88372b3a..c129e8e0c7 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_i386_sysv_macho_gas.S @@ -25,6 +25,7 @@ ****************************************************************************************/ .text +.private_extern _ontop_fcontext .globl _ontop_fcontext .align 2 _ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_loongarch64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_loongarch64_sysv_elf_gas.S index c6ea044857..ed392e8afa 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_loongarch64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_loongarch64_sysv_elf_gas.S @@ -41,6 +41,7 @@ .file "ontop_loongarch64_sysv_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .align 2 .type ontop_fcontext,@function ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_mips32_o32_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_mips32_o32_elf_gas.S index c69203c655..e6306cc375 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_mips32_o32_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_mips32_o32_elf_gas.S @@ -41,6 +41,7 @@ .file "ontop_mips32_o32_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .align 2 .type ontop_fcontext,@function .ent ontop_fcontext diff --git a/contrib/restricted/boost/context/src/asm/ontop_mips64_n64_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_mips64_n64_elf_gas.S index 68087b0521..e73e0395b1 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_mips64_n64_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_mips64_n64_elf_gas.S @@ -48,6 +48,7 @@ .file "ontop_mips64_n64_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .align 3 .type ontop_fcontext,@function .ent ontop_fcontext diff --git a/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_elf_gas.S index 464d99d59d..8aa350a4f8 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_elf_gas.S @@ -53,6 +53,7 @@ .file "ontop_ppc32_sysv_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .align 2 .type ontop_fcontext,@function ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_macho_gas.S index a74617172c..ee6f5b7228 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_ppc32_sysv_macho_gas.S @@ -74,6 +74,7 @@ *******************************************************/ .text +.private_extern _ontop_fcontext .globl _ontop_fcontext .align 2 _ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_elf_gas.S index cd97f45671..46cf30d8aa 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_elf_gas.S @@ -68,6 +68,7 @@ .file "ontop_ppc64_sysv_elf_gas.S" .globl ontop_fcontext +.hidden ontop_fcontext #if _CALL_ELF == 2 .text .align 2 diff --git a/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_macho_gas.S index a9fe8cf5b8..5cd6359e31 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_ppc64_sysv_macho_gas.S @@ -68,6 +68,7 @@ .text .align 2 +.private_extern _ontop_fcontext .globl _ontop_fcontext _ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_riscv64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_riscv64_sysv_elf_gas.S index 61ab46bcc6..f57d1f3996 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_riscv64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_riscv64_sysv_elf_gas.S @@ -61,6 +61,7 @@ .text .align 1 .global ontop_fcontext +.hidden ontop_fcontext .type ontop_fcontext, %function ontop_fcontext: # prepare stack for GP + FPU diff --git a/contrib/restricted/boost/context/src/asm/ontop_s390x_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_s390x_sysv_elf_gas.S index 6a464aa3bf..3a0d864e9c 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_s390x_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_s390x_sysv_elf_gas.S @@ -46,6 +46,7 @@ .text .align 8 .global ontop_fcontext +.hidden ontop_fcontext .type ontop_fcontext, @function #define ARG_OFFSET 0 diff --git a/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_elf_gas.S b/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_elf_gas.S index c3892b8ba0..e3e4bdf870 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_elf_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_elf_gas.S @@ -40,6 +40,7 @@ .file "ontop_x86_64_sysv_elf_gas.S" .text .globl ontop_fcontext +.hidden ontop_fcontext .type ontop_fcontext,@function .align 16 ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_macho_gas.S b/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_macho_gas.S index 49755c69b0..7d15b5ba24 100644 --- a/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_macho_gas.S +++ b/contrib/restricted/boost/context/src/asm/ontop_x86_64_sysv_macho_gas.S @@ -25,6 +25,7 @@ ****************************************************************************************/ .text +.private_extern _ontop_fcontext .globl _ontop_fcontext .align 8 _ontop_fcontext: diff --git a/contrib/restricted/boost/context/src/fcontext.cpp b/contrib/restricted/boost/context/src/fcontext.cpp new file mode 100644 index 0000000000..9fe0a4892d --- /dev/null +++ b/contrib/restricted/boost/context/src/fcontext.cpp @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates <open-source-office@arm.com> +// 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) + +// This code wraps the plain C asm symbols into properly +// namespaced and mangled C++ symbols that are safe to +// export from a library. + +#include <boost/context/detail/fcontext.hpp> + +extern "C" +boost::context::detail::transfer_t BOOST_CONTEXT_CALLDECL jump_fcontext( boost::context::detail::fcontext_t const to, void * vp); +extern "C" +boost::context::detail::fcontext_t BOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( boost::context::detail::transfer_t) ); + +// based on an idea of Giovanni Derreta +extern "C" +boost::context::detail::transfer_t BOOST_CONTEXT_CALLDECL ontop_fcontext( boost::context::detail::fcontext_t const to, void * vp, boost::context::detail::transfer_t (* fn)( boost::context::detail::transfer_t) ); + +namespace boost { +namespace context { +namespace detail { + +transfer_t jump_fcontext( fcontext_t const to, void * vp) +{ + return ::jump_fcontext(to, vp); +} + +fcontext_t make_fcontext( void * sp, std::size_t size, void (* fn)( transfer_t) ) +{ + return ::make_fcontext(sp, size, fn); +} + +transfer_t ontop_fcontext( fcontext_t const to, void * vp, transfer_t (* fn)( transfer_t) ) +{ + return ::ontop_fcontext(to, vp, fn); +} +}}} diff --git a/contrib/restricted/boost/context/ucontext_impl/ya.make b/contrib/restricted/boost/context/ucontext_impl/ya.make index 61ba1464c0..8c9ce98e9b 100644 --- a/contrib/restricted/boost/context/ucontext_impl/ya.make +++ b/contrib/restricted/boost/context/ucontext_impl/ya.make @@ -4,9 +4,9 @@ LIBRARY() WITHOUT_LICENSE_TEXTS() -VERSION(1.86.0) +VERSION(1.87.0) -ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.86.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.87.0.tar.gz) LICENSE(BSL-1.0) diff --git a/contrib/restricted/boost/context/ya.make b/contrib/restricted/boost/context/ya.make index f70cdc034c..d3c74aa986 100644 --- a/contrib/restricted/boost/context/ya.make +++ b/contrib/restricted/boost/context/ya.make @@ -6,9 +6,9 @@ LICENSE(BSL-1.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.86.0) +VERSION(1.87.0) -ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.86.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/context/archive/boost-1.87.0.tar.gz) IF (SANITIZER_TYPE) PEERDIR( |