From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id BEF3C393D035; Sat, 30 Jan 2021 19:09:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEF3C393D035 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain Buclaw To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/ibuclaw/heads/darwin)] D, Linux : Add implementation for PPC64 init stack. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/users/ibuclaw/heads/darwin X-Git-Oldrev: 408f9b7f629e6309eb7f25da9b3ef7702f2a69b5 X-Git-Newrev: d1d406bbf460fd8f1c26dcabb08fb33d4b031fc4 Message-Id: <20210130190955.BEF3C393D035@sourceware.org> Date: Sat, 30 Jan 2021 19:09:55 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 19:09:55 -0000 https://gcc.gnu.org/g:d1d406bbf460fd8f1c26dcabb08fb33d4b031fc4 commit d1d406bbf460fd8f1c26dcabb08fb33d4b031fc4 Author: Iain Sandoe Date: Fri Dec 11 00:53:40 2020 +0000 D, Linux : Add implementation for PPC64 init stack. This provides an initStack entry for 'Posix' PPC64 case. Diff: --- libphobos/libdruntime/core/thread/fiber.d | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d index 6430d7189c0..1161914a8a2 100644 --- a/libphobos/libdruntime/core/thread/fiber.d +++ b/libphobos/libdruntime/core/thread/fiber.d @@ -1357,6 +1357,33 @@ private: assert( (cast(size_t) pstack & 0x0f) == 0 ); } + else version (AsmPPC64_Posix) + { + version (StackGrowsDown) + { + pstack -= long.sizeof * 5; + } + else + { + pstack += long.sizeof * 5; + } + + push( cast(size_t) &fiber_entryPoint ); // link register + push( 0x00000000_00000000 ); // control register + push( 0x00000000_00000000 ); // old stack pointer + + // GPR values + version (StackGrowsDown) + { + pstack -= long.sizeof * 20; + } + else + { + pstack += long.sizeof * 20; + } + + assert( (cast(size_t) pstack & 0x0f) == 0 ); + } else version (AsmMIPS_O32_Posix) { version (StackGrowsDown) {}