This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: e500 port: getcontext / setcontext / swapcontext
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, libc-ports <libc-ports at sourceware dot org>
- Date: Thu, 19 Sep 2013 10:52:14 -0500
- Subject: Re: e500 port: getcontext / setcontext / swapcontext
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1309181728150 dot 1868 at digraph dot polyomino dot org dot uk>
On Wed, Sep 18, 2013 at 12:29 PM, Joseph S. Myers
<joseph@codesourcery.com> 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 <joseph@codesourcery.com>
>
> * 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 <joseph@codesourcery.com>
>
> * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h:
> New file.
> * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S:
> Include <context-e500.h>.
> * 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