mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Bobby Bingham <koorogi@koorogi.info>
To: musl@lists.openwall.com
Subject: Re: PowerPC Port: Question about magic numbers in sigsetjmp.s
Date: Sat, 30 Apr 2016 14:20:48 -0500	[thread overview]
Message-ID: <20160430192048.GA2695@dora.lan> (raw)
In-Reply-To: <1462038919.2011.12.camel@mail.com>

On Sat, Apr 30, 2016 at 12:55:19PM -0500, Dan Parrot wrote:
> I'm trying to modify the PowerPC port in order to run it on a 64-bit
> Little Endian system. I haven't been able to get pthreads to pass the

I've already submitted a patch to the mailing list to add a ppc64le port.
http://www.openwall.com/lists/musl/2016/03/27/8

I'm about to submit a new version to address the remaining comments that
have been made on it, but it should be close to done.

> tests in libc-testsuite and I believe the culprit to be sigsetjmp.s.
> 
> I would be grateful for an explanation of the offsets added to register
> 3 in these two lines in sigsetjmp.s:
> 
> stw 5, 448(3)
> stw 16, 448+4+8(3)
> 

See this commit: http://git.musl-libc.org/cgit/musl/commit/?id=583e55122e767b1586286a0d9c35e2a4027998ab

The sigjmp_buf structure includes a __jmp_buf at the beginning (see the
definition in include/setjmp.h).

__jmp_buf is 448 bytes large on ppc32 (it should be larger on ppc64).
So, these are accessing the part of the sigjmp_buf beyond the initial
__jmp_buf.

The first line is saving the return address to the __fl member, and the
second line is saving r16 to __ss[2].  The first two elements of __ss
are used by __sigsetjmp_tail to save the signal mask.  The remainder of
__ss is unused, so it's a convenient place to spill a register to.

> 
> Thanks.
> Dan.
> 
>

Bobby


  reply	other threads:[~2016-04-30 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-30 17:55 Dan Parrot
2016-04-30 19:20 ` Bobby Bingham [this message]
2016-04-30 20:12   ` Dan Parrot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160430192048.GA2695@dora.lan \
    --to=koorogi@koorogi.info \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).