2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-19 04:02:17 +00:00

1020 Commits

Author SHA1 Message Date
Oliver Kowalke
f8b3d409fb implement thread awareness in can_resume() 2023-04-21 07:27:07 +02:00
Oliver Kowalke
ab27b1bdad fix include in unit-test 2023-04-14 19:48:18 +02:00
Oliver Kowalke
2d3c2e5038 add example wait-on-sender from Lewis Baker 2023-04-08 10:49:47 +02:00
Oliver Kowalke
7e556147fa move classes to namespace std 2023-04-08 10:32:09 +02:00
Oliver Kowalke
d67f4bb6ce adapt to API of P0876R13 2023-04-08 09:38:14 +02:00
Oliver Kowalke
33c23aa8c6 remove directories cmake + performance 2023-04-08 09:11:14 +02:00
Oliver Kowalke
14b03e3079 rename class fiber to fiber_context 2023-04-08 09:10:28 +02:00
Oliver Kowalke
a016ac7447 remove class continuation 2023-04-08 08:57:24 +02:00
Oliver Kowalke
6ee7363738 fix missing include for BOOST_ASSERT
- #212

In the version of protected_fixedsize_stack the include for BOOST_ASSERT was missing.
2023-03-24 13:17:40 +01:00
Oliver Kowalke
06864b9638 Merge pull request #221 from Kojoley/fix-arm-detection
Fix arm64 detection broken by recent B2 change
2023-03-24 13:05:32 +01:00
Nikita Kniazev
d039c8e4da Fix arm64 detection broken by recent B2 change 2023-03-23 16:23:07 +03:00
Oliver Kowalke
072846b698 Merge pull request #219 from nielsdos/fix-i386-alignment-2
Make sure the i386 sysv stack is aligned
2023-01-28 08:54:14 +01:00
Niels Dossche
0eb4263705 Make sure the i386 sysv stack is aligned
The previous fix had a typo in which the wrong offset was used which
meant that the alignment still wasn't correct. Fix this properly now.
2023-01-27 23:36:15 +01:00
Oliver Kowalke
be937bd602 Merge pull request #218 from nielsdos/fix-i386-alignment
Make sure the i386 sysv stack is aligned
2023-01-26 06:48:25 +01:00
Niels Dossche
e286649f08 Make sure the i386 sysv stack is aligned
SysV ABI requires a stack alignment of 16 bytes. Currently, for i386
with SysV ABI, the trampoline function is entered with an unaligned
stack. This causes problems for the context-function that is jumped to
as its stack is also unaligned. This causes a crash for our use-case
because the context function contains an SSE instruction which reads
from the stack. The SSE instruction requires the correct alignment.
Fix it by changing the 0x2c offset to 0x30, such that the stack remains
aligned.
2023-01-25 22:07:30 +01:00
Oliver Kowalke
26585ae675 Merge pull request #217 from jschueller/cet
sys/mman.h is unix-only
2023-01-23 19:43:23 +01:00
Julien Schueller
02050ae5ad sys/mman.h is unix-only 2023-01-23 18:36:36 +01:00
Oliver Kowalke
16e2c134b6 Merge pull request #215 from evanmiller/darwin-ppc32-fixes
Fixes for Darwin PPC32
2022-12-27 20:49:27 +01:00
Evan Miller
070d03fc7e Fixes for Darwin PPC32
For make_fcontext, use the diff provided here:

https://github.com/boostorg/context/issues/211#issuecomment-1328154669

For ontop_context, adapt the Linux PPC32 fixes from here:

df8fb6b528

Co-authored-by: George Koehler <kernigh@gmail.com>
2022-12-27 10:47:41 -05:00
Oliver Kowalke
5bcc1ab155 architecture flag for Apple's combined ha changed to 'arm+x86' 2022-12-23 11:14:10 +01:00
Oliver Kowalke
984f7893ce Merge pull request #213 from eduardvoronkin/fix_ucontext_macos
fix ucontext for MacOS
2022-12-17 11:38:47 +01:00
Eduard Voronkin
cc106be672 fix ucontext for MacOS:
1. MacOS versions of ::makecontext (tested on m1 Mac Ventura 13.0.1) is able to pass only 4-byte parameters to context function
2. define _XOPEN_SOURCE before inclusion of predef.h
2022-12-15 17:31:16 -08:00
Oliver Kowalke
ad3fc892b5 support s390x + clang in build/Jamfile.v2
- #208
2022-10-16 07:27:09 +02:00
Oliver Kowalke
10310f5664 Merge pull request #209 from barracuda156/darwin-ppc
Darwin make_ppc32: fix addi in l1
2022-10-16 07:25:35 +02:00
Sergey Fedorov
a3b0224b0c Darwin make_ppc32: fix addi in l1 2022-10-06 13:01:18 +08:00
Oliver Kowalke
ee045f8f0a Merge pull request #206 from Kojoley/ci-multiarch
CI: Test multiple architectures
2022-10-04 06:57:54 +02:00
Oliver Kowalke
86b4e7110f Merge pull request #207 from PeterYang12/feature/shadowstack
Add shadow stack support for fcontext
2022-09-30 15:31:01 +02:00
PeterYang12
3484575878 Add shadow stack support for fcontext
Shadow stack is part of Intel's Control-Flow Enforcement Technology.

    Whenever a function is called, the return address is pushed onto both
    the regular stack and the shadow stack. When that function returns, the
    return addresses are popped off both stacks and compared; if they fail
    to match, #CP raised.

    Backport this commit from https://github.com/php/php-src/pull/9283
    With this commit, we create shadow stack with syscall map_shadow_stack
    (no.451) for each fiber context and switch the shadow stack accordingly
    during fcontext switch.

