2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-22 17:12:17 +00:00
Commit Graph

240 Commits

Author SHA1 Message Date
Oliver Kowalke
ac99b9bf25 prevent compiling compilation units for non-C++11 compilers 2018-03-12 12:14:50 +01:00
Daniel James
63f85b4c54 Fix braces in execution_context.cpp
When BOOST_NO_CXX11_THREAD_LOCAL is defined.
2018-03-11 18:34:30 +00:00
Oliver Kowalke
3ca5a272e7 fix C2492 (Windows/MSVC)
- in context of #73
2018-02-24 08:42:14 +01:00
Oliver Kowalke
a0433d1c72 execution_context without depended compilation
- execution_context v1 in namecpase v1
- execution_context v2 in inlined namespace v2
2018-02-05 19:34:35 +01:00
Oliver Kowalke
51ea6b583d re-introduce continuation - fix conflicts 2018-02-05 13:31:35 +01:00
Oliver Kowalke
10d3264f7b implementation of fibers without scheduler according to P0876R0 2018-02-05 13:31:32 +01:00
James Cowgill
9e7c5e0671 mips: simplify finish function
- Don't bother allocating any extra stack space. We can reuse the 16
  bytes at the top of the stack originally used for the gp and transfer_t.
- Don't bother saving the return address which we never read back.
- Use la to load the address of _exit (purely style).
- Move the "move $a0, $zero" instruction so the assembly can put it in
  the delay slot.
- Use "jr" instead of "jalr" because we don't expect _exit to ever
  return.
2018-01-11 14:38:35 +00:00
James Cowgill
3f6c3a0bb7 mips: allocate unused stack space for incoming argument area
The MIPS ABI requires that 16 bytes of unused stack space is allocated by
the caller when calling functions. Some comments refer to "shadow space"
which might be talking about this, but since the captured_context code
was added, the assembly has not actually allocated any extra space.

Therefore, allocate an extra 16 bytes between the fcontext_t data and
the saved GP which the initial function will use.

Also fix the address of the returned transfer_t which was incorrect
(although fairly harmless since this data is never read).
2018-01-11 14:37:34 +00:00
James Cowgill
e0d067c751 mips: optimize stack calculation in make_fcontext
This commit removes some useless moves which are later overwitten at the
start of the "make_fcontext" function.
2018-01-10 14:04:15 +00:00
James Cowgill
3d3bf4a1ec mips: perform jump through t9 in ontop_fcontext
The MIPS ABI requires all calls to be made "through" t9 (so the called
function can easily get its address).
2018-01-05 12:05:40 +00:00
James Cowgill
1491ce4424 mips: use v0 as temporary for returned transfer_t
For functions which return structures indirectly, the MIPS abi requires
the pointer to the returned structure to be in v0 (so in most cases v0
will contain the value passed to the function in a0).
2018-01-05 12:04:15 +00:00
James Cowgill
f410f4d80c mips: remove unused context diagram 2018-01-05 11:52:46 +00:00
Oliver Kowalke
75125efc6e set default stacksize to 128kB for all platforms 2017-11-05 07:55:56 +01:00
Oliver Kowalke
59ead04c0a move thread-local pointer of current action-record in compilation unit
- prevents error C4251 on Windows
2017-10-02 14:19:43 +02:00
Michael Johns
035d2d78f3 Fix i386/macho routines to correctly return transfer_t in EAX/EDX
The OSX 32bit ABI differs from the System V ABI in that 8 byte structs
are returned in registers EAX/EDX instead of passing the address of the
struct on the stack. See: https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html

