Skip to content

Commit

Permalink
Merge pull request #273 from rdoeffinger/develop
Browse files Browse the repository at this point in the history
Convert make_fcontext etc into true C++ symbols
  • Loading branch information
olk authored Oct 27, 2024
2 parents 59410df + 2459047 commit 7c80551
Show file tree
Hide file tree
Showing 55 changed files with 95 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ unset(_asm_suffix)

if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "fcontext")

set(IMPL_SOURCES ${ASM_SOURCES})
set(IMPL_SOURCES ${ASM_SOURCES} src/fcontext.cpp)

if(BOOST_CONTEXT_ASSEMBLER STREQUAL masm AND BOOST_CONTEXT_ARCHITECTURE STREQUAL i386)
set_source_files_properties(${ASM_SOURCES} PROPERTIES COMPILE_FLAGS "/safeseh")
Expand Down
1 change: 1 addition & 0 deletions build/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ explicit asm_sources ;
# fcontext_t
alias impl_sources
: asm_sources
fcontext.cpp
: <context-impl>fcontext
;

Expand Down
9 changes: 3 additions & 6 deletions include/boost/context/detail/fcontext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) );

}}}

Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
.text
.align 2
.global jump_fcontext
.hidden jump_fcontext
.type jump_fcontext, %function
jump_fcontext:
# prepare stack for GP + FPU
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_arm64_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
*******************************************************/

.text
.private_extern _jump_fcontext
.globl _jump_fcontext
.balign 16
_jump_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_arm_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*******************************************************/

.text
.private_extern _jump_fcontext
.globl _jump_fcontext
.align 2
_jump_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_i386_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_i386_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************************/

.text
.private_extern _jump_fcontext
.globl _jump_fcontext
.align 2
_jump_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_loongarch64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_mips32_o32_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_mips64_n64_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_ppc32_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_ppc32_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
*******************************************************/

.text
.private_extern _jump_fcontext
.globl _jump_fcontext
.align 2
_jump_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_ppc64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

.file "jump_ppc64_sysv_elf_gas.S"
.globl jump_fcontext
.hidden jump_fcontext
#if _CALL_ELF == 2
.text
.align 2
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_ppc64_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

.text
.align 2
.private_extern _jump_fcontext
.globl _jump_fcontext

_jump_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_riscv64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
.text
.align 1
.global jump_fcontext
.hidden jump_fcontext
.type jump_fcontext, %function
jump_fcontext:
# prepare stack for GP + FPU
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_s390x_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
.text
.align 8
.global jump_fcontext
.hidden jump_fcontext
.type jump_fcontext, @function

#define ARG_OFFSET 0
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/jump_x86_64_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************************/

.text
.private_extern _jump_fcontext
.globl _jump_fcontext
.align 8
_jump_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_arm64_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
*******************************************************/

.text
.private_extern _make_fcontext
.globl _make_fcontext
.balign 16

Expand Down
1 change: 1 addition & 0 deletions src/asm/make_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_arm_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*******************************************************/

.text
.private_extern _make_fcontext
.globl _make_fcontext
.align 2
_make_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_i386_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_i386_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************************/

.text
.private_extern _make_fcontext
.globl _make_fcontext
.align 2
_make_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_loongarch64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_mips32_o32_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_mips64_n64_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_ppc32_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_ppc32_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
*******************************************************/

.text
.private_extern _make_fcontext
.globl _make_fcontext
.align 2
_make_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_ppc64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

.file "make_ppc64_sysv_elf_gas.S"
.globl make_fcontext
.hidden make_fcontext
#if _CALL_ELF == 2
.text
.align 2
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_ppc64_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
*******************************************************/

.text
.private_extern _make_fcontext
.globl _make_fcontext
_make_fcontext:
; save return address into R6
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_riscv64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_s390x_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
.text
.align 8
.global make_fcontext
.hidden make_fcontext
.type make_fcontext, @function

#define ARG_OFFSET 0
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_x86_64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/make_x86_64_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************************/

.text
.private_extern _make_fcontext
.globl _make_fcontext
.align 8
_make_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_arm64_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
.text
.align 2
.global ontop_fcontext
.hidden ontop_fcontext
.type ontop_fcontext, %function
ontop_fcontext:
# prepare stack for GP + FPU
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_arm64_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
*******************************************************/

.text
.private_extern _ontop_fcontext
.global _ontop_fcontext
.balign 16
_ontop_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_arm_aapcs_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_arm_aapcs_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*******************************************************/

.text
.private_extern _ontop_fcontext
.globl _ontop_fcontext
.align 2
_ontop_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_i386_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
.file "ontop_i386_sysv_elf_gas.S"
.text
.globl ontop_fcontext
.hidden ontop_fcontext
.align 2
.type ontop_fcontext,@function
ontop_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_i386_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
****************************************************************************************/

.text
.private_extern _ontop_fcontext
.globl _ontop_fcontext
.align 2
_ontop_fcontext:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_loongarch64_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_mips32_o32_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_mips64_n64_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_ppc32_sysv_elf_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/asm/ontop_ppc32_sysv_macho_gas.S
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
*******************************************************/

.text
.private_extern _ontop_fcontext
.globl _ontop_fcontext
.align 2
_ontop_fcontext:
Expand Down
Loading

0 comments on commit 7c80551

Please sign in to comment.