This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: e500 port: getcontext / setcontext / swapcontext


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]