From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12615 invoked by alias); 19 Sep 2013 15:52:18 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 12597 invoked by uid 89); 19 Sep 2013 15:52:18 -0000 Received: from mail-we0-f182.google.com (HELO mail-we0-f182.google.com) (74.125.82.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Sep 2013 15:52:18 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,NO_RELAYS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-we0-f182.google.com Received: by mail-we0-f182.google.com with SMTP id q59so8251326wes.13 for ; Thu, 19 Sep 2013 08:52:14 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.89.233 with SMTP id br9mr1976298wjb.15.1379605934429; Thu, 19 Sep 2013 08:52:14 -0700 (PDT) Received: by 10.217.141.72 with HTTP; Thu, 19 Sep 2013 08:52:14 -0700 (PDT) In-Reply-To: References: Date: Thu, 19 Sep 2013 15:52:00 -0000 Message-ID: Subject: Re: e500 port: getcontext / setcontext / swapcontext From: "Ryan S. Arnold" To: "Joseph S. Myers" Cc: libc-alpha , libc-ports Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00107.txt.bz2 On Wed, Sep 18, 2013 at 12:29 PM, Joseph S. Myers wrote: > This patch adds e500 support to powerpc getcontext / setcontext / > swapcontext. Like setjmp/longjmp, it's compile-time conditional > rather than using HWCAPs. Unlike setjmp/longjmp, this is following an > external ABI: the context layout used by the Linux kernel. Nothing is > done about the ACC register; as it's call-clobbered and not used for > argument passing, only the signal context case needs to handle it and > that does it via a syscall. (But as is generally usual for context > code in glibc, this code doesn't otherwise try to limit GPR saving / > restoring to avoid call-clobbered registers for which it isn't > actually needed.) > > To avoid duplication of the code sequences between getcontext / > setcontext and swapcontext, they are put in assembler macros defined > in a single place, and those macros are then used as needed under the > __CONTEXT_ENABLE_E500 conditional. > > Tested with a build for e500. > > 2013-09-18 Joseph Myers > > * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S > (__CONTEXT_FUNC_NAME) [__CONTEXT_ENABLE_E500]: Use > getcontext_e500. > * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S > (__CONTEXT_FUNC_NAME) [__CONTEXT_ENABLE_E500]: Use > setcontext_e500. > * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S > (__CONTEXT_FUNC_NAME) [__CONTEXT_ENABLE_E500]: Use getcontext_e500 > and setcontext_e500. > > ports/ChangeLog.powerpc: > 2013-09-18 Joseph Myers > > * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h: > New file. > * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S: > Include . > * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S: > Likewise. > * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S: > Likewise. Structurally I'm fine with this patch. It's as non-invasive as can be expected. Ryan