Signed-off-by: PeterYang12 <yuhan.yang@intel.com>
Signed-off-by: chen-hu-97 <hu1.chen@intel.com>
2022-09-29 22:58:22 -07:00
Nikita Kniazev
49f1ff9074 Replace Boost.Test with lightweight tester 2022-09-19 05:04:18 +03:00
Nikita Kniazev
b6583a468a CI: Test multiple architectures 2022-09-19 05:04:17 +03:00
Nikita Kniazev
8701343ace Tests: Autodetect segmented stack availability 2022-09-19 05:00:41 +03:00
Oliver Kowalke
97a0054999 Merge pull request #205 from apolukhin/antoshkka/stack-protector
Support for stack protection
2022-09-18 16:25:02 +02:00
Oliver Kowalke
a8f60b9576 Merge pull request #204 from barracuda156/darwin-ppc
Fixes for currently broken Darwin ppc/ppc64 assembler
2022-09-18 16:21:19 +02:00
Oliver Kowalke
cfcccbb587 remove friend declaration of calllcc() in clas fiber
- #202
2022-09-18 16:03:36 +02:00
Oliver Kowalke
5852b49355 change address model to 32bit for x32 ABI
related to issue #200
2022-09-18 15:52:47 +02:00
Antony Polukhin
f96d65bc37 fix again 2022-09-18 11:19:22 +03:00
Antony Polukhin
a6e3302f91 fix 2022-09-18 11:02:23 +03:00
Antony Polukhin
2f0b5034b7 Support for stack protection 2022-09-17 18:38:12 +03:00
Sergey Fedorov
5f7e1f216c powerpc-darwin: does not use TOC on ppc64 2022-09-06 04:44:16 +07:00
Sergey Fedorov
1cdfb35343 powerpc-darwin: fix broken code in make_ppc* assembler 2022-09-06 02:54:06 +07:00
Sergey Fedorov
5f2c355042 powerpc-darwin: fix assembler comment character 2022-09-06 02:47:32 +07:00
Oliver Kowalke
87135f923e Merge pull request #201 from dixyes/win_arm64
Windows arm64 fcontext support
boost-1.80.0
2022-07-05 07:48:15 +02:00
dixyes
abf8e04e23 Spport Windows arm64 cpp exception
Windows C++ exception unwinding needs TEB(TIB) stack info matching real
stack.
2022-06-26 09:53:11 +08:00
dixyes
697299ea55 Add windows arm64 fcontext support 2022-06-26 09:51:30 +08:00
Oliver Kowalke
b6ff3fd02f Merge pull request #199 from PeterYang12/endbr
Add support for Indirect Branch Tracking (IBT)
2022-05-16 10:39:25 +02:00
PeterYang12
b62a991ee6 Add support for Indirect Branch Tracking (IBT)
Indirect Branch Tracking(IBT) is part of Intel's Control-Flow
Enforcement Technology(CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must
target an ENDBR instruction or suffer #CP.

This commit inserts endbr64 instruction in assembly to support IBT.
2022-05-16 00:15:57 -07:00
Oliver Kowalke
fb8cda1274 Merge pull request #197 from loongson-zn/develop
Add support for loongarch64
boost-1.80.0.beta1 boost-1.79.0.beta1 boost-1.79.0
2022-02-21 07:19:45 +01:00
Zhang Na
e1001c479e Add support for loongarch64 2022-02-15 17:28:33 +08:00
Oliver Kowalke
83f998828c Merge pull request #192 from brad0/develop
Add support for building on riscv64 with Clang
boost-1.78.0
2021-11-12 11:30:26 +01:00
Brad Smith
04ab01d386 Add support for building on riscv64 with Clang 2021-11-12 04:35:18 -05:00