diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b1f65a2..1f515c23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -140,7 +140,7 @@ jobs: if [ -n "$PACKAGES_TO_REMOVE" ]; then sudo apt-get purge -y $PACKAGES_TO_REMOVE; fi echo ">>>>> APT: REPO.." for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done - + if test -n "${LLVM_OS}" ; then wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - if test -n "${LLVM_VER}" ; then @@ -194,7 +194,7 @@ jobs: ./b2 -j 3 libs/context/test toolset=$TOOLSET cxxstd=$CXXSTD fi -# +# # osx: # strategy: # fail-fast: false @@ -203,7 +203,7 @@ jobs: # # Github Actions only supports certain Xcode versions # Change (or delete) the Xcode version for this job. -# +# # - name: "TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1 Job 7" # buildtype: "boost" # packages: "" @@ -219,7 +219,7 @@ jobs: # # Github Actions only supports certain Xcode versions # Change (or delete) the Xcode version for this job. -# +# # - name: "TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1 Job 8" # buildtype: "boost" # packages: "" @@ -232,19 +232,19 @@ jobs: # toolset: "clang" # compiler: "clang++" # cxxstd: "11,14,1z" -# -# +# +# # runs-on: ${{ matrix.os }} -# +# # steps: # - uses: actions/checkout@v2 -# +# # - name: Set DEVELOPER_DIR # if: matrix.xcode_version != '' # run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer" >> $GITHUB_ENV # - name: Test DEVELOPER_DIR # run: echo $DEVELOPER_DIR -# +# # - name: "osx" # shell: bash # env: @@ -274,11 +274,11 @@ jobs: # export USER=$(whoami) # export CC=${CC:-gcc} # export PATH=~/.local/bin:/usr/local/bin:$PATH -# +# # if [ "$JOB_BUILDTYPE" == "boost" ]; then -# +# # echo '==================================> INSTALL' -# +# # BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true # cd .. # git clone -b $BOOST_BRANCH https://github.com/boostorg/boost.git boost-root @@ -290,10 +290,10 @@ jobs: # python tools/boostdep/depinst/depinst.py context # ./bootstrap.sh # ./b2 headers -# +# # echo '==================================> SCRIPT' -# +# # echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam # ./b2 -j 3 libs/context/test toolset=$TOOLSET cxxstd=$CXXSTD -# +# # fi diff --git a/README.md b/README.md index 44aeff04..1e3d167d 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,20 @@ boost.context ============= boost.context is a foundational library that provides a sort of cooperative multitasking on a single thread. -By providing an abstraction of the current execution state in the current thread, including the stack (with -local variables) and stack pointer, all registers and CPU flags, and the instruction pointer, a execution_context -instance represents a specific point in the application's execution path. This is useful for building -higher-level abstractions, like coroutines, cooperative threads (userland threads) or an equivalent to +By providing an abstraction of the current execution state in the current thread, including the stack (with +local variables) and stack pointer, all registers and CPU flags, and the instruction pointer, a execution_context +instance represents a specific point in the application's execution path. This is useful for building +higher-level abstractions, like coroutines, cooperative threads (userland threads) or an equivalent to C# keyword yield in C++. -A fiber provides the means to suspend the current execution path and to transfer execution control, -thereby permitting another fiber to run on the current thread. This state full transfer mechanism -enables a fiber to suspend execution from within nested functions and, later, to resume from where it -was suspended. While the execution path represented by a fiber only runs on a single thread, it can be +A fiber provides the means to suspend the current execution path and to transfer execution control, +thereby permitting another fiber to run on the current thread. This state full transfer mechanism +enables a fiber to suspend execution from within nested functions and, later, to resume from where it +was suspended. While the execution path represented by a fiber only runs on a single thread, it can be migrated to another thread at any given time. -A context switch between threads requires system calls (involving the OS kernel), which can cost more than -thousand CPU cycles on x86 CPUs. By contrast, transferring control among fibers requires only fewer than +A context switch between threads requires system calls (involving the OS kernel), which can cost more than +thousand CPU cycles on x86 CPUs. By contrast, transferring control among fibers requires only fewer than hundred CPU cycles because it does not involve system calls as it is done within a single thread. -boost.context requires C++11! +boost.context requires C++11! diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index c016ed7e..9666e50b 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -1,6 +1,6 @@ # (C) Copyright 2008 Oliver Kowalke # -# Distributed under the Boost Software License, Version 1.0. (See accompanying +# 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) project context/doc ; diff --git a/example/callcc/echosse.cpp b/example/callcc/echosse.cpp index 4b76ffc5..7c91bc2a 100644 --- a/example/callcc/echosse.cpp +++ b/example/callcc/echosse.cpp @@ -19,10 +19,10 @@ void echoSSE( int i) { xmm = _mm_set_epi32( i, i + 1, i + 2, i + 3); uint32_t v32[4]; memcpy( & v32, & xmm, 16); - std::cout << v32[0]; - std::cout << v32[1]; - std::cout << v32[2]; - std::cout << v32[3]; + std::cout << v32[0]; + std::cout << v32[1]; + std::cout << v32[2]; + std::cout << v32[3]; } diff --git a/example/fiber/echosse.cpp b/example/fiber/echosse.cpp index e4f6deba..87c2b525 100644 --- a/example/fiber/echosse.cpp +++ b/example/fiber/echosse.cpp @@ -19,10 +19,10 @@ void echoSSE( int i) { xmm = _mm_set_epi32( i, i + 1, i + 2, i + 3); uint32_t v32[4]; memcpy( & v32, & xmm, 16); - std::cout << v32[0]; - std::cout << v32[1]; - std::cout << v32[2]; - std::cout << v32[3]; + std::cout << v32[0]; + std::cout << v32[1]; + std::cout << v32[2]; + std::cout << v32[3]; } diff --git a/include/boost/context/continuation_ucontext.hpp b/include/boost/context/continuation_ucontext.hpp index 09fd3114..3b74b25c 100644 --- a/include/boost/context/continuation_ucontext.hpp +++ b/include/boost/context/continuation_ucontext.hpp @@ -105,7 +105,7 @@ struct BOOST_CONTEXT_DECL activation_record { activation_record( stack_context sctx_) noexcept : sctx( sctx_ ), main_ctx( false ) { - } + } virtual ~activation_record() { } @@ -264,7 +264,7 @@ class capture_record : public activation_record { c = boost::context::detail::invoke( fn_, std::move( c) ); #else c = std::invoke( fn_, std::move( c) ); -#endif +#endif } catch ( forced_unwind const& ex) { c = Ctx{ ex.from }; } @@ -324,7 +324,7 @@ static activation_record * create_context1( StackAlloc && salloc, Fn && fn) { template< typename Ctx, typename StackAlloc, typename Fn > static activation_record * create_context2( preallocated palloc, StackAlloc && salloc, Fn && fn) { - typedef capture_record< Ctx, StackAlloc, Fn > capture_t; + typedef capture_record< Ctx, StackAlloc, Fn > capture_t; // reserve space for control structure void * storage = reinterpret_cast< void * >( @@ -478,7 +478,7 @@ class BOOST_CONTEXT_DECL continuation { } #if !defined(BOOST_EMBTC) - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, continuation const& other) { @@ -490,7 +490,7 @@ class BOOST_CONTEXT_DECL continuation { } #else - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, continuation const& other); @@ -515,7 +515,7 @@ class BOOST_CONTEXT_DECL continuation { } #endif - + template< typename Fn, typename = detail::disable_overload< continuation, Fn > diff --git a/include/boost/context/continuation_winfib.hpp b/include/boost/context/continuation_winfib.hpp index 856c8684..060930c4 100644 --- a/include/boost/context/continuation_winfib.hpp +++ b/include/boost/context/continuation_winfib.hpp @@ -87,7 +87,7 @@ struct BOOST_CONTEXT_DECL activation_record { if ( BOOST_UNLIKELY( nullptr == fiber) ) { DWORD err = ::GetLastError(); BOOST_ASSERT( ERROR_ALREADY_FIBER == err); - fiber = ::GetCurrentFiber(); + fiber = ::GetCurrentFiber(); BOOST_ASSERT( nullptr != fiber); BOOST_ASSERT( reinterpret_cast< LPVOID >( 0x1E00) != fiber); } @@ -97,7 +97,7 @@ struct BOOST_CONTEXT_DECL activation_record { activation_record( stack_context sctx_) noexcept : sctx{ sctx_ }, main_ctx{ false } { - } + } virtual ~activation_record() { if ( BOOST_UNLIKELY( main_ctx) ) { @@ -227,7 +227,7 @@ class capture_record : public activation_record { c = boost::context::detail::invoke( fn_, std::move( c) ); #else c = std::invoke( fn_, std::move( c) ); -#endif +#endif } catch ( forced_unwind const& ex) { c = Ctx{ ex.from }; } @@ -261,7 +261,7 @@ static activation_record * create_context1( StackAlloc && salloc, Fn && fn) { template< typename Ctx, typename StackAlloc, typename Fn > static activation_record * create_context2( preallocated palloc, StackAlloc && salloc, Fn && fn) { - typedef capture_record< Ctx, StackAlloc, Fn > capture_t; + typedef capture_record< Ctx, StackAlloc, Fn > capture_t; BOOST_ASSERT( ( sizeof( capture_t) ) < palloc.size); // reserve space for control structure @@ -387,9 +387,9 @@ class BOOST_CONTEXT_DECL continuation { bool operator<( continuation const& other) const noexcept { return ptr_ < other.ptr_; } - + #if !defined(BOOST_EMBTC) - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, continuation const& other) { @@ -401,7 +401,7 @@ class BOOST_CONTEXT_DECL continuation { } #else - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, continuation const& other); @@ -426,7 +426,7 @@ class BOOST_CONTEXT_DECL continuation { } #endif - + template< typename Fn, typename = detail::disable_overload< continuation, Fn > diff --git a/include/boost/context/detail/apply.hpp b/include/boost/context/detail/apply.hpp index fbf0ca61..55b0dbc2 100644 --- a/include/boost/context/detail/apply.hpp +++ b/include/boost/context/detail/apply.hpp @@ -35,7 +35,7 @@ namespace detail { template< typename Fn, typename Tpl, std::size_t ... I > auto -apply_impl( Fn && fn, Tpl && tpl, index_sequence< I ... >) +apply_impl( Fn && fn, Tpl && tpl, index_sequence< I ... >) #if defined(BOOST_NO_CXX17_STD_INVOKE) -> decltype( boost::context::detail::invoke( std::forward< Fn >( fn), std::get< I >( std::forward< Tpl >( tpl) ) ... ) ) #else @@ -51,7 +51,7 @@ apply_impl( Fn && fn, Tpl && tpl, index_sequence< I ... >) template< typename Fn, typename Tpl > auto -apply( Fn && fn, Tpl && tpl) +apply( Fn && fn, Tpl && tpl) -> decltype( apply_impl( std::forward< Fn >( fn), std::forward< Tpl >( tpl), make_index_sequence< std::tuple_size< typename std::decay< Tpl >::type >::value >{}) ) diff --git a/include/boost/context/detail/config.hpp b/include/boost/context/detail/config.hpp index 06737fdf..218d6c30 100644 --- a/include/boost/context/detail/config.hpp +++ b/include/boost/context/detail/config.hpp @@ -96,7 +96,7 @@ defined(BOOST_NO_CXX11_UNIFIED_INITIALISATION_SYNTAX) || \ defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ defined(BOOST_NO_HDR_ATOMIC) || \ - defined(BOOST_NO_HDR_TUPLE) + defined(BOOST_NO_HDR_TUPLE) # define BOOST_CONTEXT_NO_CXX11 #endif diff --git a/include/boost/context/detail/invoke.hpp b/include/boost/context/detail/invoke.hpp index 9173cbc7..fee0f185 100644 --- a/include/boost/context/detail/invoke.hpp +++ b/include/boost/context/detail/invoke.hpp @@ -29,7 +29,7 @@ typename std::enable_if< typename std::result_of< Fn &&( Args && ... ) >::type >::type invoke( Fn && fn, Args && ... args) { - return std::mem_fn( fn)( std::forward< Args >( args) ... ); + return std::mem_fn( fn)( std::forward< Args >( args) ... ); } template< typename Fn, typename ... Args > diff --git a/include/boost/context/fiber_fcontext.hpp b/include/boost/context/fiber_fcontext.hpp index a2760cbd..44b2625f 100644 --- a/include/boost/context/fiber_fcontext.hpp +++ b/include/boost/context/fiber_fcontext.hpp @@ -359,7 +359,7 @@ class fiber { } #if !defined(BOOST_EMBTC) - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, fiber const& other) { @@ -371,7 +371,7 @@ class fiber { } #else - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, fiber const& other); @@ -396,7 +396,7 @@ class fiber { } #endif - + inline void swap( fiber & l, fiber & r) noexcept { l.swap( r); diff --git a/include/boost/context/fiber_ucontext.hpp b/include/boost/context/fiber_ucontext.hpp index 927a1398..459b1076 100644 --- a/include/boost/context/fiber_ucontext.hpp +++ b/include/boost/context/fiber_ucontext.hpp @@ -120,7 +120,7 @@ struct BOOST_CONTEXT_DECL fiber_activation_record { fiber_activation_record( stack_context sctx_) noexcept : sctx( sctx_ ), main_ctx( false ) { - } + } virtual ~fiber_activation_record() { #if defined(BOOST_USE_TSAN) @@ -289,7 +289,7 @@ class fiber_capture_record : public fiber_activation_record { c = boost::context::detail::invoke( fn_, std::move( c) ); #else c = std::invoke( fn_, std::move( c) ); -#endif +#endif } catch ( forced_unwind const& ex) { c = Ctx{ ex.from }; } @@ -357,7 +357,7 @@ static fiber_activation_record * create_fiber1( StackAlloc && salloc, Fn && fn) template< typename Ctx, typename StackAlloc, typename Fn > static fiber_activation_record * create_fiber2( preallocated palloc, StackAlloc && salloc, Fn && fn) { - typedef fiber_capture_record< Ctx, StackAlloc, Fn > capture_t; + typedef fiber_capture_record< Ctx, StackAlloc, Fn > capture_t; // reserve space for control structure void * storage = reinterpret_cast< void * >( diff --git a/include/boost/context/fiber_winfib.hpp b/include/boost/context/fiber_winfib.hpp index cd496d1b..bb895ac9 100644 --- a/include/boost/context/fiber_winfib.hpp +++ b/include/boost/context/fiber_winfib.hpp @@ -86,7 +86,7 @@ struct BOOST_CONTEXT_DECL fiber_activation_record { fiber = ::ConvertThreadToFiber( nullptr); if ( BOOST_UNLIKELY( nullptr == fiber) ) { BOOST_ASSERT( ERROR_ALREADY_FIBER == ::GetLastError()); - fiber = ::GetCurrentFiber(); + fiber = ::GetCurrentFiber(); BOOST_ASSERT( nullptr != fiber); BOOST_ASSERT( reinterpret_cast< LPVOID >( 0x1E00) != fiber); } @@ -96,7 +96,7 @@ struct BOOST_CONTEXT_DECL fiber_activation_record { fiber_activation_record( stack_context sctx_) noexcept : sctx{ sctx_ }, main_ctx{ false } { - } + } virtual ~fiber_activation_record() { if ( BOOST_UNLIKELY( main_ctx) ) { @@ -226,7 +226,7 @@ class fiber_capture_record : public fiber_activation_record { c = boost::context::detail::invoke( fn_, std::move( c) ); #else c = std::invoke( fn_, std::move( c) ); -#endif +#endif } catch ( forced_unwind const& ex) { c = Ctx{ ex.from }; } @@ -260,7 +260,7 @@ static fiber_activation_record * create_fiber1( StackAlloc && salloc, Fn && fn) template< typename Ctx, typename StackAlloc, typename Fn > static fiber_activation_record * create_fiber2( preallocated palloc, StackAlloc && salloc, Fn && fn) { - typedef fiber_capture_record< Ctx, StackAlloc, Fn > capture_t; + typedef fiber_capture_record< Ctx, StackAlloc, Fn > capture_t; BOOST_ASSERT( ( sizeof( capture_t) ) < palloc.size); // reserve space for control structure @@ -390,9 +390,9 @@ class BOOST_CONTEXT_DECL fiber { bool operator<( fiber const& other) const noexcept { return ptr_ < other.ptr_; } - + #if !defined(BOOST_EMBTC) - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, fiber const& other) { @@ -404,7 +404,7 @@ class BOOST_CONTEXT_DECL fiber { } #else - + template< typename charT, class traitsT > friend std::basic_ostream< charT, traitsT > & operator<<( std::basic_ostream< charT, traitsT > & os, fiber const& other); diff --git a/index.html b/index.html index 0ade6cbd..07057214 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ doc/html/index.html

