mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Cc: "D. Jeff Dionne" <Jeff@uClinux.org>,
	ysato@users.sourceforge.jp, shumpei.kawasaki@swhwc.com
Subject: Re: Moving forward with sh2/nommu
Date: Thu, 11 Jun 2015 13:22:27 -0400	[thread overview]
Message-ID: <20150611172227.GY17573@brightrain.aerifal.cx> (raw)
In-Reply-To: <20150611151252.GW17573@brightrain.aerifal.cx>

On Thu, Jun 11, 2015 at 11:12:52AM -0400, Rich Felker wrote:
> > >> 3. We need sh/vfork.s since the default vfork.c just uses fork, which
> > >>    won't work. I have a version locally but it doesn't make sense to
> > >>    commit without runtime trap number selection.
> > > 
> > > Done and updated to use runtime selection in the (ugly) patch.
> > 
> > If they ask for vfork() they should get vfork()...?
> 
> Yes. The "runtime selection" is about the syscall trap number, not
> whether or not to use vfork. I committed vfork to upstream musl now,
> but with a SH3/4 trap number to be consistent with the code that's
> upstream now. Later I'll either convert them all to trap 31 (0x1f) if
> that ends up being acceptable, or merge the runtime-selection code,
> but I think it makes sense to make the change across all files at
> once, whichever way it's done.

Ah, maybe I misunderstood. If you were asking abaout the original
remark that the default vfork.c uses fork, the reason is simply that
you can't write vfork() in C. The return from vfork() in the child
will clobber vfork's stack frame, which may contain the return address
or saved registers, and then when the parent resumes, very bad things
will happen. vfork() has to be implemented in asm to ensure that any
state it needs to be able to return in the parent is kept in registers
rather than memory. Thus, each arch needs an arch-specific version,
and we just hadn't gotten around to adding the sh version yet.

Rich


  reply	other threads:[~2015-06-11 17:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 15:11 Rich Felker
2015-06-02  6:09 ` Rob Landley
2015-06-02 16:45   ` Rich Felker
2015-06-02 23:49     ` Rich Felker
2015-06-10  3:30 ` Rich Felker
2015-06-11  4:02   ` Rob Landley
2015-06-11 15:12     ` Rich Felker
2015-06-11 17:22       ` Rich Felker [this message]
2015-06-12  4:26         ` Yoshinori Sato
2015-06-12  4:35           ` Rich Felker
2015-06-12  4:49             ` uClinux.org
2015-06-12  6:37               ` Rich Felker
2015-06-12  6:46                 ` D. Jeff Dionne
2015-06-12  4:08       ` Yoshinori Sato
2015-06-12  4:28         ` Rich Felker
2015-06-16  6:38           ` Yoshinori Sato
2015-06-16  7:02             ` Rich Felker

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=20150611172227.GY17573@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=Jeff@uClinux.org \
    --cc=musl@lists.openwall.com \
    --cc=shumpei.kawasaki@swhwc.com \
    --cc=ysato@users.sourceforge.jp \
    /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).