diff options
author | Samuel Williams <[email protected]> | 2019-06-26 22:02:19 +1200 |
---|---|---|
committer | Samuel Williams <[email protected]> | 2019-06-26 22:02:28 +1200 |
commit | acb67472c7da459812aa9008cf8cfbedcdddea67 (patch) | |
tree | 37f361d5b187d9f5fdbd70b67b225841e26d3bfb | |
parent | ba17127e992a4d1fb1fbd58869cbb4f12ff76227 (diff) |
Restore updated implementation of arm32 coroutine code, but prefer ucontext.
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | coroutine/arm32/Context.S | 14 | ||||
-rw-r--r-- | coroutine/arm32/Context.h | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 69fa93a1c9..e5dc01abe7 100644 --- a/configure.ac +++ b/configure.ac @@ -2272,6 +2272,9 @@ AS_CASE(["$rb_cv_fiber_coroutine"], [yes|''], [ [x64-mingw32], [ rb_cv_fiber_coroutine=win64 ], + [armv7*-linux-*], [ + rb_cv_fiber_coroutine=ucontext + ], [aarch64-linux], [ rb_cv_fiber_coroutine=arm64 ], diff --git a/coroutine/arm32/Context.S b/coroutine/arm32/Context.S index c2b93d0a34..4308e1d1d2 100644 --- a/coroutine/arm32/Context.S +++ b/coroutine/arm32/Context.S @@ -9,6 +9,14 @@ .globl coroutine_transfer coroutine_transfer: - stmia r1!, {r4-r11,sp,lr} - ldmia r0!, {r4-r11,sp,pc} - bx lr + # Save caller state (8 registers + return address) + push {r4-r11,lr} + + # Save caller stack pointer + str sp, [r0] + + # Restore callee stack pointer + ldr sp, [r1] + + # Restore callee state (8 registers program counter) + pop {r4-r11,pc} diff --git a/coroutine/arm32/Context.h b/coroutine/arm32/Context.h index d6d3c7f313..27f97908bc 100644 --- a/coroutine/arm32/Context.h +++ b/coroutine/arm32/Context.h @@ -12,7 +12,7 @@ #define COROUTINE __attribute__((noreturn)) void -enum {COROUTINE_REGISTERS = 9}; +enum {COROUTINE_REGISTERS = 8}; struct coroutine_context { |