linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Zhangjin Wu <falcon@tinylab.org>
To: thomas@t-8ch.de, w@1wt.eu
Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: [PATCH v2 0/4] tools/nolibc: add two new syscall helpers
Date: Tue,  6 Jun 2023 16:08:40 +0800	[thread overview]
Message-ID: <cover.1686036862.git.falcon@tinylab.org> (raw)

Willy, Thomas

This is the revision of the v1 syscall helpers [1], just rebased it on
20230606-nolibc-rv32+stkp7a of [2]. It doesn't conflict with the -ENOSYS
patchset [3], so, it is ok to simply merge both of them.

This revision mainly applied your suggestions of v1, both of the syscall
return and call helpers are simplified or cleaned up.

Changes from v1 -> v2:

* tools/nolibc: sys.h: add __syscall() and __sysret() helpers
  * Use inline function instead of macro for the syscall return helper
    (Suggestion from Thomas)

  * Rename syscall return helper from __syscall_ret to __sysret
    (align with __syscall and it is not that long now)

  * Make __sysret() be always inline
    (Suggestion from Willy)

  * Simplify the whole __syscall() macro to oneline code
    (Benefit from the fixed 'long' return type of syscalls)

* tools/nolibc: unistd.h: apply __sysret() helper
  * Convert the whole _syscall() macro to oneline code

* tools/nolibc: sys.h: apply __sysret() helper
  * Futher convert both brk() and getpagesize() to oneline code 

* tools/nolibc: sys.h: apply __syscall() helper
  * Keep the same as v1, because the __syscall() usage not changed

Best regards,
Zhangjin

---
[1]: https://lore.kernel.org/linux-riscv/cover.1685856497.git.falcon@tinylab.org/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git
[3]: https://lore.kernel.org/linux-riscv/cover.1685780412.git.falcon@tinylab.org/

Zhangjin Wu (4):
  tools/nolibc: sys.h: add __syscall() and __sysret() helpers
  tools/nolibc: unistd.h: apply __sysret() helper
  tools/nolibc: sys.h: apply __sysret() helper
  tools/nolibc: sys.h: apply __syscall() helper

 tools/include/nolibc/sys.h    | 366 ++++++----------------------------
 tools/include/nolibc/unistd.h |  11 +-
 2 files changed, 57 insertions(+), 320 deletions(-)

-- 
2.25.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2023-06-06  8:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06  8:08 Zhangjin Wu [this message]
2023-06-06  8:09 ` [PATCH v2 1/4] tools/nolibc: sys.h: add __syscall() and __sysret() helpers Zhangjin Wu
2023-06-06 10:33   ` Zhangjin Wu
2023-06-08 14:35   ` David Laight
2023-06-08 16:06     ` Thomas Weißschuh
2023-06-09  4:42       ` Zhangjin Wu
2023-06-09  9:15         ` David Laight
2023-06-06  8:11 ` [PATCH v2 2/4] tools/nolibc: unistd.h: apply __sysret() helper Zhangjin Wu
2023-06-06  8:16 ` [PATCH v2 3/4] tools/nolibc: sys.h: " Zhangjin Wu
2023-06-06  8:17 ` [PATCH v2 4/4] tools/nolibc: sys.h: apply __syscall() helper Zhangjin Wu
2023-06-06 18:36   ` Thomas Weißschuh
2023-06-07  0:34     ` Zhangjin Wu
2023-06-07  4:05       ` Willy Tarreau
2023-06-07  5:39         ` Zhangjin Wu
2023-06-07  6:05           ` Thomas Weißschuh
2023-06-07  6:38             ` Zhangjin Wu
2023-06-10 16:34           ` David Laight
2023-06-10 16:58             ` David Laight

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=cover.1686036862.git.falcon@tinylab.org \
    --to=falcon@tinylab.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=thomas@t-8ch.de \
    --cc=w@1wt.eu \
    /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.
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).