mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Wasm support patch 2 (static syscalls)
Date: Tue, 28 Nov 2017 13:55:21 -0500	[thread overview]
Message-ID: <20171128185521.GC1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <20171128175221.GP15263@port70.net>

On Tue, Nov 28, 2017 at 06:52:22PM +0100, Szabolcs Nagy wrote:
> * John Starks <John.Starks@microsoft.com> [2017-11-28 16:51:19 +0000]:
> > What if you redefine the syscall numbers in wasm to be function
> > pointers to the actual syscalls, e.g. #define SYS_unlink
> > ((long)&__syscall_unlink). Then __syscall and friends can just
> > apply the arguments to the function pointer. This should play nice
> > with the linker and probably optimizes well.
> 
> you have to be able to cast it to the right type of
> function pointer then and pass the right amount of
> arguments.

To make this formally correct, I think all the __syscall_x functions
should just take 6 (or 7?) arguments and always be called with a dummy
arg of 0 in the additional slots. This can be done in the wasm
syscall_arch.h with no changes to musl code.

Rich


  reply	other threads:[~2017-11-28 18:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 12:31 Nicholas Wilson
2017-11-28 12:59 ` Szabolcs Nagy
2017-11-28 13:23   ` Nicholas Wilson
2017-11-28 14:05     ` Szabolcs Nagy
2017-11-28 14:34       ` Nicholas Wilson
2017-11-28 14:35         ` Szabolcs Nagy
2017-11-28 14:53           ` Nicholas Wilson
2017-11-28 15:08             ` Szabolcs Nagy
2017-11-28 15:50               ` Rich Felker
2017-11-28 16:20                 ` Nicholas Wilson
2017-11-28 16:51         ` John Starks
2017-11-28 17:52           ` Szabolcs Nagy
2017-11-28 18:55             ` Rich Felker [this message]
2017-11-28 17:53           ` Nicholas Wilson

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=20171128185521.GC1627@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).