The current implementation for this platform crashes when compiled for
32bit OSX (e.g. when running a 32bit iOS simulator) due to not
satisfying the ABI.
2017-08-24 19:05:57 +02:00
Oliver Kowalke
3bbc81a5e7 set default-stacksize to 64kB 2017-06-24 13:37:30 +02:00
Oliver Kowalke
e038a7402c fix minimum/default stacksize for POSIX 2017-06-15 18:06:11 +02:00
Oliver Kowalke
6de3a2b15f remove unused function page_count() 2017-06-10 15:32:48 +02:00
Oliver Kowalke
fa890b1c4d adapt Jamfiles for new properties 2017-06-04 20:27:03 +02:00
Oliver Kowalke
a72f69607f support WinFibers in callcc() 2017-06-04 20:27:03 +02:00
Oliver Kowalke
0f02a5ca2e 64kB default stack-size on POSIX 2017-06-01 18:20:02 +02:00
Oliver Kowalke
4b8a730919 support ucontext_t in callcc() 2017-06-01 18:20:02 +02:00
Oliver Kowalke
50ebf5bd11 x64 Windows: store/load fiber local storage from correct offset 2017-04-26 06:34:22 +02:00
Oliver Kowalke
2cec475b48 disable floating point modifications for Intel's TSX 2017-04-26 06:34:22 +02:00
Oliver Kowalke
002ed38953 fix x86/MS/PE/GAS 2017-04-22 21:27:36 +02:00
Nick Vrvilo
d6393e78c2 Fix register usage for ppc64/sysv/elfv2 2017-04-18 16:37:47 -05:00
Oliver Kowalke
d3f02dbe2f support for TSX
(cherry picked from commit 8f9c379e83a21e7e9aef32dcc41f16846190f799)
2017-04-14 12:39:45 +02:00
oliver Kowalke
c92e5b66e5 adjustements for PPC64/MACH-O 2017-04-06 17:32:54 +02:00
Oliver Kowalke
64d8d1445b fix wrong start address of stack for ARM 2017-04-05 17:41:50 +00:00
Oliver Kowalke
4f5fd1f5c8 fix stack pointer adjustement on mips 2017-04-05 17:53:20 +02:00
Oliver Kowalke
3353e3575a fix name of ontop_fcontext in ppc64/xcoff 2017-04-05 17:20:01 +02:00
Nick Vrvilo
c76b5d224a Fix fcontext assembly bugs for ppc64/sysv/elf
See issue #50 for details.
2017-04-04 21:42:55 -05:00
Timo Sandmann
dc515159f6 Little optimization for x86_64 SysV mach-o assembler 2017-01-08 18:13:05 +01:00
Oliver Kowalke
26b61a67cf remove directive '.cpu' for ARM64/AAPCS/ELF 2017-01-05 19:18:21 +01:00
Oliver Kowalke
3ea3b5cc90 fix for 12719 (mingw-w64) 2017-01-03 18:31:41 +01:00
oliver Kowalke
16bc5a5bc0 fix indirect jump asm for x86_64/SYSV/ELF 2016-12-16 08:25:25 +01:00
Oliver Kowalke
bb8b7f5dbf fix calling _exit() for x86_64 SYSV/MACH-O 2016-12-11 19:50:25 +01:00
Oliver Kowalke
e71b38c1d2 fix indirect jump for x86_64 on MACH-O 2016-12-11 17:29:26 +01:00
Oliver Kowalke
9dd3b50b8f foo 2016-12-06 19:36:58 +01:00
Oliver Kowalke
985a7c8e96 use indirect jump on x86
- load return address early
- use indirect jump
- branch prediction (two-level adaptive predictor) should be better
2016-12-06 19:34:55 +01:00
Oliver Kowalke
11ef8338fb ppc32 preserve FP env 2016-12-04 12:11:06 +01:00
Oliver Kowalke
317a01d935 mips32 preserve FP env 2016-12-04 12:11:06 +01:00
Oliver Kowalke
6d48391e51 x86_64 preserve FP env 2016-12-04 12:11:06 +01:00
Oliver Kowalke
9f84687239 i386 preserve FP env 2016-12-04 12:11:05 +01:00
Oliver Kowalke
b685a89f08 arm64 preserve FP env 2016-12-04 12:10:31 +01:00
oliver Kowalke
53e44f632d arm32 preserve FP env 2016-12-04 12:10:31 +01:00
oliver Kowalke
da5865406a set fiber-storage for missing asm to zero (Windows only) 2016-05-25 07:50:25 +02:00
Oliver Kowalke
20d4a5ed5f set fiber-storage to zero (Windows)
- fixes bug 12215
2016-05-24 18:58:35 +02:00
Andrey Semashev
c0c3053fd5 Fix boost::once_flag initialization. The initial value is required to be BOOST_ONCE_INIT. Luckily, it is currently equivalent to zero, that's why it worked before. 2016-03-24 10:32:02 +03:00
Oliver Kowalke
32beb363b0 fix ontop asm for ARM/AAPCS/PE 2016-02-27 16:52:21 +01:00