diff options
author | Jonathan Chambers <joncham@gmail.com> | 2018-02-02 11:46:19 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-02-02 11:46:19 +0300 |
commit | 02954567894bc270ffe7cb075448b56a706c9381 (patch) | |
tree | 6420c57228ba43b5bdc7297f933d2aa0aa671344 /darwin_stop_world.c | |
parent | 7e5abd8b79b351ed5b8218fb60860d05760feec1 (diff) | |
download | bdwgc-02954567894bc270ffe7cb075448b56a706c9381.tar.gz |
Implement FindTopOfStack(0) for ARM and AArch64 (Darwin)
(part of commit 9379c66 from Unity-Technologies/bdwgc)
Issue #173 (bdwgc).
* darwin_stop_world.c [!DARWIN_DONT_PARSE_STACK && (ARM32 || AARCH64)]
(GC_FindTopOfStack): Set proper frame value (using asm instruction)
if stack_start is zero (instead of ABORT).
Diffstat (limited to 'darwin_stop_world.c')
-rw-r--r-- | darwin_stop_world.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/darwin_stop_world.c b/darwin_stop_world.c index aef58c2b..062eb213 100644 --- a/darwin_stop_world.c +++ b/darwin_stop_world.c @@ -64,6 +64,14 @@ GC_INNER ptr_t GC_FindTopOfStack(unsigned long stack_start) # else __asm__ __volatile__ ("ld %0,0(r1)" : "=r" (frame)); # endif +# elif defined(ARM32) + volatile ptr_t sp_reg; + __asm__ __volatile__ ("mov %0, r7\n" : "=r" (sp_reg)); + frame = (StackFrame *)sp_reg; +# elif defined(AARCH64) + volatile ptr_t sp_reg; + __asm__ __volatile__ ("mov %0, x29\n" : "=r" (sp_reg)); + frame = (StackFrame *)sp_reg; # else ABORT("GC_FindTopOfStack(0) is not implemented"); # endif |