Skip to content

tools/nolibc: add two new syscall helpers

Zhangjin Wu linux-kselftest linux-riscv lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 12 repliesIn review
  2. v14 patches 5 repliesSuperseded

Changes in v2 from the cover letter

* 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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4tools/nolibc: sys.h: add __syscall() and __sysret() helperstools/include/nolibc/sys.h+12 -04 replies
1/4tools/nolibc: sys.h: add __syscall() and __sysret() helpers+0 -00 replies
2/4tools/nolibc: unistd.h: apply __sysret() helpertools/include/nolibc/unistd.h+1 -100 replies
3/4tools/nolibc: sys.h: apply __sysret() helpertools/include/nolibc/sys.h+2 -160 replies
4/4tools/nolibc: sys.h: apply __syscall() helpertools/include/nolibc/sys.h+42 -2948 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] tools/nolibc: add two new syscall helpers

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/[email protected]/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git
[3]: https://lore.kernel.org/linux-riscv/[email protected]/

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(-)
Signature · 1 line
2.25.1