Re: [PATCH 0/1] Only pass the minimum number of syscall arguments (RISC-V)

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Feb 10 21:19, Georg Sauthoff wrote:
> As is, the RISC-V syscall code unconditionally sets all possible syscall
> arguments even if the syscall requires fewer.
> 
> For example, the instruction sequence for a exit syscall looked like
> this:
> 
>     li    a0, 1   # in ther caller of exit()
>     # ...         # in newlib:
>     li    a1, 0   # unused arguments
>     li    a2, 0
>     li    a3, 0
>     li    a4, 0
>     li    a5, 0
>     li    a7, 93  # exit syscall number
> 
> (i.e. the binary contains then 5 superfluous instructions for this
> one argument syscall)
> 
> This patch changes the RISC-V syscall code such that only the required
> syscall argument registers are set.
> 
> Georg Sauthoff (1):
>   Only pass the minimum number of syscall arguments
> 
>  libgloss/riscv/internal_syscall.h | 41 ++++++++++++++++++++++---------
>  libgloss/riscv/sys_access.c       |  2 +-
>  libgloss/riscv/sys_close.c        |  2 +-
>  libgloss/riscv/sys_exit.c         |  2 +-
>  libgloss/riscv/sys_faccessat.c    |  2 +-
>  libgloss/riscv/sys_fstat.c        |  2 +-
>  libgloss/riscv/sys_fstatat.c      |  2 +-
>  libgloss/riscv/sys_gettimeofday.c |  2 +-
>  libgloss/riscv/sys_link.c         |  2 +-
>  libgloss/riscv/sys_lseek.c        |  2 +-
>  libgloss/riscv/sys_lstat.c        |  2 +-
>  libgloss/riscv/sys_open.c         |  2 +-
>  libgloss/riscv/sys_openat.c       |  2 +-
>  libgloss/riscv/sys_read.c         |  2 +-
>  libgloss/riscv/sys_sbrk.c         |  4 +--
>  libgloss/riscv/sys_stat.c         |  2 +-
>  libgloss/riscv/sys_unlink.c       |  2 +-
>  libgloss/riscv/sys_write.c        |  2 +-
>  18 files changed, 48 insertions(+), 29 deletions(-)
> 
> -- 
> 2.24.1

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl5CaQsACgkQ9TYGna5E
T6AZxA//WMNb+yNmYRBRdmZrNp9ztzFWnaOlErskiuzpkgPoQKLKvXUX/GWrymrS
f52e8oqH1IhqMrs8fIpfget36Jzfy64JFRhPLTPcUSKpJJOZKyzCiCrsnxbFC6z3
8YgfDMF0ExXvSBd93CSlIW9wY5BxuEqbDis8puRYcw5VNdtVctc1OWM7YXA5TiXl
9pPFGPsZ9BYJcMDxP9psihTuYc6Bcrgm1WEdy/1IXv12GSx4L4RwSh/Y4C5x+2h7
59eVy8mpw5x1aghYvTXudiEtxfyJBF3IO8e6woZC2sIcWqaR3WPJXhByZa7XUOOi
XCrc4gQU/2RPEH7vFoQncojQw3vV62N1j3TuoNUEpZVBmKLudiWezRB56gsOdfmc
YquxN9GCXhD5vABshTRI4RAi120cQuEDkZBdfybuL/wlwrLmApj0qm1eGFEJpTXd
H91CoJHx1LlfejypoeDLsowRk+3WkkpWbPvY3/yp7qAFQ4HFmVyL+/F3o9zJwlpT
cejPV6sjPdUyIr5tCG7j44qxgLRiXkklgUxGtALlKufhmUI6VoGWn6nbaZR5+37X
Hp98mTll7dWTHikqstOVTQzeRlO/ayEh1VDglMf1UlTNbI6Q3/nlVIVjS1eq9ZfJ
x9w5arSzo2rgt3oIgBzYh9T2Bxm2F/ShiP23/C+TDMzzH1//sYM=
=XHUP
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.