[前][次][番号順一覧][スレッド一覧]

ruby-changes:59266

From: Breno <ko1@a...>
Date: Mon, 16 Dec 2019 10:05:42 +0900 (JST)
Subject: [ruby-changes:59266] f47c38245f (master): gc.h: Add SET_MACHINE_STACK_END specific for Powerpc64 (#1767)

https://git.ruby-lang.org/ruby.git/commit/?id=f47c38245f

From f47c38245ff6976c5d1fc27a79f239bba00fc333 Mon Sep 17 00:00:00 2001
From: Breno Leitao <breno.leitao@g...>
Date: Mon, 16 Dec 2019 01:05:21 +0000
Subject: gc.h: Add SET_MACHINE_STACK_END specific for Powerpc64 (#1767)

Currently we are not able to grab the correct end/top of the stack on
powerpc64 due to the fact that it uses the fallback function.

The fallback function does not return the correct top of the stack
because it adds a new frame and the returned top of the stack contains
this frame overhead that could be something around 112 bytes on
Powerpc64.

This patch simply gets the correct top of the stack pointer, which is
always on r1 register according to both ABI v1 and ABI v2 (Little
endian).

Signed-off-by: Breno Leitao <leitao@d...>

diff --git a/gc.h b/gc.h
index 7c7f0ef..cf794fa 100644
--- a/gc.h
+++ b/gc.h
@@ -6,6 +6,8 @@ https://github.com/ruby/ruby/blob/trunk/gc.h#L6
 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
 #elif defined(__i386) && defined(__GNUC__)
 #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p)))
+#elif defined(__powerpc64__) && defined(__GNUC__)
+#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p)))
 #else
 NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
 #define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]