Yarn: Implement fiber context switching for Windows, macOS, Linux and Android.
Windows uses OSFiber_windows.hpp.
macOS and Linux uses OSFiber_asm_* or OSFiber_ucontext.hpp
Android has no support for makecontext / swapcontext, and so relies on the OSFiber_asm_* implementations.
Unlike makecontext, swapcontext or the Windows fiber APIs, these assembly implementations *do not* save or restore signal masks, floating-point control or status registers, FS and GS segment registers, thread-local storage state nor any SIMD registers.
This should not be a problem as the yarn scheduler requires fibers to be executed on a single thread.
Bug: b/139010488
Change-Id: I5f890ffe4f069361a7eeae64567a77be3a4ba008
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34771Tested-by:
Ben Clayton <bclayton@google.com>
Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Showing
src/Yarn/OSFiber.hpp
0 → 100644
src/Yarn/OSFiber_asm.hpp
0 → 100644
src/Yarn/OSFiber_asm_aarch64.c
0 → 100644
src/Yarn/OSFiber_asm_aarch64.h
0 → 100644
src/Yarn/OSFiber_asm_aarch64.s
0 → 100644
src/Yarn/OSFiber_asm_arm.c
0 → 100644
src/Yarn/OSFiber_asm_arm.h
0 → 100644
src/Yarn/OSFiber_asm_arm.s
0 → 100644
src/Yarn/OSFiber_asm_x64.c
0 → 100644
src/Yarn/OSFiber_asm_x64.h
0 → 100644
src/Yarn/OSFiber_asm_x64.s
0 → 100644
src/Yarn/OSFiber_asm_x86.c
0 → 100644
src/Yarn/OSFiber_asm_x86.h
0 → 100644
src/Yarn/OSFiber_asm_x86.s
0 → 100644
src/Yarn/OSFiber_test.cpp
0 → 100644
src/Yarn/OSFiber_ucontext.hpp
0 → 100644
src/Yarn/OSFiber_windows.hpp
0 → 100644
Please
register
or
sign in
to comment