© Copyright Beman Dawes, 2001

-

Distributed under the Boost Software +

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)

diff --git a/performance/cycle_i386.hpp b/performance/cycle_i386.hpp index a3eb7039..8de6d0d1 100644 --- a/performance/cycle_i386.hpp +++ b/performance/cycle_i386.hpp @@ -26,7 +26,7 @@ cycle_type cycles() { cycle_type c; __asm { - cpuid + cpuid rdtsc mov dword ptr [c + 0], eax mov dword ptr [c + 4], edx @@ -52,7 +52,7 @@ cycle_type cycles() ::: "%eax", "%ebx", "%ecx", "%edx" ); - return ( cycle_type)hi << 32 | lo; + return ( cycle_type)hi << 32 | lo; } #else # error "this compiler is not supported" diff --git a/performance/cycle_x86-64.hpp b/performance/cycle_x86-64.hpp index fae0226c..73addb24 100644 --- a/performance/cycle_x86-64.hpp +++ b/performance/cycle_x86-64.hpp @@ -48,7 +48,7 @@ cycle_type cycles() ::: "%rax", "%rbx", "%rcx", "%rdx" ); - return ( cycle_type)hi << 32 | lo; + return ( cycle_type)hi << 32 | lo; } #else # error "this compiler is not supported" diff --git a/src/asm/jump_i386_ms_pe_clang_gas.S b/src/asm/jump_i386_ms_pe_clang_gas.S index cad2c136..485698c8 100644 --- a/src/asm/jump_i386_ms_pe_clang_gas.S +++ b/src/asm/jump_i386_ms_pe_clang_gas.S @@ -73,7 +73,7 @@ _jump_fcontext: /* firstarg of jump_fcontext() == fcontext to jump to */ movl 0x30(%esp), %ecx - + /* restore ESP (pointing to context-data) from ECX */ movl %ecx, %esp diff --git a/src/asm/jump_i386_ms_pe_gas.asm b/src/asm/jump_i386_ms_pe_gas.asm index 6eb45326..a1650292 100644 --- a/src/asm/jump_i386_ms_pe_gas.asm +++ b/src/asm/jump_i386_ms_pe_gas.asm @@ -73,7 +73,7 @@ _jump_fcontext: /* firstarg of jump_fcontext() == fcontext to jump to */ movl 0x30(%esp), %ecx - + /* restore ESP (pointing to context-data) from ECX */ movl %ecx, %esp diff --git a/src/asm/jump_i386_ms_pe_masm.asm b/src/asm/jump_i386_ms_pe_masm.asm index 7a9e848f..a0450d05 100644 --- a/src/asm/jump_i386_ms_pe_masm.asm +++ b/src/asm/jump_i386_ms_pe_masm.asm @@ -55,17 +55,17 @@ ENDIF mov eax, [edx] mov [esp+018h], eax - mov [esp+01ch], edi ; save EDI - mov [esp+020h], esi ; save ESI - mov [esp+024h], ebx ; save EBX - mov [esp+028h], ebp ; save EBP + mov [esp+01ch], edi ; save EDI + mov [esp+020h], esi ; save ESI + mov [esp+024h], ebx ; save EBX + mov [esp+028h], ebp ; save EBP ; store ESP (pointing to context-data) in EAX mov eax, esp ; firstarg of jump_fcontext() == fcontext to jump to mov ecx, [esp+030h] - + ; restore ESP (pointing to context-data) from ECX mov esp, ecx @@ -98,10 +98,10 @@ ENDIF mov ecx, [esp+02ch] ; restore EIP - mov edi, [esp+01ch] ; restore EDI - mov esi, [esp+020h] ; restore ESI - mov ebx, [esp+024h] ; restore EBX - mov ebp, [esp+028h] ; restore EBP + mov edi, [esp+01ch] ; restore EDI + mov esi, [esp+020h] ; restore ESI + mov ebx, [esp+024h] ; restore EBX + mov ebp, [esp+028h] ; restore EBP ; prepare stack lea esp, [esp+030h] diff --git a/src/asm/jump_i386_sysv_macho_gas.S b/src/asm/jump_i386_sysv_macho_gas.S index 8ab7c6f2..bfa3e23e 100644 --- a/src/asm/jump_i386_sysv_macho_gas.S +++ b/src/asm/jump_i386_sysv_macho_gas.S @@ -54,8 +54,8 @@ _jump_fcontext: /* return parent fcontext_t */ movl %ecx, %eax - /* returned data is stored in EDX */ - + /* returned data is stored in EDX */ + movl 0x18(%esp), %ecx /* restore EIP */ #if !defined(BOOST_USE_TSX) diff --git a/src/asm/jump_mips32_o32_elf_gas.S b/src/asm/jump_mips32_o32_elf_gas.S index f2b8034d..2be30821 100644 --- a/src/asm/jump_mips32_o32_elf_gas.S +++ b/src/asm/jump_mips32_o32_elf_gas.S @@ -102,13 +102,13 @@ jump_fcontext: # adjust stack addiu $sp, $sp, 96 - + # return transfer_t from jump sw $a0, ($v0) # fctx of transfer_t sw $a2, 4($v0) # data of transfer_t # pass transfer_t as first arg in context function # A0 == fctx, A1 == data - move $a1, $a2 + move $a1, $a2 # jump to context jr $t9 diff --git a/src/asm/jump_ppc32_sysv_macho_gas.S b/src/asm/jump_ppc32_sysv_macho_gas.S index fef90c29..479d0f03 100644 --- a/src/asm/jump_ppc32_sysv_macho_gas.S +++ b/src/asm/jump_ppc32_sysv_macho_gas.S @@ -68,7 +68,7 @@ * ------------------------------------------------- * * | 256 | | * * ------------------------------------------------- * - * | DATA| | * + * | DATA| | * * ------------------------------------------------- * * * *******************************************************/ @@ -193,7 +193,7 @@ _jump_fcontext: ; adjust stack addi r1, r1, 244 - ; return transfer_t + ; return transfer_t stw r6, 0(r3) stw r5, 4(r3) diff --git a/src/asm/make_i386_sysv_macho_gas.S b/src/asm/make_i386_sysv_macho_gas.S index 519e4062..d798eff6 100644 --- a/src/asm/make_i386_sysv_macho_gas.S +++ b/src/asm/make_i386_sysv_macho_gas.S @@ -69,7 +69,7 @@ _make_fcontext: addl $finish-2b, %ecx /* save address of finish as return-address for context-function */ /* will be entered after context-function returns */ - movl %ecx, 0x14(%eax) + movl %ecx, 0x14(%eax) ret /* return pointer to context-data */ diff --git a/src/asm/make_ppc32_sysv_macho_gas.S b/src/asm/make_ppc32_sysv_macho_gas.S index 1102ee90..5bbe1854 100644 --- a/src/asm/make_ppc32_sysv_macho_gas.S +++ b/src/asm/make_ppc32_sysv_macho_gas.S @@ -68,7 +68,7 @@ * ------------------------------------------------- * * | 256 | | * * ------------------------------------------------- * - * | DATA| | * + * | DATA| | * * ------------------------------------------------- * * * *******************************************************/ @@ -101,8 +101,8 @@ _make_fcontext: ; compute address of returned transfer_t addi r0, r3, 252 - mr r4, r0 - stw r4, 228(r3) + mr r4, r0 + stw r4, 228(r3) ; load LR mflr r0 diff --git a/src/asm/make_x86_64_ms_pe_clang_gas.S b/src/asm/make_x86_64_ms_pe_clang_gas.S index 9b3a6fcc..62bb7965 100644 --- a/src/asm/make_x86_64_ms_pe_clang_gas.S +++ b/src/asm/make_x86_64_ms_pe_clang_gas.S @@ -151,7 +151,7 @@ make_fcontext: trampoline: /* store return address on stack */ - /* fix stack alignment */ + /* fix stack alignment */ pushq %rbp /* jump to context-function */ jmp *%rbx diff --git a/src/asm/make_x86_64_ms_pe_gas.asm b/src/asm/make_x86_64_ms_pe_gas.asm index 958a2a7b..7107d6f4 100644 --- a/src/asm/make_x86_64_ms_pe_gas.asm +++ b/src/asm/make_x86_64_ms_pe_gas.asm @@ -151,7 +151,7 @@ make_fcontext: trampoline: /* store return address on stack */ - /* fix stack alignment */ + /* fix stack alignment */ pushq %rbp /* jump to context-function */ jmp *%rbx diff --git a/src/asm/make_x86_64_ms_pe_masm.asm b/src/asm/make_x86_64_ms_pe_masm.asm index 8f6c959a..98e68a2a 100644 --- a/src/asm/make_x86_64_ms_pe_masm.asm +++ b/src/asm/make_x86_64_ms_pe_masm.asm @@ -141,7 +141,7 @@ make_fcontext PROC BOOST_CONTEXT_EXPORT FRAME ; compute abs address of label finish lea rcx, finish ; save address of finish as return-address for context-function in RBP - ; will be entered after context-function returns + ; will be entered after context-function returns mov [rax+0108h], rcx ret ; return pointer to context-data diff --git a/src/asm/ontop_i386_ms_pe_masm.asm b/src/asm/ontop_i386_ms_pe_masm.asm index 82246a4a..311a1857 100644 --- a/src/asm/ontop_i386_ms_pe_masm.asm +++ b/src/asm/ontop_i386_ms_pe_masm.asm @@ -55,10 +55,10 @@ ENDIF mov eax, [edx] mov [esp+018h], eax - mov [esp+01ch], edi ; save EDI - mov [esp+020h], esi ; save ESI - mov [esp+024h], ebx ; save EBX - mov [esp+028h], ebp ; save EBP + mov [esp+01ch], edi ; save EDI + mov [esp+020h], esi ; save ESI + mov [esp+024h], ebx ; save EBX + mov [esp+028h], ebp ; save EBP ; store ESP (pointing to context-data) in ECX mov ecx, esp @@ -77,7 +77,7 @@ ENDIF ; third arg of ontop_fcontext() == ontop-function mov ecx, [esp+038h] - + ; restore ESP (pointing to context-data) from EAX mov esp, eax @@ -108,10 +108,10 @@ ENDIF mov eax, [esp+018h] mov [edx], eax - mov edi, [esp+01ch] ; restore EDI - mov esi, [esp+020h] ; restore ESI - mov ebx, [esp+024h] ; restore EBX - mov ebp, [esp+028h] ; restore EBP + mov edi, [esp+01ch] ; restore EDI + mov esi, [esp+020h] ; restore ESI + mov ebx, [esp+024h] ; restore EBX + mov ebp, [esp+028h] ; restore EBP ; prepare stack lea esp, [esp+02ch] diff --git a/src/asm/ontop_mips32_o32_elf_gas.S b/src/asm/ontop_mips32_o32_elf_gas.S index c69203c6..a5bd2cbd 100644 --- a/src/asm/ontop_mips32_o32_elf_gas.S +++ b/src/asm/ontop_mips32_o32_elf_gas.S @@ -102,13 +102,13 @@ ontop_fcontext: # adjust stack addiu $sp, $sp, 96 - + # return transfer_t from jump sw $a0, ($v0) # fctx of transfer_t sw $a2, 4($v0) # data of transfer_t # pass transfer_t as first arg in context function # A0 == hidden, A1 == fctx, A2 == data - move $a1, $a0 + move $a1, $a0 move $a0, $v0 # jump to context diff --git a/src/asm/ontop_ppc32_sysv_macho_gas.S b/src/asm/ontop_ppc32_sysv_macho_gas.S index a7461717..b1311afe 100644 --- a/src/asm/ontop_ppc32_sysv_macho_gas.S +++ b/src/asm/ontop_ppc32_sysv_macho_gas.S @@ -68,7 +68,7 @@ * ------------------------------------------------- * * | 256 | | * * ------------------------------------------------- * - * | DATA| | * + * | DATA| | * * ------------------------------------------------- * * * *******************************************************/ diff --git a/src/asm/ontop_x86_64_ms_pe_masm.asm b/src/asm/ontop_x86_64_ms_pe_masm.asm index b57dd158..16100f49 100644 --- a/src/asm/ontop_x86_64_ms_pe_masm.asm +++ b/src/asm/ontop_x86_64_ms_pe_masm.asm @@ -197,7 +197,7 @@ ENDIF ; transport_t as 1.arg of context-function ; RCX contains address of returned (hidden) transfer_t - mov rcx, rax + mov rcx, rax ; RDX contains address of passed transfer_t mov rdx, rax diff --git a/test/test_callcc.cpp b/test/test_callcc.cpp index 1a28276f..d776f126 100644 --- a/test/test_callcc.cpp +++ b/test/test_callcc.cpp @@ -285,7 +285,7 @@ void test_ontop_exception() { c = c.resume(); } catch ( my_exception & ex) { value2 = ex.what(); - return std::move( ex.c); + return std::move( ex.c); } } return std::move( c); @@ -478,7 +478,7 @@ void test_badcatch() { BOOST_CHECK_EQUAL( 3, value1); BOOST_CHECK_EQUAL( 3., value3); // the destruction of ctx here will cause a forced_unwind to be thrown that is not caught - // in fn19. That will trigger the "not caught" assertion in ~forced_unwind. Getting that + // in fn19. That will trigger the "not caught" assertion in ~forced_unwind. Getting that // assertion to propogate bak here cleanly is non-trivial, and there seems to not be a good // way to hook directly into the assertion when it happens on an alternate stack. std::move( c);